diff --git a/CHANGELOG.md b/CHANGELOG.md index 660fc15..21566d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,50 @@ +## 1.0.1-beta (November 12, 2024) +FEATURES: +* General Version Selection Behavior added. More info detailed in README.md. +* **New Data Source:** `data_source_analytics_anc_policies` +* **New Data Source:** `data_source_analytics_dictionaries` +* **New Data Source:** `data_source_analytics_endpoints` +* **New Data Source:** `data_source_analytics_endpoints_count` +* **New Data Source:** `data_source_analytics_profiling_rules` +* **New Data Source:** `data_source_analytics_profiling_rules_count` +* **New Data Source:** `data_source_analytics_tasks` +* **New Data Source:** `data_source_disasterrecovery_system_operationstatus` +* **New Data Source:** `data_source_disasterrecovery_system_status` +* **New Data Source:** `data_source_endpoint_analytics_profiling_rules` +* **New Data Source:** `data_source_profiling_rules_count` +* **New Data Source:** `data_source_security_rogue_wireless_containment_status` +* **New Data Source:** `data_source_security_threats_level` +* **New Data Source:** `data_source_security_threats_rogue_allowed_list` +* **New Data Source:** `data_source_security_threats_rogue_allowed_list_count` +* **New Data Source:** `data_source_security_threats_type` +* **New Data Source:** `data_source_tags_interfaces_members_associations` +* **New Data Source:** `data_source_tags_interfaces_members_associations_count` +* **New Data Source:** `data_source_tags_network_devices_members_associations` +* **New Data Source:** `data_source_tags_network_devices_members_associations_count` +* **New Data Source:** `data_source_threat_detail` +* **New Data Source:** `data_source_threat_detail_count` +* **New Data Source:** `data_source_threat_summary` +* **New Resource:** `resource_analytics_cmdb_endpoints` +* **New Resource:** `resource_analytics_endpoints` +* **New Resource:** `resource_analytics_endpoints_anc_policy_delete` +* **New Resource:** `resource_analytics_endpoints_anc_policy_update` +* **New Resource:** `resource_analytics_profiling_rules` +* **New Resource:** `resource_analytics_profiling_rules_bulk` +* **New Resource:** `resource_endpoint_analytics_profiling_rules` +* **New Resource:** `resource_network_device_user_defined_field_delete` +* **New Resource:** `resource_network_device_user_defined_field_update` +* **New Resource:** `resource_profiling_rules_in_bulk_create` +* **New Resource:** `resource_security_rogue_additional_details` +* **New Resource:** `resource_security_rogue_additional_details_count` +* **New Resource:** `resource_security_rogue_wireless_containment_start` +* **New Resource:** `resource_security_rogue_wireless_containment_stop` +* **New Resource:** `resource_security_threats_details` +* **New Resource:** `resource_security_threats_details_count` +* **New Resource:** `resource_security_threats_rogue_allowed_list` +* **New Resource:** `resource_security_threats_summary` +* **New Resource:** `resource_tags_interfaces_members_associations_query` +* **New Resource:** `resource_tags_network_devices_members_associations_query` + ## 1.0.0-beta (September 13, 2024) IMPROVEMENTS: * The provider has been updated with Catalyst Center API version `2.3.7.6` diff --git a/README.md b/README.md index 3862085..8b5066c 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,89 @@ In the [docs directory](./docs/) you can find the documentation source for this You can find the documentation online for the previously released versions at [Terraform Registry - Cisco Catalyst Center provider](https://registry.terraform.io/providers/cisco-en-programmability/catalystcenter/latest/docs). + +# Automatic Version Management for Resources and DataSources +In this Terraform provider, version management is handled dynamically for **all resources** and **datasources**. The version of a resource or datasource is automatically selected based on the available versions in the environment, allowing users to either use a default version or specify a particular version when needed. Below is an explanation of how this automatic version selection works for both resources and datasources. + +## General Version Selection Behavior +For all resources and datasources, the behavior follows these general rules: + +1. **If multiple versions of a resource or datasource exist (e.g., `resource_v1`, `resource_v2`)**: + * By **default**, the **oldest** available version will be selected. That is, if both `resource_v1` and `resource_v2` are available, the provider will automatically select `v1` unless explicitly specified otherwise. + * If a user wants to use the latest version (e.g., `v2`), they need to specify it explicitly in the configuration. + +2. **If only one version of a resource or datasource exists (e.g., only `resource_v1`)**: + * **The resource or datasource will automatically be used in that version**, without needing to specify the version suffix in the configuration. + +3. **If only the latest version is available (e.g., only `resource_v2` and not `resource_v1`)**: + * The resource or datasource will automatically refer to the **latest available version**, i.e., `resource_v2`. + + +## Example Usage with Resources +### Case 1: Both `resource_v1` and `resource_v2` are available +If both `resource_v1` and `resource_v2` are available in your environment, the provider will select `resource_v1` by default. If you want to use `resource_v2`, you can specify it explicitly: + +```hcl +# Using version 1 (default) +resource "resource" "default" { + # This resource will refer to `resource_v1` by default +} + +# Explicitly using version 2 +resource "resource_v2" "default" { + # This resource will refer to `resource_v2` +} +``` +### Case 2: Only resource\_v1 exists +If only resource\_v1 is available in your environment, there is no need to specify the version, as the provider will automatically use that version: + +```hcl +resource "resource" "default" { + +# This resource will refer to `resource_v1` since it's the only version available +} +``` +### Case 3: Only resource\_v2 exists +If only resource\_v2 is available in your environment, the provider will automatically refer to that version, since resource\_v1 is not available: + +```hcl +resource "resource" "default" { + +# This resource will refer to `resource_v2` since `resource_v1` is not available +} +``` +## Example Usage with DataSources +The same version selection logic applies to datasources. Below is how version management works for datasources: + +### Case 1: Both datasource\_v1 and datasource\_v2 are available +```hcl +# Using version 1 (default) +data "datasource" "default" { + +# This datasource will refer to `datasource_v1` by default +} + +# Explicitly using version 2 +data "datasource_v2" "default" { + +# This datasource will refer to `datasource_v2` +} +``` +### Case 2: Only datasource\_v1 exists +```hcl +data "datasource" "default" { + +# This datasource will refer to `datasource_v1` since it's the only version available +} +``` +### Case 3: Only datasource\_v2 exists +```hcl +data "datasource" "default" { + +# This datasource will refer to `datasource_v2` since `datasource_v1` is not available +} +``` + # Contributing Ongoing development efforts and contributions to this provider are tracked as issues in this repository. diff --git a/catalystcenter/config.go b/catalystcenter/config.go index 818cde5..9b0e99f 100644 --- a/catalystcenter/config.go +++ b/catalystcenter/config.go @@ -47,7 +47,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{} if err != nil { diags = append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Unable to create Cisco Catalyst Center client", + Summary: "Unable to create Cisco DNA Center client", Detail: err.Error(), }) return nil, diags diff --git a/catalystcenter/convert.go b/catalystcenter/convert.go index 2fce16e..74e777d 100644 --- a/catalystcenter/convert.go +++ b/catalystcenter/convert.go @@ -3,7 +3,6 @@ package catalystcenter import ( "encoding/json" "fmt" - "log" "strconv" ) @@ -92,22 +91,6 @@ func getResourceItem(item interface{}) *map[string]interface{} { return &vvItem } -func sliceInterfaceToSliceString(v []interface{}) []string { - newValue := []string{} - for _, v2 := range v { - value, ok := v2.([]interface{}) - if !ok { - log.Print("sliceInterfaceToSliceString: Nil") - return nil - } - - for _, i := range value { - newValue = append(newValue, interfaceToString(i)) - } - } - return newValue -} - func interfaceToSliceString(v interface{}) []string { value, ok := v.([]interface{}) if !ok { @@ -136,11 +119,7 @@ func interfaceToSliceInt(v interface{}) *[]int { } func interfaceToString(v interface{}) string { - if v == nil { - return "" - } else { - return fmt.Sprint(v) - } + return fmt.Sprint(v) } func responseInterfaceToSliceString(v interface{}) []string { diff --git a/catalystcenter/data_source_accesspoint_configuration_details_by_task_id.go b/catalystcenter/data_source_accesspoint_configuration_details_by_task_id.go index aa6ffa4..6e414e0 100644 --- a/catalystcenter/data_source_accesspoint_configuration_details_by_task_id.go +++ b/catalystcenter/data_source_accesspoint_configuration_details_by_task_id.go @@ -192,27 +192,27 @@ func dataSourceAccesspointConfigurationDetailsByTaskIDRead(ctx context.Context, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAccessPointConfigurationTaskResult") + log.Printf("[DEBUG] Selected method: GetAccessPointConfigurationTaskResultV1") vvTaskID := vTaskID.(string) - response1, restyResp1, err := client.Wireless.GetAccessPointConfigurationTaskResult(vvTaskID) + response1, restyResp1, err := client.Wireless.GetAccessPointConfigurationTaskResultV1(vvTaskID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAccessPointConfigurationTaskResult", err, - "Failure at GetAccessPointConfigurationTaskResult, unexpected response", "")) + "Failure when executing 2 GetAccessPointConfigurationTaskResultV1", err, + "Failure at GetAccessPointConfigurationTaskResultV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetAccessPointConfigurationTaskResultItems(response1) + vItems1 := flattenWirelessGetAccessPointConfigurationTaskResultV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAccessPointConfigurationTaskResult response", + "Failure when setting GetAccessPointConfigurationTaskResultV1 response", err)) return diags } @@ -224,29 +224,29 @@ func dataSourceAccesspointConfigurationDetailsByTaskIDRead(ctx context.Context, return diags } -func flattenWirelessGetAccessPointConfigurationTaskResultItems(items *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationTaskResult) []map[string]interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1Items(items *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationTaskResultV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["instance_uuid"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceUUID(item.InstanceUUID) + respItem["instance_uuid"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceUUID(item.InstanceUUID) respItem["instance_id"] = item.InstanceID - respItem["auth_entity_id"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsAuthEntityID(item.AuthEntityID) + respItem["auth_entity_id"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsAuthEntityID(item.AuthEntityID) respItem["display_name"] = item.DisplayName - respItem["auth_entity_class"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsAuthEntityClass(item.AuthEntityClass) + respItem["auth_entity_class"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsAuthEntityClass(item.AuthEntityClass) respItem["instance_tenant_id"] = item.InstanceTenantID respItem["ordered_list_oeindex"] = item.OrderedListOEIndex - respItem["ordered_list_oeassoc_name"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsOrderedListOEAssocName(item.OrderedListOEAssocName) + respItem["ordered_list_oeassoc_name"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsOrderedListOEAssocName(item.OrderedListOEAssocName) respItem["creation_order_index"] = item.CreationOrderIndex respItem["is_being_changed"] = boolPtrToString(item.IsBeingChanged) respItem["deploy_pending"] = item.DeployPending - respItem["instance_created_on"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceCreatedOn(item.InstanceCreatedOn) - respItem["instance_updated_on"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceUpdatedOn(item.InstanceUpdatedOn) - respItem["change_log_list"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsChangeLogList(item.ChangeLogList) - respItem["instance_origin"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceOrigin(item.InstanceOrigin) - respItem["lazy_loaded_entities"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsLazyLoadedEntities(item.LazyLoadedEntities) + respItem["instance_created_on"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceCreatedOn(item.InstanceCreatedOn) + respItem["instance_updated_on"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceUpdatedOn(item.InstanceUpdatedOn) + respItem["change_log_list"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsChangeLogList(item.ChangeLogList) + respItem["instance_origin"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceOrigin(item.InstanceOrigin) + respItem["lazy_loaded_entities"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsLazyLoadedEntities(item.LazyLoadedEntities) respItem["instance_version"] = item.InstanceVersion respItem["ap_name"] = item.ApName respItem["controller_name"] = item.ControllerName @@ -254,13 +254,13 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItems(items *catalystce respItem["mac_address"] = item.MacAddress respItem["status"] = item.Status respItem["status_details"] = item.StatusDetails - respItem["internal_key"] = flattenWirelessGetAccessPointConfigurationTaskResultItemsInternalKey(item.InternalKey) + respItem["internal_key"] = flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInternalKey(item.InternalKey) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceUUID(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultInstanceUUID) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceUUID(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1InstanceUUID) interface{} { if item == nil { return nil } @@ -270,7 +270,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceUUID(item } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsAuthEntityID(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultAuthEntityID) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsAuthEntityID(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1AuthEntityID) interface{} { if item == nil { return nil } @@ -280,7 +280,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsAuthEntityID(item } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsAuthEntityClass(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultAuthEntityClass) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsAuthEntityClass(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1AuthEntityClass) interface{} { if item == nil { return nil } @@ -290,7 +290,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsAuthEntityClass(it } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsOrderedListOEAssocName(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultOrderedListOEAssocName) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsOrderedListOEAssocName(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1OrderedListOEAssocName) interface{} { if item == nil { return nil } @@ -300,7 +300,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsOrderedListOEAssoc } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceCreatedOn(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultInstanceCreatedOn) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceCreatedOn(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1InstanceCreatedOn) interface{} { if item == nil { return nil } @@ -310,7 +310,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceCreatedOn( } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceUpdatedOn(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultInstanceUpdatedOn) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceUpdatedOn(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1InstanceUpdatedOn) interface{} { if item == nil { return nil } @@ -320,7 +320,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceUpdatedOn( } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsChangeLogList(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultChangeLogList) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsChangeLogList(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1ChangeLogList) interface{} { if item == nil { return nil } @@ -330,7 +330,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsChangeLogList(item } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceOrigin(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultInstanceOrigin) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInstanceOrigin(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1InstanceOrigin) interface{} { if item == nil { return nil } @@ -340,7 +340,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsInstanceOrigin(ite } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsLazyLoadedEntities(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultLazyLoadedEntities) interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsLazyLoadedEntities(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1LazyLoadedEntities) interface{} { if item == nil { return nil } @@ -350,7 +350,7 @@ func flattenWirelessGetAccessPointConfigurationTaskResultItemsLazyLoadedEntities } -func flattenWirelessGetAccessPointConfigurationTaskResultItemsInternalKey(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultInternalKey) []map[string]interface{} { +func flattenWirelessGetAccessPointConfigurationTaskResultV1ItemsInternalKey(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointConfigurationTaskResultV1InternalKey) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_analytics_anc_policies.go b/catalystcenter/data_source_analytics_anc_policies.go new file mode 100644 index 0000000..6a23d96 --- /dev/null +++ b/catalystcenter/data_source_analytics_anc_policies.go @@ -0,0 +1,92 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsAncPolicies() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- Fetches the list of ANC policies available in ISE. +`, + + ReadContext: dataSourceAnalyticsAncPoliciesRead, + Schema: map[string]*schema.Schema{ + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "name": &schema.Schema{ + Description: `Name of the ANC policy. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsAncPoliciesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetAncPoliciesV1") + + response1, restyResp1, err := client.AIEndpointAnalytics.GetAncPoliciesV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetAncPoliciesV1", err, + "Failure at GetAncPoliciesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenAIEndpointAnalyticsGetAncPoliciesV1Items(response1) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetAncPoliciesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsGetAncPoliciesV1Items(items *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetAncPoliciesV1) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["name"] = item.Name + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_analytics_dictionaries.go b/catalystcenter/data_source_analytics_dictionaries.go new file mode 100644 index 0000000..cd053a6 --- /dev/null +++ b/catalystcenter/data_source_analytics_dictionaries.go @@ -0,0 +1,150 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsDictionaries() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- Fetches the list of attribute dictionaries. +`, + + ReadContext: dataSourceAnalyticsDictionariesRead, + Schema: map[string]*schema.Schema{ + "include_attributes": &schema.Schema{ + Description: `includeAttributes query parameter. Flag to indicate whether attribute list for each dictionary should be included in response. +`, + Type: schema.TypeBool, + Optional: true, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attributes": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "description": &schema.Schema{ + Description: `Description of the attribute. +`, + Type: schema.TypeString, + Computed: true, + }, + + "name": &schema.Schema{ + Description: `Name of the attribute. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "description": &schema.Schema{ + Description: `Description of the dictionary. +`, + Type: schema.TypeString, + Computed: true, + }, + + "name": &schema.Schema{ + Description: `Name of the dictionary. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsDictionariesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vIncludeAttributes, okIncludeAttributes := d.GetOk("include_attributes") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetAIEndpointAnalyticsAttributeDictionariesV1") + queryParams1 := catalystcentersdkgo.GetAIEndpointAnalyticsAttributeDictionariesV1QueryParams{} + + if okIncludeAttributes { + queryParams1.IncludeAttributes = vIncludeAttributes.(bool) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.GetAIEndpointAnalyticsAttributeDictionariesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetAIEndpointAnalyticsAttributeDictionariesV1", err, + "Failure at GetAIEndpointAnalyticsAttributeDictionariesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenAIEndpointAnalyticsGetAIEndpointAnalyticsAttributeDictionariesV1Items(response1) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetAIEndpointAnalyticsAttributeDictionariesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsGetAIEndpointAnalyticsAttributeDictionariesV1Items(items *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetAIEndpointAnalyticsAttributeDictionariesV1) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["name"] = item.Name + respItem["description"] = item.Description + respItem["attributes"] = flattenAIEndpointAnalyticsGetAIEndpointAnalyticsAttributeDictionariesV1ItemsAttributes(item.Attributes) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenAIEndpointAnalyticsGetAIEndpointAnalyticsAttributeDictionariesV1ItemsAttributes(items *[]catalystcentersdkgo.ResponseItemAIEndpointAnalyticsGetAIEndpointAnalyticsAttributeDictionariesV1Attributes) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["name"] = item.Name + respItem["description"] = item.Description + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_analytics_endpoints.go b/catalystcenter/data_source_analytics_endpoints.go new file mode 100644 index 0000000..ab6c6d4 --- /dev/null +++ b/catalystcenter/data_source_analytics_endpoints.go @@ -0,0 +1,649 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsEndpoints() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- Query the endpoints, optionally using various filter and pagination criteria. 'GET /endpoints/count' API can be used +to find out the total number of endpoints matching the filter criteria. + +- Fetches details of the endpoint for the given unique identifier 'epId'. +`, + + ReadContext: dataSourceAnalyticsEndpointsRead, + Schema: map[string]*schema.Schema{ + "ai_spoofing_trust_level": &schema.Schema{ + Description: `aiSpoofingTrustLevel query parameter. Trust level of the endpoint due to AI spoofing. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "anc_policy": &schema.Schema{ + Description: `ancPolicy query parameter. ANC policy. Only exact match will be returned. +`, + Type: schema.TypeString, + Optional: true, + }, + "auth_method": &schema.Schema{ + Description: `authMethod query parameter. Authentication method. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "changed_profile_trust_level": &schema.Schema{ + Description: `changedProfileTrustLevel query parameter. Trust level of the endpoint due to changing profile labels. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "concurrent_mac_trust_level": &schema.Schema{ + Description: `concurrentMacTrustLevel query parameter. Trust level of the endpoint due to concurrent MAC address. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "device_type": &schema.Schema{ + Description: `deviceType query parameter. Type of device to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "ep_id": &schema.Schema{ + Description: `epId path parameter. Unique identifier for the endpoint. +`, + Type: schema.TypeString, + Optional: true, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `hardwareManufacturer query parameter. Hardware manufacturer to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "hardware_model": &schema.Schema{ + Description: `hardwareModel query parameter. Hardware model to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "include": &schema.Schema{ + Description: `include query parameter. The datasets that should be included in the response. By default, value of this parameter is blank, and the response will include only basic details of the endpoint. To include other datasets or dictionaries, send comma separated list of following values: 'ALL' Include all attributes. 'CDP', 'DHCP', etc. Include attributes from given dictionaries. To get full list of dictionaries, use corresponding GET API. 'ANC' Include ANC policy related details. 'TRUST' Include trust score details. +`, + Type: schema.TypeString, + Optional: true, + }, + "ip": &schema.Schema{ + Description: `ip query parameter. IP address to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "ip_blocklist_detected": &schema.Schema{ + Description: `ipBlocklistDetected query parameter. Flag to fetch endpoints hitting IP blocklist or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + "limit": &schema.Schema{ + Description: `limit query parameter. Maximum number of records to be fetched. If not provided, 50 records will be fetched by default. Maximum 1000 records can be fetched at a time. Use pagination if more records need to be fetched. +`, + Type: schema.TypeInt, + Optional: true, + }, + "mac_address": &schema.Schema{ + Description: `macAddress query parameter. MAC address to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "mac_addresses": &schema.Schema{ + Description: `macAddresses query parameter. List of MAC addresses to filter on. Only exact matches will be returned. +`, + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "nat_trust_level": &schema.Schema{ + Description: `natTrustLevel query parameter. Trust level of the endpoint due to NAT access. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "offset": &schema.Schema{ + Description: `offset query parameter. Record offset to start data fetch at. Offset starts at zero. +`, + Type: schema.TypeInt, + Optional: true, + }, + "operating_system": &schema.Schema{ + Description: `operatingSystem query parameter. Operating system to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "order": &schema.Schema{ + Description: `order query parameter. Order to be used for sorting. Possible values are 'asc', 'desc'. +`, + Type: schema.TypeString, + Optional: true, + }, + "posture_status": &schema.Schema{ + Description: `postureStatus query parameter. Posture status. +`, + Type: schema.TypeString, + Optional: true, + }, + "profiling_status": &schema.Schema{ + Description: `profilingStatus query parameter. Profiling status of the endpoint. Possible values are 'profiled', 'partialProfiled', 'notProfiled'. +`, + Type: schema.TypeString, + Optional: true, + }, + "random_mac": &schema.Schema{ + Description: `randomMac query parameter. Flag to fetch endpoints having randomized MAC or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + "registered": &schema.Schema{ + Description: `registered query parameter. Flag to fetch manually registered or non-registered endpoints. +`, + Type: schema.TypeBool, + Optional: true, + }, + "sort_by": &schema.Schema{ + Description: `sortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more time if sorting is requested. Possible values are 'macAddress', 'ip'. +`, + Type: schema.TypeString, + Optional: true, + }, + "trust_score": &schema.Schema{ + Description: `trustScore query parameter. Overall trust score of the endpoint. It can be provided either as a number value (e.g. 5), or as a range (e.g. 3-7). Provide value as '-' if you want to search for all endpoints where trust score is not assigned. +`, + Type: schema.TypeString, + Optional: true, + }, + "unauth_port_detected": &schema.Schema{ + Description: `unauthPortDetected query parameter. Flag to fetch endpoints exposing unauthorized ports or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + "weak_cred_detected": &schema.Schema{ + Description: `weakCredDetected query parameter. Flag to fetch endpoints having weak credentials or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "anc_policy": &schema.Schema{ + Description: `ANC policy currently applied to the endpoint in ISE. +`, + Type: schema.TypeString, + Computed: true, + }, + + "attributes": &schema.Schema{ + Description: `Various endpoint attributes grouped by dictionaries (e.g. IP, DHCP, etc). +`, + Type: schema.TypeString, //TEST, + Computed: true, + }, + + "device_type": &schema.Schema{ + Description: `Type of the device represented by this endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "duid": &schema.Schema{ + Description: `Unique DUID. +`, + Type: schema.TypeString, + Computed: true, + }, + + "granular_anc_policy": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "name": &schema.Schema{ + Description: `Name of the granular ANC policy. +`, + Type: schema.TypeString, + Computed: true, + }, + + "nas_ip_address": &schema.Schema{ + Description: `IP address of the network device where endpoint is attached. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "hardware_manufacturer": &schema.Schema{ + Description: `Hardware manufacturer for the endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_model": &schema.Schema{ + Description: `Hardware model of the endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "id": &schema.Schema{ + Description: `Unique identifier for the endpoint. +`, + Type: schema.TypeString, + Computed: true, + }, + + "last_probe_collection_timestamp": &schema.Schema{ + Description: `Last probe collection timestamp in epoch milliseconds. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "mac_address": &schema.Schema{ + Description: `MAC address of the endpoint. +`, + Type: schema.TypeString, + Computed: true, + }, + + "operating_system": &schema.Schema{ + Description: `Operating system of the endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "random_mac": &schema.Schema{ + Description: `Flag to indicate whether MAC address is a randomized one or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "registered": &schema.Schema{ + Description: `Flag to indicate whether this is a manually registered endpoint or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "trust_data": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ai_spoofing_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to AI spoofing. +`, + Type: schema.TypeString, + Computed: true, + }, + + "auth_method": &schema.Schema{ + Description: `Authentication method. +`, + Type: schema.TypeString, + Computed: true, + }, + + "changed_profile_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to changing profile labels. +`, + Type: schema.TypeString, + Computed: true, + }, + + "concurrent_mac_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to concurrent MAC address. +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip_blocklist_detected": &schema.Schema{ + Description: `Flag to fetch endpoints hitting IP blocklist or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "nat_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to NAT access. +`, + Type: schema.TypeString, + Computed: true, + }, + + "posture_status": &schema.Schema{ + Description: `Posture status. +`, + Type: schema.TypeString, + Computed: true, + }, + + "trust_score": &schema.Schema{ + Description: `Overall trust score of the endpoint. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "unauth_port_detected": &schema.Schema{ + Description: `Flag to fetch endpoints exposing unauthorized ports or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "weak_cred_detected": &schema.Schema{ + Description: `Flag to fetch endpoints having weak credentials or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsEndpointsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vProfilingStatus, okProfilingStatus := d.GetOk("profiling_status") + vMacAddress, okMacAddress := d.GetOk("mac_address") + vMacAddresses, okMacAddresses := d.GetOk("mac_addresses") + vIP, okIP := d.GetOk("ip") + vDeviceType, okDeviceType := d.GetOk("device_type") + vHardwareManufacturer, okHardwareManufacturer := d.GetOk("hardware_manufacturer") + vHardwareModel, okHardwareModel := d.GetOk("hardware_model") + vOperatingSystem, okOperatingSystem := d.GetOk("operating_system") + vRegistered, okRegistered := d.GetOk("registered") + vRandomMac, okRandomMac := d.GetOk("random_mac") + vTrustScore, okTrustScore := d.GetOk("trust_score") + vAuthMethod, okAuthMethod := d.GetOk("auth_method") + vPostureStatus, okPostureStatus := d.GetOk("posture_status") + vAiSpoofingTrustLevel, okAiSpoofingTrustLevel := d.GetOk("ai_spoofing_trust_level") + vChangedProfileTrustLevel, okChangedProfileTrustLevel := d.GetOk("changed_profile_trust_level") + vNatTrustLevel, okNatTrustLevel := d.GetOk("nat_trust_level") + vConcurrentMacTrustLevel, okConcurrentMacTrustLevel := d.GetOk("concurrent_mac_trust_level") + vIPBlocklistDetected, okIPBlocklistDetected := d.GetOk("ip_blocklist_detected") + vUnauthPortDetected, okUnauthPortDetected := d.GetOk("unauth_port_detected") + vWeakCredDetected, okWeakCredDetected := d.GetOk("weak_cred_detected") + vAncPolicy, okAncPolicy := d.GetOk("anc_policy") + vLimit, okLimit := d.GetOk("limit") + vOffset, okOffset := d.GetOk("offset") + vSortBy, okSortBy := d.GetOk("sort_by") + vOrder, okOrder := d.GetOk("order") + vInclude, okInclude := d.GetOk("include") + vEpID, okEpID := d.GetOk("ep_id") + + method1 := []bool{okProfilingStatus, okMacAddress, okMacAddresses, okIP, okDeviceType, okHardwareManufacturer, okHardwareModel, okOperatingSystem, okRegistered, okRandomMac, okTrustScore, okAuthMethod, okPostureStatus, okAiSpoofingTrustLevel, okChangedProfileTrustLevel, okNatTrustLevel, okConcurrentMacTrustLevel, okIPBlocklistDetected, okUnauthPortDetected, okWeakCredDetected, okAncPolicy, okLimit, okOffset, okSortBy, okOrder, okInclude} + log.Printf("[DEBUG] Selecting method. Method 1 %v", method1) + method2 := []bool{okEpID, okInclude} + log.Printf("[DEBUG] Selecting method. Method 2 %v", method2) + + selectedMethod := pickMethod([][]bool{method1, method2}) + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: QueryTheEndpointsV1") + queryParams1 := catalystcentersdkgo.QueryTheEndpointsV1QueryParams{} + + if okProfilingStatus { + queryParams1.ProfilingStatus = vProfilingStatus.(string) + } + if okMacAddress { + queryParams1.MacAddress = vMacAddress.(string) + } + if okMacAddresses { + queryParams1.MacAddresses = interfaceToSliceString(vMacAddresses) + } + if okIP { + queryParams1.IP = vIP.(string) + } + if okDeviceType { + queryParams1.DeviceType = vDeviceType.(string) + } + if okHardwareManufacturer { + queryParams1.HardwareManufacturer = vHardwareManufacturer.(string) + } + if okHardwareModel { + queryParams1.HardwareModel = vHardwareModel.(string) + } + if okOperatingSystem { + queryParams1.OperatingSystem = vOperatingSystem.(string) + } + if okRegistered { + queryParams1.Registered = vRegistered.(bool) + } + if okRandomMac { + queryParams1.RandomMac = vRandomMac.(bool) + } + if okTrustScore { + queryParams1.TrustScore = vTrustScore.(string) + } + if okAuthMethod { + queryParams1.AuthMethod = vAuthMethod.(string) + } + if okPostureStatus { + queryParams1.PostureStatus = vPostureStatus.(string) + } + if okAiSpoofingTrustLevel { + queryParams1.AiSpoofingTrustLevel = vAiSpoofingTrustLevel.(string) + } + if okChangedProfileTrustLevel { + queryParams1.ChangedProfileTrustLevel = vChangedProfileTrustLevel.(string) + } + if okNatTrustLevel { + queryParams1.NatTrustLevel = vNatTrustLevel.(string) + } + if okConcurrentMacTrustLevel { + queryParams1.ConcurrentMacTrustLevel = vConcurrentMacTrustLevel.(string) + } + if okIPBlocklistDetected { + queryParams1.IPBlocklistDetected = vIPBlocklistDetected.(bool) + } + if okUnauthPortDetected { + queryParams1.UnauthPortDetected = vUnauthPortDetected.(bool) + } + if okWeakCredDetected { + queryParams1.WeakCredDetected = vWeakCredDetected.(bool) + } + if okAncPolicy { + queryParams1.AncPolicy = vAncPolicy.(string) + } + if okLimit { + queryParams1.Limit = vLimit.(int) + } + if okOffset { + queryParams1.Offset = vOffset.(int) + } + if okSortBy { + queryParams1.SortBy = vSortBy.(string) + } + if okOrder { + queryParams1.Order = vOrder.(string) + } + if okInclude { + queryParams1.Include = vInclude.(string) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.QueryTheEndpointsV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 QueryTheEndpointsV1", err, + "Failure at QueryTheEndpointsV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + } + if selectedMethod == 2 { + log.Printf("[DEBUG] Selected method: GetEndpointDetailsV1") + vvEpID := vEpID.(string) + queryParams2 := catalystcentersdkgo.GetEndpointDetailsV1QueryParams{} + + if okInclude { + queryParams2.Include = vInclude.(string) + } + + response2, restyResp2, err := client.AIEndpointAnalytics.GetEndpointDetailsV1(vvEpID, &queryParams2) + + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetEndpointDetailsV1", err, + "Failure at GetEndpointDetailsV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) + + vItem2 := flattenAIEndpointAnalyticsGetEndpointDetailsV1Item(response2) + if err := d.Set("item", vItem2); err != nil { + diags = append(diags, diagError( + "Failure when setting GetEndpointDetailsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsGetEndpointDetailsV1Item(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetEndpointDetailsV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["duid"] = item.Duid + respItem["mac_address"] = item.MacAddress + respItem["device_type"] = item.DeviceType + respItem["hardware_manufacturer"] = item.HardwareManufacturer + respItem["hardware_model"] = item.HardwareModel + respItem["operating_system"] = item.OperatingSystem + respItem["last_probe_collection_timestamp"] = item.LastProbeCollectionTimestamp + respItem["random_mac"] = boolPtrToString(item.RandomMac) + respItem["registered"] = boolPtrToString(item.Registered) + respItem["attributes"] = flattenAIEndpointAnalyticsGetEndpointDetailsV1ItemAttributes(item.Attributes) + respItem["trust_data"] = flattenAIEndpointAnalyticsGetEndpointDetailsV1ItemTrustData(item.TrustData) + respItem["anc_policy"] = item.AncPolicy + respItem["granular_anc_policy"] = flattenAIEndpointAnalyticsGetEndpointDetailsV1ItemGranularAncPolicy(item.GranularAncPolicy) + return []map[string]interface{}{ + respItem, + } +} + +func flattenAIEndpointAnalyticsGetEndpointDetailsV1ItemAttributes(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetEndpointDetailsV1Attributes) interface{} { + if item == nil { + return nil + } + respItem := *item + + return responseInterfaceToString(respItem) + +} + +func flattenAIEndpointAnalyticsGetEndpointDetailsV1ItemTrustData(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetEndpointDetailsV1TrustData) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["trust_score"] = item.TrustScore + respItem["auth_method"] = item.AuthMethod + respItem["posture_status"] = item.PostureStatus + respItem["ai_spoofing_trust_level"] = item.AiSpoofingTrustLevel + respItem["changed_profile_trust_level"] = item.ChangedProfileTrustLevel + respItem["nat_trust_level"] = item.NatTrustLevel + respItem["concurrent_mac_trust_level"] = item.ConcurrentMacTrustLevel + respItem["ip_blocklist_detected"] = boolPtrToString(item.IPBlocklistDetected) + respItem["unauth_port_detected"] = boolPtrToString(item.UnauthPortDetected) + respItem["weak_cred_detected"] = boolPtrToString(item.WeakCredDetected) + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenAIEndpointAnalyticsGetEndpointDetailsV1ItemGranularAncPolicy(items *[]catalystcentersdkgo.ResponseAIEndpointAnalyticsGetEndpointDetailsV1GranularAncPolicy) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["name"] = item.Name + respItem["nas_ip_address"] = item.NasIPAddress + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_analytics_endpoints_count.go b/catalystcenter/data_source_analytics_endpoints_count.go new file mode 100644 index 0000000..032b7c0 --- /dev/null +++ b/catalystcenter/data_source_analytics_endpoints_count.go @@ -0,0 +1,303 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsEndpointsCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- Fetch the total count of endpoints that match the given filter criteria. +`, + + ReadContext: dataSourceAnalyticsEndpointsCountRead, + Schema: map[string]*schema.Schema{ + "ai_spoofing_trust_level": &schema.Schema{ + Description: `aiSpoofingTrustLevel query parameter. Trust level of the endpoint due to AI spoofing. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "anc_policy": &schema.Schema{ + Description: `ancPolicy query parameter. ANC policy. Only exact match will be returned. +`, + Type: schema.TypeString, + Optional: true, + }, + "auth_method": &schema.Schema{ + Description: `authMethod query parameter. Authentication method. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "changed_profile_trust_level": &schema.Schema{ + Description: `changedProfileTrustLevel query parameter. Trust level of the endpoint due to changing profile labels. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "concurrent_mac_trust_level": &schema.Schema{ + Description: `concurrentMacTrustLevel query parameter. Trust level of the endpoint due to concurrent MAC address. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "device_type": &schema.Schema{ + Description: `deviceType query parameter. Type of device to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `hardwareManufacturer query parameter. Hardware manufacturer to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "hardware_model": &schema.Schema{ + Description: `hardwareModel query parameter. Hardware model to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "ip": &schema.Schema{ + Description: `ip query parameter. IP address to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "ip_blocklist_detected": &schema.Schema{ + Description: `ipBlocklistDetected query parameter. Flag to fetch endpoints hitting IP blocklist or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + "mac_address": &schema.Schema{ + Description: `macAddress query parameter. MAC address to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "mac_addresses": &schema.Schema{ + Description: `macAddresses query parameter. List of MAC addresses to filter on. Only exact matches will be returned. +`, + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "nat_trust_level": &schema.Schema{ + Description: `natTrustLevel query parameter. Trust level of the endpoint due to NAT access. Possible values are 'low', 'medium', 'high'. +`, + Type: schema.TypeString, + Optional: true, + }, + "operating_system": &schema.Schema{ + Description: `operatingSystem query parameter. Operating system to search for. Partial string is allowed. +`, + Type: schema.TypeString, + Optional: true, + }, + "posture_status": &schema.Schema{ + Description: `postureStatus query parameter. Posture status. +`, + Type: schema.TypeString, + Optional: true, + }, + "profiling_status": &schema.Schema{ + Description: `profilingStatus query parameter. Profiling status of the endpoint. Possible values are 'profiled', 'partialProfiled', 'notProfiled'. +`, + Type: schema.TypeString, + Optional: true, + }, + "random_mac": &schema.Schema{ + Description: `randomMac query parameter. Flag to fetch endpoints having randomized MAC or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + "registered": &schema.Schema{ + Description: `registered query parameter. Flag to fetch manually registered or non-registered endpoints. +`, + Type: schema.TypeBool, + Optional: true, + }, + "trust_score": &schema.Schema{ + Description: `trustScore query parameter. Overall trust score of the endpoint. It can be provided either as a number value (e.g. 5), or as a range (e.g. 3-7). Provide value as '-' if you want to search for all endpoints where trust score is not assigned. +`, + Type: schema.TypeString, + Optional: true, + }, + "unauth_port_detected": &schema.Schema{ + Description: `unauthPortDetected query parameter. Flag to fetch endpoints exposing unauthorized ports or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + "weak_cred_detected": &schema.Schema{ + Description: `weakCredDetected query parameter. Flag to fetch endpoints having weak credentials or not. +`, + Type: schema.TypeBool, + Optional: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "count": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsEndpointsCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vProfilingStatus, okProfilingStatus := d.GetOk("profiling_status") + vMacAddress, okMacAddress := d.GetOk("mac_address") + vMacAddresses, okMacAddresses := d.GetOk("mac_addresses") + vIP, okIP := d.GetOk("ip") + vDeviceType, okDeviceType := d.GetOk("device_type") + vHardwareManufacturer, okHardwareManufacturer := d.GetOk("hardware_manufacturer") + vHardwareModel, okHardwareModel := d.GetOk("hardware_model") + vOperatingSystem, okOperatingSystem := d.GetOk("operating_system") + vRegistered, okRegistered := d.GetOk("registered") + vRandomMac, okRandomMac := d.GetOk("random_mac") + vTrustScore, okTrustScore := d.GetOk("trust_score") + vAuthMethod, okAuthMethod := d.GetOk("auth_method") + vPostureStatus, okPostureStatus := d.GetOk("posture_status") + vAiSpoofingTrustLevel, okAiSpoofingTrustLevel := d.GetOk("ai_spoofing_trust_level") + vChangedProfileTrustLevel, okChangedProfileTrustLevel := d.GetOk("changed_profile_trust_level") + vNatTrustLevel, okNatTrustLevel := d.GetOk("nat_trust_level") + vConcurrentMacTrustLevel, okConcurrentMacTrustLevel := d.GetOk("concurrent_mac_trust_level") + vIPBlocklistDetected, okIPBlocklistDetected := d.GetOk("ip_blocklist_detected") + vUnauthPortDetected, okUnauthPortDetected := d.GetOk("unauth_port_detected") + vWeakCredDetected, okWeakCredDetected := d.GetOk("weak_cred_detected") + vAncPolicy, okAncPolicy := d.GetOk("anc_policy") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: FetchTheCountOfEndpointsV1") + queryParams1 := catalystcentersdkgo.FetchTheCountOfEndpointsV1QueryParams{} + + if okProfilingStatus { + queryParams1.ProfilingStatus = vProfilingStatus.(string) + } + if okMacAddress { + queryParams1.MacAddress = vMacAddress.(string) + } + if okMacAddresses { + queryParams1.MacAddresses = interfaceToSliceString(vMacAddresses) + } + if okIP { + queryParams1.IP = vIP.(string) + } + if okDeviceType { + queryParams1.DeviceType = vDeviceType.(string) + } + if okHardwareManufacturer { + queryParams1.HardwareManufacturer = vHardwareManufacturer.(string) + } + if okHardwareModel { + queryParams1.HardwareModel = vHardwareModel.(string) + } + if okOperatingSystem { + queryParams1.OperatingSystem = vOperatingSystem.(string) + } + if okRegistered { + queryParams1.Registered = vRegistered.(bool) + } + if okRandomMac { + queryParams1.RandomMac = vRandomMac.(bool) + } + if okTrustScore { + queryParams1.TrustScore = vTrustScore.(string) + } + if okAuthMethod { + queryParams1.AuthMethod = vAuthMethod.(string) + } + if okPostureStatus { + queryParams1.PostureStatus = vPostureStatus.(string) + } + if okAiSpoofingTrustLevel { + queryParams1.AiSpoofingTrustLevel = vAiSpoofingTrustLevel.(string) + } + if okChangedProfileTrustLevel { + queryParams1.ChangedProfileTrustLevel = vChangedProfileTrustLevel.(string) + } + if okNatTrustLevel { + queryParams1.NatTrustLevel = vNatTrustLevel.(string) + } + if okConcurrentMacTrustLevel { + queryParams1.ConcurrentMacTrustLevel = vConcurrentMacTrustLevel.(string) + } + if okIPBlocklistDetected { + queryParams1.IPBlocklistDetected = vIPBlocklistDetected.(bool) + } + if okUnauthPortDetected { + queryParams1.UnauthPortDetected = vUnauthPortDetected.(bool) + } + if okWeakCredDetected { + queryParams1.WeakCredDetected = vWeakCredDetected.(bool) + } + if okAncPolicy { + queryParams1.AncPolicy = vAncPolicy.(string) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.FetchTheCountOfEndpointsV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 FetchTheCountOfEndpointsV1", err, + "Failure at FetchTheCountOfEndpointsV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenAIEndpointAnalyticsFetchTheCountOfEndpointsV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting FetchTheCountOfEndpointsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsFetchTheCountOfEndpointsV1Item(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsFetchTheCountOfEndpointsV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["count"] = item.Count + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/data_source_analytics_profiling_rules.go b/catalystcenter/data_source_analytics_profiling_rules.go new file mode 100644 index 0000000..47e72f4 --- /dev/null +++ b/catalystcenter/data_source_analytics_profiling_rules.go @@ -0,0 +1,743 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsProfilingRules() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- This data source fetches the list of profiling rules. It can be used to show profiling rules in client applications, +or export those from an environment. 'POST /profiling-rules/bulk' API can be used to import such exported rules into +another environment. If this API is used to export rules to be imported into another Cisco DNA Center system, then +ensure that 'includeDeleted' parameter is 'true', so that deleted rules get synchronized correctly. Use query parameters +to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the +response. By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, +if required. 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system. + +- Fetches details of the profiling rule for the given 'ruleId'. +`, + + ReadContext: dataSourceAnalyticsProfilingRulesRead, + Schema: map[string]*schema.Schema{ + "include_deleted": &schema.Schema{ + Description: `includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +`, + Type: schema.TypeBool, + Optional: true, + }, + "limit": &schema.Schema{ + Description: `limit query parameter. Maximum number of records to be fetched. If not provided, 500 records will be fetched by default. To fetch all the records in the system, provide a large value for this parameter. +`, + Type: schema.TypeFloat, + Optional: true, + }, + "offset": &schema.Schema{ + Description: `offset query parameter. Record offset to start data fetch at. Offset starts at zero. +`, + Type: schema.TypeFloat, + Optional: true, + }, + "order": &schema.Schema{ + Description: `order query parameter. Order to be used for sorting. +`, + Type: schema.TypeString, + Optional: true, + }, + "rule_id": &schema.Schema{ + Description: `ruleId path parameter. Unique rule identifier +`, + Type: schema.TypeString, + Optional: true, + }, + "rule_type": &schema.Schema{ + Description: `ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. +`, + Type: schema.TypeString, + Optional: true, + }, + "sort_by": &schema.Schema{ + Description: `sortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more time if sorting is requested. +`, + Type: schema.TypeString, + Optional: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Computed: true, + }, + + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "result": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Computed: true, + }, + + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "result": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsProfilingRulesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vRuleType, okRuleType := d.GetOk("rule_type") + vIncludeDeleted, okIncludeDeleted := d.GetOk("include_deleted") + vLimit, okLimit := d.GetOk("limit") + vOffset, okOffset := d.GetOk("offset") + vSortBy, okSortBy := d.GetOk("sort_by") + vOrder, okOrder := d.GetOk("order") + vRuleID, okRuleID := d.GetOk("rule_id") + + method1 := []bool{okRuleType, okIncludeDeleted, okLimit, okOffset, okSortBy, okOrder} + log.Printf("[DEBUG] Selecting method. Method 1 %v", method1) + method2 := []bool{okRuleID} + log.Printf("[DEBUG] Selecting method. Method 2 %v", method2) + + selectedMethod := pickMethod([][]bool{method1, method2}) + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetListOfProfilingRulesV1") + queryParams1 := catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams{} + + if okRuleType { + queryParams1.RuleType = vRuleType.(string) + } + if okIncludeDeleted { + queryParams1.IncludeDeleted = vIncludeDeleted.(bool) + } + if okLimit { + queryParams1.Limit = vLimit.(float64) + } + if okOffset { + queryParams1.Offset = vOffset.(float64) + } + if okSortBy { + queryParams1.SortBy = vSortBy.(string) + } + if okOrder { + queryParams1.Order = vOrder.(string) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.GetListOfProfilingRulesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetListOfProfilingRulesV1", err, + "Failure at GetListOfProfilingRulesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenAIEndpointAnalyticsGetListOfProfilingRulesV1Items(response1.ProfilingRules) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetListOfProfilingRulesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + if selectedMethod == 2 { + log.Printf("[DEBUG] Selected method: GetDetailsOfASingleProfilingRuleV1") + vvRuleID := vRuleID.(string) + + response2, restyResp2, err := client.AIEndpointAnalytics.GetDetailsOfASingleProfilingRuleV1(vvRuleID) + + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetDetailsOfASingleProfilingRuleV1", err, + "Failure at GetDetailsOfASingleProfilingRuleV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) + + vItem2 := flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1Item(response2) + if err := d.Set("item", vItem2); err != nil { + diags = append(diags, diagError( + "Failure when setting GetDetailsOfASingleProfilingRuleV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsGetListOfProfilingRulesV1Items(items *[]catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRules) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["rule_id"] = item.RuleID + respItem["rule_name"] = item.RuleName + respItem["rule_type"] = item.RuleType + respItem["rule_version"] = item.RuleVersion + respItem["rule_priority"] = item.RulePriority + respItem["source_priority"] = item.SourcePriority + respItem["is_deleted"] = boolPtrToString(item.IsDeleted) + respItem["last_modified_by"] = item.LastModifiedBy + respItem["last_modified_on"] = item.LastModifiedOn + respItem["plugin_id"] = item.PluginID + respItem["cluster_id"] = item.ClusterID + respItem["rejected"] = boolPtrToString(item.Rejected) + respItem["result"] = flattenAIEndpointAnalyticsGetListOfProfilingRulesV1ItemsResult(item.Result) + respItem["condition_groups"] = flattenAIEndpointAnalyticsGetListOfProfilingRulesV1ItemsConditionGroups(item.ConditionGroups) + respItem["used_attributes"] = item.UsedAttributes + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenAIEndpointAnalyticsGetListOfProfilingRulesV1ItemsResult(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRulesResult) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["device_type"] = item.DeviceType + respItem["hardware_manufacturer"] = item.HardwareManufacturer + respItem["hardware_model"] = item.HardwareModel + respItem["operating_system"] = item.OperatingSystem + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenAIEndpointAnalyticsGetListOfProfilingRulesV1ItemsConditionGroups(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRulesConditionGroups) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["type"] = item.Type + respItem["condition"] = flattenAIEndpointAnalyticsGetListOfProfilingRulesV1ItemsConditionGroupsCondition(item.Condition) + respItem["operator"] = item.Operator + respItem["condition_group"] = item.ConditionGroup + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenAIEndpointAnalyticsGetListOfProfilingRulesV1ItemsConditionGroupsCondition(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRulesConditionGroupsCondition) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["attribute"] = item.Attribute + respItem["operator"] = item.Operator + respItem["value"] = item.Value + respItem["attribute_dictionary"] = item.AttributeDictionary + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1Item(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["rule_id"] = item.RuleID + respItem["rule_name"] = item.RuleName + respItem["rule_type"] = item.RuleType + respItem["rule_version"] = item.RuleVersion + respItem["rule_priority"] = item.RulePriority + respItem["source_priority"] = item.SourcePriority + respItem["is_deleted"] = boolPtrToString(item.IsDeleted) + respItem["last_modified_by"] = item.LastModifiedBy + respItem["last_modified_on"] = item.LastModifiedOn + respItem["plugin_id"] = item.PluginID + respItem["cluster_id"] = item.ClusterID + respItem["rejected"] = boolPtrToString(item.Rejected) + respItem["result"] = flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ItemResult(item.Result) + respItem["condition_groups"] = flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ItemConditionGroups(item.ConditionGroups) + respItem["used_attributes"] = item.UsedAttributes + return []map[string]interface{}{ + respItem, + } +} + +func flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ItemResult(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1Result) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["device_type"] = item.DeviceType + respItem["hardware_manufacturer"] = item.HardwareManufacturer + respItem["hardware_model"] = item.HardwareModel + respItem["operating_system"] = item.OperatingSystem + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ItemConditionGroups(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ConditionGroups) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["type"] = item.Type + respItem["condition"] = flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ItemConditionGroupsCondition(item.Condition) + respItem["operator"] = item.Operator + respItem["condition_group"] = item.ConditionGroup + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ItemConditionGroupsCondition(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1ConditionGroupsCondition) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["attribute"] = item.Attribute + respItem["operator"] = item.Operator + respItem["value"] = item.Value + respItem["attribute_dictionary"] = item.AttributeDictionary + + return []map[string]interface{}{ + respItem, + } + +} diff --git a/catalystcenter/data_source_analytics_profiling_rules_count.go b/catalystcenter/data_source_analytics_profiling_rules_count.go new file mode 100644 index 0000000..a483825 --- /dev/null +++ b/catalystcenter/data_source_analytics_profiling_rules_count.go @@ -0,0 +1,111 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsProfilingRulesCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- This data source fetches the count of profiling rules based on the filter values provided in the query parameters. The +filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. +`, + + ReadContext: dataSourceAnalyticsProfilingRulesCountRead, + Schema: map[string]*schema.Schema{ + "include_deleted": &schema.Schema{ + Description: `includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +`, + Type: schema.TypeBool, + Optional: true, + }, + "rule_type": &schema.Schema{ + Description: `ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. +`, + Type: schema.TypeString, + Optional: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "count": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsProfilingRulesCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vRuleType, okRuleType := d.GetOk("rule_type") + vIncludeDeleted, okIncludeDeleted := d.GetOk("include_deleted") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetCountOfProfilingRulesV1") + queryParams1 := catalystcentersdkgo.GetCountOfProfilingRulesV1QueryParams{} + + if okRuleType { + queryParams1.RuleType = vRuleType.(string) + } + if okIncludeDeleted { + queryParams1.IncludeDeleted = vIncludeDeleted.(bool) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.GetCountOfProfilingRulesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetCountOfProfilingRulesV1", err, + "Failure at GetCountOfProfilingRulesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenAIEndpointAnalyticsGetCountOfProfilingRulesV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetCountOfProfilingRulesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsGetCountOfProfilingRulesV1Item(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetCountOfProfilingRulesV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["count"] = item.Count + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/data_source_analytics_tasks.go b/catalystcenter/data_source_analytics_tasks.go new file mode 100644 index 0000000..ea3c4c0 --- /dev/null +++ b/catalystcenter/data_source_analytics_tasks.go @@ -0,0 +1,211 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAnalyticsTasks() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AI Endpoint Analytics. + +- Fetches the details of backend task. Task is typically created by making call to some other API that takes longer time +to execute. +`, + + ReadContext: dataSourceAnalyticsTasksRead, + Schema: map[string]*schema.Schema{ + "task_id": &schema.Schema{ + Description: `taskId path parameter. Unique identifier for the task. +`, + Type: schema.TypeString, + Required: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "additional_info": &schema.Schema{ + Description: `Additional information about the task. +`, + Type: schema.TypeString, //TEST, + Computed: true, + }, + + "created_by": &schema.Schema{ + Description: `Name of the user that created the task. +`, + Type: schema.TypeString, + Computed: true, + }, + + "created_on": &schema.Schema{ + Description: `Task creation timestamp in epoch milliseconds. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "errors": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "code": &schema.Schema{ + Description: `Error code. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "details": &schema.Schema{ + Description: `Optional details about the error. +`, + Type: schema.TypeString, + Computed: true, + }, + + "index": &schema.Schema{ + Description: `Index of the input records which had error during processing. In case the input is not an array, or the error is not record specific, this will be -1. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "message": &schema.Schema{ + Description: `Error message. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "id": &schema.Schema{ + Description: `Unique identifier for the task. +`, + Type: schema.TypeString, + Computed: true, + }, + + "last_updated_on": &schema.Schema{ + Description: `Last update timestamp in epoch milliseconds. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "name": &schema.Schema{ + Description: `Name of the task. +`, + Type: schema.TypeString, + Computed: true, + }, + + "status": &schema.Schema{ + Description: `Status of the task. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceAnalyticsTasksRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vTaskID := d.Get("task_id") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetTaskDetailsV1") + vvTaskID := vTaskID.(string) + + response1, restyResp1, err := client.AIEndpointAnalytics.GetTaskDetailsV1(vvTaskID) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetTaskDetailsV1", err, + "Failure at GetTaskDetailsV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenAIEndpointAnalyticsGetTaskDetailsV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetTaskDetailsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenAIEndpointAnalyticsGetTaskDetailsV1Item(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetTaskDetailsV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["name"] = item.Name + respItem["status"] = item.Status + respItem["errors"] = flattenAIEndpointAnalyticsGetTaskDetailsV1ItemErrors(item.Errors) + respItem["additional_info"] = flattenAIEndpointAnalyticsGetTaskDetailsV1ItemAdditionalInfo(item.AdditionalInfo) + respItem["created_by"] = item.CreatedBy + respItem["created_on"] = item.CreatedOn + respItem["last_updated_on"] = item.LastUpdatedOn + return []map[string]interface{}{ + respItem, + } +} + +func flattenAIEndpointAnalyticsGetTaskDetailsV1ItemErrors(items *[]catalystcentersdkgo.ResponseAIEndpointAnalyticsGetTaskDetailsV1Errors) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["index"] = item.Index + respItem["code"] = item.Code + respItem["message"] = item.Message + respItem["details"] = item.Details + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenAIEndpointAnalyticsGetTaskDetailsV1ItemAdditionalInfo(item *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetTaskDetailsV1AdditionalInfo) interface{} { + if item == nil { + return nil + } + respItem := *item + + return responseInterfaceToString(respItem) + +} diff --git a/catalystcenter/data_source_app_policy.go b/catalystcenter/data_source_app_policy.go index 3f22430..a96417f 100644 --- a/catalystcenter/data_source_app_policy.go +++ b/catalystcenter/data_source_app_policy.go @@ -751,31 +751,31 @@ func dataSourceAppPolicyRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationPolicy") - queryParams1 := catalystcentersdkgo.GetApplicationPolicyQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationPolicyV1") + queryParams1 := catalystcentersdkgo.GetApplicationPolicyV1QueryParams{} if okPolicyScope { queryParams1.PolicyScope = vPolicyScope.(string) } - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicy(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationPolicy", err, - "Failure at GetApplicationPolicy, unexpected response", "")) + "Failure when executing 2 GetApplicationPolicyV1", err, + "Failure at GetApplicationPolicyV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplicationPolicyItems(response1.Response) + vItems1 := flattenApplicationPolicyGetApplicationPolicyV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationPolicy response", + "Failure when setting GetApplicationPolicyV1 response", err)) return diags } @@ -787,7 +787,7 @@ func dataSourceAppPolicyRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenApplicationPolicyGetApplicationPolicyItems(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponse) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1Response) []map[string]interface{} { if items == nil { return nil } @@ -810,10 +810,10 @@ func flattenApplicationPolicyGetApplicationPolicyItems(items *[]catalystcentersd respItem["provisioning_state"] = item.ProvisioningState respItem["qualifier"] = item.Qualifier respItem["resource_version"] = item.ResourceVersion - respItem["target_id_list"] = flattenApplicationPolicyGetApplicationPolicyItemsTargetIDList(item.TargetIDList) + respItem["target_id_list"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsTargetIDList(item.TargetIDList) respItem["type"] = item.Type - respItem["cfs_change_info"] = flattenApplicationPolicyGetApplicationPolicyItemsCfsChangeInfo(item.CfsChangeInfo) - respItem["custom_provisions"] = flattenApplicationPolicyGetApplicationPolicyItemsCustomProvisions(item.CustomProvisions) + respItem["cfs_change_info"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsCfsChangeInfo(item.CfsChangeInfo) + respItem["custom_provisions"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsCustomProvisions(item.CustomProvisions) respItem["delete_policy_status"] = item.DeletePolicyStatus respItem["internal"] = boolPtrToString(item.Internal) respItem["is_deleted"] = boolPtrToString(item.IsDeleted) @@ -824,18 +824,18 @@ func flattenApplicationPolicyGetApplicationPolicyItems(items *[]catalystcentersd respItem["policy_status"] = item.PolicyStatus respItem["priority"] = item.Priority respItem["pushed"] = boolPtrToString(item.Pushed) - respItem["advanced_policy_scope"] = flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScope(item.AdvancedPolicyScope) - respItem["contract_list"] = flattenApplicationPolicyGetApplicationPolicyItemsContractList(item.ContractList) - respItem["exclusive_contract"] = flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContract(item.ExclusiveContract) - respItem["identity_source"] = flattenApplicationPolicyGetApplicationPolicyItemsIDentitySource(item.IDentitySource) - respItem["producer"] = flattenApplicationPolicyGetApplicationPolicyItemsProducer(item.Producer) - respItem["consumer"] = flattenApplicationPolicyGetApplicationPolicyItemsConsumer(item.Consumer) + respItem["advanced_policy_scope"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsAdvancedPolicyScope(item.AdvancedPolicyScope) + respItem["contract_list"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsContractList(item.ContractList) + respItem["exclusive_contract"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsExclusiveContract(item.ExclusiveContract) + respItem["identity_source"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsIDentitySource(item.IDentitySource) + respItem["producer"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsProducer(item.Producer) + respItem["consumer"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsConsumer(item.Consumer) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseTargetIDList) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseTargetIDList) []interface{} { if items == nil { return nil } @@ -847,7 +847,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsTargetIDList(items *[]cata return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseCfsChangeInfo) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseCfsChangeInfo) []interface{} { if items == nil { return nil } @@ -859,7 +859,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsCfsChangeInfo(items *[]cat return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseCustomProvisions) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseCustomProvisions) []interface{} { if items == nil { return nil } @@ -871,7 +871,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsCustomProvisions(items *[] return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScope(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseAdvancedPolicyScope) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsAdvancedPolicyScope(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseAdvancedPolicyScope) []map[string]interface{} { if item == nil { return nil } @@ -883,7 +883,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScope(item * respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion respItem["name"] = item.Name - respItem["advanced_policy_scope_element"] = flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScopeAdvancedPolicyScopeElement(item.AdvancedPolicyScopeElement) + respItem["advanced_policy_scope_element"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsAdvancedPolicyScopeAdvancedPolicyScopeElement(item.AdvancedPolicyScopeElement) return []map[string]interface{}{ respItem, @@ -891,7 +891,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScope(item * } -func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScopeAdvancedPolicyScopeElement(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseAdvancedPolicyScopeAdvancedPolicyScopeElement) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsAdvancedPolicyScopeAdvancedPolicyScopeElement(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseAdvancedPolicyScopeAdvancedPolicyScopeElement) []map[string]interface{} { if items == nil { return nil } @@ -905,13 +905,13 @@ func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScopeAdvance respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion respItem["group_id"] = item.GroupID - respItem["ssid"] = flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScopeAdvancedPolicyScopeElementSSID(item.SSID) + respItem["ssid"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsAdvancedPolicyScopeAdvancedPolicyScopeElementSSID(item.SSID) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScopeAdvancedPolicyScopeElementSSID(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseAdvancedPolicyScopeAdvancedPolicyScopeElementSSID) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsAdvancedPolicyScopeAdvancedPolicyScopeElementSSID(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseAdvancedPolicyScopeAdvancedPolicyScopeElementSSID) []interface{} { if items == nil { return nil } @@ -923,7 +923,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsAdvancedPolicyScopeAdvance return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsContractList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseContractList) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsContractList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseContractList) []interface{} { if items == nil { return nil } @@ -935,7 +935,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsContractList(items *[]cata return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContract(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseExclusiveContract) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsExclusiveContract(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseExclusiveContract) []map[string]interface{} { if item == nil { return nil } @@ -946,7 +946,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContract(item *ca respItem["instance_created_on"] = item.InstanceCreatedOn respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion - respItem["clause"] = flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContractClause(item.Clause) + respItem["clause"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsExclusiveContractClause(item.Clause) return []map[string]interface{}{ respItem, @@ -954,7 +954,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContract(item *ca } -func flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContractClause(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseExclusiveContractClause) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsExclusiveContractClause(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseExclusiveContractClause) []map[string]interface{} { if items == nil { return nil } @@ -977,7 +977,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsExclusiveContractClause(it return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseIDentitySource) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseIDentitySource) []map[string]interface{} { if item == nil { return nil } @@ -997,7 +997,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsIDentitySource(item *catal } -func flattenApplicationPolicyGetApplicationPolicyItemsProducer(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseProducer) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsProducer(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseProducer) []map[string]interface{} { if item == nil { return nil } @@ -1008,7 +1008,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsProducer(item *catalystcen respItem["instance_created_on"] = item.InstanceCreatedOn respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion - respItem["scalable_group"] = flattenApplicationPolicyGetApplicationPolicyItemsProducerScalableGroup(item.ScalableGroup) + respItem["scalable_group"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsProducerScalableGroup(item.ScalableGroup) return []map[string]interface{}{ respItem, @@ -1016,7 +1016,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsProducer(item *catalystcen } -func flattenApplicationPolicyGetApplicationPolicyItemsProducerScalableGroup(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseProducerScalableGroup) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsProducerScalableGroup(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseProducerScalableGroup) []map[string]interface{} { if items == nil { return nil } @@ -1029,7 +1029,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsProducerScalableGroup(item return respItems } -func flattenApplicationPolicyGetApplicationPolicyItemsConsumer(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseConsumer) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsConsumer(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseConsumer) []map[string]interface{} { if item == nil { return nil } @@ -1040,7 +1040,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsConsumer(item *catalystcen respItem["instance_created_on"] = item.InstanceCreatedOn respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion - respItem["scalable_group"] = flattenApplicationPolicyGetApplicationPolicyItemsConsumerScalableGroup(item.ScalableGroup) + respItem["scalable_group"] = flattenApplicationPolicyGetApplicationPolicyV1ItemsConsumerScalableGroup(item.ScalableGroup) return []map[string]interface{}{ respItem, @@ -1048,7 +1048,7 @@ func flattenApplicationPolicyGetApplicationPolicyItemsConsumer(item *catalystcen } -func flattenApplicationPolicyGetApplicationPolicyItemsConsumerScalableGroup(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyResponseConsumerScalableGroup) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyV1ItemsConsumerScalableGroup(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyV1ResponseConsumerScalableGroup) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_app_policy_default.go b/catalystcenter/data_source_app_policy_default.go index 53c0b01..480ee08 100644 --- a/catalystcenter/data_source_app_policy_default.go +++ b/catalystcenter/data_source_app_policy_default.go @@ -526,26 +526,26 @@ func dataSourceAppPolicyDefaultRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationPolicyDefault") + log.Printf("[DEBUG] Selected method: GetApplicationPolicyDefaultV1") - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyDefault() + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyDefaultV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationPolicyDefault", err, - "Failure at GetApplicationPolicyDefault, unexpected response", "")) + "Failure when executing 2 GetApplicationPolicyDefaultV1", err, + "Failure at GetApplicationPolicyDefaultV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplicationPolicyDefaultItems(response1.Response) + vItems1 := flattenApplicationPolicyGetApplicationPolicyDefaultV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationPolicyDefault response", + "Failure when setting GetApplicationPolicyDefaultV1 response", err)) return diags } @@ -557,7 +557,7 @@ func dataSourceAppPolicyDefaultRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenApplicationPolicyGetApplicationPolicyDefaultItems(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponse) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1Response) []map[string]interface{} { if items == nil { return nil } @@ -580,10 +580,10 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItems(items *[]catalystc respItem["provisioning_state"] = item.ProvisioningState respItem["qualifier"] = item.Qualifier respItem["resource_version"] = item.ResourceVersion - respItem["target_id_list"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsTargetIDList(item.TargetIDList) + respItem["target_id_list"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsTargetIDList(item.TargetIDList) respItem["type"] = item.Type - respItem["cfs_change_info"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsCfsChangeInfo(item.CfsChangeInfo) - respItem["custom_provisions"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsCustomProvisions(item.CustomProvisions) + respItem["cfs_change_info"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsCfsChangeInfo(item.CfsChangeInfo) + respItem["custom_provisions"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsCustomProvisions(item.CustomProvisions) respItem["delete_policy_status"] = item.DeletePolicyStatus respItem["internal"] = boolPtrToString(item.Internal) respItem["is_deleted"] = boolPtrToString(item.IsDeleted) @@ -593,16 +593,16 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItems(items *[]catalystc respItem["policy_status"] = item.PolicyStatus respItem["priority"] = item.Priority respItem["pushed"] = boolPtrToString(item.Pushed) - respItem["contract_list"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsContractList(item.ContractList) - respItem["exclusive_contract"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContract(item.ExclusiveContract) - respItem["identity_source"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsIDentitySource(item.IDentitySource) - respItem["producer"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsProducer(item.Producer) + respItem["contract_list"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsContractList(item.ContractList) + respItem["exclusive_contract"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsExclusiveContract(item.ExclusiveContract) + respItem["identity_source"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsIDentitySource(item.IDentitySource) + respItem["producer"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsProducer(item.Producer) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseTargetIDList) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseTargetIDList) []interface{} { if items == nil { return nil } @@ -614,7 +614,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsTargetIDList(items return respItems } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseCfsChangeInfo) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseCfsChangeInfo) []interface{} { if items == nil { return nil } @@ -626,7 +626,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsCfsChangeInfo(items return respItems } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseCustomProvisions) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseCustomProvisions) []interface{} { if items == nil { return nil } @@ -638,7 +638,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsCustomProvisions(it return respItems } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsContractList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseContractList) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsContractList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseContractList) []interface{} { if items == nil { return nil } @@ -650,7 +650,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsContractList(items return respItems } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContract(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseExclusiveContract) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsExclusiveContract(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseExclusiveContract) []map[string]interface{} { if item == nil { return nil } @@ -661,7 +661,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContract(i respItem["instance_created_on"] = item.InstanceCreatedOn respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion - respItem["clause"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContractClause(item.Clause) + respItem["clause"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsExclusiveContractClause(item.Clause) return []map[string]interface{}{ respItem, @@ -669,7 +669,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContract(i } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContractClause(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseExclusiveContractClause) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsExclusiveContractClause(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseExclusiveContractClause) []map[string]interface{} { if items == nil { return nil } @@ -690,7 +690,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsExclusiveContractCl return respItems } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseIDentitySource) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseIDentitySource) []map[string]interface{} { if item == nil { return nil } @@ -710,7 +710,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsIDentitySource(item } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsProducer(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseProducer) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsProducer(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseProducer) []map[string]interface{} { if item == nil { return nil } @@ -721,7 +721,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsProducer(item *cata respItem["instance_created_on"] = item.InstanceCreatedOn respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion - respItem["scalable_group"] = flattenApplicationPolicyGetApplicationPolicyDefaultItemsProducerScalableGroup(item.ScalableGroup) + respItem["scalable_group"] = flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsProducerScalableGroup(item.ScalableGroup) return []map[string]interface{}{ respItem, @@ -729,7 +729,7 @@ func flattenApplicationPolicyGetApplicationPolicyDefaultItemsProducer(item *cata } -func flattenApplicationPolicyGetApplicationPolicyDefaultItemsProducerScalableGroup(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultResponseProducerScalableGroup) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyDefaultV1ItemsProducerScalableGroup(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyDefaultV1ResponseProducerScalableGroup) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_app_policy_queuing_profile.go b/catalystcenter/data_source_app_policy_queuing_profile.go index 7722bff..75716e6 100644 --- a/catalystcenter/data_source_app_policy_queuing_profile.go +++ b/catalystcenter/data_source_app_policy_queuing_profile.go @@ -516,31 +516,31 @@ func dataSourceAppPolicyQueuingProfileRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationPolicyQueuingProfile") - queryParams1 := catalystcentersdkgo.GetApplicationPolicyQueuingProfileQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationPolicyQueuingProfileV1") + queryParams1 := catalystcentersdkgo.GetApplicationPolicyQueuingProfileV1QueryParams{} if okName { queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyQueuingProfile(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyQueuingProfileV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationPolicyQueuingProfile", err, - "Failure at GetApplicationPolicyQueuingProfile, unexpected response", "")) + "Failure when executing 2 GetApplicationPolicyQueuingProfileV1", err, + "Failure at GetApplicationPolicyQueuingProfileV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplicationPolicyQueuingProfileItems(response1.Response) + vItems1 := flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationPolicyQueuingProfile response", + "Failure when setting GetApplicationPolicyQueuingProfileV1 response", err)) return diags } @@ -552,7 +552,7 @@ func dataSourceAppPolicyQueuingProfileRead(ctx context.Context, d *schema.Resour return diags } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItems(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponse) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1Response) []map[string]interface{} { if items == nil { return nil } @@ -576,23 +576,23 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItems(items *[]ca respItem["provisioning_state"] = item.ProvisioningState respItem["qualifier"] = item.Qualifier respItem["resource_version"] = item.ResourceVersion - respItem["target_id_list"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsTargetIDList(item.TargetIDList) + respItem["target_id_list"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsTargetIDList(item.TargetIDList) respItem["type"] = item.Type - respItem["cfs_change_info"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsCfsChangeInfo(item.CfsChangeInfo) - respItem["custom_provisions"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsCustomProvisions(item.CustomProvisions) + respItem["cfs_change_info"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsCfsChangeInfo(item.CfsChangeInfo) + respItem["custom_provisions"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsCustomProvisions(item.CustomProvisions) respItem["gen_id"] = item.GenID respItem["internal"] = boolPtrToString(item.Internal) respItem["is_deleted"] = boolPtrToString(item.IsDeleted) respItem["ise_reserved"] = boolPtrToString(item.IseReserved) respItem["pushed"] = boolPtrToString(item.Pushed) - respItem["clause"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClause(item.Clause) - respItem["contract_classifier"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsContractClassifier(item.ContractClassifier) + respItem["clause"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClause(item.Clause) + respItem["contract_classifier"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsContractClassifier(item.ContractClassifier) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseTargetIDList) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseTargetIDList) []interface{} { if items == nil { return nil } @@ -604,7 +604,7 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsTargetIDList return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseCfsChangeInfo) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseCfsChangeInfo) []interface{} { if items == nil { return nil } @@ -616,7 +616,7 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsCfsChangeInf return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseCustomProvisions) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseCustomProvisions) []interface{} { if items == nil { return nil } @@ -628,7 +628,7 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsCustomProvis return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClause(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseClause) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClause(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseClause) []map[string]interface{} { if items == nil { return nil } @@ -644,14 +644,14 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClause(items respItem["priority"] = item.Priority respItem["type"] = item.Type respItem["is_common_between_all_interface_speeds"] = boolPtrToString(item.IsCommonBetweenAllInterfaceSpeeds) - respItem["interface_speed_bandwidth_clauses"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseInterfaceSpeedBandwidthClauses(item.InterfaceSpeedBandwidthClauses) - respItem["tc_dscp_settings"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseTcDscpSettings(item.TcDscpSettings) + respItem["interface_speed_bandwidth_clauses"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClauseInterfaceSpeedBandwidthClauses(item.InterfaceSpeedBandwidthClauses) + respItem["tc_dscp_settings"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClauseTcDscpSettings(item.TcDscpSettings) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseInterfaceSpeedBandwidthClauses(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseClauseInterfaceSpeedBandwidthClauses) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClauseInterfaceSpeedBandwidthClauses(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseClauseInterfaceSpeedBandwidthClauses) []map[string]interface{} { if items == nil { return nil } @@ -665,13 +665,13 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseInterf respItem["instance_updated_on"] = item.InstanceUpdatedOn respItem["instance_version"] = item.InstanceVersion respItem["interface_speed"] = item.InterfaceSpeed - respItem["tc_bandwidth_settings"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(item.TcBandwidthSettings) + respItem["tc_bandwidth_settings"] = flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(item.TcBandwidthSettings) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings) []map[string]interface{} { if items == nil { return nil } @@ -691,7 +691,7 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseInterf return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseTcDscpSettings(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseClauseTcDscpSettings) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsClauseTcDscpSettings(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseClauseTcDscpSettings) []map[string]interface{} { if items == nil { return nil } @@ -711,7 +711,7 @@ func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsClauseTcDscp return respItems } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileItemsContractClassifier(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponseContractClassifier) []interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1ItemsContractClassifier(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1ResponseContractClassifier) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_app_policy_queuing_profile_count.go b/catalystcenter/data_source_app_policy_queuing_profile_count.go index a9f426e..5c460fe 100644 --- a/catalystcenter/data_source_app_policy_queuing_profile_count.go +++ b/catalystcenter/data_source_app_policy_queuing_profile_count.go @@ -54,26 +54,26 @@ func dataSourceAppPolicyQueuingProfileCountRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationPolicyQueuingProfileCount") + log.Printf("[DEBUG] Selected method: GetApplicationPolicyQueuingProfileCountV1") - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyQueuingProfileCount() + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationPolicyQueuingProfileCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationPolicyQueuingProfileCount", err, - "Failure at GetApplicationPolicyQueuingProfileCount, unexpected response", "")) + "Failure when executing 2 GetApplicationPolicyQueuingProfileCountV1", err, + "Failure at GetApplicationPolicyQueuingProfileCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenApplicationPolicyGetApplicationPolicyQueuingProfileCountItem(response1) + vItem1 := flattenApplicationPolicyGetApplicationPolicyQueuingProfileCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationPolicyQueuingProfileCount response", + "Failure when setting GetApplicationPolicyQueuingProfileCountV1 response", err)) return diags } @@ -85,7 +85,7 @@ func dataSourceAppPolicyQueuingProfileCountRead(ctx context.Context, d *schema.R return diags } -func flattenApplicationPolicyGetApplicationPolicyQueuingProfileCountItem(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileCount) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationPolicyQueuingProfileCountV1Item(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_application_policy_application_set.go b/catalystcenter/data_source_application_set_v2.go similarity index 82% rename from catalystcenter/data_source_application_policy_application_set.go rename to catalystcenter/data_source_application_set_v2.go index a28ae8d..333e14b 100644 --- a/catalystcenter/data_source_application_policy_application_set.go +++ b/catalystcenter/data_source_application_set_v2.go @@ -11,26 +11,26 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceApplicationPolicyApplicationSet() *schema.Resource { +func dataSourceApplicationSetV2() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Application Policy. - Get application set/s by offset/limit or by name `, - ReadContext: dataSourceApplicationPolicyApplicationSetRead, + ReadContext: dataSourceApplicationSetV2Read, Schema: map[string]*schema.Schema{ "attributes": &schema.Schema{ Description: `attributes query parameter. Attributes to retrieve, valid value applicationSet `, Type: schema.TypeString, - Optional: true, + Required: true, }, "limit": &schema.Schema{ Description: `limit query parameter. The limit which is the maximum number of items to include in a single page of results, max value 500 `, Type: schema.TypeFloat, - Optional: true, + Required: true, }, "name": &schema.Schema{ Description: `name query parameter. Application set name @@ -42,7 +42,7 @@ func dataSourceApplicationPolicyApplicationSet() *schema.Resource { Description: `offset query parameter. The starting point or index from where the paginated results should begin. `, Type: schema.TypeFloat, - Optional: true, + Required: true, }, "items": &schema.Schema{ @@ -150,7 +150,7 @@ func dataSourceApplicationPolicyApplicationSet() *schema.Resource { } } -func dataSourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceApplicationSetV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -161,8 +161,8 @@ func dataSourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationSets2") - queryParams1 := catalystcentersdkgo.GetApplicationSets2QueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationSetsV2") + queryParams1 := catalystcentersdkgo.GetApplicationSetsV2QueryParams{} queryParams1.Attributes = vAttributes.(string) @@ -173,24 +173,24 @@ func dataSourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schem queryParams1.Limit = vLimit.(float64) - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSets2(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSetsV2(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationSets2", err, - "Failure at GetApplicationSets2, unexpected response", "")) + "Failure when executing 2 GetApplicationSetsV2", err, + "Failure at GetApplicationSetsV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplicationSets2Items(response1.Response) + vItems1 := flattenApplicationPolicyGetApplicationSetsV2Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationSets2 response", + "Failure when setting GetApplicationSetsV2 response", err)) return diags } @@ -202,7 +202,7 @@ func dataSourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schem return diags } -func flattenApplicationPolicyGetApplicationSets2Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2Response) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationSetsV2Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2Response) []map[string]interface{} { if items == nil { return nil } @@ -214,7 +214,7 @@ func flattenApplicationPolicyGetApplicationSets2Items(items *[]catalystcentersdk respItem["display_name"] = item.DisplayName respItem["instance_version"] = item.InstanceVersion respItem["default_business_relevance"] = item.DefaultBusinessRelevance - respItem["identity_source"] = flattenApplicationPolicyGetApplicationSets2ItemsIDentitySource(item.IDentitySource) + respItem["identity_source"] = flattenApplicationPolicyGetApplicationSetsV2ItemsIDentitySource(item.IDentitySource) respItem["name"] = item.Name respItem["namespace"] = item.Namespace respItem["scalable_group_external_handle"] = item.ScalableGroupExternalHandle @@ -225,7 +225,7 @@ func flattenApplicationPolicyGetApplicationSets2Items(items *[]catalystcentersdk return respItems } -func flattenApplicationPolicyGetApplicationSets2ItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2ResponseIDentitySource) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationSetsV2ItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2ResponseIDentitySource) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_application_sets.go b/catalystcenter/data_source_application_sets.go index af7b0ce..faac829 100644 --- a/catalystcenter/data_source_application_sets.go +++ b/catalystcenter/data_source_application_sets.go @@ -91,8 +91,8 @@ func dataSourceApplicationSetsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationSets") - queryParams1 := catalystcentersdkgo.GetApplicationSetsQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationSetsV1") + queryParams1 := catalystcentersdkgo.GetApplicationSetsV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -104,24 +104,24 @@ func dataSourceApplicationSetsRead(ctx context.Context, d *schema.ResourceData, queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSets(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSetsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationSets", err, - "Failure at GetApplicationSets, unexpected response", "")) + "Failure when executing 2 GetApplicationSetsV1", err, + "Failure at GetApplicationSetsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplicationSetsItems(response1.Response) + vItems1 := flattenApplicationPolicyGetApplicationSetsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationSets response", + "Failure when setting GetApplicationSetsV1 response", err)) return diags } @@ -133,7 +133,7 @@ func dataSourceApplicationSetsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenApplicationPolicyGetApplicationSetsItems(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationSetsV1Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -141,14 +141,14 @@ func flattenApplicationPolicyGetApplicationSetsItems(items *[]catalystcentersdkg for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["identity_source"] = flattenApplicationPolicyGetApplicationSetsItemsIDentitySource(item.IDentitySource) + respItem["identity_source"] = flattenApplicationPolicyGetApplicationSetsV1ItemsIDentitySource(item.IDentitySource) respItem["name"] = item.Name respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplicationSetsItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponseIDentitySource) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationSetsV1ItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1ResponseIDentitySource) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_application_sets_count.go b/catalystcenter/data_source_application_sets_count.go index 7dad03b..f9cc895 100644 --- a/catalystcenter/data_source_application_sets_count.go +++ b/catalystcenter/data_source_application_sets_count.go @@ -52,26 +52,26 @@ func dataSourceApplicationSetsCountRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationSetsCount") + log.Printf("[DEBUG] Selected method: GetApplicationSetsCountV1") - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSetsCount() + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSetsCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationSetsCount", err, - "Failure at GetApplicationSetsCount, unexpected response", "")) + "Failure when executing 2 GetApplicationSetsCountV1", err, + "Failure at GetApplicationSetsCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenApplicationPolicyGetApplicationSetsCountItem(response1) + vItem1 := flattenApplicationPolicyGetApplicationSetsCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationSetsCount response", + "Failure when setting GetApplicationSetsCountV1 response", err)) return diags } @@ -83,7 +83,7 @@ func dataSourceApplicationSetsCountRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenApplicationPolicyGetApplicationSetsCountItem(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsCount) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationSetsCountV1Item(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_application_policy_application_set_count.go b/catalystcenter/data_source_application_sets_count_v2.go similarity index 70% rename from catalystcenter/data_source_application_policy_application_set_count.go rename to catalystcenter/data_source_application_sets_count_v2.go index b273023..284247b 100644 --- a/catalystcenter/data_source_application_policy_application_set_count.go +++ b/catalystcenter/data_source_application_sets_count_v2.go @@ -3,22 +3,22 @@ package catalystcenter import ( "context" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + "log" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceApplicationPolicyApplicationSetCount() *schema.Resource { +func dataSourceApplicationSetsCountV2() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Application Policy. - Get the number of all existing application sets `, - ReadContext: dataSourceApplicationPolicyApplicationSetCountRead, + ReadContext: dataSourceApplicationSetsCountV2Read, Schema: map[string]*schema.Schema{ "scalable_group_type": &schema.Schema{ Description: `scalableGroupType query parameter. Scalable group type to retrieve, valid value APPLICATION_GROUP @@ -53,7 +53,7 @@ func dataSourceApplicationPolicyApplicationSetCount() *schema.Resource { } } -func dataSourceApplicationPolicyApplicationSetCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceApplicationSetsCountV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -61,29 +61,31 @@ func dataSourceApplicationPolicyApplicationSetCountRead(ctx context.Context, d * selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationSetCount") - queryParams1 := catalystcentersdkgo.GetApplicationSetCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationSetCountV2") + queryParams1 := catalystcentersdkgo.GetApplicationSetCountV2QueryParams{} queryParams1.ScalableGroupType = vScalableGroupType.(string) - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSetCount(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationSetCountV2(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationSetCount", err, - "Failure at GetApplicationSetCount, unexpected response", "")) + "Failure when executing 2 GetApplicationSetCountV2", err, + "Failure at GetApplicationSetCountV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenApplicationPolicyGetApplicationSetCountItem(response1) + vItem1 := flattenApplicationPolicyGetApplicationSetCountV2Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationSetCount response", + "Failure when setting GetApplicationSetCountV2 response", err)) return diags } @@ -95,7 +97,7 @@ func dataSourceApplicationPolicyApplicationSetCountRead(ctx context.Context, d * return diags } -func flattenApplicationPolicyGetApplicationSetCountItem(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetCount) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationSetCountV2Item(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetCountV2) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_applications.go b/catalystcenter/data_source_applications.go index d29ac9d..97ea11f 100644 --- a/catalystcenter/data_source_applications.go +++ b/catalystcenter/data_source_applications.go @@ -66,51 +66,6 @@ func dataSourceApplications() *schema.Resource { Computed: true, }, - "indicative_network_identity": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "display_name": &schema.Schema{ - Description: `displayName`, - Type: schema.TypeString, - Computed: true, - }, - - "id": &schema.Schema{ - Description: `id`, - Type: schema.TypeString, - Computed: true, - }, - - "lower_port": &schema.Schema{ - Description: `lowerPort`, - Type: schema.TypeInt, - Computed: true, - }, - - "ports": &schema.Schema{ - Description: `ports`, - Type: schema.TypeString, - Computed: true, - }, - - "protocol": &schema.Schema{ - Description: `protocol`, - Type: schema.TypeString, - Computed: true, - }, - - "upper_port": &schema.Schema{ - Description: `upperPort`, - Type: schema.TypeInt, - Computed: true, - }, - }, - }, - }, - "name": &schema.Schema{ Description: `Name`, Type: schema.TypeString, @@ -289,8 +244,8 @@ func dataSourceApplicationsRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplications2") - queryParams1 := catalystcentersdkgo.GetApplications2QueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationsV1") + queryParams1 := catalystcentersdkgo.GetApplicationsV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -302,24 +257,24 @@ func dataSourceApplicationsRead(ctx context.Context, d *schema.ResourceData, m i queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.ApplicationPolicy.GetApplications2(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplications2", err, - "Failure at GetApplications2, unexpected response", "")) + "Failure when executing 2 GetApplicationsV1", err, + "Failure at GetApplicationsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplications2Items(response1) + vItems1 := flattenApplicationPolicyGetApplicationsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplications2 response", + "Failure when setting GetApplicationsV1 response", err)) return diags } @@ -331,7 +286,7 @@ func dataSourceApplicationsRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenApplicationPolicyGetApplications2Items(items *catalystcentersdkgo.ResponseApplicationPolicyGetApplications2) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV1Items(items *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV1) []map[string]interface{} { if items == nil { return nil } @@ -340,16 +295,15 @@ func flattenApplicationPolicyGetApplications2Items(items *catalystcentersdkgo.Re respItem := make(map[string]interface{}) respItem["id"] = item.ID respItem["name"] = item.Name - respItem["network_applications"] = flattenApplicationPolicyGetApplications2ItemsNetworkApplications(item.NetworkApplications) - - respItem["network_identity"] = flattenApplicationPolicyGetApplications2ItemsNetworkIDentity(item.NetworkIDentity) - respItem["application_set"] = flattenApplicationPolicyGetApplications2ItemsApplicationSet(item.ApplicationSet) + respItem["network_applications"] = flattenApplicationPolicyGetApplicationsV1ItemsNetworkApplications(item.NetworkApplications) + respItem["network_identity"] = flattenApplicationPolicyGetApplicationsV1ItemsNetworkIDentity(item.NetworkIDentity) + respItem["application_set"] = flattenApplicationPolicyGetApplicationsV1ItemsApplicationSet(item.ApplicationSet) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetApplications2ItemsNetworkApplications(items *[]catalystcentersdkgo.ResponseItemApplicationPolicyGetApplications2NetworkApplications) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV1ItemsNetworkApplications(items *[]catalystcentersdkgo.ResponseItemApplicationPolicyGetApplicationsV1NetworkApplications) []map[string]interface{} { if items == nil { return nil } @@ -378,7 +332,7 @@ func flattenApplicationPolicyGetApplications2ItemsNetworkApplications(items *[]c return respItems } -func flattenApplicationPolicyGetApplications2ItemsNetworkIDentity(items *[]catalystcentersdkgo.ResponseItemApplicationPolicyGetApplications2NetworkIDentity) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV1ItemsNetworkIDentity(items *[]catalystcentersdkgo.ResponseItemApplicationPolicyGetApplicationsV1NetworkIDentity) []map[string]interface{} { if items == nil { return nil } @@ -396,7 +350,7 @@ func flattenApplicationPolicyGetApplications2ItemsNetworkIDentity(items *[]catal return respItems } -func flattenApplicationPolicyGetApplications2ItemsApplicationSet(item *catalystcentersdkgo.ResponseItemApplicationPolicyGetApplications2ApplicationSet) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV1ItemsApplicationSet(item *catalystcentersdkgo.ResponseItemApplicationPolicyGetApplicationsV1ApplicationSet) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_applications_count.go b/catalystcenter/data_source_applications_count.go index 7813c39..868136d 100644 --- a/catalystcenter/data_source_applications_count.go +++ b/catalystcenter/data_source_applications_count.go @@ -52,26 +52,26 @@ func dataSourceApplicationsCountRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationsCount") + log.Printf("[DEBUG] Selected method: GetApplicationsCountV1") - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationsCount() + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationsCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationsCount", err, - "Failure at GetApplicationsCount, unexpected response", "")) + "Failure when executing 2 GetApplicationsCountV1", err, + "Failure at GetApplicationsCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenApplicationPolicyGetApplicationsCountItem(response1) + vItem1 := flattenApplicationPolicyGetApplicationsCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationsCount response", + "Failure when setting GetApplicationsCountV1 response", err)) return diags } @@ -83,7 +83,7 @@ func dataSourceApplicationsCountRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenApplicationPolicyGetApplicationsCountItem(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsCount) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsCountV1Item(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_applications_count_v2.go b/catalystcenter/data_source_applications_count_v2.go index 01037ea..d5960a7 100644 --- a/catalystcenter/data_source_applications_count_v2.go +++ b/catalystcenter/data_source_applications_count_v2.go @@ -61,29 +61,29 @@ func dataSourceApplicationsCountV2Read(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationCount") - queryParams1 := catalystcentersdkgo.GetApplicationCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationCountV2") + queryParams1 := catalystcentersdkgo.GetApplicationCountV2QueryParams{} queryParams1.ScalableGroupType = vScalableGroupType.(string) - response1, restyResp1, err := client.ApplicationPolicy.GetApplicationCount(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationCountV2(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplicationCount", err, - "Failure at GetApplicationCount, unexpected response", "")) + "Failure when executing 2 GetApplicationCountV2", err, + "Failure at GetApplicationCountV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenApplicationPolicyGetApplicationCountItem(response1) + vItem1 := flattenApplicationPolicyGetApplicationCountV2Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationCount response", + "Failure when setting GetApplicationCountV2 response", err)) return diags } @@ -95,7 +95,7 @@ func dataSourceApplicationsCountV2Read(ctx context.Context, d *schema.ResourceDa return diags } -func flattenApplicationPolicyGetApplicationCountItem(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationCount) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationCountV2Item(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationCountV2) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_applications_health.go b/catalystcenter/data_source_applications_health.go index eeda3b9..512e1c0 100644 --- a/catalystcenter/data_source_applications_health.go +++ b/catalystcenter/data_source_applications_health.go @@ -321,8 +321,8 @@ func dataSourceApplicationsHealthRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: Applications") - queryParams1 := catalystcentersdkgo.ApplicationsQueryParams{} + log.Printf("[DEBUG] Selected method: ApplicationsV1") + queryParams1 := catalystcentersdkgo.ApplicationsV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -352,24 +352,24 @@ func dataSourceApplicationsHealthRead(ctx context.Context, d *schema.ResourceDat queryParams1.ApplicationName = vApplicationName.(string) } - response1, restyResp1, err := client.Applications.Applications(&queryParams1) + response1, restyResp1, err := client.Applications.ApplicationsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 Applications", err, - "Failure at Applications, unexpected response", "")) + "Failure when executing 2 ApplicationsV1", err, + "Failure at ApplicationsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationsApplicationsItems(response1.Response) + vItems1 := flattenApplicationsApplicationsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting Applications response", + "Failure when setting ApplicationsV1 response", err)) return diags } @@ -381,7 +381,7 @@ func dataSourceApplicationsHealthRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenApplicationsApplicationsItems(items *[]catalystcentersdkgo.ResponseApplicationsApplicationsResponse) []map[string]interface{} { +func flattenApplicationsApplicationsV1Items(items *[]catalystcentersdkgo.ResponseApplicationsApplicationsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -394,12 +394,12 @@ func flattenApplicationsApplicationsItems(items *[]catalystcentersdkgo.ResponseA respItem["traffic_class"] = item.TrafficClass respItem["usage_bytes"] = item.UsageBytes respItem["average_throughput"] = item.AverageThroughput - respItem["packet_loss_percent"] = flattenApplicationsApplicationsItemsPacketLossPercent(item.PacketLossPercent) - respItem["network_latency"] = flattenApplicationsApplicationsItemsNetworkLatency(item.NetworkLatency) - respItem["jitter"] = flattenApplicationsApplicationsItemsJitter(item.Jitter) - respItem["application_server_latency"] = flattenApplicationsApplicationsItemsApplicationServerLatency(item.ApplicationServerLatency) - respItem["client_network_latency"] = flattenApplicationsApplicationsItemsClientNetworkLatency(item.ClientNetworkLatency) - respItem["server_network_latency"] = flattenApplicationsApplicationsItemsServerNetworkLatency(item.ServerNetworkLatency) + respItem["packet_loss_percent"] = flattenApplicationsApplicationsV1ItemsPacketLossPercent(item.PacketLossPercent) + respItem["network_latency"] = flattenApplicationsApplicationsV1ItemsNetworkLatency(item.NetworkLatency) + respItem["jitter"] = flattenApplicationsApplicationsV1ItemsJitter(item.Jitter) + respItem["application_server_latency"] = flattenApplicationsApplicationsV1ItemsApplicationServerLatency(item.ApplicationServerLatency) + respItem["client_network_latency"] = flattenApplicationsApplicationsV1ItemsClientNetworkLatency(item.ClientNetworkLatency) + respItem["server_network_latency"] = flattenApplicationsApplicationsV1ItemsServerNetworkLatency(item.ServerNetworkLatency) respItem["exporter_ip_address"] = item.ExporterIPAddress respItem["exporter_name"] = item.ExporterName respItem["exporter_uui_d"] = item.ExporterUUID @@ -424,7 +424,7 @@ func flattenApplicationsApplicationsItems(items *[]catalystcentersdkgo.ResponseA return respItems } -func flattenApplicationsApplicationsItemsPacketLossPercent(item *catalystcentersdkgo.ResponseApplicationsApplicationsResponsePacketLossPercent) interface{} { +func flattenApplicationsApplicationsV1ItemsPacketLossPercent(item *catalystcentersdkgo.ResponseApplicationsApplicationsV1ResponsePacketLossPercent) interface{} { if item == nil { return nil } @@ -434,7 +434,7 @@ func flattenApplicationsApplicationsItemsPacketLossPercent(item *catalystcenters } -func flattenApplicationsApplicationsItemsNetworkLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsResponseNetworkLatency) interface{} { +func flattenApplicationsApplicationsV1ItemsNetworkLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsV1ResponseNetworkLatency) interface{} { if item == nil { return nil } @@ -444,7 +444,7 @@ func flattenApplicationsApplicationsItemsNetworkLatency(item *catalystcentersdkg } -func flattenApplicationsApplicationsItemsJitter(item *catalystcentersdkgo.ResponseApplicationsApplicationsResponseJitter) interface{} { +func flattenApplicationsApplicationsV1ItemsJitter(item *catalystcentersdkgo.ResponseApplicationsApplicationsV1ResponseJitter) interface{} { if item == nil { return nil } @@ -454,7 +454,7 @@ func flattenApplicationsApplicationsItemsJitter(item *catalystcentersdkgo.Respon } -func flattenApplicationsApplicationsItemsApplicationServerLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsResponseApplicationServerLatency) interface{} { +func flattenApplicationsApplicationsV1ItemsApplicationServerLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsV1ResponseApplicationServerLatency) interface{} { if item == nil { return nil } @@ -464,7 +464,7 @@ func flattenApplicationsApplicationsItemsApplicationServerLatency(item *catalyst } -func flattenApplicationsApplicationsItemsClientNetworkLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsResponseClientNetworkLatency) interface{} { +func flattenApplicationsApplicationsV1ItemsClientNetworkLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsV1ResponseClientNetworkLatency) interface{} { if item == nil { return nil } @@ -474,7 +474,7 @@ func flattenApplicationsApplicationsItemsClientNetworkLatency(item *catalystcent } -func flattenApplicationsApplicationsItemsServerNetworkLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsResponseServerNetworkLatency) interface{} { +func flattenApplicationsApplicationsV1ItemsServerNetworkLatency(item *catalystcentersdkgo.ResponseApplicationsApplicationsV1ResponseServerNetworkLatency) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_applications_v2.go b/catalystcenter/data_source_applications_v2.go index b711d79..659b3cb 100644 --- a/catalystcenter/data_source_applications_v2.go +++ b/catalystcenter/data_source_applications_v2.go @@ -434,8 +434,8 @@ func dataSourceApplicationsV2Read(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplications") - queryParams1 := catalystcentersdkgo.GetApplicationsQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationsV2") + queryParams1 := catalystcentersdkgo.GetApplicationsV2QueryParams{} queryParams1.Attributes = vAttributes.(string) @@ -446,24 +446,24 @@ func dataSourceApplicationsV2Read(ctx context.Context, d *schema.ResourceData, m queryParams1.Limit = vLimit.(float64) - response1, restyResp1, err := client.ApplicationPolicy.GetApplications(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetApplicationsV2(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetApplications", err, - "Failure at GetApplications, unexpected response", "")) + "Failure when executing 2 GetApplicationsV2", err, + "Failure at GetApplicationsV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetApplicationsItems(response1.Response) + vItems1 := flattenApplicationPolicyGetApplicationsV2Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplications response", + "Failure when setting GetApplicationsV2 response", err)) return diags } @@ -475,7 +475,7 @@ func dataSourceApplicationsV2Read(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenApplicationPolicyGetApplicationsItems(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponse) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV2Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2Response) []map[string]interface{} { if items == nil { return nil } @@ -486,13 +486,13 @@ func flattenApplicationPolicyGetApplicationsItems(items *[]catalystcentersdkgo.R respItem["instance_id"] = item.InstanceID respItem["display_name"] = item.DisplayName respItem["instance_version"] = item.InstanceVersion - respItem["identity_source"] = flattenApplicationPolicyGetApplicationsItemsIDentitySource(item.IDentitySource) - respItem["indicative_network_identity"] = flattenApplicationPolicyGetApplicationsItemsIndicativeNetworkIDentity(item.IndicativeNetworkIDentity) + respItem["identity_source"] = flattenApplicationPolicyGetApplicationsV2ItemsIDentitySource(item.IDentitySource) + respItem["indicative_network_identity"] = flattenApplicationPolicyGetApplicationsV2ItemsIndicativeNetworkIDentity(item.IndicativeNetworkIDentity) respItem["name"] = item.Name respItem["namespace"] = item.Namespace - respItem["network_applications"] = flattenApplicationPolicyGetApplicationsItemsNetworkApplications(item.NetworkApplications) - respItem["network_identity"] = flattenApplicationPolicyGetApplicationsItemsNetworkIDentity(item.NetworkIDentity) - respItem["parent_scalable_group"] = flattenApplicationPolicyGetApplicationsItemsParentScalableGroup(item.ParentScalableGroup) + respItem["network_applications"] = flattenApplicationPolicyGetApplicationsV2ItemsNetworkApplications(item.NetworkApplications) + respItem["network_identity"] = flattenApplicationPolicyGetApplicationsV2ItemsNetworkIDentity(item.NetworkIDentity) + respItem["parent_scalable_group"] = flattenApplicationPolicyGetApplicationsV2ItemsParentScalableGroup(item.ParentScalableGroup) respItem["qualifier"] = item.Qualifier respItem["scalable_group_external_handle"] = item.ScalableGroupExternalHandle respItem["scalable_group_type"] = item.ScalableGroupType @@ -502,7 +502,7 @@ func flattenApplicationPolicyGetApplicationsItems(items *[]catalystcentersdkgo.R return respItems } -func flattenApplicationPolicyGetApplicationsItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponseIDentitySource) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV2ItemsIDentitySource(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2ResponseIDentitySource) []map[string]interface{} { if item == nil { return nil } @@ -516,7 +516,7 @@ func flattenApplicationPolicyGetApplicationsItemsIDentitySource(item *catalystce } -func flattenApplicationPolicyGetApplicationsItemsIndicativeNetworkIDentity(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponseIndicativeNetworkIDentity) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV2ItemsIndicativeNetworkIDentity(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2ResponseIndicativeNetworkIDentity) []map[string]interface{} { if items == nil { return nil } @@ -534,7 +534,7 @@ func flattenApplicationPolicyGetApplicationsItemsIndicativeNetworkIDentity(items return respItems } -func flattenApplicationPolicyGetApplicationsItemsNetworkApplications(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponseNetworkApplications) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV2ItemsNetworkApplications(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2ResponseNetworkApplications) []map[string]interface{} { if items == nil { return nil } @@ -563,7 +563,7 @@ func flattenApplicationPolicyGetApplicationsItemsNetworkApplications(items *[]ca return respItems } -func flattenApplicationPolicyGetApplicationsItemsNetworkIDentity(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponseNetworkIDentity) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV2ItemsNetworkIDentity(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2ResponseNetworkIDentity) []map[string]interface{} { if items == nil { return nil } @@ -573,7 +573,7 @@ func flattenApplicationPolicyGetApplicationsItemsNetworkIDentity(items *[]cataly respItem["id"] = item.ID respItem["display_name"] = item.DisplayName respItem["ipv4_subnet"] = item.IPv4Subnet - respItem["ipv6_subnet"] = flattenApplicationPolicyGetApplicationsItemsNetworkIDentityIPv6Subnet(item.IPv6Subnet) + respItem["ipv6_subnet"] = flattenApplicationPolicyGetApplicationsV2ItemsNetworkIDentityIPv6Subnet(item.IPv6Subnet) respItem["lower_port"] = item.LowerPort respItem["ports"] = item.Ports respItem["protocol"] = item.Protocol @@ -583,7 +583,7 @@ func flattenApplicationPolicyGetApplicationsItemsNetworkIDentity(items *[]cataly return respItems } -func flattenApplicationPolicyGetApplicationsItemsNetworkIDentityIPv6Subnet(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponseNetworkIDentityIPv6Subnet) []interface{} { +func flattenApplicationPolicyGetApplicationsV2ItemsNetworkIDentityIPv6Subnet(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2ResponseNetworkIDentityIPv6Subnet) []interface{} { if items == nil { return nil } @@ -595,7 +595,7 @@ func flattenApplicationPolicyGetApplicationsItemsNetworkIDentityIPv6Subnet(items return respItems } -func flattenApplicationPolicyGetApplicationsItemsParentScalableGroup(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponseParentScalableGroup) []map[string]interface{} { +func flattenApplicationPolicyGetApplicationsV2ItemsParentScalableGroup(item *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2ResponseParentScalableGroup) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_areas.go b/catalystcenter/data_source_areas.go index f602214..056efd1 100644 --- a/catalystcenter/data_source_areas.go +++ b/catalystcenter/data_source_areas.go @@ -82,27 +82,27 @@ func dataSourceAreasRead(ctx context.Context, d *schema.ResourceData, m interfac selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsAnArea") + log.Printf("[DEBUG] Selected method: GetsAnAreaV1") vvID := vID.(string) - response1, restyResp1, err := client.SiteDesign.GetsAnArea(vvID) + response1, restyResp1, err := client.SiteDesign.GetsAnAreaV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsAnArea", err, - "Failure at GetsAnArea, unexpected response", "")) + "Failure when executing 2 GetsAnAreaV1", err, + "Failure at GetsAnAreaV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetsAnAreaItem(response1.Response) + vItem1 := flattenSiteDesignGetsAnAreaV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsAnArea response", + "Failure when setting GetsAnAreaV1 response", err)) return diags } @@ -114,7 +114,7 @@ func dataSourceAreasRead(ctx context.Context, d *schema.ResourceData, m interfac return diags } -func flattenSiteDesignGetsAnAreaItem(item *catalystcentersdkgo.ResponseSiteDesignGetsAnAreaResponse) []map[string]interface{} { +func flattenSiteDesignGetsAnAreaV1Item(item *catalystcentersdkgo.ResponseSiteDesignGetsAnAreaV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_assurance_events.go b/catalystcenter/data_source_assurance_events.go index bd1ce64..2bd6f45 100644 --- a/catalystcenter/data_source_assurance_events.go +++ b/catalystcenter/data_source_assurance_events.go @@ -20,7 +20,7 @@ Support Documentation' section to understand which fields are supported. For det API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- api-specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml -- API to fetch the details of an assurance event using event 'id'. For detailed information about the usage of the API, +- API to fetch the details of an assurance event using event *id*. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml `, @@ -28,46 +28,46 @@ specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml ReadContext: dataSourceAssuranceEventsRead, Schema: map[string]*schema.Schema{ "ap_mac": &schema.Schema{ - Description: `apMac query parameter. MAC address of the access point. This parameter is applicable for 'Unified AP' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*50:0F*' or '50:0F*' or '*50:0F' + Description: `apMac query parameter. MAC address of the access point. This parameter is applicable for *Unified AP* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **50:0F** or *50:0F** or **50:0F* Examples: -'apMac=50:0F:80:0F:F7:E0' (single apMac requested) -'apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0' (multiple apMac requested) +*apMac=50:0F:80:0F:F7:E0* (single apMac requested) +*apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0* (multiple apMac requested) `, Type: schema.TypeString, Optional: true, }, "attribute": &schema.Schema{ - Description: `attribute query parameter. The list of attributes that needs to be included in the response. If this parameter is not provided, then basic attributes ('id', 'name', 'timestamp', 'details', 'messageType', 'siteHierarchyId', 'siteHierarchy', 'deviceFamily', 'networkDeviceId', 'networkDeviceName', 'managementIpAddress') would be part of the response. + Description: `attribute query parameter. The list of attributes that needs to be included in the response. If this parameter is not provided, then basic attributes (*id*, *name*, *timestamp*, *details*, *messageType*, *siteHierarchyId*, *siteHierarchy*, *deviceFamily*, *networkDeviceId*, *networkDeviceName*, *managementIpAddress*) would be part of the response. Examples: -'attribute=name' (single attribute requested) -'attribute=name&attribute=networkDeviceName' (multiple attribute requested) +*attribute=name* (single attribute requested) +*attribute=name&attribute=networkDeviceName* (multiple attribute requested) `, Type: schema.TypeString, Optional: true, }, "client_mac": &schema.Schema{ - Description: `clientMac query parameter. MAC address of the client. This parameter is applicable for 'Wired Client' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*66:2B*' or '66:2B*' or '*66:2B' + Description: `clientMac query parameter. MAC address of the client. This parameter is applicable for *Wired Client* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **66:2B** or *66:2B** or **66:2B* Examples: -'clientMac=66:2B:B8:D2:01:56' (single clientMac requested) -'clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89' (multiple clientMac requested) +*clientMac=66:2B:B8:D2:01:56* (single clientMac requested) +*clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89* (multiple clientMac requested) `, Type: schema.TypeString, Optional: true, }, "device_family": &schema.Schema{ - Description: `deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing 'Routers' along with 'Wireless Client' or 'Unified AP' is not supported. Examples: -'deviceFamily=Switches and Hubs' (single deviceFamily requested) -'deviceFamily=Switches and Hubs&deviceFamily=Routers' (multiple deviceFamily requested) + Description: `deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing *Routers* along with *Wireless Client* or *Unified AP* is not supported. Examples: +*deviceFamily=Switches and Hubs* (single deviceFamily requested) +*deviceFamily=Switches and Hubs&deviceFamily=Routers* (multiple deviceFamily requested) `, Type: schema.TypeString, Optional: true, }, "end_time": &schema.Schema{ Description: `endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'endTime' is not provided, API will default to current time. +If *endTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -87,25 +87,25 @@ If 'endTime' is not provided, API will default to current time. "message_type": &schema.Schema{ Description: `messageType query parameter. Message type for the event. Examples: -'messageType=Syslog' (single messageType requested) -'messageType=Trap&messageType=Syslog' (multiple messageType requested) +*messageType=Syslog* (single messageType requested) +*messageType=Trap&messageType=Syslog* (multiple messageType requested) `, Type: schema.TypeString, Optional: true, }, "network_device_id": &schema.Schema{ - Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceId with & separator) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceId with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_name": &schema.Schema{ - Description: `networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard ('*') character-based search. Ex: '*Branch*' or 'Branch*' or '*Branch' Examples: -'networkDeviceName=Branch-3-Gateway' (single networkDeviceName requested) -'networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch' (multiple networkDeviceName requested) + Description: `networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard (***) character-based search. Ex: **Branch** or *Branch** or **Branch* Examples: +*networkDeviceName=Branch-3-Gateway* (single networkDeviceName requested) +*networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch* (multiple networkDeviceName requested) `, Type: schema.TypeString, Optional: true, @@ -123,30 +123,30 @@ Examples: Optional: true, }, "severity": &schema.Schema{ - Description: `severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and 'Wired Client' events. + Description: `severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and *Wired Client* events. | Value | Severity | | ----| ----------| | 0 | Emergency | | 1 | Alert | | 2 | Critical | | 3 | Error | | 4 | Warning | | 5 | Notice | | 6 | Info | Examples: -'severity=0' (single severity requested) -'severity=0&severity=1' (multiple severity requested) +*severity=0* (single severity requested) +*severity=0&severity=1* (multiple severity requested) `, Type: schema.TypeFloat, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyId requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single siteId requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple siteId requested) +*?siteId=id1* (single siteId requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple siteId requested) `, Type: schema.TypeString, Optional: true, @@ -159,17 +159,17 @@ Examples: }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time minus 24 hours. +If *startTime* is not provided, API will default to current time minus 24 hours. `, Type: schema.TypeFloat, Optional: true, }, "view": &schema.Schema{ - Description: `view query parameter. The list of events views. Please refer to 'EventViews' for the supported list + Description: `view query parameter. The list of events views. Please refer to *EventViews* for the supported list Examples: -'view=network' (single view requested) -'view=network&view=ap' (multiple view requested) +*view=network* (single view requested) +*view=network&view=ap* (multiple view requested) `, Type: schema.TypeString, Optional: true, @@ -1421,6 +1421,7 @@ func dataSourceAssuranceEventsRead(ctx context.Context, d *schema.ResourceData, vOrder, okOrder := d.GetOk("order") vXCaLLERID, okXCaLLERID := d.GetOk("xca_lle_rid") vID, okID := d.GetOk("id") + method1 := []bool{okDeviceFamily, okStartTime, okEndTime, okMessageType, okSeverity, okSiteID, okSiteHierarchyID, okNetworkDeviceName, okNetworkDeviceID, okApMac, okClientMac, okAttribute, okView, okOffset, okLimit, okSortBy, okOrder, okXCaLLERID} log.Printf("[DEBUG] Selecting method. Method 1 %v", method1) method2 := []bool{okID, okAttribute, okView, okXCaLLERID} @@ -1428,10 +1429,10 @@ func dataSourceAssuranceEventsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: QueryAssuranceEvents") + log.Printf("[DEBUG] Selected method: QueryAssuranceEventsV1") - headerParams1 := catalystcentersdkgo.QueryAssuranceEventsHeaderParams{} - queryParams1 := catalystcentersdkgo.QueryAssuranceEventsQueryParams{} + headerParams1 := catalystcentersdkgo.QueryAssuranceEventsV1HeaderParams{} + queryParams1 := catalystcentersdkgo.QueryAssuranceEventsV1QueryParams{} if okDeviceFamily { queryParams1.DeviceFamily = vDeviceFamily.(string) @@ -1488,24 +1489,24 @@ func dataSourceAssuranceEventsRead(ctx context.Context, d *schema.ResourceData, headerParams1.XCaLLERID = vXCaLLERID.(string) } - response1, restyResp1, err := client.Devices.QueryAssuranceEvents(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Devices.QueryAssuranceEventsV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 QueryAssuranceEvents", err, - "Failure at QueryAssuranceEvents, unexpected response", "")) + "Failure when executing 2 QueryAssuranceEventsV1", err, + "Failure at QueryAssuranceEventsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesQueryAssuranceEventsItems(response1.Response) + vItems1 := flattenDevicesQueryAssuranceEventsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting QueryAssuranceEvents response", + "Failure when setting QueryAssuranceEventsV1 response", err)) return diags } @@ -1515,11 +1516,11 @@ func dataSourceAssuranceEventsRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetDetailsOfASingleAssuranceEvent") + log.Printf("[DEBUG] Selected method: GetDetailsOfASingleAssuranceEventV1") vvID := vID.(string) - headerParams2 := catalystcentersdkgo.GetDetailsOfASingleAssuranceEventHeaderParams{} - queryParams2 := catalystcentersdkgo.GetDetailsOfASingleAssuranceEventQueryParams{} + headerParams2 := catalystcentersdkgo.GetDetailsOfASingleAssuranceEventV1HeaderParams{} + queryParams2 := catalystcentersdkgo.GetDetailsOfASingleAssuranceEventV1QueryParams{} if okAttribute { queryParams2.Attribute = vAttribute.(string) @@ -1531,24 +1532,24 @@ func dataSourceAssuranceEventsRead(ctx context.Context, d *schema.ResourceData, headerParams2.XCaLLERID = vXCaLLERID.(string) } - response2, restyResp2, err := client.Devices.GetDetailsOfASingleAssuranceEvent(vvID, &headerParams2, &queryParams2) + response2, restyResp2, err := client.Devices.GetDetailsOfASingleAssuranceEventV1(vvID, &headerParams2, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDetailsOfASingleAssuranceEvent", err, - "Failure at GetDetailsOfASingleAssuranceEvent, unexpected response", "")) + "Failure when executing 2 GetDetailsOfASingleAssuranceEventV1", err, + "Failure at GetDetailsOfASingleAssuranceEventV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetDetailsOfASingleAssuranceEventItem(response2.Response) + vItem2 := flattenDevicesGetDetailsOfASingleAssuranceEventV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetDetailsOfASingleAssuranceEvent response", + "Failure when setting GetDetailsOfASingleAssuranceEventV1 response", err)) return diags } @@ -1560,7 +1561,7 @@ func dataSourceAssuranceEventsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDevicesQueryAssuranceEventsItems(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsResponse) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsV1Items(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -1602,7 +1603,7 @@ func flattenDevicesQueryAssuranceEventsItems(items *[]catalystcentersdkgo.Respon respItem["new_radio_channel_list"] = item.NewRadioChannelList respItem["duid"] = item.Duid respItem["roam_type"] = item.RoamType - respItem["candidate_a_ps"] = flattenDevicesQueryAssuranceEventsItemsCandidateAPs(item.CandidateAPs) + respItem["candidate_a_ps"] = flattenDevicesQueryAssuranceEventsV1ItemsCandidateAPs(item.CandidateAPs) respItem["replaced_device_serial_number"] = item.ReplacedDeviceSerialNumber respItem["old_radio_channel_list"] = item.OldRadioChannelList respItem["ssid"] = item.SSID @@ -1611,14 +1612,14 @@ func flattenDevicesQueryAssuranceEventsItems(items *[]catalystcentersdkgo.Respon respItem["ipv4"] = item.IPv4 respItem["wlc_id"] = item.WlcID respItem["ipv6"] = item.IPv6 - respItem["missing_response_a_ps"] = flattenDevicesQueryAssuranceEventsItemsMissingResponseAPs(item.MissingResponseAPs) + respItem["missing_response_a_ps"] = flattenDevicesQueryAssuranceEventsV1ItemsMissingResponseAPs(item.MissingResponseAPs) respItem["timestamp"] = item.Timestamp respItem["severity"] = item.Severity respItem["current_radio_power_level"] = item.CurrentRadioPowerLevel respItem["new_radio_channel_width"] = item.NewRadioChannelWidth respItem["assoc_snr"] = item.AssocSnr respItem["auth_server_ip"] = item.AuthServerIP - respItem["child_events"] = flattenDevicesQueryAssuranceEventsItemsChildEvents(item.ChildEvents) + respItem["child_events"] = flattenDevicesQueryAssuranceEventsV1ItemsChildEvents(item.ChildEvents) respItem["connected_interface_name"] = item.ConnectedInterfaceName respItem["dhcp_server_ip"] = item.DhcpServerIP respItem["management_ip_address"] = item.ManagementIPAddress @@ -1633,14 +1634,14 @@ func flattenDevicesQueryAssuranceEventsItems(items *[]catalystcentersdkgo.Respon respItem["udn_name"] = item.UdnName respItem["facility"] = item.Facility respItem["last_ap_reset_type"] = item.LastApResetType - respItem["invalid_ie_a_ps"] = flattenDevicesQueryAssuranceEventsItemsInvalidIeAPs(item.InvalidIeAPs) + respItem["invalid_ie_a_ps"] = flattenDevicesQueryAssuranceEventsV1ItemsInvalidIeAPs(item.InvalidIeAPs) respItem["username"] = item.Username respItems = append(respItems, respItem) } return respItems } -func flattenDevicesQueryAssuranceEventsItemsCandidateAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsResponseCandidateAPs) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsV1ItemsCandidateAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsV1ResponseCandidateAPs) []map[string]interface{} { if items == nil { return nil } @@ -1657,7 +1658,7 @@ func flattenDevicesQueryAssuranceEventsItemsCandidateAPs(items *[]catalystcenter return respItems } -func flattenDevicesQueryAssuranceEventsItemsMissingResponseAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsResponseMissingResponseAPs) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsV1ItemsMissingResponseAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsV1ResponseMissingResponseAPs) []map[string]interface{} { if items == nil { return nil } @@ -1675,7 +1676,7 @@ func flattenDevicesQueryAssuranceEventsItemsMissingResponseAPs(items *[]catalyst return respItems } -func flattenDevicesQueryAssuranceEventsItemsChildEvents(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsResponseChildEvents) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsV1ItemsChildEvents(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsV1ResponseChildEvents) []map[string]interface{} { if items == nil { return nil } @@ -1698,7 +1699,7 @@ func flattenDevicesQueryAssuranceEventsItemsChildEvents(items *[]catalystcenters return respItems } -func flattenDevicesQueryAssuranceEventsItemsInvalidIeAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsResponseInvalidIeAPs) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsV1ItemsInvalidIeAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsV1ResponseInvalidIeAPs) []map[string]interface{} { if items == nil { return nil } @@ -1717,7 +1718,7 @@ func flattenDevicesQueryAssuranceEventsItemsInvalidIeAPs(items *[]catalystcenter return respItems } -func flattenDevicesGetDetailsOfASingleAssuranceEventItem(item *catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventResponse) []map[string]interface{} { +func flattenDevicesGetDetailsOfASingleAssuranceEventV1Item(item *catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventV1Response) []map[string]interface{} { if item == nil { return nil } @@ -1757,7 +1758,7 @@ func flattenDevicesGetDetailsOfASingleAssuranceEventItem(item *catalystcentersdk respItem["new_radio_channel_list"] = item.NewRadioChannelList respItem["duid"] = item.Duid respItem["roam_type"] = item.RoamType - respItem["candidate_a_ps"] = flattenDevicesGetDetailsOfASingleAssuranceEventItemCandidateAPs(item.CandidateAPs) + respItem["candidate_a_ps"] = flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemCandidateAPs(item.CandidateAPs) respItem["replaced_device_serial_number"] = item.ReplacedDeviceSerialNumber respItem["old_radio_channel_list"] = item.OldRadioChannelList respItem["ssid"] = item.SSID @@ -1766,14 +1767,14 @@ func flattenDevicesGetDetailsOfASingleAssuranceEventItem(item *catalystcentersdk respItem["ipv4"] = item.IPv4 respItem["wlc_id"] = item.WlcID respItem["ipv6"] = item.IPv6 - respItem["missing_response_a_ps"] = flattenDevicesGetDetailsOfASingleAssuranceEventItemMissingResponseAPs(item.MissingResponseAPs) + respItem["missing_response_a_ps"] = flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemMissingResponseAPs(item.MissingResponseAPs) respItem["timestamp"] = item.Timestamp respItem["severity"] = item.Severity respItem["current_radio_power_level"] = item.CurrentRadioPowerLevel respItem["new_radio_channel_width"] = item.NewRadioChannelWidth respItem["assoc_snr"] = item.AssocSnr respItem["auth_server_ip"] = item.AuthServerIP - respItem["child_events"] = flattenDevicesGetDetailsOfASingleAssuranceEventItemChildEvents(item.ChildEvents) + respItem["child_events"] = flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemChildEvents(item.ChildEvents) respItem["connected_interface_name"] = item.ConnectedInterfaceName respItem["dhcp_server_ip"] = item.DhcpServerIP respItem["management_ip_address"] = item.ManagementIPAddress @@ -1788,14 +1789,14 @@ func flattenDevicesGetDetailsOfASingleAssuranceEventItem(item *catalystcentersdk respItem["udn_name"] = item.UdnName respItem["facility"] = item.Facility respItem["last_ap_reset_type"] = item.LastApResetType - respItem["invalid_ie_a_ps"] = flattenDevicesGetDetailsOfASingleAssuranceEventItemInvalidIeAPs(item.InvalidIeAPs) + respItem["invalid_ie_a_ps"] = flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemInvalidIeAPs(item.InvalidIeAPs) respItem["username"] = item.Username return []map[string]interface{}{ respItem, } } -func flattenDevicesGetDetailsOfASingleAssuranceEventItemCandidateAPs(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventResponseCandidateAPs) []map[string]interface{} { +func flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemCandidateAPs(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventV1ResponseCandidateAPs) []map[string]interface{} { if items == nil { return nil } @@ -1812,7 +1813,7 @@ func flattenDevicesGetDetailsOfASingleAssuranceEventItemCandidateAPs(items *[]ca return respItems } -func flattenDevicesGetDetailsOfASingleAssuranceEventItemMissingResponseAPs(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventResponseMissingResponseAPs) []map[string]interface{} { +func flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemMissingResponseAPs(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventV1ResponseMissingResponseAPs) []map[string]interface{} { if items == nil { return nil } @@ -1830,7 +1831,7 @@ func flattenDevicesGetDetailsOfASingleAssuranceEventItemMissingResponseAPs(items return respItems } -func flattenDevicesGetDetailsOfASingleAssuranceEventItemChildEvents(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventResponseChildEvents) []map[string]interface{} { +func flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemChildEvents(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventV1ResponseChildEvents) []map[string]interface{} { if items == nil { return nil } @@ -1853,7 +1854,7 @@ func flattenDevicesGetDetailsOfASingleAssuranceEventItemChildEvents(items *[]cat return respItems } -func flattenDevicesGetDetailsOfASingleAssuranceEventItemInvalidIeAPs(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventResponseInvalidIeAPs) []map[string]interface{} { +func flattenDevicesGetDetailsOfASingleAssuranceEventV1ItemInvalidIeAPs(items *[]catalystcentersdkgo.ResponseDevicesGetDetailsOfASingleAssuranceEventV1ResponseInvalidIeAPs) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_assurance_events_child_events.go b/catalystcenter/data_source_assurance_events_child_events.go index 13c0931..499c3cc 100644 --- a/catalystcenter/data_source_assurance_events_child_events.go +++ b/catalystcenter/data_source_assurance_events_child_events.go @@ -15,7 +15,7 @@ func dataSourceAssuranceEventsChildEvents() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Devices. -- Wireless client event could have child events and this API can be used to fetch the same using parent event 'id' as +- Wireless client event could have child events and this API can be used to fetch the same using parent event *id* as the input. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- AssuranceEvents-1.0.0-resolved.yaml @@ -123,31 +123,31 @@ func dataSourceAssuranceEventsChildEventsRead(ctx context.Context, d *schema.Res selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetListOfChildEventsForTheGivenWirelessClientEvent") + log.Printf("[DEBUG] Selected method: GetListOfChildEventsForTheGivenWirelessClientEventV1") vvID := vID.(string) - headerParams1 := catalystcentersdkgo.GetListOfChildEventsForTheGivenWirelessClientEventHeaderParams{} + headerParams1 := catalystcentersdkgo.GetListOfChildEventsForTheGivenWirelessClientEventV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Devices.GetListOfChildEventsForTheGivenWirelessClientEvent(vvID, &headerParams1) + response1, restyResp1, err := client.Devices.GetListOfChildEventsForTheGivenWirelessClientEventV1(vvID, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetListOfChildEventsForTheGivenWirelessClientEvent", err, - "Failure at GetListOfChildEventsForTheGivenWirelessClientEvent, unexpected response", "")) + "Failure when executing 2 GetListOfChildEventsForTheGivenWirelessClientEventV1", err, + "Failure at GetListOfChildEventsForTheGivenWirelessClientEventV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetListOfChildEventsForTheGivenWirelessClientEventItems(response1.Response) + vItems1 := flattenDevicesGetListOfChildEventsForTheGivenWirelessClientEventV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetListOfChildEventsForTheGivenWirelessClientEvent response", + "Failure when setting GetListOfChildEventsForTheGivenWirelessClientEventV1 response", err)) return diags } @@ -159,7 +159,7 @@ func dataSourceAssuranceEventsChildEventsRead(ctx context.Context, d *schema.Res return diags } -func flattenDevicesGetListOfChildEventsForTheGivenWirelessClientEventItems(items *[]catalystcentersdkgo.ResponseDevicesGetListOfChildEventsForTheGivenWirelessClientEventResponse) []map[string]interface{} { +func flattenDevicesGetListOfChildEventsForTheGivenWirelessClientEventV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetListOfChildEventsForTheGivenWirelessClientEventV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_assurance_events_count.go b/catalystcenter/data_source_assurance_events_count.go index 3d58ef1..5646fb0 100644 --- a/catalystcenter/data_source_assurance_events_count.go +++ b/catalystcenter/data_source_assurance_events_count.go @@ -24,36 +24,36 @@ specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml ReadContext: dataSourceAssuranceEventsCountRead, Schema: map[string]*schema.Schema{ "ap_mac": &schema.Schema{ - Description: `apMac query parameter. MAC address of the access point. This parameter is applicable for 'Unified AP' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*50:0F*' or '50:0F*' or '*50:0F' + Description: `apMac query parameter. MAC address of the access point. This parameter is applicable for *Unified AP* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **50:0F** or *50:0F** or **50:0F* Examples: -'apMac=50:0F:80:0F:F7:E0' (single apMac requested) -'apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0' (multiple apMac requested) +*apMac=50:0F:80:0F:F7:E0* (single apMac requested) +*apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0* (multiple apMac requested) `, Type: schema.TypeString, Optional: true, }, "client_mac": &schema.Schema{ - Description: `clientMac query parameter. MAC address of the client. This parameter is applicable for 'Wired Client' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*66:2B*' or '66:2B*' or '*66:2B' + Description: `clientMac query parameter. MAC address of the client. This parameter is applicable for *Wired Client* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **66:2B** or *66:2B** or **66:2B* Examples: -'clientMac=66:2B:B8:D2:01:56' (single clientMac requested) -'clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89' (multiple clientMac requested) +*clientMac=66:2B:B8:D2:01:56* (single clientMac requested) +*clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89* (multiple clientMac requested) `, Type: schema.TypeString, Optional: true, }, "device_family": &schema.Schema{ - Description: `deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing 'Routers' along with 'Wireless Client' or 'Unified AP' is not supported. Examples: -'deviceFamily=Switches and Hubs' (single deviceFamily requested) -'deviceFamily=Switches and Hubs&deviceFamily=Routers' (multiple deviceFamily requested) + Description: `deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing *Routers* along with *Wireless Client* or *Unified AP* is not supported. Examples: +*deviceFamily=Switches and Hubs* (single deviceFamily requested) +*deviceFamily=Switches and Hubs&deviceFamily=Routers* (multiple deviceFamily requested) `, Type: schema.TypeString, Required: true, }, "end_time": &schema.Schema{ Description: `endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'endTime' is not provided, API will default to current time. +If *endTime* is not provided, API will default to current time. `, Type: schema.TypeString, Optional: true, @@ -61,61 +61,61 @@ If 'endTime' is not provided, API will default to current time. "message_type": &schema.Schema{ Description: `messageType query parameter. Message type for the event. Examples: -'messageType=Syslog' (single messageType requested) -'messageType=Trap&messageType=Syslog' (multiple messageType requested) +*messageType=Syslog* (single messageType requested) +*messageType=Trap&messageType=Syslog* (multiple messageType requested) `, Type: schema.TypeString, Optional: true, }, "network_device_id": &schema.Schema{ - Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceId requested) `, Type: schema.TypeString, Optional: true, }, "network_device_name": &schema.Schema{ - Description: `networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard ('*') character-based search. Ex: '*Branch*' or 'Branch*' or '*Branch' Examples: -'networkDeviceName=Branch-3-Gateway' (single networkDeviceName requested) -'networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch' (multiple networkDeviceName requested) + Description: `networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard (***) character-based search. Ex: **Branch** or *Branch** or **Branch* Examples: +*networkDeviceName=Branch-3-Gateway* (single networkDeviceName requested) +*networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch* (multiple networkDeviceName requested) `, Type: schema.TypeString, Optional: true, }, "severity": &schema.Schema{ - Description: `severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and 'Wired Client' events. + Description: `severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and *Wired Client* events. | Value | Severity | | ----| ----------| | 0 | Emergency | | 1 | Alert | | 2 | Critical | | 3 | Error | | 4 | Warning | | 5 | Notice | | 6 | Info | Examples: -'severity=0' (single severity requested) -'severity=0&severity=1' (multiple severity requested) +*severity=0* (single severity requested) +*severity=0&severity=1* (multiple severity requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyId requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single siteId requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple siteId requested) +*?siteId=id1* (single siteId requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple siteId requested) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time minus 24 hours. +If *startTime* is not provided, API will default to current time minus 24 hours. `, Type: schema.TypeString, Optional: true, @@ -164,10 +164,10 @@ func dataSourceAssuranceEventsCountRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CountTheNumberOfEvents") + log.Printf("[DEBUG] Selected method: CountTheNumberOfEventsV1") - headerParams1 := catalystcentersdkgo.CountTheNumberOfEventsHeaderParams{} - queryParams1 := catalystcentersdkgo.CountTheNumberOfEventsQueryParams{} + headerParams1 := catalystcentersdkgo.CountTheNumberOfEventsV1HeaderParams{} + queryParams1 := catalystcentersdkgo.CountTheNumberOfEventsV1QueryParams{} queryParams1.DeviceFamily = vDeviceFamily.(string) @@ -203,24 +203,24 @@ func dataSourceAssuranceEventsCountRead(ctx context.Context, d *schema.ResourceD } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Devices.CountTheNumberOfEvents(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Devices.CountTheNumberOfEventsV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CountTheNumberOfEvents", err, - "Failure at CountTheNumberOfEvents, unexpected response", "")) + "Failure when executing 2 CountTheNumberOfEventsV1", err, + "Failure at CountTheNumberOfEventsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesCountTheNumberOfEventsItem(response1.Response) + vItem1 := flattenDevicesCountTheNumberOfEventsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountTheNumberOfEvents response", + "Failure when setting CountTheNumberOfEventsV1 response", err)) return diags } @@ -232,7 +232,7 @@ func dataSourceAssuranceEventsCountRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenDevicesCountTheNumberOfEventsItem(item *catalystcentersdkgo.ResponseDevicesCountTheNumberOfEventsResponse) []map[string]interface{} { +func flattenDevicesCountTheNumberOfEventsV1Item(item *catalystcentersdkgo.ResponseDevicesCountTheNumberOfEventsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_assurance_get_sensor_test_results.go b/catalystcenter/data_source_assurance_get_sensor_test_results.go index 4123b85..2e067ed 100644 --- a/catalystcenter/data_source_assurance_get_sensor_test_results.go +++ b/catalystcenter/data_source_assurance_get_sensor_test_results.go @@ -428,8 +428,8 @@ func dataSourceAssuranceGetSensorTestResultsRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SensorTestResults") - queryParams1 := catalystcentersdkgo.SensorTestResultsQueryParams{} + log.Printf("[DEBUG] Selected method: SensorTestResultsV1") + queryParams1 := catalystcentersdkgo.SensorTestResultsV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -444,24 +444,24 @@ func dataSourceAssuranceGetSensorTestResultsRead(ctx context.Context, d *schema. queryParams1.TestFailureBy = vTestFailureBy.(string) } - response1, restyResp1, err := client.Wireless.SensorTestResults(&queryParams1) + response1, restyResp1, err := client.Wireless.SensorTestResultsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SensorTestResults", err, - "Failure at SensorTestResults, unexpected response", "")) + "Failure when executing 2 SensorTestResultsV1", err, + "Failure at SensorTestResultsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessSensorTestResultsItem(response1.Response) + vItem1 := flattenWirelessSensorTestResultsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SensorTestResults response", + "Failure when setting SensorTestResultsV1 response", err)) return diags } diff --git a/catalystcenter/data_source_assurance_issues.go b/catalystcenter/data_source_assurance_issues.go index 21d1fa3..163992e 100644 --- a/catalystcenter/data_source_assurance_issues.go +++ b/catalystcenter/data_source_assurance_issues.go @@ -41,7 +41,7 @@ programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- Optional: true, }, "attribute": &schema.Schema{ - Description: `attribute query parameter. List of attributes related to the issue. If these are provided, then only those attributes will be part of response along with the default attributes. Please refer to the 'IssuesResponseAttribute' Model for supported attributes. Examples: 'attribute=deviceType' (single attribute requested) 'attribute=deviceType&attribute=updatedBy' (multiple attributes requested) + Description: `attribute query parameter. List of attributes related to the issue. If these are provided, then only those attributes will be part of response along with the default attributes. Please refer to the *IssuesResponseAttribute* Model for supported attributes. Examples: *attribute=deviceType* (single attribute requested) *attribute=deviceType&attribute=updatedBy* (multiple attributes requested) `, Type: schema.TypeString, Optional: true, @@ -146,9 +146,9 @@ Examples: entityId=68:ca:e4:79:3f:20 (single entity id requested) entityId=68:ca Optional: true, }, "mac_address": &schema.Schema{ - Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) + Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) `, Type: schema.TypeString, Optional: true, @@ -160,20 +160,20 @@ Examples: entityId=68:ca:e4:79:3f:20 (single entity id requested) entityId=68:ca Optional: true, }, "network_device_id": &schema.Schema{ - Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_ip_address": &schema.Schema{ - Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' + Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) `, Type: schema.TypeString, Optional: true, @@ -203,41 +203,41 @@ Examples: Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) `, Type: schema.TypeString, Optional: true, }, "site_name": &schema.Schema{ - Description: `siteName query parameter. The name of the site. (Ex. 'FloorName') + Description: `siteName query parameter. The name of the site. (Ex. *FloorName*) This field supports wildcard asterisk (*) character search support. E.g. *San*, *San, San* Examples: -'?siteName=building1' (single siteName requested) -'?siteName=building1&siteName=building2&siteName=building3' (multiple siteNames requested) +*?siteName=building1* (single siteName requested) +*?siteName=building1&siteName=building2&siteName=building3* (multiple siteNames requested) `, Type: schema.TypeString, Optional: true, @@ -249,7 +249,7 @@ Examples: }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -267,8 +267,8 @@ If 'startTime' is not provided, API will default to current time. Optional: true, }, "view": &schema.Schema{ - Description: `view query parameter. The name of the View. Each view represents a specific data set. Please refer to the 'IssuesView' Model for supported views. View is predefined set of attributes supported by the API. Only the attributes related to the given view will be part of the API response along with default attributes. If multiple views are provided, then response will contain attributes from all those views. If no views are specified, all attributes will be returned. -| View Name | Included Attributes | | --| --| | 'update' | updatedTime, updatedBy | | 'site' | siteName, siteHierarchy, siteId, siteHierarchyId | Examples: 'view=update' (single view requested) 'view=update&view=site' (multiple views requested) + Description: `view query parameter. The name of the View. Each view represents a specific data set. Please refer to the *IssuesView* Model for supported views. View is predefined set of attributes supported by the API. Only the attributes related to the given view will be part of the API response along with default attributes. If multiple views are provided, then response will contain attributes from all those views. If no views are specified, all attributes will be returned. +| View Name | Included Attributes | | --| --| | *update* | updatedTime, updatedBy | | *site* | siteName, siteHierarchy, siteId, siteHierarchyId | Examples: *view=update* (single view requested) *view=update&view=site* (multiple views requested) `, Type: schema.TypeString, Optional: true, @@ -694,10 +694,10 @@ func dataSourceAssuranceIssuesRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheDetailsOfIssuesForGivenSetOfFilters2") + log.Printf("[DEBUG] Selected method: GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1") - headerParams1 := catalystcentersdkgo.GetTheDetailsOfIssuesForGivenSetOfFilters2HeaderParams{} - queryParams1 := catalystcentersdkgo.GetTheDetailsOfIssuesForGivenSetOfFilters2QueryParams{} + headerParams1 := catalystcentersdkgo.GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1HeaderParams{} + queryParams1 := catalystcentersdkgo.GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -808,24 +808,24 @@ func dataSourceAssuranceIssuesRead(ctx context.Context, d *schema.ResourceData, headerParams1.XCaLLERID = vXCaLLERID.(string) } - response1, restyResp1, err := client.Issues.GetTheDetailsOfIssuesForGivenSetOfFilters2(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Issues.GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheDetailsOfIssuesForGivenSetOfFilters2", err, - "Failure at GetTheDetailsOfIssuesForGivenSetOfFilters2, unexpected response", "")) + "Failure when executing 2 GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1", err, + "Failure at GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2Items(response1.Response) + vItems1 := flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheDetailsOfIssuesForGivenSetOfFilters2 response", + "Failure when setting GetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1 response", err)) return diags } @@ -835,11 +835,11 @@ func dataSourceAssuranceIssuesRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID") + log.Printf("[DEBUG] Selected method: GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1") vvID := vID.(string) - headerParams2 := catalystcentersdkgo.GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDHeaderParams{} - queryParams2 := catalystcentersdkgo.GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDQueryParams{} + headerParams2 := catalystcentersdkgo.GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1HeaderParams{} + queryParams2 := catalystcentersdkgo.GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1QueryParams{} if okView { queryParams2.View = vView.(string) @@ -854,24 +854,24 @@ func dataSourceAssuranceIssuesRead(ctx context.Context, d *schema.ResourceData, headerParams2.XCaLLERID = vXCaLLERID.(string) } - response2, restyResp2, err := client.Issues.GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID(vvID, &headerParams2, &queryParams2) + response2, restyResp2, err := client.Issues.GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1(vvID, &headerParams2, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID", err, - "Failure at GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID, unexpected response", "")) + "Failure when executing 2 GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1", err, + "Failure at GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItem(response2.Response) + vItem2 := flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID response", + "Failure when setting GetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1 response", err)) return diags } @@ -883,7 +883,7 @@ func dataSourceAssuranceIssuesRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2Items(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2Response) []map[string]interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1Items(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1Response) []map[string]interface{} { if items == nil { return nil } @@ -904,21 +904,21 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2Items(items *[]catal respItem["most_recent_occurred_time"] = item.MostRecentOccurredTime respItem["status"] = item.Status respItem["is_global"] = boolPtrToString(item.IsGlobal) - respItem["updated_by"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsUpdatedBy(item.UpdatedBy) - respItem["updated_time"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsUpdatedTime(item.UpdatedTime) - respItem["notes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsNotes(item.Notes) - respItem["site_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteID(item.SiteID) - respItem["site_hierarchy_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteHierarchyID(item.SiteHierarchyID) - respItem["site_name"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteName(item.SiteName) - respItem["site_hierarchy"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteHierarchy(item.SiteHierarchy) - respItem["suggested_actions"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSuggestedActions(item.SuggestedActions) - respItem["additional_attributes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsAdditionalAttributes(item.AdditionalAttributes) + respItem["updated_by"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsUpdatedBy(item.UpdatedBy) + respItem["updated_time"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsUpdatedTime(item.UpdatedTime) + respItem["notes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsNotes(item.Notes) + respItem["site_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteID(item.SiteID) + respItem["site_hierarchy_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteHierarchyID(item.SiteHierarchyID) + respItem["site_name"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteName(item.SiteName) + respItem["site_hierarchy"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteHierarchy(item.SiteHierarchy) + respItem["suggested_actions"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSuggestedActions(item.SuggestedActions) + respItem["additional_attributes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsAdditionalAttributes(item.AdditionalAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsUpdatedBy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseUpdatedBy) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsUpdatedBy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseUpdatedBy) interface{} { if item == nil { return nil } @@ -928,7 +928,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsUpdatedBy(item } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsUpdatedTime(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseUpdatedTime) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsUpdatedTime(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseUpdatedTime) interface{} { if item == nil { return nil } @@ -938,7 +938,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsUpdatedTime(ite } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsNotes(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseNotes) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsNotes(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseNotes) interface{} { if item == nil { return nil } @@ -948,7 +948,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsNotes(item *cat } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseSiteID) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseSiteID) interface{} { if item == nil { return nil } @@ -958,7 +958,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteID(item *ca } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteHierarchyID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseSiteHierarchyID) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteHierarchyID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseSiteHierarchyID) interface{} { if item == nil { return nil } @@ -968,7 +968,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteHierarchyID } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteName(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseSiteName) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteName(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseSiteName) interface{} { if item == nil { return nil } @@ -978,7 +978,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteName(item * } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteHierarchy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseSiteHierarchy) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSiteHierarchy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseSiteHierarchy) interface{} { if item == nil { return nil } @@ -988,7 +988,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSiteHierarchy(i } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseSuggestedActions) []map[string]interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseSuggestedActions) []map[string]interface{} { if items == nil { return nil } @@ -996,13 +996,13 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSuggestedAction for _, item := range *items { respItem := make(map[string]interface{}) respItem["message"] = item.Message - respItem["steps"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSuggestedActionsSteps(item.Steps) + respItem["steps"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSuggestedActionsSteps(item.Steps) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseSuggestedActionsSteps) []interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseSuggestedActionsSteps) []interface{} { if items == nil { return nil } @@ -1014,7 +1014,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsSuggestedAction return respItems } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ResponseAdditionalAttributes) []map[string]interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ItemsAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersKnowYourNetworkV1ResponseAdditionalAttributes) []map[string]interface{} { if items == nil { return nil } @@ -1028,7 +1028,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFilters2ItemsAdditionalAttri return respItems } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItem(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponse) []map[string]interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1Item(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1Response) []map[string]interface{} { if item == nil { return nil } @@ -1049,19 +1049,19 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID respItem["is_global"] = boolPtrToString(item.IsGlobal) respItem["updated_by"] = item.UpdatedBy respItem["updated_time"] = item.UpdatedTime - respItem["notes"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemNotes(item.Notes) - respItem["site_id"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteID(item.SiteID) - respItem["site_hierarchy_id"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteHierarchyID(item.SiteHierarchyID) - respItem["site_name"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteName(item.SiteName) - respItem["site_hierarchy"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteHierarchy(item.SiteHierarchy) - respItem["suggested_actions"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSuggestedActions(item.SuggestedActions) - respItem["additional_attributes"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemAdditionalAttributes(item.AdditionalAttributes) + respItem["notes"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemNotes(item.Notes) + respItem["site_id"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteID(item.SiteID) + respItem["site_hierarchy_id"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteHierarchyID(item.SiteHierarchyID) + respItem["site_name"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteName(item.SiteName) + respItem["site_hierarchy"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteHierarchy(item.SiteHierarchy) + respItem["suggested_actions"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSuggestedActions(item.SuggestedActions) + respItem["additional_attributes"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemAdditionalAttributes(item.AdditionalAttributes) return []map[string]interface{}{ respItem, } } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemNotes(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseNotes) interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemNotes(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseNotes) interface{} { if item == nil { return nil } @@ -1071,7 +1071,7 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteID(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseSiteID) interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteID(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseSiteID) interface{} { if item == nil { return nil } @@ -1081,7 +1081,7 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteHierarchyID(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseSiteHierarchyID) interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteHierarchyID(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseSiteHierarchyID) interface{} { if item == nil { return nil } @@ -1091,7 +1091,7 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteName(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseSiteName) interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteName(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseSiteName) interface{} { if item == nil { return nil } @@ -1101,7 +1101,7 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSiteHierarchy(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseSiteHierarchy) interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSiteHierarchy(item *catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseSiteHierarchy) interface{} { if item == nil { return nil } @@ -1111,7 +1111,7 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseSuggestedActions) []map[string]interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseSuggestedActions) []map[string]interface{} { if items == nil { return nil } @@ -1119,13 +1119,13 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID for _, item := range *items { respItem := make(map[string]interface{}) respItem["message"] = item.Message - respItem["steps"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSuggestedActionsSteps(item.Steps) + respItem["steps"] = flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSuggestedActionsSteps(item.Steps) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseSuggestedActionsSteps) []interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseSuggestedActionsSteps) []interface{} { if items == nil { return nil } @@ -1137,7 +1137,7 @@ func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueID return respItems } -func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDItemAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDResponseAdditionalAttributes) []map[string]interface{} { +func flattenIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ItemAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheDetailsAndSuggestedActionsOfAnIssueForTheGivenIssueIDV1ResponseAdditionalAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_assurance_issues_count.go b/catalystcenter/data_source_assurance_issues_count.go index 51e51f6..9d1b13b 100644 --- a/catalystcenter/data_source_assurance_issues_count.go +++ b/catalystcenter/data_source_assurance_issues_count.go @@ -116,9 +116,9 @@ Examples: entityId=68:ca:e4:79:3f:20 (single entity id requested) entityId=68:ca Optional: true, }, "mac_address": &schema.Schema{ - Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) + Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) `, Type: schema.TypeString, Optional: true, @@ -130,20 +130,20 @@ Examples: entityId=68:ca:e4:79:3f:20 (single entity id requested) entityId=68:ca Optional: true, }, "network_device_id": &schema.Schema{ - Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_ip_address": &schema.Schema{ - Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' + Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) `, Type: schema.TypeString, Optional: true, @@ -161,48 +161,48 @@ Examples: Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) `, Type: schema.TypeString, Optional: true, }, "site_name": &schema.Schema{ - Description: `siteName query parameter. The name of the site. (Ex. 'FloorName') + Description: `siteName query parameter. The name of the site. (Ex. *FloorName*) This field supports wildcard asterisk (*) character search support. E.g. *San*, *San, San* Examples: -'?siteName=building1' (single siteName requested) -'?siteName=building1&siteName=building2&siteName=building3' (multiple siteNames requested) +*?siteName=building1* (single siteName requested) +*?siteName=building1&siteName=building2&siteName=building3* (multiple siteNames requested) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -280,10 +280,10 @@ func dataSourceAssuranceIssuesCountRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheTotalNumberOfIssuesForGivenSetOfFilters2") + log.Printf("[DEBUG] Selected method: GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1") - headerParams1 := catalystcentersdkgo.GetTheTotalNumberOfIssuesForGivenSetOfFilters2HeaderParams{} - queryParams1 := catalystcentersdkgo.GetTheTotalNumberOfIssuesForGivenSetOfFilters2QueryParams{} + headerParams1 := catalystcentersdkgo.GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1HeaderParams{} + queryParams1 := catalystcentersdkgo.GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -371,24 +371,24 @@ func dataSourceAssuranceIssuesCountRead(ctx context.Context, d *schema.ResourceD } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTheTotalNumberOfIssuesForGivenSetOfFilters2(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Issues.GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheTotalNumberOfIssuesForGivenSetOfFilters2", err, - "Failure at GetTheTotalNumberOfIssuesForGivenSetOfFilters2, unexpected response", "")) + "Failure when executing 2 GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1", err, + "Failure at GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFilters2Item(response1.Response) + vItem1 := flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheTotalNumberOfIssuesForGivenSetOfFilters2 response", + "Failure when setting GetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1 response", err)) return diags } @@ -400,7 +400,7 @@ func dataSourceAssuranceIssuesCountRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFilters2Item(item *catalystcentersdkgo.ResponseIssuesGetTheTotalNumberOfIssuesForGivenSetOfFilters2Response) []map[string]interface{} { +func flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1Item(item *catalystcentersdkgo.ResponseIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersKnowYourNetworkV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_authentication_policy_servers.go b/catalystcenter/data_source_authentication_policy_servers.go index 0ef68ad..39a5fc7 100644 --- a/catalystcenter/data_source_authentication_policy_servers.go +++ b/catalystcenter/data_source_authentication_policy_servers.go @@ -329,8 +329,8 @@ func dataSourceAuthenticationPolicyServersRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAuthenticationAndPolicyServers") - queryParams1 := catalystcentersdkgo.GetAuthenticationAndPolicyServersQueryParams{} + log.Printf("[DEBUG] Selected method: GetAuthenticationAndPolicyServersV1") + queryParams1 := catalystcentersdkgo.GetAuthenticationAndPolicyServersV1QueryParams{} if okIsIseEnabled { queryParams1.IsIseEnabled = vIsIseEnabled.(bool) @@ -342,24 +342,24 @@ func dataSourceAuthenticationPolicyServersRead(ctx context.Context, d *schema.Re queryParams1.Role = vRole.(string) } - response1, restyResp1, err := client.SystemSettings.GetAuthenticationAndPolicyServers(&queryParams1) + response1, restyResp1, err := client.SystemSettings.GetAuthenticationAndPolicyServersV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAuthenticationAndPolicyServers", err, - "Failure at GetAuthenticationAndPolicyServers, unexpected response", "")) + "Failure when executing 2 GetAuthenticationAndPolicyServersV1", err, + "Failure at GetAuthenticationAndPolicyServersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSystemSettingsGetAuthenticationAndPolicyServersItems(response1.Response) + vItems1 := flattenSystemSettingsGetAuthenticationAndPolicyServersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAuthenticationAndPolicyServers response", + "Failure when setting GetAuthenticationAndPolicyServersV1 response", err)) return diags } @@ -371,7 +371,7 @@ func dataSourceAuthenticationPolicyServersRead(ctx context.Context, d *schema.Re return diags } -func flattenSystemSettingsGetAuthenticationAndPolicyServersItems(items *[]catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersResponse) []map[string]interface{} { +func flattenSystemSettingsGetAuthenticationAndPolicyServersV1Items(items *[]catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersV1Response) []map[string]interface{} { if items == nil { return nil } @@ -390,7 +390,7 @@ func flattenSystemSettingsGetAuthenticationAndPolicyServersItems(items *[]cataly respItem["is_ise_enabled"] = boolPtrToString(item.IsIseEnabled) respItem["instance_uuid"] = item.InstanceUUID respItem["state"] = item.State - respItem["cisco_ise_dtos"] = flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtos(item.CiscoIseDtos) + respItem["cisco_ise_dtos"] = flattenSystemSettingsGetAuthenticationAndPolicyServersV1ItemsCiscoIseDtos(item.CiscoIseDtos) respItem["encryption_scheme"] = item.EncryptionScheme respItem["message_key"] = item.MessageKey respItem["encryption_key"] = item.EncryptionKey @@ -404,7 +404,7 @@ func flattenSystemSettingsGetAuthenticationAndPolicyServersItems(items *[]cataly return respItems } -func flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtos(items *[]catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersResponseCiscoIseDtos) []map[string]interface{} { +func flattenSystemSettingsGetAuthenticationAndPolicyServersV1ItemsCiscoIseDtos(items *[]catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersV1ResponseCiscoIseDtos) []map[string]interface{} { if items == nil { return nil } @@ -423,19 +423,19 @@ func flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtos(ite respItem["type"] = item.Type respItem["failure_reason"] = item.FailureReason respItem["role"] = item.Role - respItem["external_cisco_ise_ip_addr_dtos"] = flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtosExternalCiscoIseIPAddrDtos(item.ExternalCiscoIseIPAddrDtos) + respItem["external_cisco_ise_ip_addr_dtos"] = flattenSystemSettingsGetAuthenticationAndPolicyServersV1ItemsCiscoIseDtosExternalCiscoIseIPAddrDtos(item.ExternalCiscoIseIPAddrDtos) respItems = append(respItems, respItem) } return respItems } -func flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtosExternalCiscoIseIPAddrDtos(item *catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersResponseCiscoIseDtosExternalCiscoIseIPAddrDtos) []map[string]interface{} { +func flattenSystemSettingsGetAuthenticationAndPolicyServersV1ItemsCiscoIseDtosExternalCiscoIseIPAddrDtos(item *catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersV1ResponseCiscoIseDtosExternalCiscoIseIPAddrDtos) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["type"] = item.Type - respItem["external_cisco_ise_ip_addresses"] = flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtosExternalCiscoIseIPAddrDtosExternalCiscoIseIPAddresses(item.ExternalCiscoIseIPAddresses) + respItem["external_cisco_ise_ip_addresses"] = flattenSystemSettingsGetAuthenticationAndPolicyServersV1ItemsCiscoIseDtosExternalCiscoIseIPAddrDtosExternalCiscoIseIPAddresses(item.ExternalCiscoIseIPAddresses) return []map[string]interface{}{ respItem, @@ -443,7 +443,7 @@ func flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtosExte } -func flattenSystemSettingsGetAuthenticationAndPolicyServersItemsCiscoIseDtosExternalCiscoIseIPAddrDtosExternalCiscoIseIPAddresses(items *[]catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersResponseCiscoIseDtosExternalCiscoIseIPAddrDtosExternalCiscoIseIPAddresses) []map[string]interface{} { +func flattenSystemSettingsGetAuthenticationAndPolicyServersV1ItemsCiscoIseDtosExternalCiscoIseIPAddrDtosExternalCiscoIseIPAddresses(items *[]catalystcentersdkgo.ResponseSystemSettingsGetAuthenticationAndPolicyServersV1ResponseCiscoIseDtosExternalCiscoIseIPAddrDtosExternalCiscoIseIPAddresses) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_buildings.go b/catalystcenter/data_source_buildings.go index 4c2bba4..7509132 100644 --- a/catalystcenter/data_source_buildings.go +++ b/catalystcenter/data_source_buildings.go @@ -96,27 +96,27 @@ func dataSourceBuildingsRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsABuilding") + log.Printf("[DEBUG] Selected method: GetsABuildingV2") vvID := vID.(string) - response1, restyResp1, err := client.SiteDesign.GetsABuilding(vvID) + response1, restyResp1, err := client.SiteDesign.GetsABuildingV2(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsABuilding", err, - "Failure at GetsABuilding, unexpected response", "")) + "Failure when executing 2 GetsABuildingV2", err, + "Failure at GetsABuildingV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetsABuildingItem(response1.Response) + vItem1 := flattenSiteDesignGetsABuildingV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsABuilding response", + "Failure when setting GetsABuildingV2 response", err)) return diags } @@ -128,7 +128,7 @@ func dataSourceBuildingsRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenSiteDesignGetsABuildingItem(item *catalystcentersdkgo.ResponseSiteDesignGetsABuildingResponse) []map[string]interface{} { +func flattenSiteDesignGetsABuildingV2Item(item *catalystcentersdkgo.ResponseSiteDesignGetsABuildingV2Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_buildings_planned_access_points.go b/catalystcenter/data_source_buildings_planned_access_points.go index e6f95c4..1931e70 100644 --- a/catalystcenter/data_source_buildings_planned_access_points.go +++ b/catalystcenter/data_source_buildings_planned_access_points.go @@ -355,9 +355,9 @@ func dataSourceBuildingsPlannedAccessPointsRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPlannedAccessPointsForBuilding") + log.Printf("[DEBUG] Selected method: GetPlannedAccessPointsForBuildingV1") vvBuildingID := vBuildingID.(string) - queryParams1 := catalystcentersdkgo.GetPlannedAccessPointsForBuildingQueryParams{} + queryParams1 := catalystcentersdkgo.GetPlannedAccessPointsForBuildingV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -369,24 +369,24 @@ func dataSourceBuildingsPlannedAccessPointsRead(ctx context.Context, d *schema.R queryParams1.Radios = vRadios.(bool) } - response1, restyResp1, err := client.Devices.GetPlannedAccessPointsForBuilding(vvBuildingID, &queryParams1) + response1, restyResp1, err := client.Devices.GetPlannedAccessPointsForBuildingV1(vvBuildingID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPlannedAccessPointsForBuilding", err, - "Failure at GetPlannedAccessPointsForBuilding, unexpected response", "")) + "Failure when executing 2 GetPlannedAccessPointsForBuildingV1", err, + "Failure at GetPlannedAccessPointsForBuildingV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetPlannedAccessPointsForBuildingItems(response1.Response) + vItems1 := flattenDevicesGetPlannedAccessPointsForBuildingV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPlannedAccessPointsForBuilding response", + "Failure when setting GetPlannedAccessPointsForBuildingV1 response", err)) return diags } @@ -398,25 +398,25 @@ func dataSourceBuildingsPlannedAccessPointsRead(ctx context.Context, d *schema.R return diags } -func flattenDevicesGetPlannedAccessPointsForBuildingItems(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponse) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForBuildingItemsAttributes(item.Attributes) - respItem["location"] = flattenDevicesGetPlannedAccessPointsForBuildingItemsLocation(item.Location) - respItem["position"] = flattenDevicesGetPlannedAccessPointsForBuildingItemsPosition(item.Position) + respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsAttributes(item.Attributes) + respItem["location"] = flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsLocation(item.Location) + respItem["position"] = flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsPosition(item.Position) respItem["radio_count"] = item.RadioCount - respItem["radios"] = flattenDevicesGetPlannedAccessPointsForBuildingItemsRadios(item.Radios) + respItem["radios"] = flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsRadios(item.Radios) respItem["is_sensor"] = boolPtrToString(item.IsSensor) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetPlannedAccessPointsForBuildingItemsAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponseAttributes) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1ResponseAttributes) []map[string]interface{} { if item == nil { return nil } @@ -437,7 +437,7 @@ func flattenDevicesGetPlannedAccessPointsForBuildingItemsAttributes(item *cataly } -func flattenDevicesGetPlannedAccessPointsForBuildingItemsLocation(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponseLocation) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsLocation(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1ResponseLocation) []map[string]interface{} { if item == nil { return nil } @@ -452,7 +452,7 @@ func flattenDevicesGetPlannedAccessPointsForBuildingItemsLocation(item *catalyst } -func flattenDevicesGetPlannedAccessPointsForBuildingItemsPosition(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponsePosition) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsPosition(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1ResponsePosition) []map[string]interface{} { if item == nil { return nil } @@ -467,22 +467,22 @@ func flattenDevicesGetPlannedAccessPointsForBuildingItemsPosition(item *catalyst } -func flattenDevicesGetPlannedAccessPointsForBuildingItemsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponseRadios) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1ResponseRadios) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForBuildingItemsRadiosAttributes(item.Attributes) - respItem["antenna"] = flattenDevicesGetPlannedAccessPointsForBuildingItemsRadiosAntenna(item.Antenna) + respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsRadiosAttributes(item.Attributes) + respItem["antenna"] = flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsRadiosAntenna(item.Antenna) respItem["is_sensor"] = boolPtrToString(item.IsSensor) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetPlannedAccessPointsForBuildingItemsRadiosAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponseRadiosAttributes) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsRadiosAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1ResponseRadiosAttributes) []map[string]interface{} { if item == nil { return nil } @@ -503,7 +503,7 @@ func flattenDevicesGetPlannedAccessPointsForBuildingItemsRadiosAttributes(item * } -func flattenDevicesGetPlannedAccessPointsForBuildingItemsRadiosAntenna(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingResponseRadiosAntenna) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForBuildingV1ItemsRadiosAntenna(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForBuildingV1ResponseRadiosAntenna) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_business_sda_hostonboarding_ssid_ippool.go b/catalystcenter/data_source_business_sda_hostonboarding_ssid_ippool.go index 7a47f54..afd668d 100644 --- a/catalystcenter/data_source_business_sda_hostonboarding_ssid_ippool.go +++ b/catalystcenter/data_source_business_sda_hostonboarding_ssid_ippool.go @@ -83,31 +83,31 @@ func dataSourceBusinessSdaHostonboardingSSIDIPpoolRead(ctx context.Context, d *s selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSSIDToIPPoolMapping") - queryParams1 := catalystcentersdkgo.GetSSIDToIPPoolMappingQueryParams{} + log.Printf("[DEBUG] Selected method: GetSSIDToIPPoolMappingV1") + queryParams1 := catalystcentersdkgo.GetSSIDToIPPoolMappingV1QueryParams{} queryParams1.VLANName = vVLANName.(string) queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) - response1, restyResp1, err := client.FabricWireless.GetSSIDToIPPoolMapping(&queryParams1) + response1, restyResp1, err := client.FabricWireless.GetSSIDToIPPoolMappingV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSSIDToIPPoolMapping", err, - "Failure at GetSSIDToIPPoolMapping, unexpected response", "")) + "Failure when executing 2 GetSSIDToIPPoolMappingV1", err, + "Failure at GetSSIDToIPPoolMappingV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenFabricWirelessGetSSIDToIPPoolMappingItem(response1) + vItem1 := flattenFabricWirelessGetSSIDToIPPoolMappingV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDToIPPoolMapping response", + "Failure when setting GetSSIDToIPPoolMappingV1 response", err)) return diags } @@ -119,19 +119,19 @@ func dataSourceBusinessSdaHostonboardingSSIDIPpoolRead(ctx context.Context, d *s return diags } -func flattenFabricWirelessGetSSIDToIPPoolMappingItem(item *catalystcentersdkgo.ResponseFabricWirelessGetSSIDToIPPoolMapping) []map[string]interface{} { +func flattenFabricWirelessGetSSIDToIPPoolMappingV1Item(item *catalystcentersdkgo.ResponseFabricWirelessGetSSIDToIPPoolMappingV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["vlan_name"] = item.VLANName - respItem["ssid_details"] = flattenFabricWirelessGetSSIDToIPPoolMappingItemSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenFabricWirelessGetSSIDToIPPoolMappingV1ItemSSIDDetails(item.SSIDDetails) return []map[string]interface{}{ respItem, } } -func flattenFabricWirelessGetSSIDToIPPoolMappingItemSSIDDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessGetSSIDToIPPoolMappingSSIDDetails) []map[string]interface{} { +func flattenFabricWirelessGetSSIDToIPPoolMappingV1ItemSSIDDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessGetSSIDToIPPoolMappingV1SSIDDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_business_sda_virtual_network_summary.go b/catalystcenter/data_source_business_sda_virtual_network_summary.go index 9e2dd79..237435f 100644 --- a/catalystcenter/data_source_business_sda_virtual_network_summary.go +++ b/catalystcenter/data_source_business_sda_virtual_network_summary.go @@ -126,29 +126,29 @@ func dataSourceBusinessSdaVirtualNetworkSummaryRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVirtualNetworkSummary") - queryParams1 := catalystcentersdkgo.GetVirtualNetworkSummaryQueryParams{} + log.Printf("[DEBUG] Selected method: GetVirtualNetworkSummaryV1") + queryParams1 := catalystcentersdkgo.GetVirtualNetworkSummaryV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) - response1, restyResp1, err := client.Sda.GetVirtualNetworkSummary(&queryParams1) + response1, restyResp1, err := client.Sda.GetVirtualNetworkSummaryV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetVirtualNetworkSummary", err, - "Failure at GetVirtualNetworkSummary, unexpected response", "")) + "Failure when executing 2 GetVirtualNetworkSummaryV1", err, + "Failure at GetVirtualNetworkSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetVirtualNetworkSummaryItem(response1) + vItem1 := flattenSdaGetVirtualNetworkSummaryV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVirtualNetworkSummary response", + "Failure when setting GetVirtualNetworkSummaryV1 response", err)) return diags } @@ -160,13 +160,13 @@ func dataSourceBusinessSdaVirtualNetworkSummaryRead(ctx context.Context, d *sche return diags } -func flattenSdaGetVirtualNetworkSummaryItem(item *catalystcentersdkgo.ResponseSdaGetVirtualNetworkSummary) []map[string]interface{} { +func flattenSdaGetVirtualNetworkSummaryV1Item(item *catalystcentersdkgo.ResponseSdaGetVirtualNetworkSummaryV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["virtual_network_count"] = item.VirtualNetworkCount - respItem["virtual_network_summary"] = flattenSdaGetVirtualNetworkSummaryItemVirtualNetworkSummary(item.VirtualNetworkSummary) + respItem["virtual_network_summary"] = flattenSdaGetVirtualNetworkSummaryV1ItemVirtualNetworkSummary(item.VirtualNetworkSummary) respItem["status"] = item.Status respItem["description"] = item.Description respItem["execution_id"] = item.ExecutionID @@ -175,7 +175,7 @@ func flattenSdaGetVirtualNetworkSummaryItem(item *catalystcentersdkgo.ResponseSd } } -func flattenSdaGetVirtualNetworkSummaryItemVirtualNetworkSummary(items *[]catalystcentersdkgo.ResponseSdaGetVirtualNetworkSummaryVirtualNetworkSummary) []map[string]interface{} { +func flattenSdaGetVirtualNetworkSummaryV1ItemVirtualNetworkSummary(items *[]catalystcentersdkgo.ResponseSdaGetVirtualNetworkSummaryV1VirtualNetworkSummary) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_client_detail.go b/catalystcenter/data_source_client_detail.go index 03b5efd..929dfa1 100644 --- a/catalystcenter/data_source_client_detail.go +++ b/catalystcenter/data_source_client_detail.go @@ -1484,8 +1484,8 @@ func dataSourceClientDetailRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetClientDetail") - queryParams1 := catalystcentersdkgo.GetClientDetailQueryParams{} + log.Printf("[DEBUG] Selected method: GetClientDetailV1") + queryParams1 := catalystcentersdkgo.GetClientDetailV1QueryParams{} queryParams1.MacAddress = vMacAddress.(string) @@ -1493,24 +1493,24 @@ func dataSourceClientDetailRead(ctx context.Context, d *schema.ResourceData, m i queryParams1.Timestamp = vTimestamp.(float64) } - response1, restyResp1, err := client.Clients.GetClientDetail(&queryParams1) + response1, restyResp1, err := client.Clients.GetClientDetailV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetClientDetail", err, - "Failure at GetClientDetail, unexpected response", "")) + "Failure when executing 2 GetClientDetailV1", err, + "Failure at GetClientDetailV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenClientsGetClientDetailItem(response1) + vItem1 := flattenClientsGetClientDetailV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetClientDetail response", + "Failure when setting GetClientDetailV1 response", err)) return diags } @@ -1522,20 +1522,20 @@ func dataSourceClientDetailRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenClientsGetClientDetailItem(item *catalystcentersdkgo.ResponseClientsGetClientDetail) []map[string]interface{} { +func flattenClientsGetClientDetailV1Item(item *catalystcentersdkgo.ResponseClientsGetClientDetailV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["detail"] = flattenClientsGetClientDetailItemDetail(item.Detail) - respItem["connection_info"] = flattenClientsGetClientDetailItemConnectionInfo(item.ConnectionInfo) - respItem["topology"] = flattenClientsGetClientDetailItemTopology(item.Topology) + respItem["detail"] = flattenClientsGetClientDetailV1ItemDetail(item.Detail) + respItem["connection_info"] = flattenClientsGetClientDetailV1ItemConnectionInfo(item.ConnectionInfo) + respItem["topology"] = flattenClientsGetClientDetailV1ItemTopology(item.Topology) return []map[string]interface{}{ respItem, } } -func flattenClientsGetClientDetailItemDetail(item *catalystcentersdkgo.ResponseClientsGetClientDetailDetail) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemDetail(item *catalystcentersdkgo.ResponseClientsGetClientDetailV1Detail) []map[string]interface{} { if item == nil { return nil } @@ -1557,7 +1557,7 @@ func flattenClientsGetClientDetailItemDetail(item *catalystcentersdkgo.ResponseC respItem["sales_code"] = item.SalesCode respItem["country_code"] = item.CountryCode respItem["last_updated"] = item.LastUpdated - respItem["health_score"] = flattenClientsGetClientDetailItemDetailHealthScore(item.HealthScore) + respItem["health_score"] = flattenClientsGetClientDetailV1ItemDetailHealthScore(item.HealthScore) respItem["host_mac"] = item.HostMac respItem["host_ip_v4"] = item.HostIPV4 respItem["host_ip_v6"] = item.HostIPV6 @@ -1575,7 +1575,7 @@ func flattenClientsGetClientDetailItemDetail(item *catalystcentersdkgo.ResponseC respItem["sgt"] = item.Sgt respItem["location"] = item.Location respItem["client_connection"] = item.ClientConnection - respItem["connected_device"] = flattenClientsGetClientDetailItemDetailConnectedDevice(item.ConnectedDevice) + respItem["connected_device"] = flattenClientsGetClientDetailV1ItemDetailConnectedDevice(item.ConnectedDevice) respItem["issue_count"] = item.IssueCount respItem["rssi"] = item.Rssi respItem["rssi_threshold"] = item.RssiThreshold @@ -1590,7 +1590,7 @@ func flattenClientsGetClientDetailItemDetail(item *catalystcentersdkgo.ResponseC respItem["rx_bytes"] = item.RxBytes respItem["dns_response"] = item.DNSResponse respItem["dns_request"] = item.DNSRequest - respItem["onboarding"] = flattenClientsGetClientDetailItemDetailOnboarding(item.Onboarding) + respItem["onboarding"] = flattenClientsGetClientDetailV1ItemDetailOnboarding(item.Onboarding) respItem["client_type"] = item.ClientType respItem["onboarding_time"] = item.OnboardingTime respItem["port"] = item.Port @@ -1653,7 +1653,7 @@ func flattenClientsGetClientDetailItemDetail(item *catalystcentersdkgo.ResponseC } -func flattenClientsGetClientDetailItemDetailHealthScore(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailDetailHealthScore) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemDetailHealthScore(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailV1DetailHealthScore) []map[string]interface{} { if items == nil { return nil } @@ -1668,7 +1668,7 @@ func flattenClientsGetClientDetailItemDetailHealthScore(items *[]catalystcenters return respItems } -func flattenClientsGetClientDetailItemDetailConnectedDevice(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailDetailConnectedDevice) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemDetailConnectedDevice(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailV1DetailConnectedDevice) []map[string]interface{} { if items == nil { return nil } @@ -1688,7 +1688,7 @@ func flattenClientsGetClientDetailItemDetailConnectedDevice(items *[]catalystcen return respItems } -func flattenClientsGetClientDetailItemDetailOnboarding(item *catalystcentersdkgo.ResponseClientsGetClientDetailDetailOnboarding) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemDetailOnboarding(item *catalystcentersdkgo.ResponseClientsGetClientDetailV1DetailOnboarding) []map[string]interface{} { if item == nil { return nil } @@ -1718,7 +1718,7 @@ func flattenClientsGetClientDetailItemDetailOnboarding(item *catalystcentersdkgo } -func flattenClientsGetClientDetailItemConnectionInfo(item *catalystcentersdkgo.ResponseClientsGetClientDetailConnectionInfo) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemConnectionInfo(item *catalystcentersdkgo.ResponseClientsGetClientDetailV1ConnectionInfo) []map[string]interface{} { if item == nil { return nil } @@ -1741,13 +1741,13 @@ func flattenClientsGetClientDetailItemConnectionInfo(item *catalystcentersdkgo.R } -func flattenClientsGetClientDetailItemTopology(item *catalystcentersdkgo.ResponseClientsGetClientDetailTopology) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemTopology(item *catalystcentersdkgo.ResponseClientsGetClientDetailV1Topology) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["nodes"] = flattenClientsGetClientDetailItemTopologyNodes(item.Nodes) - respItem["links"] = flattenClientsGetClientDetailItemTopologyLinks(item.Links) + respItem["nodes"] = flattenClientsGetClientDetailV1ItemTopologyNodes(item.Nodes) + respItem["links"] = flattenClientsGetClientDetailV1ItemTopologyLinks(item.Links) return []map[string]interface{}{ respItem, @@ -1755,7 +1755,7 @@ func flattenClientsGetClientDetailItemTopology(item *catalystcentersdkgo.Respons } -func flattenClientsGetClientDetailItemTopologyNodes(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailTopologyNodes) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemTopologyNodes(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailV1TopologyNodes) []map[string]interface{} { if items == nil { return nil } @@ -1788,7 +1788,7 @@ func flattenClientsGetClientDetailItemTopologyNodes(items *[]catalystcentersdkgo return respItems } -func flattenClientsGetClientDetailItemTopologyLinks(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailTopologyLinks) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemTopologyLinks(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailV1TopologyLinks) []map[string]interface{} { if items == nil { return nil } @@ -1815,13 +1815,13 @@ func flattenClientsGetClientDetailItemTopologyLinks(items *[]catalystcentersdkgo respItem["ap_radio_oper_status"] = item.ApRadioOperStatus respItem["source_port_vla_n_info"] = item.SourcePortVLANInfo respItem["target_port_vla_n_info"] = item.TargetPortVLANInfo - respItem["interface_details"] = flattenClientsGetClientDetailItemTopologyLinksInterfaceDetails(item.InterfaceDetails) + respItem["interface_details"] = flattenClientsGetClientDetailV1ItemTopologyLinksInterfaceDetails(item.InterfaceDetails) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientDetailItemTopologyLinksInterfaceDetails(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailTopologyLinksInterfaceDetails) []map[string]interface{} { +func flattenClientsGetClientDetailV1ItemTopologyLinksInterfaceDetails(items *[]catalystcentersdkgo.ResponseClientsGetClientDetailV1TopologyLinksInterfaceDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_client_enrichment_details.go b/catalystcenter/data_source_client_enrichment_details.go index 899f3ef..96fd99b 100644 --- a/catalystcenter/data_source_client_enrichment_details.go +++ b/catalystcenter/data_source_client_enrichment_details.go @@ -866,12 +866,13 @@ func dataSourceClientEnrichmentDetailsRead(ctx context.Context, d *schema.Resour vEntityType := d.Get("entity_type") vEntityValue := d.Get("entity_value") vIssueCategory := d.Get("issue_category") + vPersistbapioutput := d.Get("persistbapioutput") selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetClientEnrichmentDetails") + log.Printf("[DEBUG] Selected method: GetClientEnrichmentDetailsV1") - headerParams1 := catalystcentersdkgo.GetClientEnrichmentDetailsHeaderParams{} + headerParams1 := catalystcentersdkgo.GetClientEnrichmentDetailsV1HeaderParams{} headerParams1.EntityType = vEntityType.(string) @@ -879,24 +880,26 @@ func dataSourceClientEnrichmentDetailsRead(ctx context.Context, d *schema.Resour headerParams1.IssueCategory = vIssueCategory.(string) - response1, restyResp1, err := client.Clients.GetClientEnrichmentDetails(&headerParams1) + headerParams1.Persistbapioutput = vPersistbapioutput.(string) + + response1, restyResp1, err := client.Clients.GetClientEnrichmentDetailsV1(&headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetClientEnrichmentDetails", err, - "Failure at GetClientEnrichmentDetails, unexpected response", "")) + "Failure when executing 2 GetClientEnrichmentDetailsV1", err, + "Failure at GetClientEnrichmentDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenClientsGetClientEnrichmentDetailsItems(response1) + vItems1 := flattenClientsGetClientEnrichmentDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetClientEnrichmentDetails response", + "Failure when setting GetClientEnrichmentDetailsV1 response", err)) return diags } @@ -908,22 +911,22 @@ func dataSourceClientEnrichmentDetailsRead(ctx context.Context, d *schema.Resour return diags } -func flattenClientsGetClientEnrichmentDetailsItems(items *catalystcentersdkgo.ResponseClientsGetClientEnrichmentDetails) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1Items(items *catalystcentersdkgo.ResponseClientsGetClientEnrichmentDetailsV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["user_details"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetails(item.UserDetails) - respItem["connected_device"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDevice(item.ConnectedDevice) - respItem["issue_details"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetails(item.IssueDetails) + respItem["user_details"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetails(item.UserDetails) + respItem["connected_device"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDevice(item.ConnectedDevice) + respItem["issue_details"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetails(item.IssueDetails) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetails(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetails) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetails(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetails) []map[string]interface{} { if item == nil { return nil } @@ -932,26 +935,26 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetails(item *catalystcent respItem["connection_status"] = item.ConnectionStatus respItem["host_type"] = item.HostType respItem["user_id"] = item.UserID - respItem["host_name"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostName(item.HostName) - respItem["host_os"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostOs(item.HostOs) - respItem["host_version"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostVersion(item.HostVersion) - respItem["sub_type"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSubType(item.SubType) + respItem["host_name"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostName(item.HostName) + respItem["host_os"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostOs(item.HostOs) + respItem["host_version"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostVersion(item.HostVersion) + respItem["sub_type"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsSubType(item.SubType) respItem["last_updated"] = item.LastUpdated - respItem["health_score"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHealthScore(item.HealthScore) + respItem["health_score"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHealthScore(item.HealthScore) respItem["host_mac"] = item.HostMac respItem["host_ip_v4"] = item.HostIPV4 - respItem["host_ip_v6"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostIPV6(item.HostIPV6) - respItem["auth_type"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsAuthType(item.AuthType) + respItem["host_ip_v6"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostIPV6(item.HostIPV6) + respItem["auth_type"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsAuthType(item.AuthType) respItem["vlan_id"] = item.VLANID - respItem["ssid"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSSID(item.SSID) - respItem["location"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsLocation(item.Location) + respItem["ssid"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsSSID(item.SSID) + respItem["location"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsLocation(item.Location) respItem["client_connection"] = item.ClientConnection - respItem["connected_device"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsConnectedDevice(item.ConnectedDevice) + respItem["connected_device"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsConnectedDevice(item.ConnectedDevice) respItem["issue_count"] = item.IssueCount - respItem["rssi"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsRssi(item.Rssi) - respItem["snr"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSnr(item.Snr) - respItem["data_rate"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsDataRate(item.DataRate) - respItem["port"] = flattenClientsGetClientEnrichmentDetailsItemsUserDetailsPort(item.Port) + respItem["rssi"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsRssi(item.Rssi) + respItem["snr"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsSnr(item.Snr) + respItem["data_rate"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsDataRate(item.DataRate) + respItem["port"] = flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsPort(item.Port) return []map[string]interface{}{ respItem, @@ -959,7 +962,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetails(item *catalystcent } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostName(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsHostName) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostName(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsHostName) interface{} { if item == nil { return nil } @@ -969,7 +972,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostName(item *cata } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostOs(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsHostOs) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostOs(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsHostOs) interface{} { if item == nil { return nil } @@ -979,7 +982,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostOs(item *cataly } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostVersion(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsHostVersion) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostVersion(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsHostVersion) interface{} { if item == nil { return nil } @@ -989,7 +992,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostVersion(item *c } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSubType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsSubType) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsSubType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsSubType) interface{} { if item == nil { return nil } @@ -999,7 +1002,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSubType(item *catal } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHealthScore(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsHealthScore) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHealthScore(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsHealthScore) []map[string]interface{} { if items == nil { return nil } @@ -1014,7 +1017,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHealthScore(items * return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostIPV6(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsHostIPV6) []interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsHostIPV6(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsHostIPV6) []interface{} { if items == nil { return nil } @@ -1026,7 +1029,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsHostIPV6(items *[]c return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsAuthType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsAuthType) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsAuthType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsAuthType) interface{} { if item == nil { return nil } @@ -1036,7 +1039,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsAuthType(item *cata } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSSID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsSSID) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsSSID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsSSID) interface{} { if item == nil { return nil } @@ -1046,7 +1049,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSSID(item *catalyst } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsLocation(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsLocation) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsLocation(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsLocation) interface{} { if item == nil { return nil } @@ -1056,7 +1059,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsLocation(item *cata } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsConnectedDevice) []interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsConnectedDevice) []interface{} { if items == nil { return nil } @@ -1068,7 +1071,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsConnectedDevice(ite return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsRssi(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsRssi) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsRssi(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsRssi) interface{} { if item == nil { return nil } @@ -1078,7 +1081,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsRssi(item *catalyst } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSnr(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsSnr) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsSnr(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsSnr) interface{} { if item == nil { return nil } @@ -1088,7 +1091,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsSnr(item *catalystc } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsDataRate(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsDataRate) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsDataRate(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsDataRate) interface{} { if item == nil { return nil } @@ -1098,7 +1101,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsDataRate(item *cata } -func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsPort(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsUserDetailsPort) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsUserDetailsPort(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1UserDetailsPort) interface{} { if item == nil { return nil } @@ -1108,37 +1111,37 @@ func flattenClientsGetClientEnrichmentDetailsItemsUserDetailsPort(item *catalyst } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDevice) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDevice) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["device_details"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item.DeviceDetails) + respItem["device_details"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetails(item.DeviceDetails) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetails) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetails(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["family"] = item.Family respItem["type"] = item.Type - respItem["location"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocation(item.Location) + respItem["location"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocation(item.Location) respItem["error_code"] = item.ErrorCode respItem["mac_address"] = item.MacAddress respItem["role"] = item.Role respItem["ap_manager_interface_ip"] = item.ApManagerInterfaceIP respItem["associated_wlc_ip"] = item.AssociatedWlcIP - respItem["boot_date_time"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsBootDateTime(item.BootDateTime) + respItem["boot_date_time"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsBootDateTime(item.BootDateTime) respItem["collection_status"] = item.CollectionStatus - respItem["interface_count"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsInterfaceCount(item.InterfaceCount) - respItem["line_card_count"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLineCardCount(item.LineCardCount) - respItem["line_card_id"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLineCardID(item.LineCardID) + respItem["interface_count"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsInterfaceCount(item.InterfaceCount) + respItem["line_card_count"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLineCardCount(item.LineCardCount) + respItem["line_card_id"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLineCardID(item.LineCardID) respItem["management_ip_address"] = item.ManagementIPAddress respItem["memory_size"] = item.MemorySize respItem["platform_id"] = item.PlatformID @@ -1147,7 +1150,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetails(i respItem["snmp_contact"] = item.SNMPContact respItem["snmp_location"] = item.SNMPLocation respItem["tunnel_udp_port"] = item.TunnelUDPPort - respItem["waas_device_mode"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item.WaasDeviceMode) + respItem["waas_device_mode"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item.WaasDeviceMode) respItem["series"] = item.Series respItem["inventory_status_detail"] = item.InventoryStatusDetail respItem["collection_interval"] = item.CollectionInterval @@ -1157,13 +1160,13 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetails(i respItem["hostname"] = item.Hostname respItem["up_time"] = item.UpTime respItem["last_update_time"] = item.LastUpdateTime - respItem["error_description"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorDescription(item.ErrorDescription) - respItem["location_name"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocationName(item.LocationName) + respItem["error_description"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsErrorDescription(item.ErrorDescription) + respItem["location_name"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocationName(item.LocationName) respItem["tag_count"] = item.TagCount respItem["last_updated"] = item.LastUpdated respItem["instance_uuid"] = item.InstanceUUID respItem["id"] = item.ID - respItem["neighbor_topology"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopology(item.NeighborTopology) + respItem["neighbor_topology"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopology(item.NeighborTopology) respItem["cisco360view"] = item.Cisco360View return []map[string]interface{}{ @@ -1172,7 +1175,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetails(i } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocation(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsLocation) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocation(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsLocation) interface{} { if item == nil { return nil } @@ -1182,7 +1185,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLo } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsBootDateTime(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsBootDateTime) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsBootDateTime(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsBootDateTime) interface{} { if item == nil { return nil } @@ -1192,7 +1195,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsBo } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsInterfaceCount(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsInterfaceCount) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsInterfaceCount(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsInterfaceCount) interface{} { if item == nil { return nil } @@ -1202,7 +1205,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsIn } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLineCardCount(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsLineCardCount) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLineCardCount(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsLineCardCount) interface{} { if item == nil { return nil } @@ -1212,7 +1215,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLi } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLineCardID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsLineCardID) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLineCardID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsLineCardID) interface{} { if item == nil { return nil } @@ -1222,7 +1225,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLi } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsWaasDeviceMode) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsWaasDeviceMode) interface{} { if item == nil { return nil } @@ -1232,7 +1235,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsWa } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorDescription(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsErrorDescription) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsErrorDescription(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsErrorDescription) interface{} { if item == nil { return nil } @@ -1242,7 +1245,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsEr } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocationName(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsLocationName) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocationName(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsLocationName) interface{} { if item == nil { return nil } @@ -1252,21 +1255,21 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLo } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopology(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopology) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopology(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopology) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["nodes"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodes(item.Nodes) - respItem["links"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinks(item.Links) + respItem["nodes"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodes(item.Nodes) + respItem["links"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinks(item.Links) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodes(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodes) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodes(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodes) []map[string]interface{} { if items == nil { return nil } @@ -1277,25 +1280,25 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe respItem["name"] = item.Name respItem["id"] = item.ID respItem["description"] = item.Description - respItem["device_type"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesDeviceType(item.DeviceType) - respItem["platform_id"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesPlatformID(item.PlatformID) - respItem["family"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFamily(item.Family) - respItem["ip"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesIP(item.IP) - respItem["software_version"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesSoftwareVersion(item.SoftwareVersion) - respItem["user_id"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesUserID(item.UserID) - respItem["node_type"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesNodeType(item.NodeType) - respItem["radio_frequency"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesRadioFrequency(item.RadioFrequency) + respItem["device_type"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesDeviceType(item.DeviceType) + respItem["platform_id"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesPlatformID(item.PlatformID) + respItem["family"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFamily(item.Family) + respItem["ip"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesIP(item.IP) + respItem["software_version"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesSoftwareVersion(item.SoftwareVersion) + respItem["user_id"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesUserID(item.UserID) + respItem["node_type"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesNodeType(item.NodeType) + respItem["radio_frequency"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesRadioFrequency(item.RadioFrequency) respItem["clients"] = item.Clients - respItem["count"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesCount(item.Count) - respItem["health_score"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesHealthScore(item.HealthScore) + respItem["count"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesCount(item.Count) + respItem["health_score"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesHealthScore(item.HealthScore) respItem["level"] = item.Level - respItem["fabric_group"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFabricGroup(item.FabricGroup) + respItem["fabric_group"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFabricGroup(item.FabricGroup) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesDeviceType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesDeviceType) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesDeviceType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesDeviceType) interface{} { if item == nil { return nil } @@ -1305,7 +1308,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesPlatformID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesPlatformID) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesPlatformID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesPlatformID) interface{} { if item == nil { return nil } @@ -1315,7 +1318,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFamily(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesFamily) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFamily(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesFamily) interface{} { if item == nil { return nil } @@ -1325,7 +1328,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesIP(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesIP) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesIP(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesIP) interface{} { if item == nil { return nil } @@ -1335,7 +1338,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesSoftwareVersion(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesSoftwareVersion) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesSoftwareVersion(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesSoftwareVersion) interface{} { if item == nil { return nil } @@ -1345,7 +1348,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesUserID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesUserID) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesUserID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesUserID) interface{} { if item == nil { return nil } @@ -1355,7 +1358,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesNodeType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesNodeType) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesNodeType(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesNodeType) interface{} { if item == nil { return nil } @@ -1365,7 +1368,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesRadioFrequency(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesRadioFrequency) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesRadioFrequency(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesRadioFrequency) interface{} { if item == nil { return nil } @@ -1375,7 +1378,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesCount(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesCount) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesCount(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesCount) interface{} { if item == nil { return nil } @@ -1385,7 +1388,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesHealthScore(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesHealthScore) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesHealthScore(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesHealthScore) interface{} { if item == nil { return nil } @@ -1395,7 +1398,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFabricGroup(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyNodesFabricGroup) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyNodesFabricGroup(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyNodesFabricGroup) interface{} { if item == nil { return nil } @@ -1405,7 +1408,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinks(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyLinks) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinks(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyLinks) []map[string]interface{} { if items == nil { return nil } @@ -1414,16 +1417,16 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe respItem := make(map[string]interface{}) respItem["source"] = item.Source respItem["link_status"] = item.LinkStatus - respItem["label"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksLabel(item.Label) + respItem["label"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksLabel(item.Label) respItem["target"] = item.Target - respItem["id"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksID(item.ID) - respItem["port_utilization"] = flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksPortUtilization(item.PortUtilization) + respItem["id"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksID(item.ID) + respItem["port_utilization"] = flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksPortUtilization(item.PortUtilization) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksLabel(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyLinksLabel) []interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksLabel(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyLinksLabel) []interface{} { if items == nil { return nil } @@ -1435,7 +1438,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyLinksID) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksID(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyLinksID) interface{} { if item == nil { return nil } @@ -1445,7 +1448,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksPortUtilization(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopologyLinksPortUtilization) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopologyLinksPortUtilization(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopologyLinksPortUtilization) interface{} { if item == nil { return nil } @@ -1455,12 +1458,12 @@ func flattenClientsGetClientEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNe } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetails(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetails) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetails(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["issue"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssue(item.Issue) + respItem["issue"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssue(item.Issue) return []map[string]interface{}{ respItem, @@ -1468,7 +1471,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetails(item *catalystcen } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssue(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssue) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssue(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssue) []map[string]interface{} { if items == nil { return nil } @@ -1486,14 +1489,14 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssue(items *[]cat respItem["issue_priority"] = item.IssuePriority respItem["issue_summary"] = item.IssueSummary respItem["issue_timestamp"] = item.IssueTimestamp - respItem["suggested_actions"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueSuggestedActions(item.SuggestedActions) - respItem["impacted_hosts"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHosts(item.ImpactedHosts) + respItem["suggested_actions"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueSuggestedActions(item.SuggestedActions) + respItem["impacted_hosts"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHosts(item.ImpactedHosts) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueSuggestedActions(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssueSuggestedActions) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueSuggestedActions(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssueSuggestedActions) []map[string]interface{} { if items == nil { return nil } @@ -1501,13 +1504,13 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueSuggestedActi for _, item := range *items { respItem := make(map[string]interface{}) respItem["message"] = item.Message - respItem["steps"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueSuggestedActionsSteps(item.Steps) + respItem["steps"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueSuggestedActionsSteps(item.Steps) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssueSuggestedActionsSteps) []interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssueSuggestedActionsSteps) []interface{} { if items == nil { return nil } @@ -1519,7 +1522,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueSuggestedActi return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHosts(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssueImpactedHosts) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHosts(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssueImpactedHosts) []map[string]interface{} { if items == nil { return nil } @@ -1533,14 +1536,14 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHosts respItem["connected_interface"] = item.ConnectedInterface respItem["mac_address"] = item.MacAddress respItem["failed_attempts"] = item.FailedAttempts - respItem["location"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHostsLocation(item.Location) + respItem["location"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHostsLocation(item.Location) respItem["timestamp"] = item.Timestamp respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHostsLocation(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssueImpactedHostsLocation) []map[string]interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHostsLocation(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssueImpactedHostsLocation) []map[string]interface{} { if item == nil { return nil } @@ -1549,8 +1552,8 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHosts respItem["site_type"] = item.SiteType respItem["area"] = item.Area respItem["building"] = item.Building - respItem["floor"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHostsLocationFloor(item.Floor) - respItem["aps_impacted"] = flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHostsLocationApsImpacted(item.ApsImpacted) + respItem["floor"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHostsLocationFloor(item.Floor) + respItem["aps_impacted"] = flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHostsLocationApsImpacted(item.ApsImpacted) return []map[string]interface{}{ respItem, @@ -1558,7 +1561,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHosts } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHostsLocationFloor(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssueImpactedHostsLocationFloor) interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHostsLocationFloor(item *catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssueImpactedHostsLocationFloor) interface{} { if item == nil { return nil } @@ -1568,7 +1571,7 @@ func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHosts } -func flattenClientsGetClientEnrichmentDetailsItemsIssueDetailsIssueImpactedHostsLocationApsImpacted(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsIssueDetailsIssueImpactedHostsLocationApsImpacted) []interface{} { +func flattenClientsGetClientEnrichmentDetailsV1ItemsIssueDetailsIssueImpactedHostsLocationApsImpacted(items *[]catalystcentersdkgo.ResponseItemClientsGetClientEnrichmentDetailsV1IssueDetailsIssueImpactedHostsLocationApsImpacted) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_client_health.go b/catalystcenter/data_source_client_health.go index 923f7da..23372b2 100644 --- a/catalystcenter/data_source_client_health.go +++ b/catalystcenter/data_source_client_health.go @@ -258,31 +258,31 @@ func dataSourceClientHealthRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetOverallClientHealth") - queryParams1 := catalystcentersdkgo.GetOverallClientHealthQueryParams{} + log.Printf("[DEBUG] Selected method: GetOverallClientHealthV1") + queryParams1 := catalystcentersdkgo.GetOverallClientHealthV1QueryParams{} if okTimestamp { queryParams1.Timestamp = vTimestamp.(float64) } - response1, restyResp1, err := client.Clients.GetOverallClientHealth(&queryParams1) + response1, restyResp1, err := client.Clients.GetOverallClientHealthV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetOverallClientHealth", err, - "Failure at GetOverallClientHealth, unexpected response", "")) + "Failure when executing 2 GetOverallClientHealthV1", err, + "Failure at GetOverallClientHealthV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenClientsGetOverallClientHealthItems(response1.Response) + vItems1 := flattenClientsGetOverallClientHealthV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetOverallClientHealth response", + "Failure when setting GetOverallClientHealthV1 response", err)) return diags } @@ -294,7 +294,7 @@ func dataSourceClientHealthRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenClientsGetOverallClientHealthItems(items *[]catalystcentersdkgo.ResponseClientsGetOverallClientHealthResponse) []map[string]interface{} { +func flattenClientsGetOverallClientHealthV1Items(items *[]catalystcentersdkgo.ResponseClientsGetOverallClientHealthV1Response) []map[string]interface{} { if items == nil { return nil } @@ -302,20 +302,20 @@ func flattenClientsGetOverallClientHealthItems(items *[]catalystcentersdkgo.Resp for _, item := range *items { respItem := make(map[string]interface{}) respItem["site_id"] = item.SiteID - respItem["score_detail"] = flattenClientsGetOverallClientHealthItemsScoreDetail(item.ScoreDetail) + respItem["score_detail"] = flattenClientsGetOverallClientHealthV1ItemsScoreDetail(item.ScoreDetail) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetOverallClientHealthItemsScoreDetail(items *[]catalystcentersdkgo.ResponseClientsGetOverallClientHealthResponseScoreDetail) []map[string]interface{} { +func flattenClientsGetOverallClientHealthV1ItemsScoreDetail(items *[]catalystcentersdkgo.ResponseClientsGetOverallClientHealthV1ResponseScoreDetail) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["score_category"] = flattenClientsGetOverallClientHealthItemsScoreDetailScoreCategory(item.ScoreCategory) + respItem["score_category"] = flattenClientsGetOverallClientHealthV1ItemsScoreDetailScoreCategory(item.ScoreCategory) respItem["score_value"] = item.ScoreValue respItem["client_count"] = item.ClientCount respItem["client_unique_count"] = item.ClientUniqueCount @@ -326,13 +326,13 @@ func flattenClientsGetOverallClientHealthItemsScoreDetail(items *[]catalystcente respItem["endtime"] = item.Endtime respItem["connected_to_udn_count"] = item.ConnectedToUdnCount respItem["unconnected_to_udn_count"] = item.UnconnectedToUdnCount - respItem["score_list"] = flattenClientsGetOverallClientHealthItemsScoreDetailScoreList(item.ScoreList) + respItem["score_list"] = flattenClientsGetOverallClientHealthV1ItemsScoreDetailScoreList(item.ScoreList) respItems = append(respItems, respItem) } return respItems } -func flattenClientsGetOverallClientHealthItemsScoreDetailScoreCategory(item *catalystcentersdkgo.ResponseClientsGetOverallClientHealthResponseScoreDetailScoreCategory) []map[string]interface{} { +func flattenClientsGetOverallClientHealthV1ItemsScoreDetailScoreCategory(item *catalystcentersdkgo.ResponseClientsGetOverallClientHealthV1ResponseScoreDetailScoreCategory) []map[string]interface{} { if item == nil { return nil } @@ -346,14 +346,14 @@ func flattenClientsGetOverallClientHealthItemsScoreDetailScoreCategory(item *cat } -func flattenClientsGetOverallClientHealthItemsScoreDetailScoreList(items *[]catalystcentersdkgo.ResponseClientsGetOverallClientHealthResponseScoreDetailScoreList) []map[string]interface{} { +func flattenClientsGetOverallClientHealthV1ItemsScoreDetailScoreList(items *[]catalystcentersdkgo.ResponseClientsGetOverallClientHealthV1ResponseScoreDetailScoreList) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["score_category"] = flattenClientsGetOverallClientHealthItemsScoreDetailScoreListScoreCategory(item.ScoreCategory) + respItem["score_category"] = flattenClientsGetOverallClientHealthV1ItemsScoreDetailScoreListScoreCategory(item.ScoreCategory) respItem["score_value"] = item.ScoreValue respItem["client_count"] = item.ClientCount respItem["client_unique_count"] = item.ClientUniqueCount @@ -369,7 +369,7 @@ func flattenClientsGetOverallClientHealthItemsScoreDetailScoreList(items *[]cata return respItems } -func flattenClientsGetOverallClientHealthItemsScoreDetailScoreListScoreCategory(item *catalystcentersdkgo.ResponseClientsGetOverallClientHealthResponseScoreDetailScoreListScoreCategory) []map[string]interface{} { +func flattenClientsGetOverallClientHealthV1ItemsScoreDetailScoreListScoreCategory(item *catalystcentersdkgo.ResponseClientsGetOverallClientHealthV1ResponseScoreDetailScoreListScoreCategory) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_client_proximity.go b/catalystcenter/data_source_client_proximity.go index e5438c4..fec6b50 100644 --- a/catalystcenter/data_source_client_proximity.go +++ b/catalystcenter/data_source_client_proximity.go @@ -82,8 +82,8 @@ func dataSourceClientProximityRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ClientProximity") - queryParams1 := catalystcentersdkgo.ClientProximityQueryParams{} + log.Printf("[DEBUG] Selected method: ClientProximityV1") + queryParams1 := catalystcentersdkgo.ClientProximityV1QueryParams{} queryParams1.Username = vUsername.(string) @@ -94,24 +94,24 @@ func dataSourceClientProximityRead(ctx context.Context, d *schema.ResourceData, queryParams1.TimeResolution = vTimeResolution.(float64) } - response1, restyResp1, err := client.Clients.ClientProximity(&queryParams1) + response1, restyResp1, err := client.Clients.ClientProximityV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ClientProximity", err, - "Failure at ClientProximity, unexpected response", "")) + "Failure when executing 2 ClientProximityV1", err, + "Failure at ClientProximityV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenClientsClientProximityItem(response1) + vItem1 := flattenClientsClientProximityV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ClientProximity response", + "Failure when setting ClientProximityV1 response", err)) return diags } @@ -123,7 +123,7 @@ func dataSourceClientProximityRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenClientsClientProximityItem(item *catalystcentersdkgo.ResponseClientsClientProximity) []map[string]interface{} { +func flattenClientsClientProximityV1Item(item *catalystcentersdkgo.ResponseClientsClientProximityV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_clients.go b/catalystcenter/data_source_clients.go index ecfe50f..75d896e 100644 --- a/catalystcenter/data_source_clients.go +++ b/catalystcenter/data_source_clients.go @@ -27,24 +27,24 @@ specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml ReadContext: dataSourceClientsRead, Schema: map[string]*schema.Schema{ "attribute": &schema.Schema{ - Description: `attribute query parameter. List of attributes related to resource that can be requested to only be part of the response along with the required attributes. Refer to ClientAttribute schema for list of attributes supported Examples: 'attribute=band' (single attribute requested) 'attribute=band&attribute=ssid&attribute=overallScore' (multiple attribute requested) + Description: `attribute query parameter. List of attributes related to resource that can be requested to only be part of the response along with the required attributes. Refer to ClientAttribute schema for list of attributes supported Examples: *attribute=band* (single attribute requested) *attribute=band&attribute=ssid&attribute=overallScore* (multiple attribute requested) `, Type: schema.TypeString, Optional: true, }, "band": &schema.Schema{ Description: `band query parameter. WiFi frequency band that client or Access Point operates. Band value is represented in Giga Hertz GHz Examples: -'band=5GHZ' (single band requested) -'band=2.4GHZ&band=6GHZ' (multiple band requested) +*band=5GHZ* (single band requested) +*band=2.4GHZ&band=6GHZ* (multiple band requested) `, Type: schema.TypeString, Optional: true, }, "connected_network_device_name": &schema.Schema{ - Description: `connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*ap-25*' or 'ap-25*' or '*ap-25' + Description: `connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **ap-25** or *ap-25** or **ap-25* Examples: -'connectedNetworkDeviceName=ap-25' (single connectedNetworkDeviceName requested) -'connectedNetworkDeviceName=ap-25&ap-34' (multiple connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25* (single connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25&ap-34* (multiple connectedNetworkDeviceName requested) `, Type: schema.TypeString, Optional: true, @@ -62,19 +62,19 @@ Examples: Optional: true, }, "ipv4_address": &schema.Schema{ - Description: `ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' + Description: `ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'ipv4Address=1.1.1.1' (single ipv4Address requested) -'ipv4Address=1.1.1.1&ipv4Address=2.2.2.2' (multiple ipv4Address requested) +*ipv4Address=1.1.1.1* (single ipv4Address requested) +*ipv4Address=1.1.1.1&ipv4Address=2.2.2.2* (multiple ipv4Address requested) `, Type: schema.TypeString, Optional: true, }, "ipv6_address": &schema.Schema{ - Description: `ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*2001:db8*' or '2001:db8*' or '*2001:db8' + Description: `ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **2001:db8** or *2001:db8** or **2001:db8* Examples: -'ipv6Address=2001:db8:0:0:0:0:2:1' (single ipv6Address requested) -'ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348' (multiple ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1* (single ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348* (multiple ipv6Address requested) `, Type: schema.TypeString, Optional: true, @@ -86,9 +86,9 @@ Examples: Optional: true, }, "mac_address": &schema.Schema{ - Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) + Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) `, Type: schema.TypeString, Optional: true, @@ -106,35 +106,35 @@ Examples: Optional: true, }, "os_type": &schema.Schema{ - Description: `osType query parameter. Client device operating system type. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*iOS*' or 'iOS*' or '*iOS' Examples: -'osType=iOS' (single osType requested) -'osType=iOS&osType=Android' (multiple osType requested) + Description: `osType query parameter. Client device operating system type. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **iOS** or *iOS** or **iOS* Examples: +*osType=iOS* (single osType requested) +*osType=iOS&osType=Android* (multiple osType requested) `, Type: schema.TypeString, Optional: true, }, "os_version": &schema.Schema{ - Description: `osVersion query parameter. Client device operating system version This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*14.3*' or '14.3*' or '*14.3' Examples: -'osVersion=14.3' (single osVersion requested) -'osVersion=14.3&osVersion=10.1' (multiple osVersion requested) + Description: `osVersion query parameter. Client device operating system version This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **14.3** or *14.3** or **14.3* Examples: +*osVersion=14.3* (single osVersion requested) +*osVersion=14.3&osVersion=10.1* (multiple osVersion requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*BuildingName*' or 'BuildingName*' or '*BuildingName' Examples: 'siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) 'siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2' (multiple siteHierarchy requested) + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **BuildingName** or *BuildingName** or **BuildingName* Examples: *siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) *siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2* (multiple siteHierarchy requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard ('*') character-based search. Ex: '*buildingUuid*' or 'buildingUuid*' or '*buildingUuid' Examples: 'siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid' (single siteHierarchyId requested) 'siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2' (multiple siteHierarchyId requested) + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard (***) character-based search. Ex: **buildingUuid** or *buildingUuid** or **buildingUuid* Examples: *siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid* (single siteHierarchyId requested) *siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2* (multiple siteHierarchyId requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: 'siteId=floorUuid' (single siteId requested) 'siteId=floorUuid1&siteId=floorUuid2' (multiple siteId requested) + Description: `siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: *siteId=floorUuid* (single siteId requested) *siteId=floorUuid1&siteId=floorUuid2* (multiple siteId requested) `, Type: schema.TypeString, Optional: true, @@ -146,17 +146,17 @@ Examples: Optional: true, }, "ssid": &schema.Schema{ - Description: `ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*Alpha*' or 'Alpha*' or '*Alpha' + Description: `ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **Alpha** or *Alpha** or **Alpha* Examples: -'ssid=Alpha' (single ssid requested) -'ssid=Alpha&ssid=Guest' (multiple ssid requested) +*ssid=Alpha* (single ssid requested) +*ssid=Alpha&ssid=Guest* (multiple ssid requested) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -169,17 +169,17 @@ If 'startTime' is not provided, API will default to current time. }, "view": &schema.Schema{ Description: `view query parameter. Client related Views Refer to ClientView schema for list of views supported Examples: -'view=Wireless' (single view requested) -'view=WirelessHealth&view=WirelessTraffic' (multiple view requested) +*view=Wireless* (single view requested) +*view=WirelessHealth&view=WirelessTraffic* (multiple view requested) `, Type: schema.TypeString, Optional: true, }, "wlc_name": &schema.Schema{ - Description: `wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*wlc-25*' or 'wlc-25*' or '*wlc-25' + Description: `wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **wlc-25** or *wlc-25** or **wlc-25* Examples: -'wlcName=wlc-25' (single wlcName requested) -'wlcName=wlc-25&wlc-34' (multiple wlcName requested) +*wlcName=wlc-25* (single wlcName requested) +*wlcName=wlc-25&wlc-34* (multiple wlcName requested) `, Type: schema.TypeString, Optional: true, @@ -1667,10 +1667,10 @@ func dataSourceClientsRead(ctx context.Context, d *schema.ResourceData, m interf selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilities") + log.Printf("[DEBUG] Selected method: RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1") - headerParams1 := catalystcentersdkgo.RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesHeaderParams{} - queryParams1 := catalystcentersdkgo.RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesQueryParams{} + headerParams1 := catalystcentersdkgo.RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1HeaderParams{} + queryParams1 := catalystcentersdkgo.RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -1739,24 +1739,24 @@ func dataSourceClientsRead(ctx context.Context, d *schema.ResourceData, m interf headerParams1.XCaLLERID = vXCaLLERID.(string) } - response1, restyResp1, err := client.Clients.RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilities(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Clients.RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilities", err, - "Failure at RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilities, unexpected response", "")) + "Failure when executing 2 RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1", err, + "Failure at RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItems(response1.Response) + vItems1 := flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilities response", + "Failure when setting RetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1 response", err)) return diags } @@ -1766,11 +1766,11 @@ func dataSourceClientsRead(ctx context.Context, d *schema.ResourceData, m interf } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: RetrievesSpecificClientInformationMatchingTheMacaddress") + log.Printf("[DEBUG] Selected method: RetrievesSpecificClientInformationMatchingTheMacaddressV1") vvID := vID.(string) - headerParams2 := catalystcentersdkgo.RetrievesSpecificClientInformationMatchingTheMacaddressHeaderParams{} - queryParams2 := catalystcentersdkgo.RetrievesSpecificClientInformationMatchingTheMacaddressQueryParams{} + headerParams2 := catalystcentersdkgo.RetrievesSpecificClientInformationMatchingTheMacaddressV1HeaderParams{} + queryParams2 := catalystcentersdkgo.RetrievesSpecificClientInformationMatchingTheMacaddressV1QueryParams{} if okStartTime { queryParams2.StartTime = vStartTime.(float64) @@ -1788,24 +1788,24 @@ func dataSourceClientsRead(ctx context.Context, d *schema.ResourceData, m interf headerParams2.XCaLLERID = vXCaLLERID.(string) } - response2, restyResp2, err := client.Clients.RetrievesSpecificClientInformationMatchingTheMacaddress(vvID, &headerParams2, &queryParams2) + response2, restyResp2, err := client.Clients.RetrievesSpecificClientInformationMatchingTheMacaddressV1(vvID, &headerParams2, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesSpecificClientInformationMatchingTheMacaddress", err, - "Failure at RetrievesSpecificClientInformationMatchingTheMacaddress, unexpected response", "")) + "Failure when executing 2 RetrievesSpecificClientInformationMatchingTheMacaddressV1", err, + "Failure at RetrievesSpecificClientInformationMatchingTheMacaddressV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItem(response2.Response) + vItem2 := flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesSpecificClientInformationMatchingTheMacaddress response", + "Failure when setting RetrievesSpecificClientInformationMatchingTheMacaddressV1 response", err)) return diags } @@ -1817,7 +1817,7 @@ func dataSourceClientsRead(ctx context.Context, d *schema.ResourceData, m interf return diags } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItems(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponse) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1Items(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -1843,18 +1843,18 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo respItem["connection_status"] = item.ConnectionStatus respItem["tracked"] = item.Tracked respItem["is_private_mac_address"] = boolPtrToString(item.IsPrivateMacAddress) - respItem["health"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsHealth(item.Health) - respItem["traffic"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsTraffic(item.Traffic) - respItem["connected_network_device"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsConnectedNetworkDevice(item.ConnectedNetworkDevice) - respItem["connection"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsConnection(item.Connection) - respItem["onboarding"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsOnboarding(item.Onboarding) - respItem["latency"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsLatency(item.Latency) + respItem["health"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsHealth(item.Health) + respItem["traffic"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsTraffic(item.Traffic) + respItem["connected_network_device"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsConnectedNetworkDevice(item.ConnectedNetworkDevice) + respItem["connection"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsConnection(item.Connection) + respItem["onboarding"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsOnboarding(item.Onboarding) + respItem["latency"] = flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsLatency(item.Latency) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsHealth(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponseHealth) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsHealth(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ResponseHealth) []map[string]interface{} { if item == nil { return nil } @@ -1875,7 +1875,7 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsTraffic(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponseTraffic) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsTraffic(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ResponseTraffic) []map[string]interface{} { if item == nil { return nil } @@ -1902,7 +1902,7 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsConnectedNetworkDevice(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponseConnectedNetworkDevice) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsConnectedNetworkDevice(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ResponseConnectedNetworkDevice) []map[string]interface{} { if item == nil { return nil } @@ -1922,7 +1922,7 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsConnection(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponseConnection) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsConnection(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ResponseConnection) []map[string]interface{} { if item == nil { return nil } @@ -1963,7 +1963,7 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsOnboarding(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponseOnboarding) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsOnboarding(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ResponseOnboarding) []map[string]interface{} { if item == nil { return nil } @@ -1999,7 +1999,7 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo } -func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesItemsLatency(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesResponseLatency) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ItemsLatency(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSortingCapabilitiesV1ResponseLatency) []map[string]interface{} { if item == nil { return nil } @@ -2015,7 +2015,7 @@ func flattenClientsRetrievesTheListOfClientsWhileAlsoOfferingBasicFilteringAndSo } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItem(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponse) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1Item(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1Response) []map[string]interface{} { if item == nil { return nil } @@ -2039,18 +2039,18 @@ func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItem(i respItem["connection_status"] = item.ConnectionStatus respItem["tracked"] = item.Tracked respItem["is_private_mac_address"] = boolPtrToString(item.IsPrivateMacAddress) - respItem["health"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemHealth(item.Health) - respItem["traffic"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemTraffic(item.Traffic) - respItem["connected_network_device"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemConnectedNetworkDevice(item.ConnectedNetworkDevice) - respItem["connection"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemConnection(item.Connection) - respItem["onboarding"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemOnboarding(item.Onboarding) - respItem["latency"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemLatency(item.Latency) + respItem["health"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemHealth(item.Health) + respItem["traffic"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemTraffic(item.Traffic) + respItem["connected_network_device"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemConnectedNetworkDevice(item.ConnectedNetworkDevice) + respItem["connection"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemConnection(item.Connection) + respItem["onboarding"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemOnboarding(item.Onboarding) + respItem["latency"] = flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemLatency(item.Latency) return []map[string]interface{}{ respItem, } } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemHealth(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponseHealth) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemHealth(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ResponseHealth) []map[string]interface{} { if item == nil { return nil } @@ -2071,7 +2071,7 @@ func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemHe } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemTraffic(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponseTraffic) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemTraffic(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ResponseTraffic) []map[string]interface{} { if item == nil { return nil } @@ -2098,7 +2098,7 @@ func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemTr } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemConnectedNetworkDevice(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponseConnectedNetworkDevice) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemConnectedNetworkDevice(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ResponseConnectedNetworkDevice) []map[string]interface{} { if item == nil { return nil } @@ -2118,7 +2118,7 @@ func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemCo } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemConnection(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponseConnection) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemConnection(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ResponseConnection) []map[string]interface{} { if item == nil { return nil } @@ -2159,7 +2159,7 @@ func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemCo } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemOnboarding(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponseOnboarding) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemOnboarding(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ResponseOnboarding) []map[string]interface{} { if item == nil { return nil } @@ -2195,7 +2195,7 @@ func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemOn } -func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressItemLatency(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressResponseLatency) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ItemLatency(item *catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationMatchingTheMacaddressV1ResponseLatency) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_clients_count.go b/catalystcenter/data_source_clients_count.go index f11b2bb..beff5b8 100644 --- a/catalystcenter/data_source_clients_count.go +++ b/catalystcenter/data_source_clients_count.go @@ -24,17 +24,17 @@ specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml Schema: map[string]*schema.Schema{ "band": &schema.Schema{ Description: `band query parameter. WiFi frequency band that client or Access Point operates. Band value is represented in Giga Hertz GHz Examples: -'band=5GHZ' (single band requested) -'band=2.4GHZ&band=6GHZ' (multiple band requested) +*band=5GHZ* (single band requested) +*band=2.4GHZ&band=6GHZ* (multiple band requested) `, Type: schema.TypeString, Optional: true, }, "connected_network_device_name": &schema.Schema{ - Description: `connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*ap-25*' or 'ap-25*' or '*ap-25' + Description: `connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **ap-25** or *ap-25** or **ap-25* Examples: -'connectedNetworkDeviceName=ap-25' (single connectedNetworkDeviceName requested) -'connectedNetworkDeviceName=ap-25&ap-34' (multiple connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25* (single connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25&ap-34* (multiple connectedNetworkDeviceName requested) `, Type: schema.TypeString, Optional: true, @@ -46,77 +46,77 @@ Examples: Optional: true, }, "ipv4_address": &schema.Schema{ - Description: `ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' + Description: `ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'ipv4Address=1.1.1.1' (single ipv4Address requested) -'ipv4Address=1.1.1.1&ipv4Address=2.2.2.2' (multiple ipv4Address requested) +*ipv4Address=1.1.1.1* (single ipv4Address requested) +*ipv4Address=1.1.1.1&ipv4Address=2.2.2.2* (multiple ipv4Address requested) `, Type: schema.TypeString, Optional: true, }, "ipv6_address": &schema.Schema{ - Description: `ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*2001:db8*' or '2001:db8*' or '*2001:db8' + Description: `ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **2001:db8** or *2001:db8** or **2001:db8* Examples: -'ipv6Address=2001:db8:0:0:0:0:2:1' (single ipv6Address requested) -'ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348' (multiple ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1* (single ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348* (multiple ipv6Address requested) `, Type: schema.TypeString, Optional: true, }, "mac_address": &schema.Schema{ - Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) + Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) `, Type: schema.TypeString, Optional: true, }, "os_type": &schema.Schema{ - Description: `osType query parameter. Client device operating system type. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*iOS*' or 'iOS*' or '*iOS' Examples: -'osType=iOS' (single osType requested) -'osType=iOS&osType=Android' (multiple osType requested) + Description: `osType query parameter. Client device operating system type. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **iOS** or *iOS** or **iOS* Examples: +*osType=iOS* (single osType requested) +*osType=iOS&osType=Android* (multiple osType requested) `, Type: schema.TypeString, Optional: true, }, "os_version": &schema.Schema{ - Description: `osVersion query parameter. Client device operating system version This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*14.3*' or '14.3*' or '*14.3' Examples: -'osVersion=14.3' (single osVersion requested) -'osVersion=14.3&osVersion=10.1' (multiple osVersion requested) + Description: `osVersion query parameter. Client device operating system version This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **14.3** or *14.3** or **14.3* Examples: +*osVersion=14.3* (single osVersion requested) +*osVersion=14.3&osVersion=10.1* (multiple osVersion requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*BuildingName*' or 'BuildingName*' or '*BuildingName' Examples: 'siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) 'siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2' (multiple siteHierarchy requested) + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **BuildingName** or *BuildingName** or **BuildingName* Examples: *siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) *siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2* (multiple siteHierarchy requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard ('*') character-based search. Ex: '*buildingUuid*' or 'buildingUuid*' or '*buildingUuid' Examples: 'siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid' (single siteHierarchyId requested) 'siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2' (multiple siteHierarchyId requested) + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard (***) character-based search. Ex: **buildingUuid** or *buildingUuid** or **buildingUuid* Examples: *siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid* (single siteHierarchyId requested) *siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2* (multiple siteHierarchyId requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: 'siteId=floorUuid' (single siteId requested) 'siteId=floorUuid1&siteId=floorUuid2' (multiple siteId requested) + Description: `siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: *siteId=floorUuid* (single siteId requested) *siteId=floorUuid1&siteId=floorUuid2* (multiple siteId requested) `, Type: schema.TypeString, Optional: true, }, "ssid": &schema.Schema{ - Description: `ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*Alpha*' or 'Alpha*' or '*Alpha' + Description: `ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **Alpha** or *Alpha** or **Alpha* Examples: -'ssid=Alpha' (single ssid requested) -'ssid=Alpha&ssid=Guest' (multiple ssid requested) +*ssid=Alpha* (single ssid requested) +*ssid=Alpha&ssid=Guest* (multiple ssid requested) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -128,10 +128,10 @@ If 'startTime' is not provided, API will default to current time. Optional: true, }, "wlc_name": &schema.Schema{ - Description: `wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*wlc-25*' or 'wlc-25*' or '*wlc-25' + Description: `wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **wlc-25** or *wlc-25** or **wlc-25* Examples: -'wlcName=wlc-25' (single wlcName requested) -'wlcName=wlc-25&wlc-34' (multiple wlcName requested) +*wlcName=wlc-25* (single wlcName requested) +*wlcName=wlc-25&wlc-34* (multiple wlcName requested) `, Type: schema.TypeString, Optional: true, @@ -184,10 +184,10 @@ func dataSourceClientsCountRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheTotalCountOfClientsByApplyingBasicFiltering") + log.Printf("[DEBUG] Selected method: RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1") - headerParams1 := catalystcentersdkgo.RetrievesTheTotalCountOfClientsByApplyingBasicFilteringHeaderParams{} - queryParams1 := catalystcentersdkgo.RetrievesTheTotalCountOfClientsByApplyingBasicFilteringQueryParams{} + headerParams1 := catalystcentersdkgo.RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1HeaderParams{} + queryParams1 := catalystcentersdkgo.RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -236,24 +236,24 @@ func dataSourceClientsCountRead(ctx context.Context, d *schema.ResourceData, m i } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesTheTotalCountOfClientsByApplyingBasicFiltering(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Clients.RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheTotalCountOfClientsByApplyingBasicFiltering", err, - "Failure at RetrievesTheTotalCountOfClientsByApplyingBasicFiltering, unexpected response", "")) + "Failure when executing 2 RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1", err, + "Failure at RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenClientsRetrievesTheTotalCountOfClientsByApplyingBasicFilteringItem(response1.Response) + vItem1 := flattenClientsRetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheTotalCountOfClientsByApplyingBasicFiltering response", + "Failure when setting RetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1 response", err)) return diags } @@ -265,7 +265,7 @@ func dataSourceClientsCountRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenClientsRetrievesTheTotalCountOfClientsByApplyingBasicFilteringItem(item *catalystcentersdkgo.ResponseClientsRetrievesTheTotalCountOfClientsByApplyingBasicFilteringResponse) []map[string]interface{} { +func flattenClientsRetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1Item(item *catalystcentersdkgo.ResponseClientsRetrievesTheTotalCountOfClientsByApplyingBasicFilteringV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_compliance_device.go b/catalystcenter/data_source_compliance_device.go index c49bf6d..2971442 100644 --- a/catalystcenter/data_source_compliance_device.go +++ b/catalystcenter/data_source_compliance_device.go @@ -89,8 +89,8 @@ func dataSourceComplianceDeviceRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetComplianceStatus") - queryParams1 := catalystcentersdkgo.GetComplianceStatusQueryParams{} + log.Printf("[DEBUG] Selected method: GetComplianceStatusV1") + queryParams1 := catalystcentersdkgo.GetComplianceStatusV1QueryParams{} if okComplianceStatus { queryParams1.ComplianceStatus = vComplianceStatus.(string) @@ -99,24 +99,24 @@ func dataSourceComplianceDeviceRead(ctx context.Context, d *schema.ResourceData, queryParams1.DeviceUUID = vDeviceUUID.(string) } - response1, restyResp1, err := client.Compliance.GetComplianceStatus(&queryParams1) + response1, restyResp1, err := client.Compliance.GetComplianceStatusV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetComplianceStatus", err, - "Failure at GetComplianceStatus, unexpected response", "")) + "Failure when executing 2 GetComplianceStatusV1", err, + "Failure at GetComplianceStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenComplianceGetComplianceStatusItems(response1.Response) + vItems1 := flattenComplianceGetComplianceStatusV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetComplianceStatus response", + "Failure when setting GetComplianceStatusV1 response", err)) return diags } @@ -128,7 +128,7 @@ func dataSourceComplianceDeviceRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenComplianceGetComplianceStatusItems(items *[]catalystcentersdkgo.ResponseComplianceGetComplianceStatusResponse) []map[string]interface{} { +func flattenComplianceGetComplianceStatusV1Items(items *[]catalystcentersdkgo.ResponseComplianceGetComplianceStatusV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_compliance_device_by_id.go b/catalystcenter/data_source_compliance_device_by_id.go index a44e370..667d708 100644 --- a/catalystcenter/data_source_compliance_device_by_id.go +++ b/catalystcenter/data_source_compliance_device_by_id.go @@ -75,27 +75,27 @@ func dataSourceComplianceDeviceByIDRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: DeviceComplianceStatus") + log.Printf("[DEBUG] Selected method: DeviceComplianceStatusV1") vvDeviceUUID := vDeviceUUID.(string) - response1, restyResp1, err := client.Compliance.DeviceComplianceStatus(vvDeviceUUID) + response1, restyResp1, err := client.Compliance.DeviceComplianceStatusV1(vvDeviceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 DeviceComplianceStatus", err, - "Failure at DeviceComplianceStatus, unexpected response", "")) + "Failure when executing 2 DeviceComplianceStatusV1", err, + "Failure at DeviceComplianceStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenComplianceDeviceComplianceStatusItem(response1.Response) + vItem1 := flattenComplianceDeviceComplianceStatusV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeviceComplianceStatus response", + "Failure when setting DeviceComplianceStatusV1 response", err)) return diags } @@ -107,7 +107,7 @@ func dataSourceComplianceDeviceByIDRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenComplianceDeviceComplianceStatusItem(item *catalystcentersdkgo.ResponseComplianceDeviceComplianceStatusResponse) []map[string]interface{} { +func flattenComplianceDeviceComplianceStatusV1Item(item *catalystcentersdkgo.ResponseComplianceDeviceComplianceStatusV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_compliance_device_by_id_detail.go b/catalystcenter/data_source_compliance_device_by_id_detail.go index 567facd..cf828fe 100644 --- a/catalystcenter/data_source_compliance_device_by_id_detail.go +++ b/catalystcenter/data_source_compliance_device_by_id_detail.go @@ -21,13 +21,13 @@ func dataSourceComplianceDeviceByIDDetail() *schema.Resource { ReadContext: dataSourceComplianceDeviceByIDDetailRead, Schema: map[string]*schema.Schema{ "category": &schema.Schema{ - Description: `category query parameter. category can have any value among 'INTENT', 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'DESIGN_OOD' , 'EOX' , 'NETWORK_SETTINGS' + Description: `category query parameter. category can have any value among 'INTENT', 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'DESIGN_OOD' , 'EoX' , 'NETWORK_SETTINGS' `, Type: schema.TypeString, Optional: true, }, "compliance_type": &schema.Schema{ - Description: `complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EOX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. + Description: `complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EoX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. `, Type: schema.TypeString, Optional: true, @@ -59,7 +59,7 @@ func dataSourceComplianceDeviceByIDDetail() *schema.Resource { }, "compliance_type": &schema.Schema{ - Description: `Compliance type corresponds to a tile on the UI that will be one of NETWORK_PROFILE, IMAGE, APPLICATION_VISIBILITY, FABRIC, PSIRT, RUNNING_CONFIG, NETWORK_SETTINGS, WORKFLOW, or EOX. + Description: `Compliance type corresponds to a tile on the UI that will be one of NETWORK_PROFILE, IMAGE, APPLICATION_VISIBILITY, FABRIC, PSIRT, RUNNING_CONFIG, NETWORK_SETTINGS, WORKFLOW, or EoX. `, Type: schema.TypeString, Computed: true, @@ -289,7 +289,7 @@ func dataSourceComplianceDeviceByIDDetail() *schema.Resource { }, "op": &schema.Schema{ - Description: `Type of change (Add remove, or update). + Description: `Type of change (add, remove, or update). `, Type: schema.TypeString, Computed: true, @@ -380,9 +380,9 @@ func dataSourceComplianceDeviceByIDDetailRead(ctx context.Context, d *schema.Res selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ComplianceDetailsOfDevice") + log.Printf("[DEBUG] Selected method: ComplianceDetailsOfDeviceV1") vvDeviceUUID := vDeviceUUID.(string) - queryParams1 := catalystcentersdkgo.ComplianceDetailsOfDeviceQueryParams{} + queryParams1 := catalystcentersdkgo.ComplianceDetailsOfDeviceV1QueryParams{} if okCategory { queryParams1.Category = vCategory.(string) @@ -394,24 +394,24 @@ func dataSourceComplianceDeviceByIDDetailRead(ctx context.Context, d *schema.Res queryParams1.DiffList = vDiffList.(bool) } - response1, restyResp1, err := client.Compliance.ComplianceDetailsOfDevice(vvDeviceUUID, &queryParams1) + response1, restyResp1, err := client.Compliance.ComplianceDetailsOfDeviceV1(vvDeviceUUID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ComplianceDetailsOfDevice", err, - "Failure at ComplianceDetailsOfDevice, unexpected response", "")) + "Failure when executing 2 ComplianceDetailsOfDeviceV1", err, + "Failure at ComplianceDetailsOfDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenComplianceComplianceDetailsOfDeviceItems(response1.Response) + vItems1 := flattenComplianceComplianceDetailsOfDeviceV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ComplianceDetailsOfDevice response", + "Failure when setting ComplianceDetailsOfDeviceV1 response", err)) return diags } @@ -423,7 +423,7 @@ func dataSourceComplianceDeviceByIDDetailRead(ctx context.Context, d *schema.Res return diags } -func flattenComplianceComplianceDetailsOfDeviceItems(items *[]catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponse) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1Items(items *[]catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1Response) []map[string]interface{} { if items == nil { return nil } @@ -436,7 +436,7 @@ func flattenComplianceComplianceDetailsOfDeviceItems(items *[]catalystcentersdkg respItem["state"] = item.State respItem["last_sync_time"] = item.LastSyncTime respItem["last_update_time"] = item.LastUpdateTime - respItem["source_info_list"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoList(item.SourceInfoList) + respItem["source_info_list"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoList(item.SourceInfoList) respItem["ack_status"] = item.AckStatus respItem["version"] = item.Version respItems = append(respItems, respItem) @@ -444,7 +444,7 @@ func flattenComplianceComplianceDetailsOfDeviceItems(items *[]catalystcentersdkg return respItems } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoList(items *[]catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoList) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoList(items *[]catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoList) []map[string]interface{} { if items == nil { return nil } @@ -458,22 +458,22 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoList(items *[]cata respItem["app_name"] = item.AppName respItem["count"] = item.Count respItem["ack_status"] = item.AckStatus - respItem["business_key"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKey(item.BusinessKey) - respItem["diff_list"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListDiffList(item.DiffList) + respItem["business_key"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKey(item.BusinessKey) + respItem["diff_list"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListDiffList(item.DiffList) respItem["display_name"] = item.DisplayName respItems = append(respItems, respItem) } return respItems } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKey(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoListBusinessKey) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKey(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoListBusinessKey) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["resource_name"] = item.ResourceName - respItem["business_key_attributes"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyBusinessKeyAttributes(item.BusinessKeyAttributes) - respItem["other_attributes"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyOtherAttributes(item.OtherAttributes) + respItem["business_key_attributes"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKeyBusinessKeyAttributes(item.BusinessKeyAttributes) + respItem["other_attributes"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKeyOtherAttributes(item.OtherAttributes) return []map[string]interface{}{ respItem, @@ -481,7 +481,7 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKey(it } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyBusinessKeyAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoListBusinessKeyBusinessKeyAttributes) interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKeyBusinessKeyAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoListBusinessKeyBusinessKeyAttributes) interface{} { if item == nil { return nil } @@ -491,13 +491,13 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyBus } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyOtherAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoListBusinessKeyOtherAttributes) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKeyOtherAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoListBusinessKeyOtherAttributes) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["cfs_attributes"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyOtherAttributesCfsAttributes(item.CfsAttributes) + respItem["cfs_attributes"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKeyOtherAttributesCfsAttributes(item.CfsAttributes) return []map[string]interface{}{ respItem, @@ -505,7 +505,7 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyOth } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyOtherAttributesCfsAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoListBusinessKeyOtherAttributesCfsAttributes) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListBusinessKeyOtherAttributesCfsAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoListBusinessKeyOtherAttributesCfsAttributes) []map[string]interface{} { if item == nil { return nil } @@ -522,7 +522,7 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListBusinessKeyOth } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListDiffList(items *[]catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoListDiffList) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListDiffList(items *[]catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoListDiffList) []map[string]interface{} { if items == nil { return nil } @@ -535,7 +535,7 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListDiffList(items respItem["move_from_path"] = item.MoveFromPath respItem["business_key"] = item.BusinessKey respItem["path"] = item.Path - respItem["extended_attributes"] = flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListDiffListExtendedAttributes(item.ExtendedAttributes) + respItem["extended_attributes"] = flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListDiffListExtendedAttributes(item.ExtendedAttributes) respItem["ack_status"] = item.AckStatus respItem["instance_uui_d"] = item.InstanceUUID respItem["display_name"] = item.DisplayName @@ -544,7 +544,7 @@ func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListDiffList(items return respItems } -func flattenComplianceComplianceDetailsOfDeviceItemsSourceInfoListDiffListExtendedAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceResponseSourceInfoListDiffListExtendedAttributes) []map[string]interface{} { +func flattenComplianceComplianceDetailsOfDeviceV1ItemsSourceInfoListDiffListExtendedAttributes(item *catalystcentersdkgo.ResponseComplianceComplianceDetailsOfDeviceV1ResponseSourceInfoListDiffListExtendedAttributes) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_compliance_device_details.go b/catalystcenter/data_source_compliance_device_details.go index 5ed4a36..d635eeb 100644 --- a/catalystcenter/data_source_compliance_device_details.go +++ b/catalystcenter/data_source_compliance_device_details.go @@ -27,7 +27,7 @@ func dataSourceComplianceDeviceDetails() *schema.Resource { Optional: true, }, "compliance_type": &schema.Schema{ - Description: `complianceType query parameter. Specify "Compliance type(s)" in commas. The Compliance type can be 'NETWORK_PROFILE', 'IMAGE', 'FABRIC', 'APPLICATION_VISIBILITY', 'FABRIC', RUNNING_CONFIG', 'NETWORK_SETTINGS', 'WORKFLOW' , 'EOX'. + Description: `complianceType query parameter. Specify "Compliance type(s)" in commas. The Compliance type can be 'NETWORK_PROFILE', 'IMAGE', 'FABRIC', 'APPLICATION_VISIBILITY', 'FABRIC', RUNNING_CONFIG', 'NETWORK_SETTINGS', 'WORKFLOW' , 'EoX'. `, Type: schema.TypeString, Optional: true, @@ -58,14 +58,14 @@ func dataSourceComplianceDeviceDetails() *schema.Resource { Schema: map[string]*schema.Schema{ "category": &schema.Schema{ - Description: `category can have any value among 'INTENT'(mapped to compliance types: NETWORK_SETTINGS,NETWORK_PROFILEWORKFLOW,FABRIC,APPLICATION_VISIBILITY), 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'EOX' , 'NETWORK_SETTINGS'. + Description: `category can have any value among 'INTENT'(mapped to compliance types: NETWORK_SETTINGS,NETWORK_PROFILE,WORKFLOW,FABRIC,APPLICATION_VISIBILITY), 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'EoX' , 'NETWORK_SETTINGS'. `, Type: schema.TypeString, Computed: true, }, "compliance_type": &schema.Schema{ - Description: `Compliance type corresponds to a tile on the UI. Will be one of NETWORK_PROFILE, IMAGE, APPLICATION_VISIBILITY, FABRIC, PSIRT, RUNNING_CONFIG, NETWORK_SETTINGS, WORKFLOW, or EOX. + Description: `Compliance type corresponds to a tile on the UI. Will be one of NETWORK_PROFILE, IMAGE, APPLICATION_VISIBILITY, FABRIC, PSIRT, RUNNING_CONFIG, NETWORK_SETTINGS, WORKFLOW, or EoX. `, Type: schema.TypeString, Computed: true, @@ -131,8 +131,8 @@ func dataSourceComplianceDeviceDetailsRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetComplianceDetail") - queryParams1 := catalystcentersdkgo.GetComplianceDetailQueryParams{} + log.Printf("[DEBUG] Selected method: GetComplianceDetailV1") + queryParams1 := catalystcentersdkgo.GetComplianceDetailV1QueryParams{} if okComplianceType { queryParams1.ComplianceType = vComplianceType.(string) @@ -150,24 +150,24 @@ func dataSourceComplianceDeviceDetailsRead(ctx context.Context, d *schema.Resour queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Compliance.GetComplianceDetail(&queryParams1) + response1, restyResp1, err := client.Compliance.GetComplianceDetailV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetComplianceDetail", err, - "Failure at GetComplianceDetail, unexpected response", "")) + "Failure when executing 2 GetComplianceDetailV1", err, + "Failure at GetComplianceDetailV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenComplianceGetComplianceDetailItems(response1.Response) + vItems1 := flattenComplianceGetComplianceDetailV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetComplianceDetail response", + "Failure when setting GetComplianceDetailV1 response", err)) return diags } @@ -179,7 +179,7 @@ func dataSourceComplianceDeviceDetailsRead(ctx context.Context, d *schema.Resour return diags } -func flattenComplianceGetComplianceDetailItems(items *[]catalystcentersdkgo.ResponseComplianceGetComplianceDetailResponse) []map[string]interface{} { +func flattenComplianceGetComplianceDetailV1Items(items *[]catalystcentersdkgo.ResponseComplianceGetComplianceDetailV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_compliance_device_details_count.go b/catalystcenter/data_source_compliance_device_details_count.go index 4a5a0eb..1ae5172 100644 --- a/catalystcenter/data_source_compliance_device_details_count.go +++ b/catalystcenter/data_source_compliance_device_details_count.go @@ -27,7 +27,7 @@ func dataSourceComplianceDeviceDetailsCount() *schema.Resource { Optional: true, }, "compliance_type": &schema.Schema{ - Description: `complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EOX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. + Description: `complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EoX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. `, Type: schema.TypeString, Optional: true, @@ -68,8 +68,8 @@ func dataSourceComplianceDeviceDetailsCountRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetComplianceDetailCount") - queryParams1 := catalystcentersdkgo.GetComplianceDetailCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetComplianceDetailCountV1") + queryParams1 := catalystcentersdkgo.GetComplianceDetailCountV1QueryParams{} if okComplianceType { queryParams1.ComplianceType = vComplianceType.(string) @@ -78,24 +78,24 @@ func dataSourceComplianceDeviceDetailsCountRead(ctx context.Context, d *schema.R queryParams1.ComplianceStatus = vComplianceStatus.(string) } - response1, restyResp1, err := client.Compliance.GetComplianceDetailCount(&queryParams1) + response1, restyResp1, err := client.Compliance.GetComplianceDetailCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetComplianceDetailCount", err, - "Failure at GetComplianceDetailCount, unexpected response", "")) + "Failure when executing 2 GetComplianceDetailCountV1", err, + "Failure at GetComplianceDetailCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenComplianceGetComplianceDetailCountItem(response1) + vItem1 := flattenComplianceGetComplianceDetailCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetComplianceDetailCount response", + "Failure when setting GetComplianceDetailCountV1 response", err)) return diags } @@ -107,7 +107,7 @@ func dataSourceComplianceDeviceDetailsCountRead(ctx context.Context, d *schema.R return diags } -func flattenComplianceGetComplianceDetailCountItem(item *catalystcentersdkgo.ResponseComplianceGetComplianceDetailCount) []map[string]interface{} { +func flattenComplianceGetComplianceDetailCountV1Item(item *catalystcentersdkgo.ResponseComplianceGetComplianceDetailCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_compliance_device_status_count.go b/catalystcenter/data_source_compliance_device_status_count.go index e9346ec..aad240c 100644 --- a/catalystcenter/data_source_compliance_device_status_count.go +++ b/catalystcenter/data_source_compliance_device_status_count.go @@ -61,31 +61,31 @@ func dataSourceComplianceDeviceStatusCountRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetComplianceStatusCount") - queryParams1 := catalystcentersdkgo.GetComplianceStatusCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetComplianceStatusCountV1") + queryParams1 := catalystcentersdkgo.GetComplianceStatusCountV1QueryParams{} if okComplianceStatus { queryParams1.ComplianceStatus = vComplianceStatus.(string) } - response1, restyResp1, err := client.Compliance.GetComplianceStatusCount(&queryParams1) + response1, restyResp1, err := client.Compliance.GetComplianceStatusCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetComplianceStatusCount", err, - "Failure at GetComplianceStatusCount, unexpected response", "")) + "Failure when executing 2 GetComplianceStatusCountV1", err, + "Failure at GetComplianceStatusCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenComplianceGetComplianceStatusCountItem(response1) + vItem1 := flattenComplianceGetComplianceStatusCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetComplianceStatusCount response", + "Failure when setting GetComplianceStatusCountV1 response", err)) return diags } @@ -97,7 +97,7 @@ func dataSourceComplianceDeviceStatusCountRead(ctx context.Context, d *schema.Re return diags } -func flattenComplianceGetComplianceStatusCountItem(item *catalystcentersdkgo.ResponseComplianceGetComplianceStatusCount) []map[string]interface{} { +func flattenComplianceGetComplianceStatusCountV1Item(item *catalystcentersdkgo.ResponseComplianceGetComplianceStatusCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_configuration_template.go b/catalystcenter/data_source_configuration_template.go index 8642aed..d2d048b 100644 --- a/catalystcenter/data_source_configuration_template.go +++ b/catalystcenter/data_source_configuration_template.go @@ -1367,8 +1367,8 @@ func dataSourceConfigurationTemplateRead(ctx context.Context, d *schema.Resource selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsTheTemplatesAvailable") - queryParams1 := catalystcentersdkgo.GetsTheTemplatesAvailableQueryParams{} + log.Printf("[DEBUG] Selected method: GetsTheTemplatesAvailableV1") + queryParams1 := catalystcentersdkgo.GetsTheTemplatesAvailableV1QueryParams{} if okProjectID { queryParams1.ProjectID = vProjectID.(string) @@ -1404,24 +1404,24 @@ func dataSourceConfigurationTemplateRead(ctx context.Context, d *schema.Resource queryParams1.SortOrder = vSortOrder.(string) } - response1, restyResp1, err := client.ConfigurationTemplates.GetsTheTemplatesAvailable(&queryParams1) + response1, restyResp1, err := client.ConfigurationTemplates.GetsTheTemplatesAvailableV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsTheTemplatesAvailable", err, - "Failure at GetsTheTemplatesAvailable, unexpected response", "")) + "Failure when executing 2 GetsTheTemplatesAvailableV1", err, + "Failure at GetsTheTemplatesAvailableV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenConfigurationTemplatesGetsTheTemplatesAvailableItems(response1) + vItems1 := flattenConfigurationTemplatesGetsTheTemplatesAvailableV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheTemplatesAvailable response", + "Failure when setting GetsTheTemplatesAvailableV1 response", err)) return diags } @@ -1431,32 +1431,32 @@ func dataSourceConfigurationTemplateRead(ctx context.Context, d *schema.Resource } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetsDetailsOfAGivenTemplate") + log.Printf("[DEBUG] Selected method: GetsDetailsOfAGivenTemplateV1") vvTemplateID := vTemplateID.(string) - queryParams2 := catalystcentersdkgo.GetsDetailsOfAGivenTemplateQueryParams{} + queryParams2 := catalystcentersdkgo.GetsDetailsOfAGivenTemplateV1QueryParams{} if okLatestVersion { queryParams2.LatestVersion = vLatestVersion.(bool) } - response2, restyResp2, err := client.ConfigurationTemplates.GetsDetailsOfAGivenTemplate(vvTemplateID, &queryParams2) + response2, restyResp2, err := client.ConfigurationTemplates.GetsDetailsOfAGivenTemplateV1(vvTemplateID, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsDetailsOfAGivenTemplate", err, - "Failure at GetsDetailsOfAGivenTemplate, unexpected response", "")) + "Failure when executing 2 GetsDetailsOfAGivenTemplateV1", err, + "Failure at GetsDetailsOfAGivenTemplateV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItem(response2) + vItem2 := flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetsDetailsOfAGivenTemplate response", + "Failure when setting GetsDetailsOfAGivenTemplateV1 response", err)) return diags } @@ -1468,7 +1468,7 @@ func dataSourceConfigurationTemplateRead(ctx context.Context, d *schema.Resource return diags } -func flattenConfigurationTemplatesGetsTheTemplatesAvailableItems(items *catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheTemplatesAvailable) []map[string]interface{} { +func flattenConfigurationTemplatesGetsTheTemplatesAvailableV1Items(items *catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheTemplatesAvailableV1) []map[string]interface{} { if items == nil { return nil } @@ -1480,13 +1480,13 @@ func flattenConfigurationTemplatesGetsTheTemplatesAvailableItems(items *catalyst respItem["project_id"] = item.ProjectID respItem["project_name"] = item.ProjectName respItem["template_id"] = item.TemplateID - respItem["versions_info"] = flattenConfigurationTemplatesGetsTheTemplatesAvailableItemsVersionsInfo(item.VersionsInfo) + respItem["versions_info"] = flattenConfigurationTemplatesGetsTheTemplatesAvailableV1ItemsVersionsInfo(item.VersionsInfo) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsTheTemplatesAvailableItemsVersionsInfo(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsTheTemplatesAvailableVersionsInfo) []map[string]interface{} { +func flattenConfigurationTemplatesGetsTheTemplatesAvailableV1ItemsVersionsInfo(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsTheTemplatesAvailableV1VersionsInfo) []map[string]interface{} { if items == nil { return nil } @@ -1504,19 +1504,19 @@ func flattenConfigurationTemplatesGetsTheTemplatesAvailableItemsVersionsInfo(ite return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplate) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["tags"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTags(item.Tags) + respItem["tags"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTags(item.Tags) respItem["author"] = item.Author respItem["composite"] = boolPtrToString(item.Composite) - respItem["containing_templates"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplates(item.ContainingTemplates) + respItem["containing_templates"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplates(item.ContainingTemplates) respItem["create_time"] = item.CreateTime respItem["custom_params_order"] = boolPtrToString(item.CustomParamsOrder) respItem["description"] = item.Description - respItem["device_types"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemDeviceTypes(item.DeviceTypes) + respItem["device_types"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemDeviceTypes(item.DeviceTypes) respItem["failure_policy"] = item.FailurePolicy respItem["id"] = item.ID respItem["language"] = item.Language @@ -1527,20 +1527,20 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItem(item *catalyst respItem["project_id"] = item.ProjectID respItem["project_name"] = item.ProjectName respItem["rollback_template_content"] = item.RollbackTemplateContent - respItem["rollback_template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParams(item.RollbackTemplateParams) + respItem["rollback_template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParams(item.RollbackTemplateParams) respItem["software_type"] = item.SoftwareType respItem["software_variant"] = item.SoftwareVariant respItem["software_version"] = item.SoftwareVersion respItem["template_content"] = item.TemplateContent - respItem["template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParams(item.TemplateParams) - respItem["validation_errors"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationErrors(item.ValidationErrors) + respItem["template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParams(item.TemplateParams) + respItem["validation_errors"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemValidationErrors(item.ValidationErrors) respItem["version"] = item.Version return []map[string]interface{}{ respItem, } } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1Tags) []map[string]interface{} { if items == nil { return nil } @@ -1554,31 +1554,31 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTags(items *[]c return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplates(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplates) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplates(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplates) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["tags"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTags(item.Tags) + respItem["tags"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTags(item.Tags) respItem["composite"] = boolPtrToString(item.Composite) respItem["description"] = item.Description - respItem["device_types"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesDeviceTypes(item.DeviceTypes) + respItem["device_types"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesDeviceTypes(item.DeviceTypes) respItem["id"] = item.ID respItem["language"] = item.Language respItem["name"] = item.Name respItem["project_name"] = item.ProjectName - respItem["rollback_template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParams(item.RollbackTemplateParams) + respItem["rollback_template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParams(item.RollbackTemplateParams) respItem["template_content"] = item.TemplateContent - respItem["template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParams(item.TemplateParams) + respItem["template_params"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParams(item.TemplateParams) respItem["version"] = item.Version respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesTags) []map[string]interface{} { if items == nil { return nil } @@ -1592,7 +1592,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesDeviceTypes) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesDeviceTypes) []map[string]interface{} { if items == nil { return nil } @@ -1607,7 +1607,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesRollbackTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesRollbackTemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1629,15 +1629,15 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesRollbackTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesRollbackTemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1652,7 +1652,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesRollbackTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesRollbackTemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1660,7 +1660,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1668,7 +1668,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1678,7 +1678,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesTemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1700,15 +1700,15 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesTemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1723,7 +1723,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesTemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1731,7 +1731,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1739,7 +1739,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTemplatesTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateContainingTemplatesTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemContainingTemplatesTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1749,7 +1749,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemContainingTempl } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateDeviceTypes) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1DeviceTypes) []map[string]interface{} { if items == nil { return nil } @@ -1764,7 +1764,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemDeviceTypes(ite return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateRollbackTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1RollbackTemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1786,15 +1786,15 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplat respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateRollbackTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1RollbackTemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1809,7 +1809,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplat return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateRollbackTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1RollbackTemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1817,7 +1817,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplat respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1825,7 +1825,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplat } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateRollbackTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1RollbackTemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1835,7 +1835,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemRollbackTemplat } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1TemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1857,15 +1857,15 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParams( respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1TemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1880,7 +1880,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsR return respItems } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1TemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1888,7 +1888,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsS respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1896,7 +1896,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsS } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1TemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1906,13 +1906,13 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemTemplateParamsS } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateValidationErrors) []map[string]interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemValidationErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ValidationErrors) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["rollback_template_errors"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationErrorsRollbackTemplateErrors(item.RollbackTemplateErrors) - respItem["template_errors"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationErrorsTemplateErrors(item.TemplateErrors) + respItem["rollback_template_errors"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemValidationErrorsRollbackTemplateErrors(item.RollbackTemplateErrors) + respItem["template_errors"] = flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemValidationErrorsTemplateErrors(item.TemplateErrors) respItem["template_id"] = item.TemplateID respItem["template_version"] = item.TemplateVersion @@ -1922,7 +1922,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationError } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationErrorsRollbackTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateValidationErrorsRollbackTemplateErrors) interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemValidationErrorsRollbackTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ValidationErrorsRollbackTemplateErrors) interface{} { if item == nil { return nil } @@ -1932,7 +1932,7 @@ func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationError } -func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItemValidationErrorsTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateValidationErrorsTemplateErrors) interface{} { +func flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ItemValidationErrorsTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplateV1ValidationErrorsTemplateErrors) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_configuration_template_deploy_status.go b/catalystcenter/data_source_configuration_template_deploy_status.go index c5d46ec..6961636 100644 --- a/catalystcenter/data_source_configuration_template_deploy_status.go +++ b/catalystcenter/data_source_configuration_template_deploy_status.go @@ -196,27 +196,27 @@ func dataSourceConfigurationTemplateDeployStatusRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: StatusOfTemplateDeployment") + log.Printf("[DEBUG] Selected method: StatusOfTemplateDeploymentV1") vvDeploymentID := vDeploymentID.(string) - response1, restyResp1, err := client.ConfigurationTemplates.StatusOfTemplateDeployment(vvDeploymentID) + response1, restyResp1, err := client.ConfigurationTemplates.StatusOfTemplateDeploymentV1(vvDeploymentID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 StatusOfTemplateDeployment", err, - "Failure at StatusOfTemplateDeployment, unexpected response", "")) + "Failure when executing 2 StatusOfTemplateDeploymentV1", err, + "Failure at StatusOfTemplateDeploymentV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenConfigurationTemplatesStatusOfTemplateDeploymentItem(response1) + vItem1 := flattenConfigurationTemplatesStatusOfTemplateDeploymentV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting StatusOfTemplateDeployment response", + "Failure when setting StatusOfTemplateDeploymentV1 response", err)) return diags } @@ -227,3 +227,46 @@ func dataSourceConfigurationTemplateDeployStatusRead(ctx context.Context, d *sch } return diags } + +func flattenConfigurationTemplatesStatusOfTemplateDeploymentV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesStatusOfTemplateDeploymentV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["deployment_id"] = item.DeploymentID + respItem["deployment_name"] = item.DeploymentName + respItem["devices"] = flattenConfigurationTemplatesStatusOfTemplateDeploymentV1ItemDevices(item.Devices) + respItem["duration"] = item.Duration + respItem["end_time"] = item.EndTime + respItem["project_name"] = item.ProjectName + respItem["start_time"] = item.StartTime + respItem["status"] = item.Status + respItem["status_message"] = item.StatusMessage + respItem["template_name"] = item.TemplateName + respItem["template_version"] = item.TemplateVersion + return []map[string]interface{}{ + respItem, + } +} + +func flattenConfigurationTemplatesStatusOfTemplateDeploymentV1ItemDevices(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesStatusOfTemplateDeploymentV1Devices) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["detailed_status_message"] = item.DetailedStatusMessage + respItem["device_id"] = item.DeviceID + respItem["duration"] = item.Duration + respItem["end_time"] = item.EndTime + respItem["identifier"] = item.IDentifier + respItem["ip_address"] = item.IPAddress + respItem["name"] = item.Name + respItem["start_time"] = item.StartTime + respItem["status"] = item.Status + respItem["target_type"] = item.TargetType + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_configuration_template_project.go b/catalystcenter/data_source_configuration_template_project.go index bdf16d0..ffb01f0 100644 --- a/catalystcenter/data_source_configuration_template_project.go +++ b/catalystcenter/data_source_configuration_template_project.go @@ -2469,8 +2469,8 @@ func dataSourceConfigurationTemplateProjectRead(ctx context.Context, d *schema.R selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsAListOfProjects") - queryParams1 := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + log.Printf("[DEBUG] Selected method: GetsAListOfProjectsV1") + queryParams1 := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -2479,24 +2479,24 @@ func dataSourceConfigurationTemplateProjectRead(ctx context.Context, d *schema.R queryParams1.SortOrder = vSortOrder.(string) } - response1, restyResp1, err := client.ConfigurationTemplates.GetsAListOfProjects(&queryParams1) + response1, restyResp1, err := client.ConfigurationTemplates.GetsAListOfProjectsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsAListOfProjects", err, - "Failure at GetsAListOfProjects, unexpected response", "")) + "Failure when executing 2 GetsAListOfProjectsV1", err, + "Failure at GetsAListOfProjectsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenConfigurationTemplatesGetsAListOfProjectsItems(response1) + vItems1 := flattenConfigurationTemplatesGetsAListOfProjectsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsAListOfProjects response", + "Failure when setting GetsAListOfProjectsV1 response", err)) return diags } @@ -2506,18 +2506,18 @@ func dataSourceConfigurationTemplateProjectRead(ctx context.Context, d *schema.R } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetsTheDetailsOfAGivenProject") + log.Printf("[DEBUG] Selected method: GetsTheDetailsOfAGivenProjectV1") vvProjectID := vProjectID.(string) - response2, restyResp2, err := client.ConfigurationTemplates.GetsTheDetailsOfAGivenProject(vvProjectID) + response2, restyResp2, err := client.ConfigurationTemplates.GetsTheDetailsOfAGivenProjectV1(vvProjectID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsTheDetailsOfAGivenProject", err, - "Failure at GetsTheDetailsOfAGivenProject, unexpected response", "")) + "Failure when executing 2 GetsTheDetailsOfAGivenProjectV1", err, + "Failure at GetsTheDetailsOfAGivenProjectV1, unexpected response", "")) return diags } @@ -2526,7 +2526,7 @@ func dataSourceConfigurationTemplateProjectRead(ctx context.Context, d *schema.R vItem2 := flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItem(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheDetailsOfAGivenProject response", + "Failure when setting GetsTheDetailsOfAGivenProjectV1 response", err)) return diags } @@ -2538,14 +2538,14 @@ func dataSourceConfigurationTemplateProjectRead(ctx context.Context, d *schema.R return diags } -func flattenConfigurationTemplatesGetsAListOfProjectsItems(items *catalystcentersdkgo.ResponseConfigurationTemplatesGetsAListOfProjects) []map[string]interface{} { +func flattenConfigurationTemplatesGetsAListOfProjectsV1Items(items *catalystcentersdkgo.ResponseConfigurationTemplatesGetsAListOfProjectsV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["tags"] = flattenConfigurationTemplatesGetsAListOfProjectsItemsTags(item.Tags) + respItem["tags"] = flattenConfigurationTemplatesGetsAListOfProjectsV1ItemsTags(item.Tags) respItem["create_time"] = item.CreateTime respItem["description"] = item.Description respItem["id"] = item.ID @@ -2557,7 +2557,7 @@ func flattenConfigurationTemplatesGetsAListOfProjectsItems(items *catalystcenter return respItems } -func flattenConfigurationTemplatesGetsAListOfProjectsItemsTags(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetsAListOfProjectsV1ItemsTags(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1Tags) []map[string]interface{} { if items == nil { return nil } @@ -2571,7 +2571,7 @@ func flattenConfigurationTemplatesGetsAListOfProjectsItemsTags(items *[]catalyst return respItems } -func flattenConfigurationTemplatesGetsAListOfProjectsItemsTemplates(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsTemplates) []map[string]interface{} { +func flattenConfigurationTemplatesGetsAListOfProjectsItemsTemplates(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1Templates) []map[string]interface{} { if items == nil { return nil } @@ -3011,12 +3011,12 @@ func flattenConfigurationTemplatesGetsAListOfProjectsItemsTemplatesValidationErr } -func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheDetailsOfAGivenProject) []map[string]interface{} { +func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheDetailsOfAGivenProjectV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["tags"] = flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItemTags(item.Tags) + respItem["tags"] = flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectV1ItemTags(item.Tags) respItem["create_time"] = item.CreateTime respItem["description"] = item.Description respItem["id"] = item.ID @@ -3028,7 +3028,7 @@ func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItem(item *cataly } } -func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheDetailsOfAGivenProjectTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectV1ItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheDetailsOfAGivenProjectV1Tags) []map[string]interface{} { if items == nil { return nil } @@ -3042,7 +3042,7 @@ func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItemTags(items *[ return respItems } -func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItemTemplates(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheDetailsOfAGivenProjectTemplates) []map[string]interface{} { +func flattenConfigurationTemplatesGetsTheDetailsOfAGivenProjectItemTemplates(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetsTheDetailsOfAGivenProjectV1Templates) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_configuration_template_version.go b/catalystcenter/data_source_configuration_template_version.go index 5ed8844..00080f6 100644 --- a/catalystcenter/data_source_configuration_template_version.go +++ b/catalystcenter/data_source_configuration_template_version.go @@ -134,27 +134,27 @@ func dataSourceConfigurationTemplateVersionRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsAllTheVersionsOfAGivenTemplate") + log.Printf("[DEBUG] Selected method: GetsAllTheVersionsOfAGivenTemplateV1") vvTemplateID := vTemplateID.(string) - response1, restyResp1, err := client.ConfigurationTemplates.GetsAllTheVersionsOfAGivenTemplate(vvTemplateID) + response1, restyResp1, err := client.ConfigurationTemplates.GetsAllTheVersionsOfAGivenTemplateV1(vvTemplateID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsAllTheVersionsOfAGivenTemplate", err, - "Failure at GetsAllTheVersionsOfAGivenTemplate, unexpected response", "")) + "Failure when executing 2 GetsAllTheVersionsOfAGivenTemplateV1", err, + "Failure at GetsAllTheVersionsOfAGivenTemplateV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateItems(response1) + vItems1 := flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsAllTheVersionsOfAGivenTemplate response", + "Failure when setting GetsAllTheVersionsOfAGivenTemplateV1 response", err)) return diags } @@ -166,7 +166,7 @@ func dataSourceConfigurationTemplateVersionRead(ctx context.Context, d *schema.R return diags } -func flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateItems(items *catalystcentersdkgo.ResponseConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplate) []map[string]interface{} { +func flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateV1Items(items *catalystcentersdkgo.ResponseConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateV1) []map[string]interface{} { if items == nil { return nil } @@ -178,13 +178,13 @@ func flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateItems(items respItem["project_id"] = item.ProjectID respItem["project_name"] = item.ProjectName respItem["template_id"] = item.TemplateID - respItem["versions_info"] = flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateItemsVersionsInfo(item.VersionsInfo) + respItem["versions_info"] = flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateV1ItemsVersionsInfo(item.VersionsInfo) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateItemsVersionsInfo(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateVersionsInfo) []map[string]interface{} { +func flattenConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateV1ItemsVersionsInfo(items *[]catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAllTheVersionsOfAGivenTemplateV1VersionsInfo) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_custom_issue_definitions.go b/catalystcenter/data_source_custom_issue_definitions.go index ef2c890..e96b8b8 100644 --- a/catalystcenter/data_source_custom_issue_definitions.go +++ b/catalystcenter/data_source_custom_issue_definitions.go @@ -251,8 +251,8 @@ func dataSourceCustomIssueDefinitionsRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters") - queryParams1 := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersQueryParams{} + log.Printf("[DEBUG] Selected method: GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1") + queryParams1 := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -291,24 +291,24 @@ func dataSourceCustomIssueDefinitionsRead(ctx context.Context, d *schema.Resourc queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.Issues.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(&queryParams1) + response1, restyResp1, err := client.Issues.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters", err, - "Failure at GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters, unexpected response", "")) + "Failure when executing 2 GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1", err, + "Failure at GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItems(response1.Response) + vItems1 := flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters response", + "Failure when setting GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1 response", err)) return diags } @@ -320,7 +320,7 @@ func dataSourceCustomIssueDefinitionsRead(ctx context.Context, d *schema.Resourc return diags } -func flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItems(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersResponse) []map[string]interface{} { +func flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Items(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Response) []map[string]interface{} { if items == nil { return nil } @@ -332,7 +332,7 @@ func flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItems(ite respItem["description"] = item.Description respItem["profile_id"] = item.ProfileID respItem["trigger_id"] = item.TriggerID - respItem["rules"] = flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItemsRules(item.Rules) + respItem["rules"] = flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1ItemsRules(item.Rules) respItem["is_enabled"] = boolPtrToString(item.IsEnabled) respItem["priority"] = item.Priority respItem["is_deletable"] = boolPtrToString(item.IsDeletable) @@ -344,7 +344,7 @@ func flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItems(ite return respItems } -func flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItemsRules(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersResponseRules) []map[string]interface{} { +func flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1ItemsRules(items *[]catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1ResponseRules) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_custom_issue_definitions_count.go b/catalystcenter/data_source_custom_issue_definitions_count.go index ed1667d..67da868 100644 --- a/catalystcenter/data_source_custom_issue_definitions_count.go +++ b/catalystcenter/data_source_custom_issue_definitions_count.go @@ -112,10 +112,10 @@ func dataSourceCustomIssueDefinitionsCountRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFilters") + log.Printf("[DEBUG] Selected method: GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1") - headerParams1 := catalystcentersdkgo.GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersHeaderParams{} - queryParams1 := catalystcentersdkgo.GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersQueryParams{} + headerParams1 := catalystcentersdkgo.GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1HeaderParams{} + queryParams1 := catalystcentersdkgo.GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -143,24 +143,24 @@ func dataSourceCustomIssueDefinitionsCountRead(ctx context.Context, d *schema.Re } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFilters(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Issues.GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFilters", err, - "Failure at GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFilters, unexpected response", "")) + "Failure when executing 2 GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1", err, + "Failure at GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenIssuesGetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersItem(response1.Response) + vItem1 := flattenIssuesGetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFilters response", + "Failure when setting GetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1 response", err)) return diags } @@ -172,7 +172,7 @@ func dataSourceCustomIssueDefinitionsCountRead(ctx context.Context, d *schema.Re return diags } -func flattenIssuesGetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersItem(item *catalystcentersdkgo.ResponseIssuesGetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersResponse) []map[string]interface{} { +func flattenIssuesGetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1Item(item *catalystcentersdkgo.ResponseIssuesGetTheTotalCustomIssueDefinitionsCountBasedOnTheProvidedFiltersV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_deploy_template.go b/catalystcenter/data_source_deploy_template.go index eca8d94..ac3d152 100644 --- a/catalystcenter/data_source_deploy_template.go +++ b/catalystcenter/data_source_deploy_template.go @@ -228,7 +228,7 @@ func dataSourceDeployTemplateRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenConfigurationTemplatesStatusOfTemplateDeploymentItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesStatusOfTemplateDeployment) []map[string]interface{} { +func flattenConfigurationTemplatesStatusOfTemplateDeploymentItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesStatusOfTemplateDeploymentV1) []map[string]interface{} { if item == nil { return nil } @@ -249,7 +249,7 @@ func flattenConfigurationTemplatesStatusOfTemplateDeploymentItem(item *catalystc } } -func flattenConfigurationTemplatesStatusOfTemplateDeploymentItemDevices(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesStatusOfTemplateDeploymentDevices) []map[string]interface{} { +func flattenConfigurationTemplatesStatusOfTemplateDeploymentItemDevices(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesStatusOfTemplateDeploymentV1Devices) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_device_credential.go b/catalystcenter/data_source_device_credential.go index 4450431..e140b0c 100644 --- a/catalystcenter/data_source_device_credential.go +++ b/catalystcenter/data_source_device_credential.go @@ -435,31 +435,31 @@ func dataSourceDeviceCredentialRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceCredentialDetails") - queryParams1 := catalystcentersdkgo.GetDeviceCredentialDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceCredentialDetailsV1") + queryParams1 := catalystcentersdkgo.GetDeviceCredentialDetailsV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) } - response1, restyResp1, err := client.NetworkSettings.GetDeviceCredentialDetails(&queryParams1) + response1, restyResp1, err := client.NetworkSettings.GetDeviceCredentialDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceCredentialDetails", err, - "Failure at GetDeviceCredentialDetails, unexpected response", "")) + "Failure when executing 2 GetDeviceCredentialDetailsV1", err, + "Failure at GetDeviceCredentialDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsGetDeviceCredentialDetailsItem(response1) + vItem1 := flattenNetworkSettingsGetDeviceCredentialDetailsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceCredentialDetails response", + "Failure when setting GetDeviceCredentialDetailsV1 response", err)) return diags } @@ -471,23 +471,23 @@ func dataSourceDeviceCredentialRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenNetworkSettingsGetDeviceCredentialDetailsItem(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetails) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["snmp_v3"] = flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV3(item.SNMPV3) - respItem["http_read"] = flattenNetworkSettingsGetDeviceCredentialDetailsItemHTTPRead(item.HTTPRead) - respItem["http_write"] = flattenNetworkSettingsGetDeviceCredentialDetailsItemHTTPWrite(item.HTTPWrite) - respItem["snmp_v2_write"] = flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV2Write(item.SNMPV2Write) - respItem["snmp_v2_read"] = flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV2Read(item.SNMPV2Read) - respItem["cli"] = flattenNetworkSettingsGetDeviceCredentialDetailsItemCli(item.Cli) + respItem["snmp_v3"] = flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemSNMPV3(item.SNMPV3) + respItem["http_read"] = flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemHTTPRead(item.HTTPRead) + respItem["http_write"] = flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemHTTPWrite(item.HTTPWrite) + respItem["snmp_v2_write"] = flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemSNMPV2Write(item.SNMPV2Write) + respItem["snmp_v2_read"] = flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemSNMPV2Read(item.SNMPV2Read) + respItem["cli"] = flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemCli(item.Cli) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV3(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsSNMPV3) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemSNMPV3(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1SNMPV3) []map[string]interface{} { if items == nil { return nil } @@ -511,7 +511,7 @@ func flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV3(items *[]catalys return respItems } -func flattenNetworkSettingsGetDeviceCredentialDetailsItemHTTPRead(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsHTTPRead) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemHTTPRead(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1HTTPRead) []map[string]interface{} { if items == nil { return nil } @@ -533,7 +533,7 @@ func flattenNetworkSettingsGetDeviceCredentialDetailsItemHTTPRead(items *[]catal return respItems } -func flattenNetworkSettingsGetDeviceCredentialDetailsItemHTTPWrite(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsHTTPWrite) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemHTTPWrite(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1HTTPWrite) []map[string]interface{} { if items == nil { return nil } @@ -555,7 +555,7 @@ func flattenNetworkSettingsGetDeviceCredentialDetailsItemHTTPWrite(items *[]cata return respItems } -func flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV2Write(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsSNMPV2Write) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemSNMPV2Write(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1SNMPV2Write) []map[string]interface{} { if items == nil { return nil } @@ -574,7 +574,7 @@ func flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV2Write(items *[]ca return respItems } -func flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV2Read(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsSNMPV2Read) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemSNMPV2Read(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1SNMPV2Read) []map[string]interface{} { if items == nil { return nil } @@ -593,7 +593,7 @@ func flattenNetworkSettingsGetDeviceCredentialDetailsItemSNMPV2Read(items *[]cat return respItems } -func flattenNetworkSettingsGetDeviceCredentialDetailsItemCli(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsCli) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialDetailsV1ItemCli(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialDetailsV1Cli) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_device_details.go b/catalystcenter/data_source_device_details.go index 32f5252..a792b7c 100644 --- a/catalystcenter/data_source_device_details.go +++ b/catalystcenter/data_source_device_details.go @@ -637,8 +637,8 @@ func dataSourceDeviceDetailsRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceDetail") - queryParams1 := catalystcentersdkgo.GetDeviceDetailQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceDetailV1") + queryParams1 := catalystcentersdkgo.GetDeviceDetailV1QueryParams{} if okTimestamp { queryParams1.Timestamp = vTimestamp.(float64) @@ -647,24 +647,24 @@ func dataSourceDeviceDetailsRead(ctx context.Context, d *schema.ResourceData, m queryParams1.SearchBy = vSearchBy.(string) - response1, restyResp1, err := client.Devices.GetDeviceDetail(&queryParams1) + response1, restyResp1, err := client.Devices.GetDeviceDetailV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceDetail", err, - "Failure at GetDeviceDetail, unexpected response", "")) + "Failure when executing 2 GetDeviceDetailV1", err, + "Failure at GetDeviceDetailV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceDetailItem(response1.Response) + vItem1 := flattenDevicesGetDeviceDetailV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceDetail response", + "Failure when setting GetDeviceDetailV1 response", err)) return diags } @@ -676,7 +676,7 @@ func dataSourceDeviceDetailsRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDevicesGetDeviceDetailItem(item *catalystcentersdkgo.ResponseDevicesGetDeviceDetailResponse) []map[string]interface{} { +func flattenDevicesGetDeviceDetailV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceDetailV1Response) []map[string]interface{} { if item == nil { return nil } @@ -713,7 +713,7 @@ func flattenDevicesGetDeviceDetailItem(item *catalystcentersdkgo.ResponseDevices respItem["maintenance_mode"] = boolPtrToString(item.MaintenanceMode) respItem["interference"] = item.Interference respItem["software_version"] = item.SoftwareVersion - respItem["tag_id_list"] = flattenDevicesGetDeviceDetailItemTagIDList(item.TagIDList) + respItem["tag_id_list"] = flattenDevicesGetDeviceDetailV1ItemTagIDList(item.TagIDList) respItem["power_type"] = item.PowerType respItem["overall_health"] = item.OverallHealth respItem["management_ip_addr"] = item.ManagementIPAddr @@ -768,7 +768,7 @@ func flattenDevicesGetDeviceDetailItem(item *catalystcentersdkgo.ResponseDevices } } -func flattenDevicesGetDeviceDetailItemTagIDList(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceDetailResponseTagIDList) []interface{} { +func flattenDevicesGetDeviceDetailV1ItemTagIDList(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceDetailV1ResponseTagIDList) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_device_enrichment_details.go b/catalystcenter/data_source_device_enrichment_details.go index 6ccb693..55fcc34 100644 --- a/catalystcenter/data_source_device_enrichment_details.go +++ b/catalystcenter/data_source_device_enrichment_details.go @@ -522,9 +522,9 @@ func dataSourceDeviceEnrichmentDetailsRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceEnrichmentDetails") + log.Printf("[DEBUG] Selected method: GetDeviceEnrichmentDetailsV1") - headerParams1 := catalystcentersdkgo.GetDeviceEnrichmentDetailsHeaderParams{} + headerParams1 := catalystcentersdkgo.GetDeviceEnrichmentDetailsV1HeaderParams{} headerParams1.EntityType = vEntityType.(string) @@ -532,24 +532,24 @@ func dataSourceDeviceEnrichmentDetailsRead(ctx context.Context, d *schema.Resour headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Devices.GetDeviceEnrichmentDetails(&headerParams1) + response1, restyResp1, err := client.Devices.GetDeviceEnrichmentDetailsV1(&headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceEnrichmentDetails", err, - "Failure at GetDeviceEnrichmentDetails, unexpected response", "")) + "Failure when executing 2 GetDeviceEnrichmentDetailsV1", err, + "Failure at GetDeviceEnrichmentDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetDeviceEnrichmentDetailsItems(response1) + vItems1 := flattenDevicesGetDeviceEnrichmentDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceEnrichmentDetails response", + "Failure when setting GetDeviceEnrichmentDetailsV1 response", err)) return diags } @@ -561,27 +561,27 @@ func dataSourceDeviceEnrichmentDetailsRead(ctx context.Context, d *schema.Resour return diags } -func flattenDevicesGetDeviceEnrichmentDetailsItems(items *catalystcentersdkgo.ResponseDevicesGetDeviceEnrichmentDetails) []map[string]interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1Items(items *catalystcentersdkgo.ResponseDevicesGetDeviceEnrichmentDetailsV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["device_details"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetails(item.DeviceDetails) + respItem["device_details"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetails(item.DeviceDetails) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetails(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetails) []map[string]interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetails(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["family"] = item.Family respItem["type"] = item.Type - respItem["location"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsLocation(item.Location) + respItem["location"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsLocation(item.Location) respItem["error_code"] = item.ErrorCode respItem["mac_address"] = item.MacAddress respItem["role"] = item.Role @@ -599,8 +599,8 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetails(item *catalystce respItem["reachability_status"] = item.ReachabilityStatus respItem["snmp_contact"] = item.SNMPContact respItem["snmp_location"] = item.SNMPLocation - respItem["tunnel_udp_port"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsTunnelUDPPort(item.TunnelUDPPort) - respItem["waas_device_mode"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsWaasDeviceMode(item.WaasDeviceMode) + respItem["tunnel_udp_port"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsTunnelUDPPort(item.TunnelUDPPort) + respItem["waas_device_mode"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsWaasDeviceMode(item.WaasDeviceMode) respItem["series"] = item.Series respItem["inventory_status_detail"] = item.InventoryStatusDetail respItem["collection_interval"] = item.CollectionInterval @@ -611,12 +611,12 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetails(item *catalystce respItem["up_time"] = item.UpTime respItem["last_update_time"] = item.LastUpdateTime respItem["error_description"] = item.ErrorDescription - respItem["location_name"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsLocationName(item.LocationName) + respItem["location_name"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsLocationName(item.LocationName) respItem["tag_count"] = item.TagCount respItem["last_updated"] = item.LastUpdated respItem["instance_uuid"] = item.InstanceUUID respItem["id"] = item.ID - respItem["neighbor_topology"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopology(item.NeighborTopology) + respItem["neighbor_topology"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopology(item.NeighborTopology) return []map[string]interface{}{ respItem, @@ -624,7 +624,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetails(item *catalystce } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsLocation(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsLocation) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsLocation(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsLocation) interface{} { if item == nil { return nil } @@ -634,7 +634,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsLocation(item *ca } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsTunnelUDPPort(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsTunnelUDPPort) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsTunnelUDPPort(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsTunnelUDPPort) interface{} { if item == nil { return nil } @@ -644,7 +644,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsTunnelUDPPort(ite } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsWaasDeviceMode(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsWaasDeviceMode) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsWaasDeviceMode(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsWaasDeviceMode) interface{} { if item == nil { return nil } @@ -654,7 +654,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsWaasDeviceMode(it } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsLocationName(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsLocationName) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsLocationName(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsLocationName) interface{} { if item == nil { return nil } @@ -664,21 +664,21 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsLocationName(item } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopology(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopology) []map[string]interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopology(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopology) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["nodes"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodes(item.Nodes) - respItem["links"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinks(item.Links) + respItem["nodes"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodes(item.Nodes) + respItem["links"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinks(item.Links) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodes(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodes) []map[string]interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodes(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodes) []map[string]interface{} { if items == nil { return nil } @@ -694,21 +694,21 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN respItem["family"] = item.Family respItem["ip"] = item.IP respItem["software_version"] = item.SoftwareVersion - respItem["user_id"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesUserID(item.UserID) + respItem["user_id"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesUserID(item.UserID) respItem["node_type"] = item.NodeType - respItem["radio_frequency"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesRadioFrequency(item.RadioFrequency) - respItem["clients"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesClients(item.Clients) - respItem["count"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesCount(item.Count) + respItem["radio_frequency"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesRadioFrequency(item.RadioFrequency) + respItem["clients"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesClients(item.Clients) + respItem["count"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesCount(item.Count) respItem["health_score"] = item.HealthScore respItem["level"] = item.Level - respItem["fabric_group"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesFabricGroup(item.FabricGroup) - respItem["connected_device"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesConnectedDevice(item.ConnectedDevice) + respItem["fabric_group"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesFabricGroup(item.FabricGroup) + respItem["connected_device"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesConnectedDevice(item.ConnectedDevice) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesUserID(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodesUserID) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesUserID(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodesUserID) interface{} { if item == nil { return nil } @@ -718,7 +718,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesRadioFrequency(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodesRadioFrequency) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesRadioFrequency(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodesRadioFrequency) interface{} { if item == nil { return nil } @@ -728,7 +728,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesClients(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodesClients) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesClients(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodesClients) interface{} { if item == nil { return nil } @@ -738,7 +738,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesCount(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodesCount) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesCount(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodesCount) interface{} { if item == nil { return nil } @@ -748,7 +748,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesFabricGroup(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodesFabricGroup) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesFabricGroup(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodesFabricGroup) interface{} { if item == nil { return nil } @@ -758,7 +758,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyNodesConnectedDevice(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyNodesConnectedDevice) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyNodesConnectedDevice(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyNodesConnectedDevice) interface{} { if item == nil { return nil } @@ -768,7 +768,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyN } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinks(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyLinks) []map[string]interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinks(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyLinks) []map[string]interface{} { if items == nil { return nil } @@ -777,16 +777,16 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyL respItem := make(map[string]interface{}) respItem["source"] = item.Source respItem["link_status"] = item.LinkStatus - respItem["label"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinksLabel(item.Label) + respItem["label"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinksLabel(item.Label) respItem["target"] = item.Target - respItem["id"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinksID(item.ID) - respItem["port_utilization"] = flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinksPortUtilization(item.PortUtilization) + respItem["id"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinksID(item.ID) + respItem["port_utilization"] = flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinksPortUtilization(item.PortUtilization) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinksLabel(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyLinksLabel) []interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinksLabel(items *[]catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyLinksLabel) []interface{} { if items == nil { return nil } @@ -798,7 +798,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyL return respItems } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinksID(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyLinksID) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinksID(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyLinksID) interface{} { if item == nil { return nil } @@ -808,7 +808,7 @@ func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyL } -func flattenDevicesGetDeviceEnrichmentDetailsItemsDeviceDetailsNeighborTopologyLinksPortUtilization(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsDeviceDetailsNeighborTopologyLinksPortUtilization) interface{} { +func flattenDevicesGetDeviceEnrichmentDetailsV1ItemsDeviceDetailsNeighborTopologyLinksPortUtilization(item *catalystcentersdkgo.ResponseItemDevicesGetDeviceEnrichmentDetailsV1DeviceDetailsNeighborTopologyLinksPortUtilization) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_family_identifiers_details.go b/catalystcenter/data_source_device_family_identifiers_details.go index 4e6b61b..bc52a48 100644 --- a/catalystcenter/data_source_device_family_identifiers_details.go +++ b/catalystcenter/data_source_device_family_identifiers_details.go @@ -54,26 +54,26 @@ func dataSourceDeviceFamilyIDentifiersDetailsRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceFamilyIDentifiers") + log.Printf("[DEBUG] Selected method: GetDeviceFamilyIDentifiersV1") - response1, restyResp1, err := client.SoftwareImageManagementSwim.GetDeviceFamilyIDentifiers() + response1, restyResp1, err := client.SoftwareImageManagementSwim.GetDeviceFamilyIDentifiersV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceFamilyIDentifiers", err, - "Failure at GetDeviceFamilyIDentifiers, unexpected response", "")) + "Failure when executing 2 GetDeviceFamilyIDentifiersV1", err, + "Failure at GetDeviceFamilyIDentifiersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimGetDeviceFamilyIDentifiersItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimGetDeviceFamilyIDentifiersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceFamilyIDentifiers response", + "Failure when setting GetDeviceFamilyIDentifiersV1 response", err)) return diags } @@ -85,7 +85,7 @@ func dataSourceDeviceFamilyIDentifiersDetailsRead(ctx context.Context, d *schema return diags } -func flattenSoftwareImageManagementSwimGetDeviceFamilyIDentifiersItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetDeviceFamilyIDentifiersResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetDeviceFamilyIDentifiersV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetDeviceFamilyIDentifiersV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_device_health.go b/catalystcenter/data_source_device_health.go index bc893f5..1daba97 100644 --- a/catalystcenter/data_source_device_health.go +++ b/catalystcenter/data_source_device_health.go @@ -572,8 +572,8 @@ func dataSourceDeviceHealthRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: Devices") - queryParams1 := catalystcentersdkgo.DevicesQueryParams{} + log.Printf("[DEBUG] Selected method: DevicesV1") + queryParams1 := catalystcentersdkgo.DevicesV1QueryParams{} if okDeviceRole { queryParams1.DeviceRole = vDeviceRole.(string) @@ -597,24 +597,24 @@ func dataSourceDeviceHealthRead(ctx context.Context, d *schema.ResourceData, m i queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Devices.Devices(&queryParams1) + response1, restyResp1, err := client.Devices.DevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 Devices", err, - "Failure at Devices, unexpected response", "")) + "Failure when executing 2 DevicesV1", err, + "Failure at DevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesDevicesItems(response1.Response) + vItems1 := flattenDevicesDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting Devices response", + "Failure when setting DevicesV1 response", err)) return diags } @@ -626,7 +626,7 @@ func dataSourceDeviceHealthRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenDevicesDevicesItems(items *[]catalystcentersdkgo.ResponseDevicesDevicesResponse) []map[string]interface{} { +func flattenDevicesDevicesV1Items(items *[]catalystcentersdkgo.ResponseDevicesDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -636,26 +636,26 @@ func flattenDevicesDevicesItems(items *[]catalystcentersdkgo.ResponseDevicesDevi respItem["device_type"] = item.DeviceType respItem["cpu_utilization"] = item.CPUUtilization respItem["overall_health"] = item.OverallHealth - respItem["utilization_health"] = flattenDevicesDevicesItemsUtilizationHealth(item.UtilizationHealth) - respItem["air_quality_health"] = flattenDevicesDevicesItemsAirQualityHealth(item.AirQualityHealth) + respItem["utilization_health"] = flattenDevicesDevicesV1ItemsUtilizationHealth(item.UtilizationHealth) + respItem["air_quality_health"] = flattenDevicesDevicesV1ItemsAirQualityHealth(item.AirQualityHealth) respItem["ip_address"] = item.IPAddress respItem["cpu_health"] = item.CPUHealth respItem["device_family"] = item.DeviceFamily respItem["issue_count"] = item.IssueCount respItem["mac_address"] = item.MacAddress - respItem["noise_health"] = flattenDevicesDevicesItemsNoiseHealth(item.NoiseHealth) + respItem["noise_health"] = flattenDevicesDevicesV1ItemsNoiseHealth(item.NoiseHealth) respItem["os_version"] = item.OsVersion respItem["name"] = item.Name respItem["interface_link_err_health"] = item.InterfaceLinkErrHealth respItem["memory_utilization"] = item.MemoryUtilization respItem["inter_device_link_avail_health"] = item.InterDeviceLinkAvailHealth - respItem["interference_health"] = flattenDevicesDevicesItemsInterferenceHealth(item.InterferenceHealth) + respItem["interference_health"] = flattenDevicesDevicesV1ItemsInterferenceHealth(item.InterferenceHealth) respItem["model"] = item.Model respItem["location"] = item.Location respItem["reachability_health"] = item.ReachabilityHealth - respItem["band"] = flattenDevicesDevicesItemsBand(item.Band) + respItem["band"] = flattenDevicesDevicesV1ItemsBand(item.Band) respItem["memory_utilization_health"] = item.MemoryUtilizationHealth - respItem["client_count"] = flattenDevicesDevicesItemsClientCount(item.ClientCount) + respItem["client_count"] = flattenDevicesDevicesV1ItemsClientCount(item.ClientCount) respItem["avg_temperature"] = item.AvgTemperature respItem["max_temperature"] = item.MaxTemperature respItem["inter_device_link_avail_fabric"] = item.InterDeviceLinkAvailFabric @@ -676,7 +676,7 @@ func flattenDevicesDevicesItems(items *[]catalystcentersdkgo.ResponseDevicesDevi return respItems } -func flattenDevicesDevicesItemsUtilizationHealth(item *catalystcentersdkgo.ResponseDevicesDevicesResponseUtilizationHealth) []map[string]interface{} { +func flattenDevicesDevicesV1ItemsUtilizationHealth(item *catalystcentersdkgo.ResponseDevicesDevicesV1ResponseUtilizationHealth) []map[string]interface{} { if item == nil { return nil } @@ -694,7 +694,7 @@ func flattenDevicesDevicesItemsUtilizationHealth(item *catalystcentersdkgo.Respo } -func flattenDevicesDevicesItemsAirQualityHealth(item *catalystcentersdkgo.ResponseDevicesDevicesResponseAirQualityHealth) []map[string]interface{} { +func flattenDevicesDevicesV1ItemsAirQualityHealth(item *catalystcentersdkgo.ResponseDevicesDevicesV1ResponseAirQualityHealth) []map[string]interface{} { if item == nil { return nil } @@ -712,7 +712,7 @@ func flattenDevicesDevicesItemsAirQualityHealth(item *catalystcentersdkgo.Respon } -func flattenDevicesDevicesItemsNoiseHealth(item *catalystcentersdkgo.ResponseDevicesDevicesResponseNoiseHealth) []map[string]interface{} { +func flattenDevicesDevicesV1ItemsNoiseHealth(item *catalystcentersdkgo.ResponseDevicesDevicesV1ResponseNoiseHealth) []map[string]interface{} { if item == nil { return nil } @@ -730,7 +730,7 @@ func flattenDevicesDevicesItemsNoiseHealth(item *catalystcentersdkgo.ResponseDev } -func flattenDevicesDevicesItemsInterferenceHealth(item *catalystcentersdkgo.ResponseDevicesDevicesResponseInterferenceHealth) []map[string]interface{} { +func flattenDevicesDevicesV1ItemsInterferenceHealth(item *catalystcentersdkgo.ResponseDevicesDevicesV1ResponseInterferenceHealth) []map[string]interface{} { if item == nil { return nil } @@ -748,7 +748,7 @@ func flattenDevicesDevicesItemsInterferenceHealth(item *catalystcentersdkgo.Resp } -func flattenDevicesDevicesItemsBand(item *catalystcentersdkgo.ResponseDevicesDevicesResponseBand) []map[string]interface{} { +func flattenDevicesDevicesV1ItemsBand(item *catalystcentersdkgo.ResponseDevicesDevicesV1ResponseBand) []map[string]interface{} { if item == nil { return nil } @@ -764,7 +764,7 @@ func flattenDevicesDevicesItemsBand(item *catalystcentersdkgo.ResponseDevicesDev } -func flattenDevicesDevicesItemsClientCount(item *catalystcentersdkgo.ResponseDevicesDevicesResponseClientCount) []map[string]interface{} { +func flattenDevicesDevicesV1ItemsClientCount(item *catalystcentersdkgo.ResponseDevicesDevicesV1ResponseClientCount) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_interface.go b/catalystcenter/data_source_device_interface.go index 9b2ab09..9468247 100644 --- a/catalystcenter/data_source_device_interface.go +++ b/catalystcenter/data_source_device_interface.go @@ -695,8 +695,8 @@ func dataSourceDeviceInterfaceRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllInterfaces") - queryParams1 := catalystcentersdkgo.GetAllInterfacesQueryParams{} + log.Printf("[DEBUG] Selected method: GetAllInterfacesV1") + queryParams1 := catalystcentersdkgo.GetAllInterfacesV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(int) @@ -711,24 +711,24 @@ func dataSourceDeviceInterfaceRead(ctx context.Context, d *schema.ResourceData, queryParams1.LastOutputTime = vLastOutputTime.(string) } - response1, restyResp1, err := client.Devices.GetAllInterfaces(&queryParams1) + response1, restyResp1, err := client.Devices.GetAllInterfacesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllInterfaces", err, - "Failure at GetAllInterfaces, unexpected response", "")) + "Failure when executing 2 GetAllInterfacesV1", err, + "Failure at GetAllInterfacesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetAllInterfacesItems(response1.Response) + vItems1 := flattenDevicesGetAllInterfacesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllInterfaces response", + "Failure when setting GetAllInterfacesV1 response", err)) return diags } @@ -738,27 +738,27 @@ func dataSourceDeviceInterfaceRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetInterfaceByID") + log.Printf("[DEBUG] Selected method: GetInterfaceByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Devices.GetInterfaceByID(vvID) + response2, restyResp2, err := client.Devices.GetInterfaceByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfaceByID", err, - "Failure at GetInterfaceByID, unexpected response", "")) + "Failure when executing 2 GetInterfaceByIDV1", err, + "Failure at GetInterfaceByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetInterfaceByIDItem(response2.Response) + vItem2 := flattenDevicesGetInterfaceByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfaceByID response", + "Failure when setting GetInterfaceByIDV1 response", err)) return diags } @@ -770,14 +770,14 @@ func dataSourceDeviceInterfaceRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDevicesGetAllInterfacesItems(items *[]catalystcentersdkgo.ResponseDevicesGetAllInterfacesResponse) []map[string]interface{} { +func flattenDevicesGetAllInterfacesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetAllInterfacesV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetAllInterfacesItemsAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetAllInterfacesV1ItemsAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -817,27 +817,27 @@ func flattenDevicesGetAllInterfacesItems(items *[]catalystcentersdkgo.ResponseDe return respItems } -func flattenDevicesGetAllInterfacesItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetAllInterfacesResponseAddresses) []map[string]interface{} { +func flattenDevicesGetAllInterfacesV1ItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetAllInterfacesV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetAllInterfacesItemsAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetAllInterfacesV1ItemsAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetAllInterfacesItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetAllInterfacesResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetAllInterfacesV1ItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetAllInterfacesV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetAllInterfacesItemsAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetAllInterfacesItemsAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetAllInterfacesV1ItemsAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetAllInterfacesV1ItemsAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -846,7 +846,7 @@ func flattenDevicesGetAllInterfacesItemsAddressesAddress(item *catalystcentersdk } -func flattenDevicesGetAllInterfacesItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetAllInterfacesResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetAllInterfacesV1ItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetAllInterfacesV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -859,7 +859,7 @@ func flattenDevicesGetAllInterfacesItemsAddressesAddressIPAddress(item *catalyst } -func flattenDevicesGetAllInterfacesItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetAllInterfacesResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetAllInterfacesV1ItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetAllInterfacesV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } @@ -872,12 +872,12 @@ func flattenDevicesGetAllInterfacesItemsAddressesAddressIPMask(item *catalystcen } -func flattenDevicesGetInterfaceByIDItem(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDResponse) []map[string]interface{} { +func flattenDevicesGetInterfaceByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetInterfaceByIDItemAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetInterfaceByIDV1ItemAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -917,27 +917,27 @@ func flattenDevicesGetInterfaceByIDItem(item *catalystcentersdkgo.ResponseDevice } } -func flattenDevicesGetInterfaceByIDItemAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceByIDResponseAddresses) []map[string]interface{} { +func flattenDevicesGetInterfaceByIDV1ItemAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceByIDV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetInterfaceByIDItemAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetInterfaceByIDV1ItemAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetInterfaceByIDItemAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceByIDV1ItemAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetInterfaceByIDItemAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetInterfaceByIDItemAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetInterfaceByIDV1ItemAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetInterfaceByIDV1ItemAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -946,7 +946,7 @@ func flattenDevicesGetInterfaceByIDItemAddressesAddress(item *catalystcentersdkg } -func flattenDevicesGetInterfaceByIDItemAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceByIDV1ItemAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -959,7 +959,7 @@ func flattenDevicesGetInterfaceByIDItemAddressesAddressIPAddress(item *catalystc } -func flattenDevicesGetInterfaceByIDItemAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetInterfaceByIDV1ItemAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIDV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_interface_by_ip.go b/catalystcenter/data_source_device_interface_by_ip.go index 7fd2ef2..42ea5b0 100644 --- a/catalystcenter/data_source_device_interface_by_ip.go +++ b/catalystcenter/data_source_device_interface_by_ip.go @@ -350,27 +350,27 @@ func dataSourceDeviceInterfaceByIPRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetInterfaceByIP") + log.Printf("[DEBUG] Selected method: GetInterfaceByIPV1") vvIPAddress := vIPAddress.(string) - response1, restyResp1, err := client.Devices.GetInterfaceByIP(vvIPAddress) + response1, restyResp1, err := client.Devices.GetInterfaceByIPV1(vvIPAddress) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfaceByIP", err, - "Failure at GetInterfaceByIP, unexpected response", "")) + "Failure when executing 2 GetInterfaceByIPV1", err, + "Failure at GetInterfaceByIPV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetInterfaceByIPItems(response1.Response) + vItems1 := flattenDevicesGetInterfaceByIPV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfaceByIP response", + "Failure when setting GetInterfaceByIPV1 response", err)) return diags } @@ -382,14 +382,14 @@ func dataSourceDeviceInterfaceByIPRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenDevicesGetInterfaceByIPItems(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceByIPResponse) []map[string]interface{} { +func flattenDevicesGetInterfaceByIPV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceByIPV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetInterfaceByIPItemsAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetInterfaceByIPV1ItemsAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -429,27 +429,27 @@ func flattenDevicesGetInterfaceByIPItems(items *[]catalystcentersdkgo.ResponseDe return respItems } -func flattenDevicesGetInterfaceByIPItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceByIPResponseAddresses) []map[string]interface{} { +func flattenDevicesGetInterfaceByIPV1ItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceByIPV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetInterfaceByIPItemsAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetInterfaceByIPV1ItemsAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetInterfaceByIPItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIPResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceByIPV1ItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIPV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetInterfaceByIPItemsAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetInterfaceByIPItemsAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetInterfaceByIPV1ItemsAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetInterfaceByIPV1ItemsAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -458,7 +458,7 @@ func flattenDevicesGetInterfaceByIPItemsAddressesAddress(item *catalystcentersdk } -func flattenDevicesGetInterfaceByIPItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIPResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceByIPV1ItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIPV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -471,7 +471,7 @@ func flattenDevicesGetInterfaceByIPItemsAddressesAddressIPAddress(item *catalyst } -func flattenDevicesGetInterfaceByIPItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIPResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetInterfaceByIPV1ItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceByIPV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_interface_count.go b/catalystcenter/data_source_device_interface_count.go index 8fec5fc..06ac06c 100644 --- a/catalystcenter/data_source_device_interface_count.go +++ b/catalystcenter/data_source_device_interface_count.go @@ -50,26 +50,26 @@ func dataSourceDeviceInterfaceCountRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceInterfaceCountForMultipleDevices") + log.Printf("[DEBUG] Selected method: GetDeviceInterfaceCountForMultipleDevicesV1") - response1, restyResp1, err := client.Devices.GetDeviceInterfaceCountForMultipleDevices() + response1, restyResp1, err := client.Devices.GetDeviceInterfaceCountForMultipleDevicesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceInterfaceCountForMultipleDevices", err, - "Failure at GetDeviceInterfaceCountForMultipleDevices, unexpected response", "")) + "Failure when executing 2 GetDeviceInterfaceCountForMultipleDevicesV1", err, + "Failure at GetDeviceInterfaceCountForMultipleDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceInterfaceCountForMultipleDevicesItem(response1) + vItem1 := flattenDevicesGetDeviceInterfaceCountForMultipleDevicesV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceInterfaceCountForMultipleDevices response", + "Failure when setting GetDeviceInterfaceCountForMultipleDevicesV1 response", err)) return diags } @@ -81,7 +81,7 @@ func dataSourceDeviceInterfaceCountRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenDevicesGetDeviceInterfaceCountForMultipleDevicesItem(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceCountForMultipleDevices) []map[string]interface{} { +func flattenDevicesGetDeviceInterfaceCountForMultipleDevicesV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceCountForMultipleDevicesV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_interface_isis.go b/catalystcenter/data_source_device_interface_isis.go index 3cd56db..815413d 100644 --- a/catalystcenter/data_source_device_interface_isis.go +++ b/catalystcenter/data_source_device_interface_isis.go @@ -343,26 +343,26 @@ func dataSourceDeviceInterfaceIsisRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetIsisInterfaces") + log.Printf("[DEBUG] Selected method: GetIsisInterfacesV1") - response1, restyResp1, err := client.Devices.GetIsisInterfaces() + response1, restyResp1, err := client.Devices.GetIsisInterfacesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetIsisInterfaces", err, - "Failure at GetIsisInterfaces, unexpected response", "")) + "Failure when executing 2 GetIsisInterfacesV1", err, + "Failure at GetIsisInterfacesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetIsisInterfacesItems(response1.Response) + vItems1 := flattenDevicesGetIsisInterfacesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetIsisInterfaces response", + "Failure when setting GetIsisInterfacesV1 response", err)) return diags } @@ -374,14 +374,14 @@ func dataSourceDeviceInterfaceIsisRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenDevicesGetIsisInterfacesItems(items *[]catalystcentersdkgo.ResponseDevicesGetIsisInterfacesResponse) []map[string]interface{} { +func flattenDevicesGetIsisInterfacesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetIsisInterfacesV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetIsisInterfacesItemsAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetIsisInterfacesV1ItemsAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -421,27 +421,27 @@ func flattenDevicesGetIsisInterfacesItems(items *[]catalystcentersdkgo.ResponseD return respItems } -func flattenDevicesGetIsisInterfacesItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetIsisInterfacesResponseAddresses) []map[string]interface{} { +func flattenDevicesGetIsisInterfacesV1ItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetIsisInterfacesV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetIsisInterfacesItemsAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetIsisInterfacesV1ItemsAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetIsisInterfacesItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetIsisInterfacesResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetIsisInterfacesV1ItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetIsisInterfacesV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetIsisInterfacesItemsAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetIsisInterfacesItemsAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetIsisInterfacesV1ItemsAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetIsisInterfacesV1ItemsAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -450,7 +450,7 @@ func flattenDevicesGetIsisInterfacesItemsAddressesAddress(item *catalystcentersd } -func flattenDevicesGetIsisInterfacesItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetIsisInterfacesResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetIsisInterfacesV1ItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetIsisInterfacesV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -463,7 +463,7 @@ func flattenDevicesGetIsisInterfacesItemsAddressesAddressIPAddress(item *catalys } -func flattenDevicesGetIsisInterfacesItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetIsisInterfacesResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetIsisInterfacesV1ItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetIsisInterfacesV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_interface_ospf.go b/catalystcenter/data_source_device_interface_ospf.go index d6c0e3b..8e93fce 100644 --- a/catalystcenter/data_source_device_interface_ospf.go +++ b/catalystcenter/data_source_device_interface_ospf.go @@ -343,26 +343,26 @@ func dataSourceDeviceInterfaceOspfRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetOspfInterfaces") + log.Printf("[DEBUG] Selected method: GetOspfInterfacesV1") - response1, restyResp1, err := client.Devices.GetOspfInterfaces() + response1, restyResp1, err := client.Devices.GetOspfInterfacesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetOspfInterfaces", err, - "Failure at GetOspfInterfaces, unexpected response", "")) + "Failure when executing 2 GetOspfInterfacesV1", err, + "Failure at GetOspfInterfacesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetOspfInterfacesItems(response1.Response) + vItems1 := flattenDevicesGetOspfInterfacesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetOspfInterfaces response", + "Failure when setting GetOspfInterfacesV1 response", err)) return diags } @@ -374,14 +374,14 @@ func dataSourceDeviceInterfaceOspfRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenDevicesGetOspfInterfacesItems(items *[]catalystcentersdkgo.ResponseDevicesGetOspfInterfacesResponse) []map[string]interface{} { +func flattenDevicesGetOspfInterfacesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetOspfInterfacesV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetOspfInterfacesItemsAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetOspfInterfacesV1ItemsAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -421,27 +421,27 @@ func flattenDevicesGetOspfInterfacesItems(items *[]catalystcentersdkgo.ResponseD return respItems } -func flattenDevicesGetOspfInterfacesItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetOspfInterfacesResponseAddresses) []map[string]interface{} { +func flattenDevicesGetOspfInterfacesV1ItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetOspfInterfacesV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetOspfInterfacesItemsAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetOspfInterfacesV1ItemsAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetOspfInterfacesItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetOspfInterfacesResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetOspfInterfacesV1ItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetOspfInterfacesV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetOspfInterfacesItemsAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetOspfInterfacesItemsAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetOspfInterfacesV1ItemsAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetOspfInterfacesV1ItemsAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -450,7 +450,7 @@ func flattenDevicesGetOspfInterfacesItemsAddressesAddress(item *catalystcentersd } -func flattenDevicesGetOspfInterfacesItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetOspfInterfacesResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetOspfInterfacesV1ItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetOspfInterfacesV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -463,7 +463,7 @@ func flattenDevicesGetOspfInterfacesItemsAddressesAddressIPAddress(item *catalys } -func flattenDevicesGetOspfInterfacesItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetOspfInterfacesResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetOspfInterfacesV1ItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetOspfInterfacesV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_reboot_apreboot.go b/catalystcenter/data_source_device_reboot_apreboot.go index b97e723..5f9ec3a 100644 --- a/catalystcenter/data_source_device_reboot_apreboot.go +++ b/catalystcenter/data_source_device_reboot_apreboot.go @@ -76,31 +76,31 @@ func dataSourceDeviceRebootAprebootRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAccessPointRebootTaskResult") - queryParams1 := catalystcentersdkgo.GetAccessPointRebootTaskResultQueryParams{} + log.Printf("[DEBUG] Selected method: GetAccessPointRebootTaskResultV1") + queryParams1 := catalystcentersdkgo.GetAccessPointRebootTaskResultV1QueryParams{} if okParentTaskID { queryParams1.ParentTaskID = vParentTaskID.(string) } - response1, restyResp1, err := client.Wireless.GetAccessPointRebootTaskResult(&queryParams1) + response1, restyResp1, err := client.Wireless.GetAccessPointRebootTaskResultV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAccessPointRebootTaskResult", err, - "Failure at GetAccessPointRebootTaskResult, unexpected response", "")) + "Failure when executing 2 GetAccessPointRebootTaskResultV1", err, + "Failure at GetAccessPointRebootTaskResultV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetAccessPointRebootTaskResultItems(response1) + vItems1 := flattenWirelessGetAccessPointRebootTaskResultV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAccessPointRebootTaskResult response", + "Failure when setting GetAccessPointRebootTaskResultV1 response", err)) return diags } @@ -112,7 +112,7 @@ func dataSourceDeviceRebootAprebootRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenWirelessGetAccessPointRebootTaskResultItems(items *catalystcentersdkgo.ResponseWirelessGetAccessPointRebootTaskResult) []map[string]interface{} { +func flattenWirelessGetAccessPointRebootTaskResultV1Items(items *catalystcentersdkgo.ResponseWirelessGetAccessPointRebootTaskResultV1) []map[string]interface{} { if items == nil { return nil } @@ -120,13 +120,13 @@ func flattenWirelessGetAccessPointRebootTaskResultItems(items *catalystcentersdk for _, item := range *items { respItem := make(map[string]interface{}) respItem["wlc_ip"] = item.WlcIP - respItem["ap_list"] = flattenWirelessGetAccessPointRebootTaskResultItemsApList(item.ApList) + respItem["ap_list"] = flattenWirelessGetAccessPointRebootTaskResultV1ItemsApList(item.ApList) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAccessPointRebootTaskResultItemsApList(items *[]catalystcentersdkgo.ResponseItemWirelessGetAccessPointRebootTaskResultApList) []map[string]interface{} { +func flattenWirelessGetAccessPointRebootTaskResultV1ItemsApList(items *[]catalystcentersdkgo.ResponseItemWirelessGetAccessPointRebootTaskResultV1ApList) []map[string]interface{} { if items == nil { return nil } @@ -135,13 +135,13 @@ func flattenWirelessGetAccessPointRebootTaskResultItemsApList(items *[]catalystc respItem := make(map[string]interface{}) respItem["ap_name"] = item.ApName respItem["reboot_status"] = item.RebootStatus - respItem["failure_reason"] = flattenWirelessGetAccessPointRebootTaskResultItemsApListFailureReason(item.FailureReason) + respItem["failure_reason"] = flattenWirelessGetAccessPointRebootTaskResultV1ItemsApListFailureReason(item.FailureReason) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAccessPointRebootTaskResultItemsApListFailureReason(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointRebootTaskResultApListFailureReason) interface{} { +func flattenWirelessGetAccessPointRebootTaskResultV1ItemsApListFailureReason(item *catalystcentersdkgo.ResponseItemWirelessGetAccessPointRebootTaskResultV1ApListFailureReason) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_device_replacement.go b/catalystcenter/data_source_device_replacement.go index 50bcb31..452c9e5 100644 --- a/catalystcenter/data_source_device_replacement.go +++ b/catalystcenter/data_source_device_replacement.go @@ -235,8 +235,8 @@ func dataSourceDeviceReplacementRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnListOfReplacementDevicesWithReplacementDetails") - queryParams1 := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnListOfReplacementDevicesWithReplacementDetailsV1") + queryParams1 := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsV1QueryParams{} if okFaultyDeviceName { queryParams1.FaultyDeviceName = vFaultyDeviceName.(string) @@ -272,24 +272,24 @@ func dataSourceDeviceReplacementRead(ctx context.Context, d *schema.ResourceData queryParams1.Limit = vLimit.(int) } - response1, restyResp1, err := client.DeviceReplacement.ReturnListOfReplacementDevicesWithReplacementDetails(&queryParams1) + response1, restyResp1, err := client.DeviceReplacement.ReturnListOfReplacementDevicesWithReplacementDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnListOfReplacementDevicesWithReplacementDetails", err, - "Failure at ReturnListOfReplacementDevicesWithReplacementDetails, unexpected response", "")) + "Failure when executing 2 ReturnListOfReplacementDevicesWithReplacementDetailsV1", err, + "Failure at ReturnListOfReplacementDevicesWithReplacementDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsItems(response1.Response) + vItems1 := flattenDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnListOfReplacementDevicesWithReplacementDetails response", + "Failure when setting ReturnListOfReplacementDevicesWithReplacementDetailsV1 response", err)) return diags } @@ -301,7 +301,7 @@ func dataSourceDeviceReplacementRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsItems(items *[]catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsResponse) []map[string]interface{} { +func flattenDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Items(items *[]catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_device_replacement_count.go b/catalystcenter/data_source_device_replacement_count.go index e8447e5..a6f6567 100644 --- a/catalystcenter/data_source_device_replacement_count.go +++ b/catalystcenter/data_source_device_replacement_count.go @@ -60,31 +60,31 @@ func dataSourceDeviceReplacementCountRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnReplacementDevicesCount") - queryParams1 := catalystcentersdkgo.ReturnReplacementDevicesCountQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnReplacementDevicesCountV1") + queryParams1 := catalystcentersdkgo.ReturnReplacementDevicesCountV1QueryParams{} if okReplacementStatus { queryParams1.ReplacementStatus = interfaceToSliceString(vReplacementStatus) } - response1, restyResp1, err := client.DeviceReplacement.ReturnReplacementDevicesCount(&queryParams1) + response1, restyResp1, err := client.DeviceReplacement.ReturnReplacementDevicesCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnReplacementDevicesCount", err, - "Failure at ReturnReplacementDevicesCount, unexpected response", "")) + "Failure when executing 2 ReturnReplacementDevicesCountV1", err, + "Failure at ReturnReplacementDevicesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDeviceReplacementReturnReplacementDevicesCountItem(response1) + vItem1 := flattenDeviceReplacementReturnReplacementDevicesCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnReplacementDevicesCount response", + "Failure when setting ReturnReplacementDevicesCountV1 response", err)) return diags } @@ -96,7 +96,7 @@ func dataSourceDeviceReplacementCountRead(ctx context.Context, d *schema.Resourc return diags } -func flattenDeviceReplacementReturnReplacementDevicesCountItem(item *catalystcentersdkgo.ResponseDeviceReplacementReturnReplacementDevicesCount) []map[string]interface{} { +func flattenDeviceReplacementReturnReplacementDevicesCountV1Item(item *catalystcentersdkgo.ResponseDeviceReplacementReturnReplacementDevicesCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_diagnostic_validation_sets.go b/catalystcenter/data_source_diagnostic_validation_sets.go index 0a8b178..2aa232b 100644 --- a/catalystcenter/data_source_diagnostic_validation_sets.go +++ b/catalystcenter/data_source_diagnostic_validation_sets.go @@ -29,7 +29,7 @@ func dataSourceDiagnosticValidationSets() *schema.Resource { Optional: true, }, "view": &schema.Schema{ - Description: `view query parameter. When the query parameter 'view=DETAIL' is passed, all validation sets and associated validations will be returned. When the query parameter 'view=DEFAULT' is passed, only validation sets metadata will be returned. + Description: `view query parameter. When the query parameter *view=DETAIL* is passed, all validation sets and associated validations will be returned. When the query parameter *view=DEFAULT* is passed, only validation sets metadata will be returned. `, Type: schema.TypeString, Optional: true, @@ -232,31 +232,31 @@ func dataSourceDiagnosticValidationSetsRead(ctx context.Context, d *schema.Resou selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesAllTheValidationSets") - queryParams1 := catalystcentersdkgo.RetrievesAllTheValidationSetsQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesAllTheValidationSetsV1") + queryParams1 := catalystcentersdkgo.RetrievesAllTheValidationSetsV1QueryParams{} if okView { queryParams1.View = vView.(string) } - response1, restyResp1, err := client.HealthAndPerformance.RetrievesAllTheValidationSets(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.RetrievesAllTheValidationSetsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesAllTheValidationSets", err, - "Failure at RetrievesAllTheValidationSets, unexpected response", "")) + "Failure when executing 2 RetrievesAllTheValidationSetsV1", err, + "Failure at RetrievesAllTheValidationSetsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenHealthAndPerformanceRetrievesAllTheValidationSetsItems(response1.Response) + vItems1 := flattenHealthAndPerformanceRetrievesAllTheValidationSetsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesAllTheValidationSets response", + "Failure when setting RetrievesAllTheValidationSetsV1 response", err)) return diags } @@ -266,27 +266,27 @@ func dataSourceDiagnosticValidationSetsRead(ctx context.Context, d *schema.Resou } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: RetrievesValidationDetailsForAValidationSet") + log.Printf("[DEBUG] Selected method: RetrievesValidationDetailsForAValidationSetV1") vvID := vID.(string) - response2, restyResp2, err := client.HealthAndPerformance.RetrievesValidationDetailsForAValidationSet(vvID) + response2, restyResp2, err := client.HealthAndPerformance.RetrievesValidationDetailsForAValidationSetV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesValidationDetailsForAValidationSet", err, - "Failure at RetrievesValidationDetailsForAValidationSet, unexpected response", "")) + "Failure when executing 2 RetrievesValidationDetailsForAValidationSetV1", err, + "Failure at RetrievesValidationDetailsForAValidationSetV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItem(response2.Response) + vItem2 := flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesValidationDetailsForAValidationSet response", + "Failure when setting RetrievesValidationDetailsForAValidationSetV1 response", err)) return diags } @@ -298,7 +298,7 @@ func dataSourceDiagnosticValidationSetsRead(ctx context.Context, d *schema.Resou return diags } -func flattenHealthAndPerformanceRetrievesAllTheValidationSetsItems(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesAllTheValidationSetsResponse) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesAllTheValidationSetsV1Items(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesAllTheValidationSetsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -309,13 +309,13 @@ func flattenHealthAndPerformanceRetrievesAllTheValidationSetsItems(items *[]cata respItem["name"] = item.Name respItem["description"] = item.Description respItem["version"] = item.Version - respItem["validation_groups"] = flattenHealthAndPerformanceRetrievesAllTheValidationSetsItemsValidationGroups(item.ValidationGroups) + respItem["validation_groups"] = flattenHealthAndPerformanceRetrievesAllTheValidationSetsV1ItemsValidationGroups(item.ValidationGroups) respItems = append(respItems, respItem) } return respItems } -func flattenHealthAndPerformanceRetrievesAllTheValidationSetsItemsValidationGroups(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesAllTheValidationSetsResponseValidationGroups) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesAllTheValidationSetsV1ItemsValidationGroups(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesAllTheValidationSetsV1ResponseValidationGroups) []map[string]interface{} { if items == nil { return nil } @@ -325,13 +325,13 @@ func flattenHealthAndPerformanceRetrievesAllTheValidationSetsItemsValidationGrou respItem["name"] = item.Name respItem["id"] = item.ID respItem["description"] = item.Description - respItem["validations"] = flattenHealthAndPerformanceRetrievesAllTheValidationSetsItemsValidationGroupsValidations(item.Validations) + respItem["validations"] = flattenHealthAndPerformanceRetrievesAllTheValidationSetsV1ItemsValidationGroupsValidations(item.Validations) respItems = append(respItems, respItem) } return respItems } -func flattenHealthAndPerformanceRetrievesAllTheValidationSetsItemsValidationGroupsValidations(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesAllTheValidationSetsResponseValidationGroupsValidations) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesAllTheValidationSetsV1ItemsValidationGroupsValidations(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesAllTheValidationSetsV1ResponseValidationGroupsValidations) []map[string]interface{} { if items == nil { return nil } @@ -345,7 +345,7 @@ func flattenHealthAndPerformanceRetrievesAllTheValidationSetsItemsValidationGrou return respItems } -func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationDetailsForAValidationSetResponse) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1Response) []map[string]interface{} { if item == nil { return nil } @@ -354,13 +354,13 @@ func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItem( respItem["name"] = item.Name respItem["description"] = item.Description respItem["version"] = item.Version - respItem["validation_groups"] = flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItemValidationGroups(item.ValidationGroups) + respItem["validation_groups"] = flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1ItemValidationGroups(item.ValidationGroups) return []map[string]interface{}{ respItem, } } -func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItemValidationGroups(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationDetailsForAValidationSetResponseValidationGroups) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1ItemValidationGroups(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1ResponseValidationGroups) []map[string]interface{} { if items == nil { return nil } @@ -370,13 +370,13 @@ func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItemV respItem["name"] = item.Name respItem["id"] = item.ID respItem["description"] = item.Description - respItem["validations"] = flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItemValidationGroupsValidations(item.Validations) + respItem["validations"] = flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1ItemValidationGroupsValidations(item.Validations) respItems = append(respItems, respItem) } return respItems } -func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetItemValidationGroupsValidations(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationDetailsForAValidationSetResponseValidationGroupsValidations) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1ItemValidationGroupsValidations(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationDetailsForAValidationSetV1ResponseValidationGroupsValidations) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_diagnostic_validation_workflows.go b/catalystcenter/data_source_diagnostic_validation_workflows.go index d494378..173931c 100644 --- a/catalystcenter/data_source_diagnostic_validation_workflows.go +++ b/catalystcenter/data_source_diagnostic_validation_workflows.go @@ -16,7 +16,7 @@ func dataSourceDiagnosticValidationWorkflows() *schema.Resource { Description: `It performs read operation on Health and Performance. - Retrieves the workflows that have been successfully submitted and are currently available. This is sorted by -'submitTime' +*submitTime* - Retrieves workflow details for a workflow id `, @@ -48,7 +48,7 @@ func dataSourceDiagnosticValidationWorkflows() *schema.Resource { Optional: true, }, "run_status": &schema.Schema{ - Description: `runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is 'PENDING'. If the workflow execution has started, runStatus is 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus is 'COMPLETED'. If the workflow execution fails while running validations, runStatus is 'FAILED'. + Description: `runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is *PENDING*. If the workflow execution has started, runStatus is *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus is *COMPLETED*. If the workflow execution fails while running validations, runStatus is *FAILED*. `, Type: schema.TypeString, Optional: true, @@ -95,7 +95,7 @@ func dataSourceDiagnosticValidationWorkflows() *schema.Resource { }, "run_status": &schema.Schema{ - Description: `Execution status of the workflow. If the workflow is successfully submitted, runStatus will return 'PENDING'. If the workflow execution has started, runStatus will return 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus will return 'COMPLETED'. If the workflow execution fails while running validations, runStatus will return 'FAILED'. + Description: `Execution status of the workflow. If the workflow is successfully submitted, runStatus will return *PENDING*. If the workflow execution has started, runStatus will return *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus will return *COMPLETED*. If the workflow execution fails while running validations, runStatus will return *FAILED*. `, Type: schema.TypeString, Computed: true, @@ -183,7 +183,7 @@ func dataSourceDiagnosticValidationWorkflows() *schema.Resource { }, "validation_status": &schema.Schema{ - Description: `Overall result of the validation set execution. If any of the contained validation execution status is 'CRITICAL', this is marked as 'CRITICAL'. Else, if any of the contained validation execution status is 'WARNING', this is marked as 'WARNING'. Else, this is marked as 'INFORMATION'. This is empty when the workflow is in progress. + Description: `Overall result of the validation set execution. If any of the contained validation execution status is *CRITICAL*, this is marked as *CRITICAL*. Else, if any of the contained validation execution status is *WARNING*, this is marked as *WARNING*. Else, this is marked as *INFORMATION*. This is empty when the workflow is in progress. `, Type: schema.TypeString, Computed: true, @@ -200,7 +200,7 @@ func dataSourceDiagnosticValidationWorkflows() *schema.Resource { }, "validation_status": &schema.Schema{ - Description: `Overall result of the execution of all the validations. If any of the contained validation execution status is 'CRITICAL', this is marked as 'CRITICAL'. Else, if any of the contained validation execution status is 'WARNING', this is marked as 'WARNING'. Else, this is marked as 'INFORMATION'. + Description: `Overall result of the execution of all the validations. If any of the contained validation execution status is *CRITICAL*, this is marked as *CRITICAL*. Else, if any of the contained validation execution status is *WARNING*, this is marked as *WARNING*. Else, this is marked as *INFORMATION*. `, Type: schema.TypeString, Computed: true, @@ -244,7 +244,7 @@ func dataSourceDiagnosticValidationWorkflows() *schema.Resource { }, "run_status": &schema.Schema{ - Description: `Execution status of the workflow. If the workflow is successfully submitted, runStatus will return 'PENDING'. If the workflow execution has started, runStatus will return 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus will return 'COMPLETED'. If the workflow execution fails while running validations, runStatus will return 'FAILED'. + Description: `Execution status of the workflow. If the workflow is successfully submitted, runStatus will return *PENDING*. If the workflow execution has started, runStatus will return *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus will return *COMPLETED*. If the workflow execution fails while running validations, runStatus will return *FAILED*. `, Type: schema.TypeString, Computed: true, @@ -305,8 +305,8 @@ func dataSourceDiagnosticValidationWorkflowsRead(ctx context.Context, d *schema. selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheListOfValidationWorkflows") - queryParams1 := catalystcentersdkgo.RetrievesTheListOfValidationWorkflowsQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesTheListOfValidationWorkflowsV1") + queryParams1 := catalystcentersdkgo.RetrievesTheListOfValidationWorkflowsV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -324,24 +324,24 @@ func dataSourceDiagnosticValidationWorkflowsRead(ctx context.Context, d *schema. queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.HealthAndPerformance.RetrievesTheListOfValidationWorkflows(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.RetrievesTheListOfValidationWorkflowsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheListOfValidationWorkflows", err, - "Failure at RetrievesTheListOfValidationWorkflows, unexpected response", "")) + "Failure when executing 2 RetrievesTheListOfValidationWorkflowsV1", err, + "Failure at RetrievesTheListOfValidationWorkflowsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenHealthAndPerformanceRetrievesTheListOfValidationWorkflowsItems(response1.Response) + vItems1 := flattenHealthAndPerformanceRetrievesTheListOfValidationWorkflowsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfValidationWorkflows response", + "Failure when setting RetrievesTheListOfValidationWorkflowsV1 response", err)) return diags } @@ -351,27 +351,27 @@ func dataSourceDiagnosticValidationWorkflowsRead(ctx context.Context, d *schema. } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: RetrievesValidationWorkflowDetails") + log.Printf("[DEBUG] Selected method: RetrievesValidationWorkflowDetailsV1") vvID := vID.(string) - response2, restyResp2, err := client.HealthAndPerformance.RetrievesValidationWorkflowDetails(vvID) + response2, restyResp2, err := client.HealthAndPerformance.RetrievesValidationWorkflowDetailsV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesValidationWorkflowDetails", err, - "Failure at RetrievesValidationWorkflowDetails, unexpected response", "")) + "Failure when executing 2 RetrievesValidationWorkflowDetailsV1", err, + "Failure at RetrievesValidationWorkflowDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItem(response2.Response) + vItem2 := flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesValidationWorkflowDetails response", + "Failure when setting RetrievesValidationWorkflowDetailsV1 response", err)) return diags } @@ -383,7 +383,7 @@ func dataSourceDiagnosticValidationWorkflowsRead(ctx context.Context, d *schema. return diags } -func flattenHealthAndPerformanceRetrievesTheListOfValidationWorkflowsItems(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflowsResponse) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesTheListOfValidationWorkflowsV1Items(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflowsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -404,7 +404,7 @@ func flattenHealthAndPerformanceRetrievesTheListOfValidationWorkflowsItems(items return respItems } -func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationWorkflowDetailsResponse) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationWorkflowDetailsV1Response) []map[string]interface{} { if item == nil { return nil } @@ -416,14 +416,14 @@ func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItem(item *cat respItem["submit_time"] = item.SubmitTime respItem["validation_set_ids"] = item.ValidationSetIDs respItem["release_version"] = item.ReleaseVersion - respItem["validation_sets_run_details"] = flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItemValidationSetsRunDetails(item.ValidationSetsRunDetails) + respItem["validation_sets_run_details"] = flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1ItemValidationSetsRunDetails(item.ValidationSetsRunDetails) respItem["validation_status"] = item.ValidationStatus return []map[string]interface{}{ respItem, } } -func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItemValidationSetsRunDetails(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationWorkflowDetailsResponseValidationSetsRunDetails) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1ItemValidationSetsRunDetails(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationWorkflowDetailsV1ResponseValidationSetsRunDetails) []map[string]interface{} { if items == nil { return nil } @@ -435,13 +435,13 @@ func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItemValidation respItem["end_time"] = item.EndTime respItem["validation_status"] = item.ValidationStatus respItem["version"] = item.Version - respItem["validation_run_details"] = flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItemValidationSetsRunDetailsValidationRunDetails(item.ValidationRunDetails) + respItem["validation_run_details"] = flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1ItemValidationSetsRunDetailsValidationRunDetails(item.ValidationRunDetails) respItems = append(respItems, respItem) } return respItems } -func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItemValidationSetsRunDetailsValidationRunDetails(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationWorkflowDetailsResponseValidationSetsRunDetailsValidationRunDetails) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1ItemValidationSetsRunDetailsValidationRunDetails(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesValidationWorkflowDetailsV1ResponseValidationSetsRunDetailsValidationRunDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_diagnostic_validation_workflows_count.go b/catalystcenter/data_source_diagnostic_validation_workflows_count.go index b80cebb..7a5e197 100644 --- a/catalystcenter/data_source_diagnostic_validation_workflows_count.go +++ b/catalystcenter/data_source_diagnostic_validation_workflows_count.go @@ -27,7 +27,7 @@ func dataSourceDiagnosticValidationWorkflowsCount() *schema.Resource { Optional: true, }, "run_status": &schema.Schema{ - Description: `runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is 'PENDING'. If the workflow execution has started, runStatus is 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus is 'COMPLETED'. If the workflow execution fails while running validations, runStatus is 'FAILED'. + Description: `runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is *PENDING*. If the workflow execution has started, runStatus is *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus is *COMPLETED*. If the workflow execution fails while running validations, runStatus is *FAILED*. `, Type: schema.TypeString, Optional: true, @@ -68,8 +68,8 @@ func dataSourceDiagnosticValidationWorkflowsCountRead(ctx context.Context, d *sc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheCountOfValidationWorkflows") - queryParams1 := catalystcentersdkgo.RetrievesTheCountOfValidationWorkflowsQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesTheCountOfValidationWorkflowsV1") + queryParams1 := catalystcentersdkgo.RetrievesTheCountOfValidationWorkflowsV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -81,24 +81,24 @@ func dataSourceDiagnosticValidationWorkflowsCountRead(ctx context.Context, d *sc queryParams1.RunStatus = vRunStatus.(string) } - response1, restyResp1, err := client.HealthAndPerformance.RetrievesTheCountOfValidationWorkflows(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.RetrievesTheCountOfValidationWorkflowsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheCountOfValidationWorkflows", err, - "Failure at RetrievesTheCountOfValidationWorkflows, unexpected response", "")) + "Failure when executing 2 RetrievesTheCountOfValidationWorkflowsV1", err, + "Failure at RetrievesTheCountOfValidationWorkflowsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenHealthAndPerformanceRetrievesTheCountOfValidationWorkflowsItem(response1.Response) + vItem1 := flattenHealthAndPerformanceRetrievesTheCountOfValidationWorkflowsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheCountOfValidationWorkflows response", + "Failure when setting RetrievesTheCountOfValidationWorkflowsV1 response", err)) return diags } @@ -110,7 +110,7 @@ func dataSourceDiagnosticValidationWorkflowsCountRead(ctx context.Context, d *sc return diags } -func flattenHealthAndPerformanceRetrievesTheCountOfValidationWorkflowsItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheCountOfValidationWorkflowsResponse) []map[string]interface{} { +func flattenHealthAndPerformanceRetrievesTheCountOfValidationWorkflowsV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheCountOfValidationWorkflowsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_disasterrecovery_system_operationstatus.go b/catalystcenter/data_source_disasterrecovery_system_operationstatus.go new file mode 100644 index 0000000..1eab911 --- /dev/null +++ b/catalystcenter/data_source_disasterrecovery_system_operationstatus.go @@ -0,0 +1,308 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceDisasterrecoverySystemOperationstatus() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Disaster Recovery. + +- Returns the status of Disaster Recovery operation performed on the system. +`, + + ReadContext: dataSourceDisasterrecoverySystemOperationstatusRead, + Schema: map[string]*schema.Schema{ + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "end_timestamp": &schema.Schema{ + Description: `End timestamp of the DR event +`, + Type: schema.TypeString, + Computed: true, + }, + + "initiated_by": &schema.Schema{ + Description: `Who initiated this event. Is it a system triggered one or user triggered one. +`, + Type: schema.TypeString, + Computed: true, + }, + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `This floating virtual IP address automatically moves to and operates on the site that is currently acting as your network's active site. If the interface is enterprise, then this address manages traffic between your disaster recovery system and your Enterprise network. If the interface is management, then this address manages traffic between your disaster recovery system and your Management network. +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface a Virtual IP address or not. This is true for Site VIP +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "message": &schema.Schema{ + Description: `Detailed Description about the DR event +`, + Type: schema.TypeString, + Computed: true, + }, + + "severity": &schema.Schema{ + Description: `Severity of the DR Event. +`, + Type: schema.TypeString, + Computed: true, + }, + + "site": &schema.Schema{ + Description: `Site of the DR in which this event occurred. +`, + Type: schema.TypeString, + Computed: true, + }, + + "start_timestamp": &schema.Schema{ + Description: `Starting timestamp of the DR event +`, + Type: schema.TypeString, + Computed: true, + }, + + "status": &schema.Schema{ + Description: `Status of the DR Event. +`, + Type: schema.TypeString, + Computed: true, + }, + + "tasks": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "end_timestamp": &schema.Schema{ + Description: `End timestamp of the DR event +`, + Type: schema.TypeString, + Computed: true, + }, + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `This floating virtual IP address automatically moves to and operates on the site that is currently acting as your network's active site. If the interface is enterprise, then this address manages traffic between your disaster recovery system and your Enterprise network. If the interface is management, then this address manages traffic between your disaster recovery system and your Management network. +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface a Virtual IP address or not. This is true for Site VIP +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "message": &schema.Schema{ + Description: `Detailed description about the DR event +`, + Type: schema.TypeString, + Computed: true, + }, + + "site": &schema.Schema{ + Description: `Site of the DR in which this event occured +`, + Type: schema.TypeString, + Computed: true, + }, + + "start_timestamp": &schema.Schema{ + Description: `Starting timestamp of the DR event +`, + Type: schema.TypeString, + Computed: true, + }, + + "status": &schema.Schema{ + Description: `Status of the DR event. +`, + Type: schema.TypeString, + Computed: true, + }, + + "title": &schema.Schema{ + Description: `DR Event Summary +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "title": &schema.Schema{ + Description: `DR Event Summary +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceDisasterrecoverySystemOperationstatusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: DisasterRecoveryOperationalStatusV1") + + response1, restyResp1, err := client.DisasterRecovery.DisasterRecoveryOperationalStatusV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 DisasterRecoveryOperationalStatusV1", err, + "Failure at DisasterRecoveryOperationalStatusV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting DisasterRecoveryOperationalStatusV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1Item(item *catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryOperationalStatusV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["severity"] = item.Severity + respItem["status"] = item.Status + respItem["initiated_by"] = item.InitiatedBy + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1ItemIPconfig(item.IPconfig) + respItem["tasks"] = flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1ItemTasks(item.Tasks) + respItem["title"] = item.Title + respItem["site"] = item.Site + respItem["start_timestamp"] = item.StartTimestamp + respItem["message"] = item.Message + respItem["end_timestamp"] = item.EndTimestamp + return []map[string]interface{}{ + respItem, + } +} + +func flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1ItemIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryOperationalStatusV1IPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = item.Vip + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1ItemTasks(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryOperationalStatusV1Tasks) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["status"] = item.Status + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1ItemTasksIPconfig(item.IPconfig) + respItem["title"] = item.Title + respItem["site"] = item.Site + respItem["start_timestamp"] = item.StartTimestamp + respItem["message"] = item.Message + respItem["end_timestamp"] = item.EndTimestamp + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryOperationalStatusV1ItemTasksIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryOperationalStatusV1TasksIPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = item.Vip + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_disasterrecovery_system_status.go b/catalystcenter/data_source_disasterrecovery_system_status.go new file mode 100644 index 0000000..2c787f6 --- /dev/null +++ b/catalystcenter/data_source_disasterrecovery_system_status.go @@ -0,0 +1,677 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceDisasterrecoverySystemStatus() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Disaster Recovery. + +- Detailed and Summarized status of DR components (Active, Standby and Witness system's health). +`, + + ReadContext: dataSourceDisasterrecoverySystemStatusRead, + Schema: map[string]*schema.Schema{ + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `This floating virtual IP address automatically moves to and operates on the site that is currently acting as your network's active site. If the interface is enterprise, then this address manages traffic between your disaster recovery system and your Enterprise network. If the interface is management, then this address manages traffic between your disaster recovery system and your Management network. +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface an Virtual IP address or not. This is true for Global DR VIP +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "ipsec_tunnel": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "side_a": &schema.Schema{ + Description: `A Side of the IPSec Tunnel +`, + Type: schema.TypeString, + Computed: true, + }, + + "side_b": &schema.Schema{ + Description: `Other Side of the IPSec Tunnel +`, + Type: schema.TypeString, + Computed: true, + }, + + "status": &schema.Schema{ + Description: `Status of this IPSec Tunnel +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "main": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `This floating virtual IP address automatically moves to and operates on the site that is currently acting as your network's active site. If the interface is enterprise, then this address manages traffic between your disaster recovery system and your Enterprise network. If the interface is management, then this address manages traffic between your disaster recovery system and your Management network. +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface an Virtual IP address or not. This is true for cluster level. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "nodes": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "hostname": &schema.Schema{ + Description: `Hostname of the node +`, + Type: schema.TypeString, + Computed: true, + }, + + "ipaddresses": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `Node IP address +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface a Virtual IP address or not. This is false for node level. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "state": &schema.Schema{ + Description: `State of the node +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "state": &schema.Schema{ + Description: `State of the Main Site. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "recovery": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `This floating virtual IP address automatically moves to and operates on the site that is currently acting as your network's active site. If the interface is enterprise, then this address manages traffic between your disaster recovery system and your Enterprise network. If the interface is management, then this address manages traffic between your disaster recovery system and your Management network. +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface an Virtual IP address or not. This is true for cluster level. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "nodes": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "hostname": &schema.Schema{ + Description: `Hostname of the node +`, + Type: schema.TypeString, + Computed: true, + }, + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `Node IP Address +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface a Virtual IP Address or not. This is false for node level. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "state": &schema.Schema{ + Description: `State of the node +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "state": &schema.Schema{ + Description: `State of the Recovery site +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "site": &schema.Schema{ + Description: `Site of the disaster recovery system. +`, + Type: schema.TypeString, + Computed: true, + }, + + "state": &schema.Schema{ + Description: `State of the Disaster Recovery System. +`, + Type: schema.TypeString, + Computed: true, + }, + + "witness": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `In case of witness, this is only an IP. +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface an Virtual IP address or not. This is false for witness. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "nodes": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "hostname": &schema.Schema{ + Description: `Hostname of the witness node +`, + Type: schema.TypeString, + Computed: true, + }, + + "ipconfig": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "interface": &schema.Schema{ + Description: `Enterprise or Management interface +`, + Type: schema.TypeString, + Computed: true, + }, + + "ip": &schema.Schema{ + Description: `In case of witness, this is only an IP +`, + Type: schema.TypeString, + Computed: true, + }, + + "vip": &schema.Schema{ + Description: `Is this interface an Virtual IP address or not. This is false for Witness +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "state": &schema.Schema{ + Description: `State of the node +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "state": &schema.Schema{ + Description: `State of the Witness Site +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceDisasterrecoverySystemStatusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: DisasterRecoveryStatusV1") + + response1, restyResp1, err := client.DisasterRecovery.DisasterRecoveryStatusV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 DisasterRecoveryStatusV1", err, + "Failure at DisasterRecoveryStatusV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenDisasterRecoveryDisasterRecoveryStatusV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting DisasterRecoveryStatusV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1Item(item *catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemIPconfig(item.IPconfig) + respItem["site"] = item.Site + respItem["main"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMain(item.Main) + respItem["recovery"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecovery(item.Recovery) + respItem["witness"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitness(item.Witness) + respItem["state"] = item.State + respItem["ipsec_tunnel"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemIPsecTunnel(item.IPsecTunnel) + return []map[string]interface{}{ + respItem, + } +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1IPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMain(item *catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1Main) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMainIPconfig(item.IPconfig) + respItem["state"] = item.State + respItem["nodes"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMainNodes(item.Nodes) + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMainIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1MainIPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMainNodes(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1MainNodes) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["hostname"] = item.Hostname + respItem["state"] = item.State + respItem["ipaddresses"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMainNodesIPaddresses(item.IPaddresses) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemMainNodesIPaddresses(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1MainNodesIPaddresses) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecovery(item *catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1Recovery) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecoveryIPconfig(item.IPconfig) + respItem["state"] = item.State + respItem["nodes"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecoveryNodes(item.Nodes) + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecoveryIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1RecoveryIPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecoveryNodes(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1RecoveryNodes) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["hostname"] = item.Hostname + respItem["state"] = item.State + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecoveryNodesIPconfig(item.IPconfig) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemRecoveryNodesIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1RecoveryNodesIPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitness(item *catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1Witness) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitnessIPconfig(item.IPconfig) + respItem["state"] = item.State + respItem["nodes"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitnessNodes(item.Nodes) + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitnessIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1WitnessIPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitnessNodes(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1WitnessNodes) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["hostname"] = item.Hostname + respItem["state"] = item.State + respItem["ipconfig"] = flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitnessNodesIPconfig(item.IPconfig) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemWitnessNodesIPconfig(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1WitnessNodesIPconfig) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["interface"] = item.Interface + respItem["vip"] = boolPtrToString(item.Vip) + respItem["ip"] = item.IP + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDisasterRecoveryDisasterRecoveryStatusV1ItemIPsecTunnel(items *[]catalystcentersdkgo.ResponseDisasterRecoveryDisasterRecoveryStatusV1IPsecTunnel) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["side_a"] = item.SideA + respItem["side_b"] = item.SideB + respItem["status"] = item.Status + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_discovery.go b/catalystcenter/data_source_discovery.go index 0a990e7..2834679 100644 --- a/catalystcenter/data_source_discovery.go +++ b/catalystcenter/data_source_discovery.go @@ -453,27 +453,27 @@ func dataSourceDiscoveryRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDiscoveryByID") + log.Printf("[DEBUG] Selected method: GetDiscoveryByIDV1") vvID := vID.(string) - response1, restyResp1, err := client.Discovery.GetDiscoveryByID(vvID) + response1, restyResp1, err := client.Discovery.GetDiscoveryByIDV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDiscoveryByID", err, - "Failure at GetDiscoveryByID, unexpected response", "")) + "Failure when executing 2 GetDiscoveryByIDV1", err, + "Failure at GetDiscoveryByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDiscoveryGetDiscoveryByIDItem(response1.Response) + vItem1 := flattenDiscoveryGetDiscoveryByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDiscoveryByID response", + "Failure when setting GetDiscoveryByIDV1 response", err)) return diags } @@ -485,12 +485,12 @@ func dataSourceDiscoveryRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenDiscoveryGetDiscoveryByIDItem(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDResponse) []map[string]interface{} { +func flattenDiscoveryGetDiscoveryByIDV1Item(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDiscoveryGetDiscoveryByIDItemAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDiscoveryGetDiscoveryByIDV1ItemAttributeInfo(item.AttributeInfo) respItem["cdp_level"] = item.CdpLevel respItem["device_ids"] = item.DeviceIDs respItem["discovery_condition"] = item.DiscoveryCondition @@ -498,8 +498,8 @@ func flattenDiscoveryGetDiscoveryByIDItem(item *catalystcentersdkgo.ResponseDisc respItem["discovery_type"] = item.DiscoveryType respItem["enable_password_list"] = item.EnablePasswordList respItem["global_credential_id_list"] = item.GlobalCredentialIDList - respItem["http_read_credential"] = flattenDiscoveryGetDiscoveryByIDItemHTTPReadCredential(item.HTTPReadCredential) - respItem["http_write_credential"] = flattenDiscoveryGetDiscoveryByIDItemHTTPWriteCredential(item.HTTPWriteCredential) + respItem["http_read_credential"] = flattenDiscoveryGetDiscoveryByIDV1ItemHTTPReadCredential(item.HTTPReadCredential) + respItem["http_write_credential"] = flattenDiscoveryGetDiscoveryByIDV1ItemHTTPWriteCredential(item.HTTPWriteCredential) respItem["id"] = item.ID respItem["ip_address_list"] = item.IPAddressList respItem["ip_filter_list"] = item.IPFilterList @@ -531,7 +531,7 @@ func flattenDiscoveryGetDiscoveryByIDItem(item *catalystcentersdkgo.ResponseDisc } } -func flattenDiscoveryGetDiscoveryByIDItemAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDResponseAttributeInfo) interface{} { +func flattenDiscoveryGetDiscoveryByIDV1ItemAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDV1ResponseAttributeInfo) interface{} { if item == nil { return nil } @@ -541,7 +541,7 @@ func flattenDiscoveryGetDiscoveryByIDItemAttributeInfo(item *catalystcentersdkgo } -func flattenDiscoveryGetDiscoveryByIDItemHTTPReadCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDResponseHTTPReadCredential) []map[string]interface{} { +func flattenDiscoveryGetDiscoveryByIDV1ItemHTTPReadCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDV1ResponseHTTPReadCredential) []map[string]interface{} { if item == nil { return nil } @@ -563,7 +563,7 @@ func flattenDiscoveryGetDiscoveryByIDItemHTTPReadCredential(item *catalystcenter } -func flattenDiscoveryGetDiscoveryByIDItemHTTPWriteCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDResponseHTTPWriteCredential) []map[string]interface{} { +func flattenDiscoveryGetDiscoveryByIDV1ItemHTTPWriteCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryByIDV1ResponseHTTPWriteCredential) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_discovery_count.go b/catalystcenter/data_source_discovery_count.go index b665c02..65ea3a7 100644 --- a/catalystcenter/data_source_discovery_count.go +++ b/catalystcenter/data_source_discovery_count.go @@ -52,26 +52,26 @@ func dataSourceDiscoveryCountRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetCountOfAllDiscoveryJobs") + log.Printf("[DEBUG] Selected method: GetCountOfAllDiscoveryJobsV1") - response1, restyResp1, err := client.Discovery.GetCountOfAllDiscoveryJobs() + response1, restyResp1, err := client.Discovery.GetCountOfAllDiscoveryJobsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetCountOfAllDiscoveryJobs", err, - "Failure at GetCountOfAllDiscoveryJobs, unexpected response", "")) + "Failure when executing 2 GetCountOfAllDiscoveryJobsV1", err, + "Failure at GetCountOfAllDiscoveryJobsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDiscoveryGetCountOfAllDiscoveryJobsItem(response1) + vItem1 := flattenDiscoveryGetCountOfAllDiscoveryJobsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetCountOfAllDiscoveryJobs response", + "Failure when setting GetCountOfAllDiscoveryJobsV1 response", err)) return diags } @@ -83,7 +83,7 @@ func dataSourceDiscoveryCountRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDiscoveryGetCountOfAllDiscoveryJobsItem(item *catalystcentersdkgo.ResponseDiscoveryGetCountOfAllDiscoveryJobs) []map[string]interface{} { +func flattenDiscoveryGetCountOfAllDiscoveryJobsV1Item(item *catalystcentersdkgo.ResponseDiscoveryGetCountOfAllDiscoveryJobsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_discovery_device.go b/catalystcenter/data_source_discovery_device.go index e16ea29..b7fc15f 100644 --- a/catalystcenter/data_source_discovery_device.go +++ b/catalystcenter/data_source_discovery_device.go @@ -374,32 +374,32 @@ func dataSourceDiscoveryDeviceRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDiscoveredNetworkDevicesByDiscoveryID") + log.Printf("[DEBUG] Selected method: GetDiscoveredNetworkDevicesByDiscoveryIDV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetDiscoveredNetworkDevicesByDiscoveryIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetDiscoveredNetworkDevicesByDiscoveryIDV1QueryParams{} if okTaskID { queryParams1.TaskID = vTaskID.(string) } - response1, restyResp1, err := client.Discovery.GetDiscoveredNetworkDevicesByDiscoveryID(vvID, &queryParams1) + response1, restyResp1, err := client.Discovery.GetDiscoveredNetworkDevicesByDiscoveryIDV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDiscoveredNetworkDevicesByDiscoveryID", err, - "Failure at GetDiscoveredNetworkDevicesByDiscoveryID, unexpected response", "")) + "Failure when executing 2 GetDiscoveredNetworkDevicesByDiscoveryIDV1", err, + "Failure at GetDiscoveredNetworkDevicesByDiscoveryIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetDiscoveredNetworkDevicesByDiscoveryIDItems(response1.Response) + vItems1 := flattenDiscoveryGetDiscoveredNetworkDevicesByDiscoveryIDV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDiscoveredNetworkDevicesByDiscoveryID response", + "Failure when setting GetDiscoveredNetworkDevicesByDiscoveryIDV1 response", err)) return diags } @@ -411,7 +411,7 @@ func dataSourceDiscoveryDeviceRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDiscoveryGetDiscoveredNetworkDevicesByDiscoveryIDItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveredNetworkDevicesByDiscoveryIDResponse) []map[string]interface{} { +func flattenDiscoveryGetDiscoveredNetworkDevicesByDiscoveryIDV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveredNetworkDevicesByDiscoveryIDV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_discovery_device_count.go b/catalystcenter/data_source_discovery_device_count.go index 22f9f85..497b72a 100644 --- a/catalystcenter/data_source_discovery_device_count.go +++ b/catalystcenter/data_source_discovery_device_count.go @@ -66,32 +66,32 @@ func dataSourceDiscoveryDeviceCountRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDevicesDiscoveredByID") + log.Printf("[DEBUG] Selected method: GetDevicesDiscoveredByIDV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetDevicesDiscoveredByIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetDevicesDiscoveredByIDV1QueryParams{} if okTaskID { queryParams1.TaskID = vTaskID.(string) } - response1, restyResp1, err := client.Discovery.GetDevicesDiscoveredByID(vvID, &queryParams1) + response1, restyResp1, err := client.Discovery.GetDevicesDiscoveredByIDV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDevicesDiscoveredByID", err, - "Failure at GetDevicesDiscoveredByID, unexpected response", "")) + "Failure when executing 2 GetDevicesDiscoveredByIDV1", err, + "Failure at GetDevicesDiscoveredByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDiscoveryGetDevicesDiscoveredByIDItem(response1) + vItem1 := flattenDiscoveryGetDevicesDiscoveredByIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDevicesDiscoveredByID response", + "Failure when setting GetDevicesDiscoveredByIDV1 response", err)) return diags } @@ -103,7 +103,7 @@ func dataSourceDiscoveryDeviceCountRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenDiscoveryGetDevicesDiscoveredByIDItem(item *catalystcentersdkgo.ResponseDiscoveryGetDevicesDiscoveredByID) []map[string]interface{} { +func flattenDiscoveryGetDevicesDiscoveredByIDV1Item(item *catalystcentersdkgo.ResponseDiscoveryGetDevicesDiscoveredByIDV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_discovery_device_range.go b/catalystcenter/data_source_discovery_device_range.go index 8e84b04..a152964 100644 --- a/catalystcenter/data_source_discovery_device_range.go +++ b/catalystcenter/data_source_discovery_device_range.go @@ -390,34 +390,34 @@ func dataSourceDiscoveryDeviceRangeRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDiscoveredDevicesByRange") + log.Printf("[DEBUG] Selected method: GetDiscoveredDevicesByRangeV1") vvID := vID.(string) vvStartIndex := vStartIndex.(int) vvRecordsToReturn := vRecordsToReturn.(int) - queryParams1 := catalystcentersdkgo.GetDiscoveredDevicesByRangeQueryParams{} + queryParams1 := catalystcentersdkgo.GetDiscoveredDevicesByRangeV1QueryParams{} if okTaskID { queryParams1.TaskID = vTaskID.(string) } - response1, restyResp1, err := client.Discovery.GetDiscoveredDevicesByRange(vvID, vvStartIndex, vvRecordsToReturn, &queryParams1) + response1, restyResp1, err := client.Discovery.GetDiscoveredDevicesByRangeV1(vvID, vvStartIndex, vvRecordsToReturn, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDiscoveredDevicesByRange", err, - "Failure at GetDiscoveredDevicesByRange, unexpected response", "")) + "Failure when executing 2 GetDiscoveredDevicesByRangeV1", err, + "Failure at GetDiscoveredDevicesByRangeV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetDiscoveredDevicesByRangeItems(response1.Response) + vItems1 := flattenDiscoveryGetDiscoveredDevicesByRangeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDiscoveredDevicesByRange response", + "Failure when setting GetDiscoveredDevicesByRangeV1 response", err)) return diags } @@ -429,7 +429,7 @@ func dataSourceDiscoveryDeviceRangeRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenDiscoveryGetDiscoveredDevicesByRangeItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveredDevicesByRangeResponse) []map[string]interface{} { +func flattenDiscoveryGetDiscoveredDevicesByRangeV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveredDevicesByRangeV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_discovery_job_by_id.go b/catalystcenter/data_source_discovery_job_by_id.go index 97281fd..046d325 100644 --- a/catalystcenter/data_source_discovery_job_by_id.go +++ b/catalystcenter/data_source_discovery_job_by_id.go @@ -181,9 +181,9 @@ func dataSourceDiscoveryJobByIDRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetListOfDiscoveriesByDiscoveryID") + log.Printf("[DEBUG] Selected method: GetListOfDiscoveriesByDiscoveryIDV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetListOfDiscoveriesByDiscoveryIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetListOfDiscoveriesByDiscoveryIDV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(int) @@ -195,24 +195,24 @@ func dataSourceDiscoveryJobByIDRead(ctx context.Context, d *schema.ResourceData, queryParams1.IPAddress = vIPAddress.(string) } - response1, restyResp1, err := client.Discovery.GetListOfDiscoveriesByDiscoveryID(vvID, &queryParams1) + response1, restyResp1, err := client.Discovery.GetListOfDiscoveriesByDiscoveryIDV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetListOfDiscoveriesByDiscoveryID", err, - "Failure at GetListOfDiscoveriesByDiscoveryID, unexpected response", "")) + "Failure when executing 2 GetListOfDiscoveriesByDiscoveryIDV1", err, + "Failure at GetListOfDiscoveriesByDiscoveryIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDItems(response1.Response) + vItems1 := flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetListOfDiscoveriesByDiscoveryID response", + "Failure when setting GetListOfDiscoveriesByDiscoveryIDV1 response", err)) return diags } @@ -224,14 +224,14 @@ func dataSourceDiscoveryJobByIDRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetListOfDiscoveriesByDiscoveryIDResponse) []map[string]interface{} { +func flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetListOfDiscoveriesByDiscoveryIDV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDItemsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDV1ItemsAttributeInfo(item.AttributeInfo) respItem["clistatus"] = item.Clistatus respItem["discovery_status"] = item.DiscoveryStatus respItem["end_time"] = item.EndTime @@ -252,7 +252,7 @@ func flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDItems(items *[]catalystcen return respItems } -func flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDItemsAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetListOfDiscoveriesByDiscoveryIDResponseAttributeInfo) interface{} { +func flattenDiscoveryGetListOfDiscoveriesByDiscoveryIDV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetListOfDiscoveriesByDiscoveryIDV1ResponseAttributeInfo) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_discovery_jobs.go b/catalystcenter/data_source_discovery_jobs.go index 70161e2..8601ef2 100644 --- a/catalystcenter/data_source_discovery_jobs.go +++ b/catalystcenter/data_source_discovery_jobs.go @@ -144,8 +144,8 @@ func dataSourceDiscoveryJobsRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDiscoveryJobsByIP") - queryParams1 := catalystcentersdkgo.GetDiscoveryJobsByIPQueryParams{} + log.Printf("[DEBUG] Selected method: GetDiscoveryJobsByIPV1") + queryParams1 := catalystcentersdkgo.GetDiscoveryJobsByIPV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(int) @@ -159,24 +159,24 @@ func dataSourceDiscoveryJobsRead(ctx context.Context, d *schema.ResourceData, m queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.Discovery.GetDiscoveryJobsByIP(&queryParams1) + response1, restyResp1, err := client.Discovery.GetDiscoveryJobsByIPV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDiscoveryJobsByIP", err, - "Failure at GetDiscoveryJobsByIP, unexpected response", "")) + "Failure when executing 2 GetDiscoveryJobsByIPV1", err, + "Failure at GetDiscoveryJobsByIPV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetDiscoveryJobsByIPItems(response1.Response) + vItems1 := flattenDiscoveryGetDiscoveryJobsByIPV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDiscoveryJobsByIP response", + "Failure when setting GetDiscoveryJobsByIPV1 response", err)) return diags } @@ -188,14 +188,14 @@ func dataSourceDiscoveryJobsRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDiscoveryGetDiscoveryJobsByIPItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveryJobsByIPResponse) []map[string]interface{} { +func flattenDiscoveryGetDiscoveryJobsByIPV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveryJobsByIPV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDiscoveryGetDiscoveryJobsByIPItemsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDiscoveryGetDiscoveryJobsByIPV1ItemsAttributeInfo(item.AttributeInfo) respItem["clistatus"] = item.Clistatus respItem["discovery_status"] = item.DiscoveryStatus respItem["end_time"] = item.EndTime @@ -216,7 +216,7 @@ func flattenDiscoveryGetDiscoveryJobsByIPItems(items *[]catalystcentersdkgo.Resp return respItems } -func flattenDiscoveryGetDiscoveryJobsByIPItemsAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryJobsByIPResponseAttributeInfo) interface{} { +func flattenDiscoveryGetDiscoveryJobsByIPV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveryJobsByIPV1ResponseAttributeInfo) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_discovery_range.go b/catalystcenter/data_source_discovery_range.go index b1d2c84..03a9517 100644 --- a/catalystcenter/data_source_discovery_range.go +++ b/catalystcenter/data_source_discovery_range.go @@ -460,28 +460,28 @@ func dataSourceDiscoveryRangeRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDiscoveriesByRange") + log.Printf("[DEBUG] Selected method: GetDiscoveriesByRangeV1") vvStartIndex := vStartIndex.(int) vvRecordsToReturn := vRecordsToReturn.(int) - response1, restyResp1, err := client.Discovery.GetDiscoveriesByRange(vvStartIndex, vvRecordsToReturn) + response1, restyResp1, err := client.Discovery.GetDiscoveriesByRangeV1(vvStartIndex, vvRecordsToReturn) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDiscoveriesByRange", err, - "Failure at GetDiscoveriesByRange, unexpected response", "")) + "Failure when executing 2 GetDiscoveriesByRangeV1", err, + "Failure at GetDiscoveriesByRangeV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetDiscoveriesByRangeItems(response1.Response) + vItems1 := flattenDiscoveryGetDiscoveriesByRangeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDiscoveriesByRange response", + "Failure when setting GetDiscoveriesByRangeV1 response", err)) return diags } @@ -493,14 +493,14 @@ func dataSourceDiscoveryRangeRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDiscoveryGetDiscoveriesByRangeItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeResponse) []map[string]interface{} { +func flattenDiscoveryGetDiscoveriesByRangeV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDiscoveryGetDiscoveriesByRangeItemsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDiscoveryGetDiscoveriesByRangeV1ItemsAttributeInfo(item.AttributeInfo) respItem["cdp_level"] = item.CdpLevel respItem["device_ids"] = item.DeviceIDs respItem["discovery_condition"] = item.DiscoveryCondition @@ -508,8 +508,8 @@ func flattenDiscoveryGetDiscoveriesByRangeItems(items *[]catalystcentersdkgo.Res respItem["discovery_type"] = item.DiscoveryType respItem["enable_password_list"] = item.EnablePasswordList respItem["global_credential_id_list"] = item.GlobalCredentialIDList - respItem["http_read_credential"] = flattenDiscoveryGetDiscoveriesByRangeItemsHTTPReadCredential(item.HTTPReadCredential) - respItem["http_write_credential"] = flattenDiscoveryGetDiscoveriesByRangeItemsHTTPWriteCredential(item.HTTPWriteCredential) + respItem["http_read_credential"] = flattenDiscoveryGetDiscoveriesByRangeV1ItemsHTTPReadCredential(item.HTTPReadCredential) + respItem["http_write_credential"] = flattenDiscoveryGetDiscoveriesByRangeV1ItemsHTTPWriteCredential(item.HTTPWriteCredential) respItem["id"] = item.ID respItem["ip_address_list"] = item.IPAddressList respItem["ip_filter_list"] = item.IPFilterList @@ -541,7 +541,7 @@ func flattenDiscoveryGetDiscoveriesByRangeItems(items *[]catalystcentersdkgo.Res return respItems } -func flattenDiscoveryGetDiscoveriesByRangeItemsAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeResponseAttributeInfo) interface{} { +func flattenDiscoveryGetDiscoveriesByRangeV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeV1ResponseAttributeInfo) interface{} { if item == nil { return nil } @@ -551,7 +551,7 @@ func flattenDiscoveryGetDiscoveriesByRangeItemsAttributeInfo(item *catalystcente } -func flattenDiscoveryGetDiscoveriesByRangeItemsHTTPReadCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeResponseHTTPReadCredential) []map[string]interface{} { +func flattenDiscoveryGetDiscoveriesByRangeV1ItemsHTTPReadCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeV1ResponseHTTPReadCredential) []map[string]interface{} { if item == nil { return nil } @@ -573,7 +573,7 @@ func flattenDiscoveryGetDiscoveriesByRangeItemsHTTPReadCredential(item *catalyst } -func flattenDiscoveryGetDiscoveriesByRangeItemsHTTPWriteCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeResponseHTTPWriteCredential) []map[string]interface{} { +func flattenDiscoveryGetDiscoveriesByRangeV1ItemsHTTPWriteCredential(item *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeV1ResponseHTTPWriteCredential) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_discovery_summary.go b/catalystcenter/data_source_discovery_summary.go index 17eb5e6..1588eec 100644 --- a/catalystcenter/data_source_discovery_summary.go +++ b/catalystcenter/data_source_discovery_summary.go @@ -140,9 +140,9 @@ func dataSourceDiscoverySummaryRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetworkDevicesFromDiscovery") + log.Printf("[DEBUG] Selected method: GetNetworkDevicesFromDiscoveryV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetNetworkDevicesFromDiscoveryQueryParams{} + queryParams1 := catalystcentersdkgo.GetNetworkDevicesFromDiscoveryV1QueryParams{} if okTaskID { queryParams1.TaskID = vTaskID.(string) @@ -172,24 +172,24 @@ func dataSourceDiscoverySummaryRead(ctx context.Context, d *schema.ResourceData, queryParams1.HTTPStatus = interfaceToSliceString(vHTTPStatus) } - response1, restyResp1, err := client.Discovery.GetNetworkDevicesFromDiscovery(vvID, &queryParams1) + response1, restyResp1, err := client.Discovery.GetNetworkDevicesFromDiscoveryV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetworkDevicesFromDiscovery", err, - "Failure at GetNetworkDevicesFromDiscovery, unexpected response", "")) + "Failure when executing 2 GetNetworkDevicesFromDiscoveryV1", err, + "Failure at GetNetworkDevicesFromDiscoveryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDiscoveryGetNetworkDevicesFromDiscoveryItem(response1) + vItem1 := flattenDiscoveryGetNetworkDevicesFromDiscoveryV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetworkDevicesFromDiscovery response", + "Failure when setting GetNetworkDevicesFromDiscoveryV1 response", err)) return diags } @@ -201,7 +201,7 @@ func dataSourceDiscoverySummaryRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDiscoveryGetNetworkDevicesFromDiscoveryItem(item *catalystcentersdkgo.ResponseDiscoveryGetNetworkDevicesFromDiscovery) []map[string]interface{} { +func flattenDiscoveryGetNetworkDevicesFromDiscoveryV1Item(item *catalystcentersdkgo.ResponseDiscoveryGetNetworkDevicesFromDiscoveryV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_dna_command_runner_keywords.go b/catalystcenter/data_source_dna_command_runner_keywords.go index 62dbb03..a89d0c9 100644 --- a/catalystcenter/data_source_dna_command_runner_keywords.go +++ b/catalystcenter/data_source_dna_command_runner_keywords.go @@ -53,26 +53,26 @@ func dataSourceDnaCommandRunnerKeywordsRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllKeywordsOfClisAcceptedByCommandRunner") + log.Printf("[DEBUG] Selected method: GetAllKeywordsOfClisAcceptedByCommandRunnerV1") - response1, restyResp1, err := client.CommandRunner.GetAllKeywordsOfClisAcceptedByCommandRunner() + response1, restyResp1, err := client.CommandRunner.GetAllKeywordsOfClisAcceptedByCommandRunnerV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllKeywordsOfClisAcceptedByCommandRunner", err, - "Failure at GetAllKeywordsOfClisAcceptedByCommandRunner, unexpected response", "")) + "Failure when executing 2 GetAllKeywordsOfClisAcceptedByCommandRunnerV1", err, + "Failure at GetAllKeywordsOfClisAcceptedByCommandRunnerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenCommandRunnerGetAllKeywordsOfClisAcceptedByCommandRunnerItems(response1) + vItems1 := flattenCommandRunnerGetAllKeywordsOfClisAcceptedByCommandRunnerV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllKeywordsOfClisAcceptedByCommandRunner response", + "Failure when setting GetAllKeywordsOfClisAcceptedByCommandRunnerV1 response", err)) return diags } @@ -84,7 +84,7 @@ func dataSourceDnaCommandRunnerKeywordsRead(ctx context.Context, d *schema.Resou return diags } -func flattenCommandRunnerGetAllKeywordsOfClisAcceptedByCommandRunnerItems(items *catalystcentersdkgo.ResponseCommandRunnerGetAllKeywordsOfClisAcceptedByCommandRunner) []map[string]interface{} { +func flattenCommandRunnerGetAllKeywordsOfClisAcceptedByCommandRunnerV1Items(items *catalystcentersdkgo.ResponseCommandRunnerGetAllKeywordsOfClisAcceptedByCommandRunnerV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_dna_event_snmp_config.go b/catalystcenter/data_source_dna_event_snmp_config.go index f30849c..102c973 100644 --- a/catalystcenter/data_source_dna_event_snmp_config.go +++ b/catalystcenter/data_source_dna_event_snmp_config.go @@ -164,8 +164,8 @@ func dataSourceDnaEventSNMPConfigRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSNMPDestination") - queryParams1 := catalystcentersdkgo.GetSNMPDestinationQueryParams{} + log.Printf("[DEBUG] Selected method: GetSNMPDestinationV1") + queryParams1 := catalystcentersdkgo.GetSNMPDestinationV1QueryParams{} if okConfigID { queryParams1.ConfigID = vConfigID.(string) @@ -183,24 +183,24 @@ func dataSourceDnaEventSNMPConfigRead(ctx context.Context, d *schema.ResourceDat queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetSNMPDestination(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetSNMPDestinationV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSNMPDestination", err, - "Failure at GetSNMPDestination, unexpected response", "")) + "Failure when executing 2 GetSNMPDestinationV1", err, + "Failure at GetSNMPDestinationV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetSNMPDestinationItems(response1) + vItems1 := flattenEventManagementGetSNMPDestinationV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSNMPDestination response", + "Failure when setting GetSNMPDestinationV1 response", err)) return diags } @@ -212,7 +212,7 @@ func dataSourceDnaEventSNMPConfigRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenEventManagementGetSNMPDestinationItems(items *catalystcentersdkgo.ResponseEventManagementGetSNMPDestination) []map[string]interface{} { +func flattenEventManagementGetSNMPDestinationV1Items(items *catalystcentersdkgo.ResponseEventManagementGetSNMPDestinationV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_dnac_packages.go b/catalystcenter/data_source_dnac_packages.go index 64a3a19..1cc7f4b 100644 --- a/catalystcenter/data_source_dnac_packages.go +++ b/catalystcenter/data_source_dnac_packages.go @@ -15,7 +15,7 @@ func dataSourceDnacPackages() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Platform. -- Provides information such as name, version of packages installed on the Catalyst Center. +- Provides information such as name, version of packages installed on the DNA center. `, ReadContext: dataSourceDnacPackagesRead, @@ -54,26 +54,26 @@ func dataSourceDnacPackagesRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CiscoDnaCenterPackagesSummary") + log.Printf("[DEBUG] Selected method: CiscoDnaCenterPackagesSummaryV1") - response1, restyResp1, err := client.Platform.CiscoDnaCenterPackagesSummary() + response1, restyResp1, err := client.Platform.CiscoDnaCenterPackagesSummaryV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CiscoDnaCenterPackagesSummary", err, - "Failure at CiscoDnaCenterPackagesSummary, unexpected response", "")) + "Failure when executing 2 CiscoDnaCenterPackagesSummaryV1", err, + "Failure at CiscoDnaCenterPackagesSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenPlatformCiscoDnaCenterPackagesSummaryItems(response1.Response) + vItems1 := flattenPlatformCiscoDnaCenterPackagesSummaryV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting CiscoDnaCenterPackagesSummary response", + "Failure when setting CiscoDnaCenterPackagesSummaryV1 response", err)) return diags } @@ -85,7 +85,7 @@ func dataSourceDnacPackagesRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenPlatformCiscoDnaCenterPackagesSummaryItems(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterPackagesSummaryResponse) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterPackagesSummaryV1Items(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterPackagesSummaryV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_dnacaap_management_execution_status.go b/catalystcenter/data_source_dnacaap_management_execution_status.go index ff4f083..5a4d2a8 100644 --- a/catalystcenter/data_source_dnacaap_management_execution_status.go +++ b/catalystcenter/data_source_dnacaap_management_execution_status.go @@ -124,27 +124,27 @@ func dataSourceDnacaapManagementExecutionStatusRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetBusinessAPIExecutionDetails") + log.Printf("[DEBUG] Selected method: GetBusinessAPIExecutionDetailsV1") vvExecutionID := vExecutionID.(string) - response1, restyResp1, err := client.Task.GetBusinessAPIExecutionDetails(vvExecutionID) + response1, restyResp1, err := client.Task.GetBusinessAPIExecutionDetailsV1(vvExecutionID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetBusinessAPIExecutionDetails", err, - "Failure at GetBusinessAPIExecutionDetails, unexpected response", "")) + "Failure when executing 2 GetBusinessAPIExecutionDetailsV1", err, + "Failure at GetBusinessAPIExecutionDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTaskGetBusinessAPIExecutionDetailsItem(response1) + vItem1 := flattenTaskGetBusinessAPIExecutionDetailsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetBusinessAPIExecutionDetails response", + "Failure when setting GetBusinessAPIExecutionDetailsV1 response", err)) return diags } @@ -156,7 +156,7 @@ func dataSourceDnacaapManagementExecutionStatusRead(ctx context.Context, d *sche return diags } -func flattenTaskGetBusinessAPIExecutionDetailsItem(item *catalystcentersdkgo.ResponseTaskGetBusinessAPIExecutionDetails) []map[string]interface{} { +func flattenTaskGetBusinessAPIExecutionDetailsV1Item(item *catalystcentersdkgo.ResponseTaskGetBusinessAPIExecutionDetailsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_endpoint_analytics_profiling_rules.go b/catalystcenter/data_source_endpoint_analytics_profiling_rules.go new file mode 100644 index 0000000..f97b8d3 --- /dev/null +++ b/catalystcenter/data_source_endpoint_analytics_profiling_rules.go @@ -0,0 +1,595 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceEndpointAnalyticsProfilingRules() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AIEndpointAnalytics. + +- This data source fetches the list of profiling rules. It can be used to show profiling rules in client applications, +or export those from an environment. 'POST /profiling-rules/bulk' API can be used to import such exported rules into +another environment. If this API is used to export rules to be imported into another Cisco DNA Center system, then +ensure that 'includeDeleted' parameter is 'true', so that deleted rules get synchronized correctly. Use query parameters +to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the +response. By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, +if required. 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system. + +- Fetches details of the profiling rule for the given 'ruleId'. +`, + + ReadContext: dataSourceEndpointAnalyticsProfilingRulesRead, + Schema: map[string]*schema.Schema{ + "include_deleted": &schema.Schema{ + Description: `includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +`, + Type: schema.TypeBool, + Optional: true, + }, + "limit": &schema.Schema{ + Description: `limit query parameter. Maximum number of records to be fetched. If not provided, 500 records will be fetched by default. To fetch all the records in the system, provide a large value for this parameter. +`, + Type: schema.TypeFloat, + Optional: true, + }, + "offset": &schema.Schema{ + Description: `offset query parameter. Record offset to start data fetch at. Offset starts at zero. +`, + Type: schema.TypeFloat, + Optional: true, + }, + "order": &schema.Schema{ + Description: `order query parameter. Order to be used for sorting. +`, + Type: schema.TypeString, + Optional: true, + }, + "rule_id": &schema.Schema{ + Description: `ruleId path parameter. Unique rule identifier +`, + Type: schema.TypeString, + Optional: true, + }, + "rule_type": &schema.Schema{ + Description: `ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. +`, + Type: schema.TypeString, + Optional: true, + }, + "sort_by": &schema.Schema{ + Description: `sortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more time if sorting is requested. +`, + Type: schema.TypeString, + Optional: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Computed: true, + }, + + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "result": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Computed: true, + }, + + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Computed: true, + }, + + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "result": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceEndpointAnalyticsProfilingRulesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vRuleType, okRuleType := d.GetOk("rule_type") + vIncludeDeleted, okIncludeDeleted := d.GetOk("include_deleted") + vLimit, okLimit := d.GetOk("limit") + vOffset, okOffset := d.GetOk("offset") + vSortBy, okSortBy := d.GetOk("sort_by") + vOrder, okOrder := d.GetOk("order") + vRuleID, okRuleID := d.GetOk("rule_id") + + method1 := []bool{okRuleType, okIncludeDeleted, okLimit, okOffset, okSortBy, okOrder} + log.Printf("[DEBUG] Selecting method. Method 1 %v", method1) + method2 := []bool{okRuleID} + log.Printf("[DEBUG] Selecting method. Method 2 %v", method2) + + selectedMethod := pickMethod([][]bool{method1, method2}) + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetListOfProfilingRulesV1") + queryParams1 := catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams{} + + if okRuleType { + queryParams1.RuleType = vRuleType.(string) + } + if okIncludeDeleted { + queryParams1.IncludeDeleted = vIncludeDeleted.(bool) + } + if okLimit { + queryParams1.Limit = vLimit.(float64) + } + if okOffset { + queryParams1.Offset = vOffset.(float64) + } + if okSortBy { + queryParams1.SortBy = vSortBy.(string) + } + if okOrder { + queryParams1.Order = vOrder.(string) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.GetListOfProfilingRulesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetListOfProfilingRulesV1", err, + "Failure at GetListOfProfilingRulesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenAIEndpointAnalyticsGetListOfProfilingRulesV1Items(response1.ProfilingRules) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetListOfProfilingRulesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + if selectedMethod == 2 { + log.Printf("[DEBUG] Selected method: GetDetailsOfASingleProfilingRuleV1") + vvRuleID := vRuleID.(string) + + response2, restyResp2, err := client.AIEndpointAnalytics.GetDetailsOfASingleProfilingRuleV1(vvRuleID) + + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetDetailsOfASingleProfilingRuleV1", err, + "Failure at GetDetailsOfASingleProfilingRuleV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) + + vItem2 := flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1Item(response2) + if err := d.Set("item", vItem2); err != nil { + diags = append(diags, diagError( + "Failure when setting GetDetailsOfASingleProfilingRuleV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} diff --git a/catalystcenter/data_source_eox_status_device.go b/catalystcenter/data_source_eox_status_device.go index d0da907..66bfb94 100644 --- a/catalystcenter/data_source_eox_status_device.go +++ b/catalystcenter/data_source_eox_status_device.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceEoxStatusDevice() *schema.Resource { +func dataSourceEoXStatusDevice() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on EoX. @@ -20,7 +20,7 @@ func dataSourceEoxStatusDevice() *schema.Resource { - Retrieves EoX details for a device `, - ReadContext: dataSourceEoxStatusDeviceRead, + ReadContext: dataSourceEoXStatusDeviceRead, Schema: map[string]*schema.Schema{ "device_id": &schema.Schema{ Description: `deviceId path parameter. Device instance UUID @@ -284,7 +284,7 @@ func dataSourceEoxStatusDevice() *schema.Resource { } } -func dataSourceEoxStatusDeviceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceEoXStatusDeviceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -297,26 +297,26 @@ func dataSourceEoxStatusDeviceRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEoxStatusForAllDevices") + log.Printf("[DEBUG] Selected method: GetEoXStatusForAllDevicesV1") - response1, restyResp1, err := client.Eox.GetEoxStatusForAllDevices() + response1, restyResp1, err := client.EoX.GetEoXStatusForAllDevicesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEoxStatusForAllDevices", err, - "Failure at GetEoxStatusForAllDevices, unexpected response", "")) + "Failure when executing 2 GetEoXStatusForAllDevicesV1", err, + "Failure at GetEoXStatusForAllDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEoxGetEoxStatusForAllDevicesItems(response1.Response) + vItems1 := flattenEoXGetEoXStatusForAllDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEoxStatusForAllDevices response", + "Failure when setting GetEoXStatusForAllDevicesV1 response", err)) return diags } @@ -326,27 +326,27 @@ func dataSourceEoxStatusDeviceRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetEoxDetailsPerDevice") + log.Printf("[DEBUG] Selected method: GetEoXDetailsPerDeviceV1") vvDeviceID := vDeviceID.(string) - response2, restyResp2, err := client.Eox.GetEoxDetailsPerDevice(vvDeviceID) + response2, restyResp2, err := client.EoX.GetEoXDetailsPerDeviceV1(vvDeviceID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEoxDetailsPerDevice", err, - "Failure at GetEoxDetailsPerDevice, unexpected response", "")) + "Failure when executing 2 GetEoXDetailsPerDeviceV1", err, + "Failure at GetEoXDetailsPerDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenEoxGetEoxDetailsPerDeviceItem(response2.Response) + vItem2 := flattenEoXGetEoXDetailsPerDeviceV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetEoxDetailsPerDevice response", + "Failure when setting GetEoXDetailsPerDeviceV1 response", err)) return diags } @@ -358,7 +358,7 @@ func dataSourceEoxStatusDeviceRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenEoxGetEoxStatusForAllDevicesItems(items *[]catalystcentersdkgo.ResponseEoxGetEoxStatusForAllDevicesResponse) []map[string]interface{} { +func flattenEoXGetEoXStatusForAllDevicesV1Items(items *[]catalystcentersdkgo.ResponseEoXGetEoXStatusForAllDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -367,7 +367,7 @@ func flattenEoxGetEoxStatusForAllDevicesItems(items *[]catalystcentersdkgo.Respo respItem := make(map[string]interface{}) respItem["device_id"] = item.DeviceID respItem["alert_count"] = item.AlertCount - respItem["summary"] = flattenEoxGetEoxStatusForAllDevicesItemsSummary(item.Summary) + respItem["summary"] = flattenEoXGetEoXStatusForAllDevicesV1ItemsSummary(item.Summary) respItem["scan_status"] = item.ScanStatus respItem["comments"] = item.Comments respItem["last_scan_time"] = item.LastScanTime @@ -376,27 +376,27 @@ func flattenEoxGetEoxStatusForAllDevicesItems(items *[]catalystcentersdkgo.Respo return respItems } -func flattenEoxGetEoxStatusForAllDevicesItemsSummary(items *[]catalystcentersdkgo.ResponseEoxGetEoxStatusForAllDevicesResponseSummary) []map[string]interface{} { +func flattenEoXGetEoXStatusForAllDevicesV1ItemsSummary(items *[]catalystcentersdkgo.ResponseEoXGetEoXStatusForAllDevicesV1ResponseSummary) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["eox_type"] = item.EoxType + respItem["eox_type"] = item.EoXType respItems = append(respItems, respItem) } return respItems } -func flattenEoxGetEoxDetailsPerDeviceItem(item *catalystcentersdkgo.ResponseEoxGetEoxDetailsPerDeviceResponse) []map[string]interface{} { +func flattenEoXGetEoXDetailsPerDeviceV1Item(item *catalystcentersdkgo.ResponseEoXGetEoXDetailsPerDeviceV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["device_id"] = item.DeviceID respItem["alert_count"] = item.AlertCount - respItem["eox_details"] = flattenEoxGetEoxDetailsPerDeviceItemEoxDetails(item.EoxDetails) + respItem["eox_details"] = flattenEoXGetEoXDetailsPerDeviceV1ItemEoXDetails(item.EoXDetails) respItem["scan_status"] = item.ScanStatus respItem["comments"] = item.Comments respItem["last_scan_time"] = item.LastScanTime @@ -405,7 +405,7 @@ func flattenEoxGetEoxDetailsPerDeviceItem(item *catalystcentersdkgo.ResponseEoxG } } -func flattenEoxGetEoxDetailsPerDeviceItemEoxDetails(items *[]catalystcentersdkgo.ResponseEoxGetEoxDetailsPerDeviceResponseEoxDetails) []map[string]interface{} { +func flattenEoXGetEoXDetailsPerDeviceV1ItemEoXDetails(items *[]catalystcentersdkgo.ResponseEoXGetEoXDetailsPerDeviceV1ResponseEoXDetails) []map[string]interface{} { if items == nil { return nil } @@ -428,8 +428,8 @@ func flattenEoxGetEoxDetailsPerDeviceItemEoxDetails(items *[]catalystcentersdkgo respItem["end_of_life_date"] = item.EndOfLifeDate respItem["last_date_of_support"] = item.LastDateOfSupport respItem["end_of_software_maintenance_releases_date"] = item.EndOfSoftwareMaintenanceReleasesDate - respItem["eox_alert_type"] = item.EoxAlertType - respItem["eox_physical_type"] = item.EoxPhysicalType + respItem["eox_alert_type"] = item.EoXAlertType + respItem["eox_physical_type"] = item.EoXPhysicalType respItem["bulletin_pid"] = item.BulletinPID respItems = append(respItems, respItem) } diff --git a/catalystcenter/data_source_eox_status_summary.go b/catalystcenter/data_source_eox_status_summary.go index 9553535..0124f4a 100644 --- a/catalystcenter/data_source_eox_status_summary.go +++ b/catalystcenter/data_source_eox_status_summary.go @@ -11,14 +11,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceEoxStatusSummary() *schema.Resource { +func dataSourceEoXStatusSummary() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on EoX. - Retrieves EoX summary for all devices in the network `, - ReadContext: dataSourceEoxStatusSummaryRead, + ReadContext: dataSourceEoXStatusSummaryRead, Schema: map[string]*schema.Schema{ "item": &schema.Schema{ @@ -61,33 +61,33 @@ func dataSourceEoxStatusSummary() *schema.Resource { } } -func dataSourceEoxStatusSummaryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceEoXStatusSummaryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEoxSummary") + log.Printf("[DEBUG] Selected method: GetEoXSummaryV1") - response1, restyResp1, err := client.Eox.GetEoxSummary() + response1, restyResp1, err := client.EoX.GetEoXSummaryV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEoxSummary", err, - "Failure at GetEoxSummary, unexpected response", "")) + "Failure when executing 2 GetEoXSummaryV1", err, + "Failure at GetEoXSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEoxGetEoxSummaryItem(response1.Response) + vItem1 := flattenEoXGetEoXSummaryV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEoxSummary response", + "Failure when setting GetEoXSummaryV1 response", err)) return diags } @@ -99,7 +99,7 @@ func dataSourceEoxStatusSummaryRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenEoxGetEoxSummaryItem(item *catalystcentersdkgo.ResponseEoxGetEoxSummaryResponse) []map[string]interface{} { +func flattenEoXGetEoXSummaryV1Item(item *catalystcentersdkgo.ResponseEoXGetEoXSummaryV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event.go b/catalystcenter/data_source_event.go index f32de61..6f7ae0c 100644 --- a/catalystcenter/data_source_event.go +++ b/catalystcenter/data_source_event.go @@ -165,8 +165,8 @@ func dataSourceEventRead(ctx context.Context, d *schema.ResourceData, m interfac selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEvents") - queryParams1 := catalystcentersdkgo.GetEventsQueryParams{} + log.Printf("[DEBUG] Selected method: GetEventsV1") + queryParams1 := catalystcentersdkgo.GetEventsV1QueryParams{} if okEventID { queryParams1.EventID = vEventID.(string) @@ -186,24 +186,24 @@ func dataSourceEventRead(ctx context.Context, d *schema.ResourceData, m interfac queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetEvents(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetEventsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEvents", err, - "Failure at GetEvents, unexpected response", "")) + "Failure when executing 2 GetEventsV1", err, + "Failure at GetEventsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetEventsItems(response1) + vItems1 := flattenEventManagementGetEventsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEvents response", + "Failure when setting GetEventsV1 response", err)) return diags } @@ -215,7 +215,7 @@ func dataSourceEventRead(ctx context.Context, d *schema.ResourceData, m interfac return diags } -func flattenEventManagementGetEventsItems(items *catalystcentersdkgo.ResponseEventManagementGetEvents) []map[string]interface{} { +func flattenEventManagementGetEventsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetEventsV1) []map[string]interface{} { if items == nil { return nil } @@ -233,14 +233,14 @@ func flattenEventManagementGetEventsItems(items *catalystcentersdkgo.ResponseEve respItem["type"] = item.Type respItem["tags"] = item.Tags respItem["severity"] = item.Severity - respItem["details"] = flattenEventManagementGetEventsItemsDetails(item.Details) + respItem["details"] = flattenEventManagementGetEventsV1ItemsDetails(item.Details) respItem["subscription_types"] = item.SubscriptionTypes respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetEventsItemsDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventsDetails) interface{} { +func flattenEventManagementGetEventsV1ItemsDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventsV1Details) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_api_status.go b/catalystcenter/data_source_event_api_status.go index 237227c..252419b 100644 --- a/catalystcenter/data_source_event_api_status.go +++ b/catalystcenter/data_source_event_api_status.go @@ -65,27 +65,27 @@ func dataSourceEventAPIStatusRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetStatusAPIForEvents") + log.Printf("[DEBUG] Selected method: GetStatusAPIForEventsV1") vvExecutionID := vExecutionID.(string) - response1, restyResp1, err := client.EventManagement.GetStatusAPIForEvents(vvExecutionID) + response1, restyResp1, err := client.EventManagement.GetStatusAPIForEventsV1(vvExecutionID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetStatusAPIForEvents", err, - "Failure at GetStatusAPIForEvents, unexpected response", "")) + "Failure when executing 2 GetStatusAPIForEventsV1", err, + "Failure at GetStatusAPIForEventsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementGetStatusAPIForEventsItem(response1) + vItem1 := flattenEventManagementGetStatusAPIForEventsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetStatusAPIForEvents response", + "Failure when setting GetStatusAPIForEventsV1 response", err)) return diags } @@ -97,12 +97,12 @@ func dataSourceEventAPIStatusRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenEventManagementGetStatusAPIForEventsItem(item *catalystcentersdkgo.ResponseEventManagementGetStatusAPIForEvents) []map[string]interface{} { +func flattenEventManagementGetStatusAPIForEventsV1Item(item *catalystcentersdkgo.ResponseEventManagementGetStatusAPIForEventsV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["error_message"] = flattenEventManagementGetStatusAPIForEventsItemErrorMessage(item.ErrorMessage) + respItem["error_message"] = flattenEventManagementGetStatusAPIForEventsV1ItemErrorMessage(item.ErrorMessage) respItem["api_status"] = item.APIStatus respItem["status_message"] = item.StatusMessage return []map[string]interface{}{ @@ -110,7 +110,7 @@ func flattenEventManagementGetStatusAPIForEventsItem(item *catalystcentersdkgo.R } } -func flattenEventManagementGetStatusAPIForEventsItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementGetStatusAPIForEventsErrorMessage) interface{} { +func flattenEventManagementGetStatusAPIForEventsV1ItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementGetStatusAPIForEventsV1ErrorMessage) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_artifact.go b/catalystcenter/data_source_event_artifact.go index a5eec4e..4387854 100644 --- a/catalystcenter/data_source_event_artifact.go +++ b/catalystcenter/data_source_event_artifact.go @@ -282,8 +282,8 @@ func dataSourceEventArtifactRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEventArtifacts") - queryParams1 := catalystcentersdkgo.GetEventArtifactsQueryParams{} + log.Printf("[DEBUG] Selected method: GetEventArtifactsV1") + queryParams1 := catalystcentersdkgo.GetEventArtifactsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -307,24 +307,24 @@ func dataSourceEventArtifactRead(ctx context.Context, d *schema.ResourceData, m queryParams1.Search = vSearch.(string) } - response1, restyResp1, err := client.EventManagement.GetEventArtifacts(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetEventArtifactsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEventArtifacts", err, - "Failure at GetEventArtifacts, unexpected response", "")) + "Failure when executing 2 GetEventArtifactsV1", err, + "Failure at GetEventArtifactsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetEventArtifactsItems(response1) + vItems1 := flattenEventManagementGetEventArtifactsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEventArtifacts response", + "Failure when setting GetEventArtifactsV1 response", err)) return diags } @@ -336,7 +336,7 @@ func dataSourceEventArtifactRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenEventManagementGetEventArtifactsItems(items *catalystcentersdkgo.ResponseEventManagementGetEventArtifacts) []map[string]interface{} { +func flattenEventManagementGetEventArtifactsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetEventArtifactsV1) []map[string]interface{} { if items == nil { return nil } @@ -357,8 +357,8 @@ func flattenEventManagementGetEventArtifactsItems(items *catalystcentersdkgo.Res respItem["cisco_dna_event_link"] = item.CiscoDnaEventLink respItem["note"] = item.Note respItem["is_private"] = boolPtrToString(item.IsPrivate) - respItem["event_payload"] = flattenEventManagementGetEventArtifactsItemsEventPayload(item.EventPayload) - respItem["event_templates"] = flattenEventManagementGetEventArtifactsItemsEventTemplates(item.EventTemplates) + respItem["event_payload"] = flattenEventManagementGetEventArtifactsV1ItemsEventPayload(item.EventPayload) + respItem["event_templates"] = flattenEventManagementGetEventArtifactsV1ItemsEventTemplates(item.EventTemplates) respItem["is_tenant_aware"] = boolPtrToString(item.IsTenantAware) respItem["supported_connector_types"] = item.SupportedConnectorTypes respItem["tenant_id"] = item.TenantID @@ -367,7 +367,7 @@ func flattenEventManagementGetEventArtifactsItems(items *catalystcentersdkgo.Res return respItems } -func flattenEventManagementGetEventArtifactsItemsEventPayload(item *catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsEventPayload) []map[string]interface{} { +func flattenEventManagementGetEventArtifactsV1ItemsEventPayload(item *catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsV1EventPayload) []map[string]interface{} { if item == nil { return nil } @@ -378,8 +378,8 @@ func flattenEventManagementGetEventArtifactsItemsEventPayload(item *catalystcent respItem["type"] = item.Type respItem["source"] = item.Source respItem["severity"] = item.Severity - respItem["details"] = flattenEventManagementGetEventArtifactsItemsEventPayloadDetails(item.Details) - respItem["additional_details"] = flattenEventManagementGetEventArtifactsItemsEventPayloadAdditionalDetails(item.AdditionalDetails) + respItem["details"] = flattenEventManagementGetEventArtifactsV1ItemsEventPayloadDetails(item.Details) + respItem["additional_details"] = flattenEventManagementGetEventArtifactsV1ItemsEventPayloadAdditionalDetails(item.AdditionalDetails) return []map[string]interface{}{ respItem, @@ -387,7 +387,7 @@ func flattenEventManagementGetEventArtifactsItemsEventPayload(item *catalystcent } -func flattenEventManagementGetEventArtifactsItemsEventPayloadDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsEventPayloadDetails) []map[string]interface{} { +func flattenEventManagementGetEventArtifactsV1ItemsEventPayloadDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsV1EventPayloadDetails) []map[string]interface{} { if item == nil { return nil } @@ -401,7 +401,7 @@ func flattenEventManagementGetEventArtifactsItemsEventPayloadDetails(item *catal } -func flattenEventManagementGetEventArtifactsItemsEventPayloadAdditionalDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsEventPayloadAdditionalDetails) interface{} { +func flattenEventManagementGetEventArtifactsV1ItemsEventPayloadAdditionalDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsV1EventPayloadAdditionalDetails) interface{} { if item == nil { return nil } @@ -411,7 +411,7 @@ func flattenEventManagementGetEventArtifactsItemsEventPayloadAdditionalDetails(i } -func flattenEventManagementGetEventArtifactsItemsEventTemplates(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsEventTemplates) []interface{} { +func flattenEventManagementGetEventArtifactsV1ItemsEventTemplates(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventArtifactsV1EventTemplates) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_artifact_count.go b/catalystcenter/data_source_event_artifact_count.go index d718fda..1de68c8 100644 --- a/catalystcenter/data_source_event_artifact_count.go +++ b/catalystcenter/data_source_event_artifact_count.go @@ -46,26 +46,26 @@ func dataSourceEventArtifactCountRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: EventArtifactCount") + log.Printf("[DEBUG] Selected method: EventArtifactCountV1") - response1, restyResp1, err := client.EventManagement.EventArtifactCount() + response1, restyResp1, err := client.EventManagement.EventArtifactCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 EventArtifactCount", err, - "Failure at EventArtifactCount, unexpected response", "")) + "Failure when executing 2 EventArtifactCountV1", err, + "Failure at EventArtifactCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementEventArtifactCountItem(response1) + vItem1 := flattenEventManagementEventArtifactCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting EventArtifactCount response", + "Failure when setting EventArtifactCountV1 response", err)) return diags } @@ -77,7 +77,7 @@ func dataSourceEventArtifactCountRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenEventManagementEventArtifactCountItem(item *catalystcentersdkgo.ResponseEventManagementEventArtifactCount) []map[string]interface{} { +func flattenEventManagementEventArtifactCountV1Item(item *catalystcentersdkgo.ResponseEventManagementEventArtifactCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_config_connector_types.go b/catalystcenter/data_source_event_config_connector_types.go index 76f5778..035c557 100644 --- a/catalystcenter/data_source_event_config_connector_types.go +++ b/catalystcenter/data_source_event_config_connector_types.go @@ -66,26 +66,26 @@ func dataSourceEventConfigConnectorTypesRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetConnectorTypes") + log.Printf("[DEBUG] Selected method: GetConnectorTypesV1") - response1, restyResp1, err := client.EventManagement.GetConnectorTypes() + response1, restyResp1, err := client.EventManagement.GetConnectorTypesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetConnectorTypes", err, - "Failure at GetConnectorTypes, unexpected response", "")) + "Failure when executing 2 GetConnectorTypesV1", err, + "Failure at GetConnectorTypesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetConnectorTypesItems(response1) + vItems1 := flattenEventManagementGetConnectorTypesV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetConnectorTypes response", + "Failure when setting GetConnectorTypesV1 response", err)) return diags } @@ -97,7 +97,7 @@ func dataSourceEventConfigConnectorTypesRead(ctx context.Context, d *schema.Reso return diags } -func flattenEventManagementGetConnectorTypesItems(items *catalystcentersdkgo.ResponseEventManagementGetConnectorTypes) []map[string]interface{} { +func flattenEventManagementGetConnectorTypesV1Items(items *catalystcentersdkgo.ResponseEventManagementGetConnectorTypesV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_count.go b/catalystcenter/data_source_event_count.go index f831015..9f28935 100644 --- a/catalystcenter/data_source_event_count.go +++ b/catalystcenter/data_source_event_count.go @@ -60,32 +60,32 @@ func dataSourceEventCountRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CountOfEvents") - queryParams1 := catalystcentersdkgo.CountOfEventsQueryParams{} + log.Printf("[DEBUG] Selected method: CountOfEventsV1") + queryParams1 := catalystcentersdkgo.CountOfEventsV1QueryParams{} if okEventID { queryParams1.EventID = vEventID.(string) } queryParams1.Tags = vTags.(string) - response1, restyResp1, err := client.EventManagement.CountOfEvents(&queryParams1) + response1, restyResp1, err := client.EventManagement.CountOfEventsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CountOfEvents", err, - "Failure at CountOfEvents, unexpected response", "")) + "Failure when executing 2 CountOfEventsV1", err, + "Failure at CountOfEventsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementCountOfEventsItem(response1) + vItem1 := flattenEventManagementCountOfEventsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountOfEvents response", + "Failure when setting CountOfEventsV1 response", err)) return diags } @@ -97,7 +97,7 @@ func dataSourceEventCountRead(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenEventManagementCountOfEventsItem(item *catalystcentersdkgo.ResponseEventManagementCountOfEvents) []map[string]interface{} { +func flattenEventManagementCountOfEventsV1Item(item *catalystcentersdkgo.ResponseEventManagementCountOfEventsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_email_config.go b/catalystcenter/data_source_event_email_config.go index 2f5af22..18b65f8 100644 --- a/catalystcenter/data_source_event_email_config.go +++ b/catalystcenter/data_source_event_email_config.go @@ -157,26 +157,26 @@ func dataSourceEventEmailConfigRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEmailDestination") + log.Printf("[DEBUG] Selected method: GetEmailDestinationV1") - response1, restyResp1, err := client.EventManagement.GetEmailDestination() + response1, restyResp1, err := client.EventManagement.GetEmailDestinationV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEmailDestination", err, - "Failure at GetEmailDestination, unexpected response", "")) + "Failure when executing 2 GetEmailDestinationV1", err, + "Failure at GetEmailDestinationV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetEmailDestinationItems(response1) + vItems1 := flattenEventManagementGetEmailDestinationV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEmailDestination response", + "Failure when setting GetEmailDestinationV1 response", err)) return diags } @@ -188,7 +188,7 @@ func dataSourceEventEmailConfigRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenEventManagementGetEmailDestinationItems(items *catalystcentersdkgo.ResponseEventManagementGetEmailDestination) []map[string]interface{} { +func flattenEventManagementGetEmailDestinationV1Items(items *catalystcentersdkgo.ResponseEventManagementGetEmailDestinationV1) []map[string]interface{} { if items == nil { return nil } @@ -196,8 +196,8 @@ func flattenEventManagementGetEmailDestinationItems(items *catalystcentersdkgo.R for _, item := range *items { respItem := make(map[string]interface{}) respItem["email_config_id"] = item.EmailConfigID - respItem["primary_smt_p_config"] = flattenEventManagementGetEmailDestinationItemsPrimarySmtpConfig(item.PrimarySmtpConfig) - respItem["secondary_smt_p_config"] = flattenEventManagementGetEmailDestinationItemsSecondarySmtpConfig(item.SecondarySmtpConfig) + respItem["primary_smt_p_config"] = flattenEventManagementGetEmailDestinationV1ItemsPrimarySmtpConfig(item.PrimarySmtpConfig) + respItem["secondary_smt_p_config"] = flattenEventManagementGetEmailDestinationV1ItemsSecondarySmtpConfig(item.SecondarySmtpConfig) respItem["from_email"] = item.FromEmail respItem["to_email"] = item.ToEmail respItem["subject"] = item.Subject @@ -208,7 +208,7 @@ func flattenEventManagementGetEmailDestinationItems(items *catalystcentersdkgo.R return respItems } -func flattenEventManagementGetEmailDestinationItemsPrimarySmtpConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailDestinationPrimarySmtpConfig) []map[string]interface{} { +func flattenEventManagementGetEmailDestinationV1ItemsPrimarySmtpConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailDestinationV1PrimarySmtpConfig) []map[string]interface{} { if item == nil { return nil } @@ -225,7 +225,7 @@ func flattenEventManagementGetEmailDestinationItemsPrimarySmtpConfig(item *catal } -func flattenEventManagementGetEmailDestinationItemsSecondarySmtpConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailDestinationSecondarySmtpConfig) []map[string]interface{} { +func flattenEventManagementGetEmailDestinationV1ItemsSecondarySmtpConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailDestinationV1SecondarySmtpConfig) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_series.go b/catalystcenter/data_source_event_series.go index ea14b9a..e835b5b 100644 --- a/catalystcenter/data_source_event_series.go +++ b/catalystcenter/data_source_event_series.go @@ -256,8 +256,8 @@ func dataSourceEventSeriesRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNotifications") - queryParams1 := catalystcentersdkgo.GetNotificationsQueryParams{} + log.Printf("[DEBUG] Selected method: GetNotificationsV1") + queryParams1 := catalystcentersdkgo.GetNotificationsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -308,24 +308,24 @@ func dataSourceEventSeriesRead(ctx context.Context, d *schema.ResourceData, m in queryParams1.SiteID = vSiteID.(string) } - response1, restyResp1, err := client.EventManagement.GetNotifications(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetNotificationsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNotifications", err, - "Failure at GetNotifications, unexpected response", "")) + "Failure when executing 2 GetNotificationsV1", err, + "Failure at GetNotificationsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetNotificationsItems(response1) + vItems1 := flattenEventManagementGetNotificationsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNotifications response", + "Failure when setting GetNotificationsV1 response", err)) return diags } @@ -337,7 +337,7 @@ func dataSourceEventSeriesRead(ctx context.Context, d *schema.ResourceData, m in return diags } -func flattenEventManagementGetNotificationsItems(items *catalystcentersdkgo.ResponseEventManagementGetNotifications) []map[string]interface{} { +func flattenEventManagementGetNotificationsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetNotificationsV1) []map[string]interface{} { if items == nil { return nil } @@ -359,13 +359,13 @@ func flattenEventManagementGetNotificationsItems(items *catalystcentersdkgo.Resp respItem["timestamp"] = item.Timestamp respItem["details"] = item.Details respItem["event_hierarchy"] = item.EventHierarchy - respItem["network"] = flattenEventManagementGetNotificationsItemsNetwork(item.Network) + respItem["network"] = flattenEventManagementGetNotificationsV1ItemsNetwork(item.Network) respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetNotificationsItemsNetwork(item *catalystcentersdkgo.ResponseItemEventManagementGetNotificationsNetwork) []map[string]interface{} { +func flattenEventManagementGetNotificationsV1ItemsNetwork(item *catalystcentersdkgo.ResponseItemEventManagementGetNotificationsV1Network) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_series_audit_logs.go b/catalystcenter/data_source_event_series_audit_logs.go index 28bf6d5..3881741 100644 --- a/catalystcenter/data_source_event_series_audit_logs.go +++ b/catalystcenter/data_source_event_series_audit_logs.go @@ -371,8 +371,8 @@ func dataSourceEventSeriesAuditLogsRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAuditLogRecords") - queryParams1 := catalystcentersdkgo.GetAuditLogRecordsQueryParams{} + log.Printf("[DEBUG] Selected method: GetAuditLogRecordsV1") + queryParams1 := catalystcentersdkgo.GetAuditLogRecordsV1QueryParams{} if okParentInstanceID { queryParams1.ParentInstanceID = vParentInstanceID.(string) @@ -441,24 +441,24 @@ func dataSourceEventSeriesAuditLogsRead(ctx context.Context, d *schema.ResourceD queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetAuditLogRecords(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetAuditLogRecordsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAuditLogRecords", err, - "Failure at GetAuditLogRecords, unexpected response", "")) + "Failure when executing 2 GetAuditLogRecordsV1", err, + "Failure at GetAuditLogRecordsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetAuditLogRecordsItems(response1) + vItems1 := flattenEventManagementGetAuditLogRecordsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAuditLogRecords response", + "Failure when setting GetAuditLogRecordsV1 response", err)) return diags } @@ -470,7 +470,7 @@ func dataSourceEventSeriesAuditLogsRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenEventManagementGetAuditLogRecordsItems(items *catalystcentersdkgo.ResponseEventManagementGetAuditLogRecords) []map[string]interface{} { +func flattenEventManagementGetAuditLogRecordsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetAuditLogRecordsV1) []map[string]interface{} { if items == nil { return nil } @@ -490,8 +490,8 @@ func flattenEventManagementGetAuditLogRecordsItems(items *catalystcentersdkgo.Re respItem["severity"] = item.Severity respItem["source"] = item.Source respItem["timestamp"] = item.Timestamp - respItem["tags"] = flattenEventManagementGetAuditLogRecordsItemsTags(item.Tags) - respItem["details"] = flattenEventManagementGetAuditLogRecordsItemsDetails(item.Details) + respItem["tags"] = flattenEventManagementGetAuditLogRecordsV1ItemsTags(item.Tags) + respItem["details"] = flattenEventManagementGetAuditLogRecordsV1ItemsDetails(item.Details) respItem["cisco_dna_event_link"] = item.CiscoDnaEventLink respItem["note"] = item.Note respItem["tnt_id"] = item.TntID @@ -501,7 +501,7 @@ func flattenEventManagementGetAuditLogRecordsItems(items *catalystcentersdkgo.Re respItem["event_hierarchy"] = item.EventHierarchy respItem["message"] = item.Message respItem["message_params"] = item.MessageParams - respItem["additional_details"] = flattenEventManagementGetAuditLogRecordsItemsAdditionalDetails(item.AdditionalDetails) + respItem["additional_details"] = flattenEventManagementGetAuditLogRecordsV1ItemsAdditionalDetails(item.AdditionalDetails) respItem["parent_instance_id"] = item.ParentInstanceID respItem["network"] = item.Network respItem["child_count"] = item.ChildCount @@ -511,7 +511,7 @@ func flattenEventManagementGetAuditLogRecordsItems(items *catalystcentersdkgo.Re return respItems } -func flattenEventManagementGetAuditLogRecordsItemsTags(items *[]catalystcentersdkgo.ResponseItemEventManagementGetAuditLogRecordsTags) []interface{} { +func flattenEventManagementGetAuditLogRecordsV1ItemsTags(items *[]catalystcentersdkgo.ResponseItemEventManagementGetAuditLogRecordsV1Tags) []interface{} { if items == nil { return nil } @@ -523,7 +523,7 @@ func flattenEventManagementGetAuditLogRecordsItemsTags(items *[]catalystcentersd return respItems } -func flattenEventManagementGetAuditLogRecordsItemsDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogRecordsDetails) interface{} { +func flattenEventManagementGetAuditLogRecordsV1ItemsDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogRecordsV1Details) interface{} { if item == nil { return nil } @@ -533,7 +533,7 @@ func flattenEventManagementGetAuditLogRecordsItemsDetails(item *catalystcentersd } -func flattenEventManagementGetAuditLogRecordsItemsAdditionalDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogRecordsAdditionalDetails) interface{} { +func flattenEventManagementGetAuditLogRecordsV1ItemsAdditionalDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogRecordsV1AdditionalDetails) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_series_audit_logs_parent_records.go b/catalystcenter/data_source_event_series_audit_logs_parent_records.go index 796b931..9bff1b1 100644 --- a/catalystcenter/data_source_event_series_audit_logs_parent_records.go +++ b/catalystcenter/data_source_event_series_audit_logs_parent_records.go @@ -364,8 +364,8 @@ func dataSourceEventSeriesAuditLogsParentRecordsRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAuditLogParentRecords") - queryParams1 := catalystcentersdkgo.GetAuditLogParentRecordsQueryParams{} + log.Printf("[DEBUG] Selected method: GetAuditLogParentRecordsV1") + queryParams1 := catalystcentersdkgo.GetAuditLogParentRecordsV1QueryParams{} if okInstanceID { queryParams1.InstanceID = vInstanceID.(string) @@ -431,24 +431,24 @@ func dataSourceEventSeriesAuditLogsParentRecordsRead(ctx context.Context, d *sch queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetAuditLogParentRecords(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetAuditLogParentRecordsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAuditLogParentRecords", err, - "Failure at GetAuditLogParentRecords, unexpected response", "")) + "Failure when executing 2 GetAuditLogParentRecordsV1", err, + "Failure at GetAuditLogParentRecordsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetAuditLogParentRecordsItems(response1) + vItems1 := flattenEventManagementGetAuditLogParentRecordsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAuditLogParentRecords response", + "Failure when setting GetAuditLogParentRecordsV1 response", err)) return diags } @@ -460,7 +460,7 @@ func dataSourceEventSeriesAuditLogsParentRecordsRead(ctx context.Context, d *sch return diags } -func flattenEventManagementGetAuditLogParentRecordsItems(items *catalystcentersdkgo.ResponseEventManagementGetAuditLogParentRecords) []map[string]interface{} { +func flattenEventManagementGetAuditLogParentRecordsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetAuditLogParentRecordsV1) []map[string]interface{} { if items == nil { return nil } @@ -480,8 +480,8 @@ func flattenEventManagementGetAuditLogParentRecordsItems(items *catalystcentersd respItem["severity"] = item.Severity respItem["source"] = item.Source respItem["timestamp"] = item.Timestamp - respItem["tags"] = flattenEventManagementGetAuditLogParentRecordsItemsTags(item.Tags) - respItem["details"] = flattenEventManagementGetAuditLogParentRecordsItemsDetails(item.Details) + respItem["tags"] = flattenEventManagementGetAuditLogParentRecordsV1ItemsTags(item.Tags) + respItem["details"] = flattenEventManagementGetAuditLogParentRecordsV1ItemsDetails(item.Details) respItem["cisco_dna_event_link"] = item.CiscoDnaEventLink respItem["note"] = item.Note respItem["tnt_id"] = item.TntID @@ -491,7 +491,7 @@ func flattenEventManagementGetAuditLogParentRecordsItems(items *catalystcentersd respItem["event_hierarchy"] = item.EventHierarchy respItem["message"] = item.Message respItem["message_params"] = item.MessageParams - respItem["additional_details"] = flattenEventManagementGetAuditLogParentRecordsItemsAdditionalDetails(item.AdditionalDetails) + respItem["additional_details"] = flattenEventManagementGetAuditLogParentRecordsV1ItemsAdditionalDetails(item.AdditionalDetails) respItem["parent_instance_id"] = item.ParentInstanceID respItem["network"] = item.Network respItem["child_count"] = item.ChildCount @@ -501,7 +501,7 @@ func flattenEventManagementGetAuditLogParentRecordsItems(items *catalystcentersd return respItems } -func flattenEventManagementGetAuditLogParentRecordsItemsTags(items *[]catalystcentersdkgo.ResponseItemEventManagementGetAuditLogParentRecordsTags) []interface{} { +func flattenEventManagementGetAuditLogParentRecordsV1ItemsTags(items *[]catalystcentersdkgo.ResponseItemEventManagementGetAuditLogParentRecordsV1Tags) []interface{} { if items == nil { return nil } @@ -513,7 +513,7 @@ func flattenEventManagementGetAuditLogParentRecordsItemsTags(items *[]catalystce return respItems } -func flattenEventManagementGetAuditLogParentRecordsItemsDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogParentRecordsDetails) interface{} { +func flattenEventManagementGetAuditLogParentRecordsV1ItemsDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogParentRecordsV1Details) interface{} { if item == nil { return nil } @@ -523,7 +523,7 @@ func flattenEventManagementGetAuditLogParentRecordsItemsDetails(item *catalystce } -func flattenEventManagementGetAuditLogParentRecordsItemsAdditionalDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogParentRecordsAdditionalDetails) interface{} { +func flattenEventManagementGetAuditLogParentRecordsV1ItemsAdditionalDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetAuditLogParentRecordsV1AdditionalDetails) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_series_audit_logs_summary.go b/catalystcenter/data_source_event_series_audit_logs_summary.go index 3ad45bc..f593530 100644 --- a/catalystcenter/data_source_event_series_audit_logs_summary.go +++ b/catalystcenter/data_source_event_series_audit_logs_summary.go @@ -191,8 +191,8 @@ func dataSourceEventSeriesAuditLogsSummaryRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAuditLogSummary") - queryParams1 := catalystcentersdkgo.GetAuditLogSummaryQueryParams{} + log.Printf("[DEBUG] Selected method: GetAuditLogSummaryV1") + queryParams1 := catalystcentersdkgo.GetAuditLogSummaryV1QueryParams{} if okParentInstanceID { queryParams1.ParentInstanceID = vParentInstanceID.(string) @@ -252,24 +252,24 @@ func dataSourceEventSeriesAuditLogsSummaryRead(ctx context.Context, d *schema.Re queryParams1.EndTime = vEndTime.(float64) } - response1, restyResp1, err := client.EventManagement.GetAuditLogSummary(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetAuditLogSummaryV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAuditLogSummary", err, - "Failure at GetAuditLogSummary, unexpected response", "")) + "Failure when executing 2 GetAuditLogSummaryV1", err, + "Failure at GetAuditLogSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetAuditLogSummaryItems(response1) + vItems1 := flattenEventManagementGetAuditLogSummaryV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAuditLogSummary response", + "Failure when setting GetAuditLogSummaryV1 response", err)) return diags } @@ -281,7 +281,7 @@ func dataSourceEventSeriesAuditLogsSummaryRead(ctx context.Context, d *schema.Re return diags } -func flattenEventManagementGetAuditLogSummaryItems(items *catalystcentersdkgo.ResponseEventManagementGetAuditLogSummary) []map[string]interface{} { +func flattenEventManagementGetAuditLogSummaryV1Items(items *catalystcentersdkgo.ResponseEventManagementGetAuditLogSummaryV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_series_count.go b/catalystcenter/data_source_event_series_count.go index 7f486d6..21ce248 100644 --- a/catalystcenter/data_source_event_series_count.go +++ b/catalystcenter/data_source_event_series_count.go @@ -104,8 +104,8 @@ func dataSourceEventSeriesCountRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CountOfNotifications") - queryParams1 := catalystcentersdkgo.CountOfNotificationsQueryParams{} + log.Printf("[DEBUG] Selected method: CountOfNotificationsV1") + queryParams1 := catalystcentersdkgo.CountOfNotificationsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -135,24 +135,24 @@ func dataSourceEventSeriesCountRead(ctx context.Context, d *schema.ResourceData, queryParams1.Source = vSource.(string) } - response1, restyResp1, err := client.EventManagement.CountOfNotifications(&queryParams1) + response1, restyResp1, err := client.EventManagement.CountOfNotificationsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CountOfNotifications", err, - "Failure at CountOfNotifications, unexpected response", "")) + "Failure when executing 2 CountOfNotificationsV1", err, + "Failure at CountOfNotificationsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementCountOfNotificationsItem(response1) + vItem1 := flattenEventManagementCountOfNotificationsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountOfNotifications response", + "Failure when setting CountOfNotificationsV1 response", err)) return diags } @@ -164,7 +164,7 @@ func dataSourceEventSeriesCountRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenEventManagementCountOfNotificationsItem(item *catalystcentersdkgo.ResponseEventManagementCountOfNotifications) []map[string]interface{} { +func flattenEventManagementCountOfNotificationsV1Item(item *catalystcentersdkgo.ResponseEventManagementCountOfNotificationsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription.go b/catalystcenter/data_source_event_subscription.go index ae2c8d4..7669a7d 100644 --- a/catalystcenter/data_source_event_subscription.go +++ b/catalystcenter/data_source_event_subscription.go @@ -355,8 +355,8 @@ func dataSourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetEventSubscriptionsQueryParams{} + log.Printf("[DEBUG] Selected method: GetEventSubscriptionsV1") + queryParams1 := catalystcentersdkgo.GetEventSubscriptionsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -374,24 +374,24 @@ func dataSourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetEventSubscriptions(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetEventSubscriptionsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEventSubscriptions", err, - "Failure at GetEventSubscriptions, unexpected response", "")) + "Failure when executing 2 GetEventSubscriptionsV1", err, + "Failure at GetEventSubscriptionsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetEventSubscriptionsItems(response1) + vItems1 := flattenEventManagementGetEventSubscriptionsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEventSubscriptions response", + "Failure when setting GetEventSubscriptionsV1 response", err)) return diags } @@ -403,7 +403,7 @@ func dataSourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenEventManagementGetEventSubscriptionsItems(items *catalystcentersdkgo.ResponseEventManagementGetEventSubscriptions) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetEventSubscriptionsV1) []map[string]interface{} { if items == nil { return nil } @@ -414,8 +414,8 @@ func flattenEventManagementGetEventSubscriptionsItems(items *catalystcentersdkgo respItem["subscription_id"] = item.SubscriptionID respItem["name"] = item.Name respItem["description"] = item.Description - respItem["subscription_endpoints"] = flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpoints(item.SubscriptionEndpoints) - respItem["filter"] = flattenEventManagementGetEventSubscriptionsItemsFilter(item.Filter) + respItem["subscription_endpoints"] = flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpoints(item.SubscriptionEndpoints) + respItem["filter"] = flattenEventManagementGetEventSubscriptionsV1ItemsFilter(item.Filter) respItem["is_private"] = boolPtrToString(item.IsPrivate) respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -423,7 +423,7 @@ func flattenEventManagementGetEventSubscriptionsItems(items *catalystcentersdkgo return respItems } -func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsSubscriptionEndpoints) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1SubscriptionEndpoints) []map[string]interface{} { if items == nil { return nil } @@ -431,14 +431,14 @@ func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpoints(items for _, item := range *items { respItem := make(map[string]interface{}) respItem["instance_id"] = item.InstanceID - respItem["subscription_details"] = flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) + respItem["subscription_details"] = flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) respItem["connector_type"] = item.ConnectorType respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsSubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { if item == nil { return nil } @@ -452,9 +452,9 @@ func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscr respItem["resource"] = item.Resource respItem["method"] = item.Method respItem["trust_cert"] = boolPtrToString(item.TrustCert) - respItem["headers"] = flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsHeaders(item.Headers) - respItem["query_params"] = flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(item.QueryParams) - respItem["path_params"] = flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsPathParams(item.PathParams) + respItem["headers"] = flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsHeaders(item.Headers) + respItem["query_params"] = flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(item.QueryParams) + respItem["path_params"] = flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsPathParams(item.PathParams) respItem["body"] = item.Body respItem["connect_timeout"] = item.ConnectTimeout respItem["read_timeout"] = item.ReadTimeout @@ -465,7 +465,7 @@ func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscr } -func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsHeaders(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsHeaders) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsHeaders(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsHeaders) []map[string]interface{} { if items == nil { return nil } @@ -478,7 +478,7 @@ func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscr return respItems } -func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsQueryParams) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsQueryParams) []map[string]interface{} { if items == nil { return nil } @@ -491,7 +491,7 @@ func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscr return respItems } -func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsPathParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsPathParams) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsPathParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsPathParams) []map[string]interface{} { if items == nil { return nil } @@ -504,14 +504,14 @@ func flattenEventManagementGetEventSubscriptionsItemsSubscriptionEndpointsSubscr return respItems } -func flattenEventManagementGetEventSubscriptionsItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsFilter) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1Filter) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["event_ids"] = item.EventIDs respItem["others"] = item.Others - respItem["domains_subdomains"] = flattenEventManagementGetEventSubscriptionsItemsFilterDomainsSubdomains(item.DomainsSubdomains) + respItem["domains_subdomains"] = flattenEventManagementGetEventSubscriptionsV1ItemsFilterDomainsSubdomains(item.DomainsSubdomains) respItem["types"] = item.Types respItem["categories"] = item.Categories respItem["severities"] = item.Severities @@ -524,7 +524,7 @@ func flattenEventManagementGetEventSubscriptionsItemsFilter(item *catalystcenter } -func flattenEventManagementGetEventSubscriptionsItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsFilterDomainsSubdomains) []map[string]interface{} { +func flattenEventManagementGetEventSubscriptionsV1ItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1FilterDomainsSubdomains) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_count.go b/catalystcenter/data_source_event_subscription_count.go index 407ccce..ec3f921 100644 --- a/catalystcenter/data_source_event_subscription_count.go +++ b/catalystcenter/data_source_event_subscription_count.go @@ -53,29 +53,29 @@ func dataSourceEventSubscriptionCountRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CountOfEventSubscriptions") - queryParams1 := catalystcentersdkgo.CountOfEventSubscriptionsQueryParams{} + log.Printf("[DEBUG] Selected method: CountOfEventSubscriptionsV1") + queryParams1 := catalystcentersdkgo.CountOfEventSubscriptionsV1QueryParams{} queryParams1.EventIDs = vEventIDs.(string) - response1, restyResp1, err := client.EventManagement.CountOfEventSubscriptions(&queryParams1) + response1, restyResp1, err := client.EventManagement.CountOfEventSubscriptionsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CountOfEventSubscriptions", err, - "Failure at CountOfEventSubscriptions, unexpected response", "")) + "Failure when executing 2 CountOfEventSubscriptionsV1", err, + "Failure at CountOfEventSubscriptionsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementCountOfEventSubscriptionsItem(response1) + vItem1 := flattenEventManagementCountOfEventSubscriptionsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountOfEventSubscriptions response", + "Failure when setting CountOfEventSubscriptionsV1 response", err)) return diags } @@ -87,7 +87,7 @@ func dataSourceEventSubscriptionCountRead(ctx context.Context, d *schema.Resourc return diags } -func flattenEventManagementCountOfEventSubscriptionsItem(item *catalystcentersdkgo.ResponseEventManagementCountOfEventSubscriptions) []map[string]interface{} { +func flattenEventManagementCountOfEventSubscriptionsV1Item(item *catalystcentersdkgo.ResponseEventManagementCountOfEventSubscriptionsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_details_email.go b/catalystcenter/data_source_event_subscription_details_email.go index 36f6546..5052ff8 100644 --- a/catalystcenter/data_source_event_subscription_details_email.go +++ b/catalystcenter/data_source_event_subscription_details_email.go @@ -126,8 +126,8 @@ func dataSourceEventSubscriptionDetailsEmailRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEmailSubscriptionDetails") - queryParams1 := catalystcentersdkgo.GetEmailSubscriptionDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetEmailSubscriptionDetailsV1") + queryParams1 := catalystcentersdkgo.GetEmailSubscriptionDetailsV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -148,24 +148,24 @@ func dataSourceEventSubscriptionDetailsEmailRead(ctx context.Context, d *schema. queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetEmailSubscriptionDetails(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetEmailSubscriptionDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEmailSubscriptionDetails", err, - "Failure at GetEmailSubscriptionDetails, unexpected response", "")) + "Failure when executing 2 GetEmailSubscriptionDetailsV1", err, + "Failure at GetEmailSubscriptionDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetEmailSubscriptionDetailsItems(response1) + vItems1 := flattenEventManagementGetEmailSubscriptionDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEmailSubscriptionDetails response", + "Failure when setting GetEmailSubscriptionDetailsV1 response", err)) return diags } @@ -177,7 +177,7 @@ func dataSourceEventSubscriptionDetailsEmailRead(ctx context.Context, d *schema. return diags } -func flattenEventManagementGetEmailSubscriptionDetailsItems(items *catalystcentersdkgo.ResponseEventManagementGetEmailSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetEmailSubscriptionDetailsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetEmailSubscriptionDetailsV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_details_rest.go b/catalystcenter/data_source_event_subscription_details_rest.go index cb84a37..a70c636 100644 --- a/catalystcenter/data_source_event_subscription_details_rest.go +++ b/catalystcenter/data_source_event_subscription_details_rest.go @@ -206,8 +206,8 @@ func dataSourceEventSubscriptionDetailsRestRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetRestWebhookSubscriptionDetails") - queryParams1 := catalystcentersdkgo.GetRestWebhookSubscriptionDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetRestWebhookSubscriptionDetailsV1") + queryParams1 := catalystcentersdkgo.GetRestWebhookSubscriptionDetailsV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -228,24 +228,24 @@ func dataSourceEventSubscriptionDetailsRestRead(ctx context.Context, d *schema.R queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetRestWebhookSubscriptionDetails(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetRestWebhookSubscriptionDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetRestWebhookSubscriptionDetails", err, - "Failure at GetRestWebhookSubscriptionDetails, unexpected response", "")) + "Failure when executing 2 GetRestWebhookSubscriptionDetailsV1", err, + "Failure at GetRestWebhookSubscriptionDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetRestWebhookSubscriptionDetailsItems(response1) + vItems1 := flattenEventManagementGetRestWebhookSubscriptionDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetRestWebhookSubscriptionDetails response", + "Failure when setting GetRestWebhookSubscriptionDetailsV1 response", err)) return diags } @@ -257,7 +257,7 @@ func dataSourceEventSubscriptionDetailsRestRead(ctx context.Context, d *schema.R return diags } -func flattenEventManagementGetRestWebhookSubscriptionDetailsItems(items *catalystcentersdkgo.ResponseEventManagementGetRestWebhookSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetRestWebhookSubscriptionDetailsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetRestWebhookSubscriptionDetailsV1) []map[string]interface{} { if items == nil { return nil } @@ -271,7 +271,7 @@ func flattenEventManagementGetRestWebhookSubscriptionDetailsItems(items *catalys respItem["url"] = item.URL respItem["method"] = item.Method respItem["trust_cert"] = boolPtrToString(item.TrustCert) - respItem["headers"] = flattenEventManagementGetRestWebhookSubscriptionDetailsItemsHeaders(item.Headers) + respItem["headers"] = flattenEventManagementGetRestWebhookSubscriptionDetailsV1ItemsHeaders(item.Headers) respItem["query_params"] = item.QueryParams respItem["path_params"] = item.PathParams respItem["body"] = item.Body @@ -286,7 +286,7 @@ func flattenEventManagementGetRestWebhookSubscriptionDetailsItems(items *catalys return respItems } -func flattenEventManagementGetRestWebhookSubscriptionDetailsItemsHeaders(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookSubscriptionDetailsHeaders) []map[string]interface{} { +func flattenEventManagementGetRestWebhookSubscriptionDetailsV1ItemsHeaders(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookSubscriptionDetailsV1Headers) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_details_syslog.go b/catalystcenter/data_source_event_subscription_details_syslog.go index c5b5ee3..e094b80 100644 --- a/catalystcenter/data_source_event_subscription_details_syslog.go +++ b/catalystcenter/data_source_event_subscription_details_syslog.go @@ -150,8 +150,8 @@ func dataSourceEventSubscriptionDetailsSyslogRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSyslogSubscriptionDetails") - queryParams1 := catalystcentersdkgo.GetSyslogSubscriptionDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetSyslogSubscriptionDetailsV1") + queryParams1 := catalystcentersdkgo.GetSyslogSubscriptionDetailsV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -172,24 +172,24 @@ func dataSourceEventSubscriptionDetailsSyslogRead(ctx context.Context, d *schema queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetSyslogSubscriptionDetails(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetSyslogSubscriptionDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSyslogSubscriptionDetails", err, - "Failure at GetSyslogSubscriptionDetails, unexpected response", "")) + "Failure when executing 2 GetSyslogSubscriptionDetailsV1", err, + "Failure at GetSyslogSubscriptionDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetSyslogSubscriptionDetailsItems(response1) + vItems1 := flattenEventManagementGetSyslogSubscriptionDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSyslogSubscriptionDetails response", + "Failure when setting GetSyslogSubscriptionDetailsV1 response", err)) return diags } @@ -201,7 +201,7 @@ func dataSourceEventSubscriptionDetailsSyslogRead(ctx context.Context, d *schema return diags } -func flattenEventManagementGetSyslogSubscriptionDetailsItems(items *catalystcentersdkgo.ResponseEventManagementGetSyslogSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetSyslogSubscriptionDetailsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetSyslogSubscriptionDetailsV1) []map[string]interface{} { if items == nil { return nil } @@ -212,13 +212,13 @@ func flattenEventManagementGetSyslogSubscriptionDetailsItems(items *catalystcent respItem["name"] = item.Name respItem["description"] = item.Description respItem["connector_type"] = item.ConnectorType - respItem["syslog_config"] = flattenEventManagementGetSyslogSubscriptionDetailsItemsSyslogConfig(item.SyslogConfig) + respItem["syslog_config"] = flattenEventManagementGetSyslogSubscriptionDetailsV1ItemsSyslogConfig(item.SyslogConfig) respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetSyslogSubscriptionDetailsItemsSyslogConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogSubscriptionDetailsSyslogConfig) []map[string]interface{} { +func flattenEventManagementGetSyslogSubscriptionDetailsV1ItemsSyslogConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogSubscriptionDetailsV1SyslogConfig) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_email.go b/catalystcenter/data_source_event_subscription_email.go index e135986..1d478ed 100644 --- a/catalystcenter/data_source_event_subscription_email.go +++ b/catalystcenter/data_source_event_subscription_email.go @@ -317,8 +317,8 @@ func dataSourceEventSubscriptionEmailRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEmailEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetEmailEventSubscriptionsQueryParams{} + log.Printf("[DEBUG] Selected method: GetEmailEventSubscriptionsV1") + queryParams1 := catalystcentersdkgo.GetEmailEventSubscriptionsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -351,24 +351,24 @@ func dataSourceEventSubscriptionEmailRead(ctx context.Context, d *schema.Resourc queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.EventManagement.GetEmailEventSubscriptions(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetEmailEventSubscriptionsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEmailEventSubscriptions", err, - "Failure at GetEmailEventSubscriptions, unexpected response", "")) + "Failure when executing 2 GetEmailEventSubscriptionsV1", err, + "Failure at GetEmailEventSubscriptionsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetEmailEventSubscriptionsItems(response1) + vItems1 := flattenEventManagementGetEmailEventSubscriptionsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEmailEventSubscriptions response", + "Failure when setting GetEmailEventSubscriptionsV1 response", err)) return diags } @@ -380,7 +380,7 @@ func dataSourceEventSubscriptionEmailRead(ctx context.Context, d *schema.Resourc return diags } -func flattenEventManagementGetEmailEventSubscriptionsItems(items *catalystcentersdkgo.ResponseEventManagementGetEmailEventSubscriptions) []map[string]interface{} { +func flattenEventManagementGetEmailEventSubscriptionsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetEmailEventSubscriptionsV1) []map[string]interface{} { if items == nil { return nil } @@ -391,8 +391,8 @@ func flattenEventManagementGetEmailEventSubscriptionsItems(items *catalystcenter respItem["subscription_id"] = item.SubscriptionID respItem["name"] = item.Name respItem["description"] = item.Description - respItem["subscription_endpoints"] = flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpoints(item.SubscriptionEndpoints) - respItem["filter"] = flattenEventManagementGetEmailEventSubscriptionsItemsFilter(item.Filter) + respItem["subscription_endpoints"] = flattenEventManagementGetEmailEventSubscriptionsV1ItemsSubscriptionEndpoints(item.SubscriptionEndpoints) + respItem["filter"] = flattenEventManagementGetEmailEventSubscriptionsV1ItemsFilter(item.Filter) respItem["is_private"] = boolPtrToString(item.IsPrivate) respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -400,27 +400,7 @@ func flattenEventManagementGetEmailEventSubscriptionsItems(items *catalystcenter return respItems } -func flattenEventManagementGetEmailEventSubscriptionsItems2(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptions) []map[string]interface{} { - if items == nil { - return nil - } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["version"] = item.Version - respItem["subscription_id"] = item.SubscriptionID - respItem["name"] = item.Name - respItem["description"] = item.Description - respItem["subscription_endpoints"] = flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpoints(item.SubscriptionEndpoints) - respItem["filter"] = flattenEventManagementGetEmailEventSubscriptionsItemsFilter(item.Filter) - respItem["is_private"] = boolPtrToString(item.IsPrivate) - respItem["tenant_id"] = item.TenantID - respItems = append(respItems, respItem) - } - return respItems -} - -func flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsSubscriptionEndpoints) []map[string]interface{} { +func flattenEventManagementGetEmailEventSubscriptionsV1ItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1SubscriptionEndpoints) []map[string]interface{} { if items == nil { return nil } @@ -428,14 +408,14 @@ func flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpoints( for _, item := range *items { respItem := make(map[string]interface{}) respItem["instance_id"] = item.InstanceID - respItem["subscription_details"] = flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) + respItem["subscription_details"] = flattenEventManagementGetEmailEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) respItem["connector_type"] = item.ConnectorType respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsSubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetEmailEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { if item == nil { return nil } @@ -454,14 +434,14 @@ func flattenEventManagementGetEmailEventSubscriptionsItemsSubscriptionEndpointsS } -func flattenEventManagementGetEmailEventSubscriptionsItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsFilter) []map[string]interface{} { +func flattenEventManagementGetEmailEventSubscriptionsV1ItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1Filter) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["event_ids"] = item.EventIDs respItem["others"] = item.Others - respItem["domains_subdomains"] = flattenEventManagementGetEmailEventSubscriptionsItemsFilterDomainsSubdomains(item.DomainsSubdomains) + respItem["domains_subdomains"] = flattenEventManagementGetEmailEventSubscriptionsV1ItemsFilterDomainsSubdomains(item.DomainsSubdomains) respItem["types"] = item.Types respItem["categories"] = item.Categories respItem["severities"] = item.Severities @@ -474,7 +454,7 @@ func flattenEventManagementGetEmailEventSubscriptionsItemsFilter(item *catalystc } -func flattenEventManagementGetEmailEventSubscriptionsItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsFilterDomainsSubdomains) []map[string]interface{} { +func flattenEventManagementGetEmailEventSubscriptionsV1ItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1FilterDomainsSubdomains) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_rest.go b/catalystcenter/data_source_event_subscription_rest.go index 77a602b..9fd45db 100644 --- a/catalystcenter/data_source_event_subscription_rest.go +++ b/catalystcenter/data_source_event_subscription_rest.go @@ -388,8 +388,8 @@ func dataSourceEventSubscriptionRestRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetRestWebhookEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsQueryParams{} + log.Printf("[DEBUG] Selected method: GetRestWebhookEventSubscriptionsV1") + queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -422,24 +422,24 @@ func dataSourceEventSubscriptionRestRead(ctx context.Context, d *schema.Resource queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.EventManagement.GetRestWebhookEventSubscriptions(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetRestWebhookEventSubscriptionsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetRestWebhookEventSubscriptions", err, - "Failure at GetRestWebhookEventSubscriptions, unexpected response", "")) + "Failure when executing 2 GetRestWebhookEventSubscriptionsV1", err, + "Failure at GetRestWebhookEventSubscriptionsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetRestWebhookEventSubscriptionsItems(response1) + vItems1 := flattenEventManagementGetRestWebhookEventSubscriptionsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetRestWebhookEventSubscriptions response", + "Failure when setting GetRestWebhookEventSubscriptionsV1 response", err)) return diags } @@ -451,7 +451,7 @@ func dataSourceEventSubscriptionRestRead(ctx context.Context, d *schema.Resource return diags } -func flattenEventManagementGetRestWebhookEventSubscriptionsItems(items *catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptions) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptionsV1) []map[string]interface{} { if items == nil { return nil } @@ -462,8 +462,8 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItems(items *catalyst respItem["subscription_id"] = item.SubscriptionID respItem["name"] = item.Name respItem["description"] = item.Description - respItem["subscription_endpoints"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpoints(item.SubscriptionEndpoints) - respItem["filter"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsFilter(item.Filter) + respItem["subscription_endpoints"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpoints(item.SubscriptionEndpoints) + respItem["filter"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsFilter(item.Filter) respItem["is_private"] = item.IsPrivate respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -471,7 +471,7 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItems(items *catalyst return respItems } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsSubscriptionEndpoints) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1SubscriptionEndpoints) []map[string]interface{} { if items == nil { return nil } @@ -479,14 +479,14 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndp for _, item := range *items { respItem := make(map[string]interface{}) respItem["instance_id"] = item.InstanceID - respItem["subscription_details"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) + respItem["subscription_details"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) respItem["connector_type"] = item.ConnectorType respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsSubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { if item == nil { return nil } @@ -500,9 +500,9 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndp respItem["resource"] = item.Resource respItem["method"] = item.Method respItem["trust_cert"] = item.TrustCert - respItem["headers"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsHeaders(item.Headers) - respItem["query_params"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(item.QueryParams) - respItem["path_params"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsPathParams(item.PathParams) + respItem["headers"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsHeaders(item.Headers) + respItem["query_params"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(item.QueryParams) + respItem["path_params"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsPathParams(item.PathParams) respItem["body"] = item.Body respItem["connect_timeout"] = item.ConnectTimeout respItem["read_timeout"] = item.ReadTimeout @@ -513,7 +513,7 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndp } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsHeaders(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsHeaders) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsHeaders(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsHeaders) []map[string]interface{} { if items == nil { return nil } @@ -526,7 +526,7 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndp return respItems } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsQueryParams) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsQueryParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsQueryParams) []map[string]interface{} { if items == nil { return nil } @@ -539,7 +539,7 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndp return respItems } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsPathParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsPathParams) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsPathParams(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsPathParams) []map[string]interface{} { if items == nil { return nil } @@ -552,14 +552,14 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsSubscriptionEndp return respItems } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsFilter) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1Filter) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["event_ids"] = item.EventIDs respItem["others"] = item.Others - respItem["domains_subdomains"] = flattenEventManagementGetRestWebhookEventSubscriptionsItemsFilterDomainsSubdomains(item.DomainsSubdomains) + respItem["domains_subdomains"] = flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsFilterDomainsSubdomains(item.DomainsSubdomains) respItem["types"] = item.Types respItem["categories"] = item.Categories respItem["severities"] = item.Severities @@ -572,7 +572,7 @@ func flattenEventManagementGetRestWebhookEventSubscriptionsItemsFilter(item *cat } -func flattenEventManagementGetRestWebhookEventSubscriptionsItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsFilterDomainsSubdomains) []map[string]interface{} { +func flattenEventManagementGetRestWebhookEventSubscriptionsV1ItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetRestWebhookEventSubscriptionsV1FilterDomainsSubdomains) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_subscription_syslog.go b/catalystcenter/data_source_event_subscription_syslog.go index 8a65050..d5c933e 100644 --- a/catalystcenter/data_source_event_subscription_syslog.go +++ b/catalystcenter/data_source_event_subscription_syslog.go @@ -347,8 +347,8 @@ func dataSourceEventSubscriptionSyslogRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSyslogEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetSyslogEventSubscriptionsQueryParams{} + log.Printf("[DEBUG] Selected method: GetSyslogEventSubscriptionsV1") + queryParams1 := catalystcentersdkgo.GetSyslogEventSubscriptionsV1QueryParams{} if okEventIDs { queryParams1.EventIDs = vEventIDs.(string) @@ -381,24 +381,24 @@ func dataSourceEventSubscriptionSyslogRead(ctx context.Context, d *schema.Resour queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.EventManagement.GetSyslogEventSubscriptions(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetSyslogEventSubscriptionsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSyslogEventSubscriptions", err, - "Failure at GetSyslogEventSubscriptions, unexpected response", "")) + "Failure when executing 2 GetSyslogEventSubscriptionsV1", err, + "Failure at GetSyslogEventSubscriptionsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenEventManagementGetSyslogEventSubscriptionsItems(response1) + vItems1 := flattenEventManagementGetSyslogEventSubscriptionsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSyslogEventSubscriptions response", + "Failure when setting GetSyslogEventSubscriptionsV1 response", err)) return diags } @@ -410,7 +410,7 @@ func dataSourceEventSubscriptionSyslogRead(ctx context.Context, d *schema.Resour return diags } -func flattenEventManagementGetSyslogEventSubscriptionsItems(items *catalystcentersdkgo.ResponseEventManagementGetSyslogEventSubscriptions) []map[string]interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1Items(items *catalystcentersdkgo.ResponseEventManagementGetSyslogEventSubscriptionsV1) []map[string]interface{} { if items == nil { return nil } @@ -421,8 +421,8 @@ func flattenEventManagementGetSyslogEventSubscriptionsItems(items *catalystcente respItem["subscription_id"] = item.SubscriptionID respItem["name"] = item.Name respItem["description"] = item.Description - respItem["subscription_endpoints"] = flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpoints(item.SubscriptionEndpoints) - respItem["filter"] = flattenEventManagementGetSyslogEventSubscriptionsItemsFilter(item.Filter) + respItem["subscription_endpoints"] = flattenEventManagementGetSyslogEventSubscriptionsV1ItemsSubscriptionEndpoints(item.SubscriptionEndpoints) + respItem["filter"] = flattenEventManagementGetSyslogEventSubscriptionsV1ItemsFilter(item.Filter) respItem["is_private"] = boolPtrToString(item.IsPrivate) respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -430,7 +430,7 @@ func flattenEventManagementGetSyslogEventSubscriptionsItems(items *catalystcente return respItems } -func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsSubscriptionEndpoints) []map[string]interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1ItemsSubscriptionEndpoints(items *[]catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1SubscriptionEndpoints) []map[string]interface{} { if items == nil { return nil } @@ -438,14 +438,14 @@ func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpoints for _, item := range *items { respItem := make(map[string]interface{}) respItem["instance_id"] = item.InstanceID - respItem["subscription_details"] = flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) + respItem["subscription_details"] = flattenEventManagementGetSyslogEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item.SubscriptionDetails) respItem["connector_type"] = item.ConnectorType respItems = append(respItems, respItem) } return respItems } -func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsSubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetails(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails) []map[string]interface{} { if item == nil { return nil } @@ -454,7 +454,7 @@ func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpoints respItem["instance_id"] = item.InstanceID respItem["name"] = item.Name respItem["description"] = item.Description - respItem["syslog_config"] = flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsSyslogConfig(item.SyslogConfig) + respItem["syslog_config"] = flattenEventManagementGetSyslogEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsSyslogConfig(item.SyslogConfig) return []map[string]interface{}{ respItem, @@ -462,7 +462,7 @@ func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpoints } -func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpointsSubscriptionDetailsSyslogConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsSubscriptionEndpointsSubscriptionDetailsSyslogConfig) []map[string]interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1ItemsSubscriptionEndpointsSubscriptionDetailsSyslogConfig(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetailsSyslogConfig) []map[string]interface{} { if item == nil { return nil } @@ -481,17 +481,17 @@ func flattenEventManagementGetSyslogEventSubscriptionsItemsSubscriptionEndpoints } -func flattenEventManagementGetSyslogEventSubscriptionsItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsFilter) []map[string]interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1ItemsFilter(item *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1Filter) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["event_ids"] = item.EventIDs respItem["others"] = item.Others - respItem["domains_subdomains"] = flattenEventManagementGetSyslogEventSubscriptionsItemsFilterDomainsSubdomains(item.DomainsSubdomains) + respItem["domains_subdomains"] = flattenEventManagementGetSyslogEventSubscriptionsV1ItemsFilterDomainsSubdomains(item.DomainsSubdomains) respItem["types"] = item.Types respItem["categories"] = item.Categories - respItem["severities"] = flattenEventManagementGetSyslogEventSubscriptionsItemsFilterSeverities(item.Severities) + respItem["severities"] = flattenEventManagementGetSyslogEventSubscriptionsV1ItemsFilterSeverities(item.Severities) respItem["sources"] = item.Sources respItem["site_ids"] = item.SiteIDs @@ -501,7 +501,7 @@ func flattenEventManagementGetSyslogEventSubscriptionsItemsFilter(item *catalyst } -func flattenEventManagementGetSyslogEventSubscriptionsItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsFilterDomainsSubdomains) []map[string]interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1ItemsFilterDomainsSubdomains(items *[]catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1FilterDomainsSubdomains) []map[string]interface{} { if items == nil { return nil } @@ -515,7 +515,7 @@ func flattenEventManagementGetSyslogEventSubscriptionsItemsFilterDomainsSubdomai return respItems } -func flattenEventManagementGetSyslogEventSubscriptionsItemsFilterSeverities(items *[]catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsFilterSeverities) []interface{} { +func flattenEventManagementGetSyslogEventSubscriptionsV1ItemsFilterSeverities(items *[]catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1FilterSeverities) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_event_syslog_config.go b/catalystcenter/data_source_event_syslog_config.go index 4a08afb..5e55de1 100644 --- a/catalystcenter/data_source_event_syslog_config.go +++ b/catalystcenter/data_source_event_syslog_config.go @@ -171,8 +171,8 @@ func dataSourceEventSyslogConfigRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSyslogDestination") - queryParams1 := catalystcentersdkgo.GetSyslogDestinationQueryParams{} + log.Printf("[DEBUG] Selected method: GetSyslogDestinationV1") + queryParams1 := catalystcentersdkgo.GetSyslogDestinationV1QueryParams{} if okConfigID { queryParams1.ConfigID = vConfigID.(string) @@ -196,24 +196,24 @@ func dataSourceEventSyslogConfigRead(ctx context.Context, d *schema.ResourceData queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.EventManagement.GetSyslogDestination(&queryParams1) + response1, restyResp1, err := client.EventManagement.GetSyslogDestinationV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSyslogDestination", err, - "Failure at GetSyslogDestination, unexpected response", "")) + "Failure when executing 2 GetSyslogDestinationV1", err, + "Failure at GetSyslogDestinationV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementGetSyslogDestinationItem(response1) + vItem1 := flattenEventManagementGetSyslogDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSyslogDestination response", + "Failure when setting GetSyslogDestinationV1 response", err)) return diags } @@ -225,20 +225,20 @@ func dataSourceEventSyslogConfigRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenEventManagementGetSyslogDestinationItem(item *catalystcentersdkgo.ResponseEventManagementGetSyslogDestination) []map[string]interface{} { +func flattenEventManagementGetSyslogDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementGetSyslogDestinationV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["error_message"] = flattenEventManagementGetSyslogDestinationItemErrorMessage(item.ErrorMessage) + respItem["error_message"] = flattenEventManagementGetSyslogDestinationV1ItemErrorMessage(item.ErrorMessage) respItem["api_status"] = item.APIStatus - respItem["status_message"] = flattenEventManagementGetSyslogDestinationItemStatusMessage(item.StatusMessage) + respItem["status_message"] = flattenEventManagementGetSyslogDestinationV1ItemStatusMessage(item.StatusMessage) return []map[string]interface{}{ respItem, } } -func flattenEventManagementGetSyslogDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementGetSyslogDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementGetSyslogDestinationV1ItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementGetSyslogDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } @@ -251,7 +251,7 @@ func flattenEventManagementGetSyslogDestinationItemErrorMessage(item *catalystce } -func flattenEventManagementGetSyslogDestinationItemStatusMessage(items *[]catalystcentersdkgo.ResponseEventManagementGetSyslogDestinationStatusMessage) []map[string]interface{} { +func flattenEventManagementGetSyslogDestinationV1ItemStatusMessage(items *[]catalystcentersdkgo.ResponseEventManagementGetSyslogDestinationV1StatusMessage) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_file_namespace_files.go b/catalystcenter/data_source_file_namespace_files.go index dcd8fb3..9f6fcac 100644 --- a/catalystcenter/data_source_file_namespace_files.go +++ b/catalystcenter/data_source_file_namespace_files.go @@ -111,27 +111,27 @@ func dataSourceFileNamespaceFilesRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetListOfFiles") + log.Printf("[DEBUG] Selected method: GetListOfFilesV1") vvNameSpace := vNameSpace.(string) - response1, restyResp1, err := client.File.GetListOfFiles(vvNameSpace) + response1, restyResp1, err := client.File.GetListOfFilesV1(vvNameSpace) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetListOfFiles", err, - "Failure at GetListOfFiles, unexpected response", "")) + "Failure when executing 2 GetListOfFilesV1", err, + "Failure at GetListOfFilesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenFileGetListOfFilesItems(response1.Response) + vItems1 := flattenFileGetListOfFilesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetListOfFiles response", + "Failure when setting GetListOfFilesV1 response", err)) return diags } @@ -143,14 +143,14 @@ func dataSourceFileNamespaceFilesRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenFileGetListOfFilesItems(items *[]catalystcentersdkgo.ResponseFileGetListOfFilesResponse) []map[string]interface{} { +func flattenFileGetListOfFilesV1Items(items *[]catalystcentersdkgo.ResponseFileGetListOfFilesV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenFileGetListOfFilesItemsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenFileGetListOfFilesV1ItemsAttributeInfo(item.AttributeInfo) respItem["download_path"] = item.DownloadPath respItem["encrypted"] = boolPtrToString(item.Encrypted) respItem["file_format"] = item.FileFormat @@ -159,7 +159,7 @@ func flattenFileGetListOfFilesItems(items *[]catalystcentersdkgo.ResponseFileGet respItem["md5_checksum"] = item.Md5Checksum respItem["name"] = item.Name respItem["name_space"] = item.NameSpace - respItem["sftp_server_list"] = flattenFileGetListOfFilesItemsSftpServerList(item.SftpServerList) + respItem["sftp_server_list"] = flattenFileGetListOfFilesV1ItemsSftpServerList(item.SftpServerList) respItem["sha1_checksum"] = item.Sha1Checksum respItem["task_id"] = item.TaskID respItems = append(respItems, respItem) @@ -167,7 +167,7 @@ func flattenFileGetListOfFilesItems(items *[]catalystcentersdkgo.ResponseFileGet return respItems } -func flattenFileGetListOfFilesItemsAttributeInfo(item *catalystcentersdkgo.ResponseFileGetListOfFilesResponseAttributeInfo) interface{} { +func flattenFileGetListOfFilesV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseFileGetListOfFilesV1ResponseAttributeInfo) interface{} { if item == nil { return nil } @@ -177,7 +177,7 @@ func flattenFileGetListOfFilesItemsAttributeInfo(item *catalystcentersdkgo.Respo } -func flattenFileGetListOfFilesItemsSftpServerList(items *[]catalystcentersdkgo.ResponseFileGetListOfFilesResponseSftpServerList) []interface{} { +func flattenFileGetListOfFilesV1ItemsSftpServerList(items *[]catalystcentersdkgo.ResponseFileGetListOfFilesV1ResponseSftpServerList) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_file_namespaces.go b/catalystcenter/data_source_file_namespaces.go index 35bed5b..8564cc5 100644 --- a/catalystcenter/data_source_file_namespaces.go +++ b/catalystcenter/data_source_file_namespaces.go @@ -53,26 +53,26 @@ func dataSourceFileNamespacesRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetListOfAvailableNamespaces") + log.Printf("[DEBUG] Selected method: GetListOfAvailableNamespacesV1") - response1, restyResp1, err := client.File.GetListOfAvailableNamespaces() + response1, restyResp1, err := client.File.GetListOfAvailableNamespacesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetListOfAvailableNamespaces", err, - "Failure at GetListOfAvailableNamespaces, unexpected response", "")) + "Failure when executing 2 GetListOfAvailableNamespacesV1", err, + "Failure at GetListOfAvailableNamespacesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenFileGetListOfAvailableNamespacesItems(response1) + vItems1 := flattenFileGetListOfAvailableNamespacesV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetListOfAvailableNamespaces response", + "Failure when setting GetListOfAvailableNamespacesV1 response", err)) return diags } @@ -84,7 +84,7 @@ func dataSourceFileNamespacesRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenFileGetListOfAvailableNamespacesItems(items *catalystcentersdkgo.ResponseFileGetListOfAvailableNamespaces) []map[string]interface{} { +func flattenFileGetListOfAvailableNamespacesV1Items(items *catalystcentersdkgo.ResponseFileGetListOfAvailableNamespacesV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_flexible_report_executions.go b/catalystcenter/data_source_flexible_report_executions.go index 9c8ba36..2a60628 100644 --- a/catalystcenter/data_source_flexible_report_executions.go +++ b/catalystcenter/data_source_flexible_report_executions.go @@ -140,27 +140,27 @@ func dataSourceFlexibleReportExecutionsRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetExecutionIDByReportID") + log.Printf("[DEBUG] Selected method: GetExecutionIDByReportIDV1") vvReportID := vReportID.(string) - response1, restyResp1, err := client.Reports.GetExecutionIDByReportID(vvReportID) + response1, restyResp1, err := client.Reports.GetExecutionIDByReportIDV1(vvReportID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetExecutionIDByReportID", err, - "Failure at GetExecutionIDByReportID, unexpected response", "")) + "Failure when executing 2 GetExecutionIDByReportIDV1", err, + "Failure at GetExecutionIDByReportIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenReportsGetExecutionIDByReportIDItem(response1) + vItem1 := flattenReportsGetExecutionIDByReportIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetExecutionIDByReportID response", + "Failure when setting GetExecutionIDByReportIDV1 response", err)) return diags } @@ -172,14 +172,14 @@ func dataSourceFlexibleReportExecutionsRead(ctx context.Context, d *schema.Resou return diags } -func flattenReportsGetExecutionIDByReportIDItem(item *catalystcentersdkgo.ResponseReportsGetExecutionIDByReportID) []map[string]interface{} { +func flattenReportsGetExecutionIDByReportIDV1Item(item *catalystcentersdkgo.ResponseReportsGetExecutionIDByReportIDV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["report_id"] = item.ReportID respItem["report_name"] = item.ReportName - respItem["executions"] = flattenReportsGetExecutionIDByReportIDItemExecutions(item.Executions) + respItem["executions"] = flattenReportsGetExecutionIDByReportIDV1ItemExecutions(item.Executions) respItem["execution_count"] = item.ExecutionCount respItem["report_was_executed"] = boolPtrToString(item.ReportWasExecuted) return []map[string]interface{}{ @@ -187,7 +187,7 @@ func flattenReportsGetExecutionIDByReportIDItem(item *catalystcentersdkgo.Respon } } -func flattenReportsGetExecutionIDByReportIDItemExecutions(items *[]catalystcentersdkgo.ResponseReportsGetExecutionIDByReportIDExecutions) []map[string]interface{} { +func flattenReportsGetExecutionIDByReportIDV1ItemExecutions(items *[]catalystcentersdkgo.ResponseReportsGetExecutionIDByReportIDV1Executions) []map[string]interface{} { if items == nil { return nil } @@ -200,13 +200,13 @@ func flattenReportsGetExecutionIDByReportIDItemExecutions(items *[]catalystcente respItem["process_status"] = item.ProcessStatus respItem["request_status"] = item.RequestStatus respItem["errors"] = item.Errors - respItem["warnings"] = flattenReportsGetExecutionIDByReportIDItemExecutionsWarnings(item.Warnings) + respItem["warnings"] = flattenReportsGetExecutionIDByReportIDV1ItemExecutionsWarnings(item.Warnings) respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetExecutionIDByReportIDItemExecutionsWarnings(items *[]catalystcentersdkgo.ResponseReportsGetExecutionIDByReportIDExecutionsWarnings) []interface{} { +func flattenReportsGetExecutionIDByReportIDV1ItemExecutionsWarnings(items *[]catalystcentersdkgo.ResponseReportsGetExecutionIDByReportIDV1ExecutionsWarnings) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_flexible_report_schedule.go b/catalystcenter/data_source_flexible_report_schedule.go index 3f9ea6d..9025881 100644 --- a/catalystcenter/data_source_flexible_report_schedule.go +++ b/catalystcenter/data_source_flexible_report_schedule.go @@ -46,18 +46,18 @@ func dataSourceFlexibleReportScheduleRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFlexibleReportScheduleByReportID") + log.Printf("[DEBUG] Selected method: GetFlexibleReportScheduleByReportIDV1") vvReportID := vReportID.(string) - response1, restyResp1, err := client.Reports.GetFlexibleReportScheduleByReportID(vvReportID) + response1, restyResp1, err := client.Reports.GetFlexibleReportScheduleByReportIDV1(vvReportID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFlexibleReportScheduleByReportID", err, - "Failure at GetFlexibleReportScheduleByReportID, unexpected response", "")) + "Failure when executing 2 GetFlexibleReportScheduleByReportIDV1", err, + "Failure at GetFlexibleReportScheduleByReportIDV1, unexpected response", "")) return diags } @@ -66,7 +66,7 @@ func dataSourceFlexibleReportScheduleRead(ctx context.Context, d *schema.Resourc vItem1 := restyResp1.String() if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFlexibleReportScheduleByReportID response", + "Failure when setting GetFlexibleReportScheduleByReportIDV1 response", err)) return diags } diff --git a/catalystcenter/data_source_flexible_report_schedules.go b/catalystcenter/data_source_flexible_report_schedules.go index 4240b8e..ceb4574 100644 --- a/catalystcenter/data_source_flexible_report_schedules.go +++ b/catalystcenter/data_source_flexible_report_schedules.go @@ -61,26 +61,26 @@ func dataSourceFlexibleReportSchedulesRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllFlexibleReportSchedules") + log.Printf("[DEBUG] Selected method: GetAllFlexibleReportSchedulesV1") - response1, restyResp1, err := client.Reports.GetAllFlexibleReportSchedules() + response1, restyResp1, err := client.Reports.GetAllFlexibleReportSchedulesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllFlexibleReportSchedules", err, - "Failure at GetAllFlexibleReportSchedules, unexpected response", "")) + "Failure when executing 2 GetAllFlexibleReportSchedulesV1", err, + "Failure at GetAllFlexibleReportSchedulesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenReportsGetAllFlexibleReportSchedulesItems(response1) + vItems1 := flattenReportsGetAllFlexibleReportSchedulesV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllFlexibleReportSchedules response", + "Failure when setting GetAllFlexibleReportSchedulesV1 response", err)) return diags } @@ -92,7 +92,7 @@ func dataSourceFlexibleReportSchedulesRead(ctx context.Context, d *schema.Resour return diags } -func flattenReportsGetAllFlexibleReportSchedulesItems(items *catalystcentersdkgo.ResponseReportsGetAllFlexibleReportSchedules) []map[string]interface{} { +func flattenReportsGetAllFlexibleReportSchedulesV1Items(items *catalystcentersdkgo.ResponseReportsGetAllFlexibleReportSchedulesV1) []map[string]interface{} { if items == nil { return nil } @@ -100,14 +100,14 @@ func flattenReportsGetAllFlexibleReportSchedulesItems(items *catalystcentersdkgo for _, item := range *items { respItem := make(map[string]interface{}) respItem["report_id"] = item.ReportID - respItem["schedule"] = flattenReportsGetAllFlexibleReportSchedulesItemsSchedule(item.Schedule) + respItem["schedule"] = flattenReportsGetAllFlexibleReportSchedulesV1ItemsSchedule(item.Schedule) respItem["report_name"] = item.ReportName respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetAllFlexibleReportSchedulesItemsSchedule(item *catalystcentersdkgo.ResponseItemReportsGetAllFlexibleReportSchedulesSchedule) interface{} { +func flattenReportsGetAllFlexibleReportSchedulesV1ItemsSchedule(item *catalystcentersdkgo.ResponseItemReportsGetAllFlexibleReportSchedulesV1Schedule) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_floors.go b/catalystcenter/data_source_floors.go index 80a0293..9751055 100644 --- a/catalystcenter/data_source_floors.go +++ b/catalystcenter/data_source_floors.go @@ -130,32 +130,32 @@ func dataSourceFloorsRead(ctx context.Context, d *schema.ResourceData, m interfa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsAFloor") + log.Printf("[DEBUG] Selected method: GetsAFloorV2") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetsAFloorQueryParams{} + queryParams1 := catalystcentersdkgo.GetsAFloorV2QueryParams{} if okUnitsOfMeasure { queryParams1.UnitsOfMeasure = vUnitsOfMeasure.(string) } - response1, restyResp1, err := client.SiteDesign.GetsAFloor(vvID, &queryParams1) + response1, restyResp1, err := client.SiteDesign.GetsAFloorV2(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsAFloor", err, - "Failure at GetsAFloor, unexpected response", "")) + "Failure when executing 2 GetsAFloorV2", err, + "Failure at GetsAFloorV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetsAFloorItem(response1.Response) + vItem1 := flattenSiteDesignGetsAFloorV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsAFloor response", + "Failure when setting GetsAFloorV2 response", err)) return diags } @@ -167,7 +167,7 @@ func dataSourceFloorsRead(ctx context.Context, d *schema.ResourceData, m interfa return diags } -func flattenSiteDesignGetsAFloorItem(item *catalystcentersdkgo.ResponseSiteDesignGetsAFloorResponse) []map[string]interface{} { +func flattenSiteDesignGetsAFloorV2Item(item *catalystcentersdkgo.ResponseSiteDesignGetsAFloorV2Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_floors_settings.go b/catalystcenter/data_source_floors_settings_v2.go similarity index 70% rename from catalystcenter/data_source_floors_settings.go rename to catalystcenter/data_source_floors_settings_v2.go index d552015..d9f7ae4 100644 --- a/catalystcenter/data_source_floors_settings.go +++ b/catalystcenter/data_source_floors_settings_v2.go @@ -11,14 +11,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceFloorsSettings() *schema.Resource { +func dataSourceFloorsSettingsV2() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Site Design. - Gets UI user preference for floor unit system. `, - ReadContext: dataSourceFloorsSettingsRead, + ReadContext: dataSourceFloorsSettingsV2Read, Schema: map[string]*schema.Schema{ "item": &schema.Schema{ @@ -40,33 +40,33 @@ func dataSourceFloorsSettings() *schema.Resource { } } -func dataSourceFloorsSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceFloorsSettingsV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFloorSettings") + log.Printf("[DEBUG] Selected method: GetFloorSettingsV2") - response1, restyResp1, err := client.SiteDesign.GetFloorSettings() + response1, restyResp1, err := client.SiteDesign.GetFloorSettingsV2() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFloorSettings", err, - "Failure at GetFloorSettings, unexpected response", "")) + "Failure when executing 2 GetFloorSettingsV2", err, + "Failure at GetFloorSettingsV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetFloorSettingsItem(response1.Response) + vItem1 := flattenSiteDesignGetFloorSettingsV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFloorSettings response", + "Failure when setting GetFloorSettingsV2 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceFloorsSettingsRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSiteDesignGetFloorSettingsItem(item *catalystcentersdkgo.ResponseSiteDesignGetFloorSettingsResponse) []map[string]interface{} { +func flattenSiteDesignGetFloorSettingsV2Item(item *catalystcentersdkgo.ResponseSiteDesignGetFloorSettingsV2Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_global_credential.go b/catalystcenter/data_source_global_credential_v1.go similarity index 89% rename from catalystcenter/data_source_global_credential.go rename to catalystcenter/data_source_global_credential_v1.go index 6f2e3d8..15f3302 100644 --- a/catalystcenter/data_source_global_credential.go +++ b/catalystcenter/data_source_global_credential_v1.go @@ -230,8 +230,8 @@ func dataSourceGlobalCredentialRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + log.Printf("[DEBUG] Selected method: GetGlobalCredentialsV1") + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} if okCredentialSubType { queryParams1.CredentialSubType = vCredentialSubType.(string) @@ -243,24 +243,24 @@ func dataSourceGlobalCredentialRead(ctx context.Context, d *schema.ResourceData, queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.Discovery.GetGlobalCredentials(&queryParams1) + response1, restyResp1, err := client.Discovery.GetGlobalCredentialsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetGlobalCredentials", err, - "Failure at GetGlobalCredentials, unexpected response", "")) + "Failure when executing 2 GetGlobalCredentialsV1", err, + "Failure at GetGlobalCredentialsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetGlobalCredentialsItems(response1.Response) + vItems1 := flattenDiscoveryGetGlobalCredentialsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetGlobalCredentials response", + "Failure when setting GetGlobalCredentialsV1 response", err)) return diags } @@ -270,27 +270,27 @@ func dataSourceGlobalCredentialRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetCredentialSubTypeByCredentialID") + log.Printf("[DEBUG] Selected method: GetCredentialSubTypeByCredentialIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Discovery.GetCredentialSubTypeByCredentialID(vvID) + response2, restyResp2, err := client.Discovery.GetCredentialSubTypeByCredentialIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetCredentialSubTypeByCredentialID", err, - "Failure at GetCredentialSubTypeByCredentialID, unexpected response", "")) + "Failure when executing 2 GetCredentialSubTypeByCredentialIDV1", err, + "Failure at GetCredentialSubTypeByCredentialIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDiscoveryGetCredentialSubTypeByCredentialIDItem(response2) + vItem2 := flattenDiscoveryGetCredentialSubTypeByCredentialIDV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetCredentialSubTypeByCredentialID response", + "Failure when setting GetCredentialSubTypeByCredentialIDV1 response", err)) return diags } @@ -302,7 +302,7 @@ func dataSourceGlobalCredentialRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDiscoveryGetGlobalCredentialsItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse) []map[string]interface{} { +func flattenDiscoveryGetGlobalCredentialsV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -333,7 +333,7 @@ func flattenDiscoveryGetGlobalCredentialsItems(items *[]catalystcentersdkgo.Resp return respItems } -func flattenDiscoveryGetCredentialSubTypeByCredentialIDItem(item *catalystcentersdkgo.ResponseDiscoveryGetCredentialSubTypeByCredentialID) []map[string]interface{} { +func flattenDiscoveryGetCredentialSubTypeByCredentialIDV1Item(item *catalystcentersdkgo.ResponseDiscoveryGetCredentialSubTypeByCredentialIDV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_global_pool.go b/catalystcenter/data_source_global_pool.go index d8983a2..c07a81d 100644 --- a/catalystcenter/data_source_global_pool.go +++ b/catalystcenter/data_source_global_pool.go @@ -239,8 +239,8 @@ func dataSourceGlobalPoolRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetGlobalPool") - queryParams1 := catalystcentersdkgo.GetGlobalPoolQueryParams{} + log.Printf("[DEBUG] Selected method: GetGlobalPoolV1") + queryParams1 := catalystcentersdkgo.GetGlobalPoolV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -249,24 +249,24 @@ func dataSourceGlobalPoolRead(ctx context.Context, d *schema.ResourceData, m int queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.NetworkSettings.GetGlobalPool(&queryParams1) + response1, restyResp1, err := client.NetworkSettings.GetGlobalPoolV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetGlobalPool", err, - "Failure at GetGlobalPool, unexpected response", "")) + "Failure when executing 2 GetGlobalPoolV1", err, + "Failure at GetGlobalPoolV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenNetworkSettingsGetGlobalPoolItems(response1.Response) + vItems1 := flattenNetworkSettingsGetGlobalPoolV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetGlobalPool response", + "Failure when setting GetGlobalPoolV1 response", err)) return diags } @@ -278,7 +278,7 @@ func dataSourceGlobalPoolRead(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenNetworkSettingsGetGlobalPoolItems(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolResponse) []map[string]interface{} { +func flattenNetworkSettingsGetGlobalPoolV1Items(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolV1Response) []map[string]interface{} { if items == nil { return nil } @@ -298,7 +298,7 @@ func flattenNetworkSettingsGetGlobalPoolItems(items *[]catalystcentersdkgo.Respo respItem["overlapping"] = boolPtrToString(item.Overlapping) respItem["configure_external_dhcp"] = boolPtrToString(item.ConfigureExternalDhcp) respItem["used_percentage"] = item.UsedPercentage - respItem["client_options"] = flattenNetworkSettingsGetGlobalPoolItemsClientOptions(item.ClientOptions) + respItem["client_options"] = flattenNetworkSettingsGetGlobalPoolV1ItemsClientOptions(item.ClientOptions) respItem["ip_pool_type"] = item.IPPoolType respItem["unavailable_ip_address_count"] = item.UnavailableIPAddressCount respItem["available_ip_address_count"] = item.AvailableIPAddressCount @@ -306,7 +306,7 @@ func flattenNetworkSettingsGetGlobalPoolItems(items *[]catalystcentersdkgo.Respo respItem["dns_server_ips"] = item.DNSServerIPs respItem["has_subpools"] = boolPtrToString(item.HasSubpools) respItem["default_assigned_ip_address_count"] = item.DefaultAssignedIPAddressCount - respItem["context"] = flattenNetworkSettingsGetGlobalPoolItemsContext(item.Context) + respItem["context"] = flattenNetworkSettingsGetGlobalPoolV1ItemsContext(item.Context) respItem["ipv6"] = boolPtrToString(item.IPv6) respItem["id"] = item.ID respItem["ip_pool_cidr"] = item.IPPoolCidr @@ -315,7 +315,7 @@ func flattenNetworkSettingsGetGlobalPoolItems(items *[]catalystcentersdkgo.Respo return respItems } -func flattenNetworkSettingsGetGlobalPoolItemsClientOptions(item *catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolResponseClientOptions) interface{} { +func flattenNetworkSettingsGetGlobalPoolV1ItemsClientOptions(item *catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolV1ResponseClientOptions) interface{} { if item == nil { return nil } @@ -325,7 +325,7 @@ func flattenNetworkSettingsGetGlobalPoolItemsClientOptions(item *catalystcenters } -func flattenNetworkSettingsGetGlobalPoolItemsContext(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolResponseContext) []map[string]interface{} { +func flattenNetworkSettingsGetGlobalPoolV1ItemsContext(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolV1ResponseContext) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_golden_tag_image.go b/catalystcenter/data_source_golden_tag_image.go index 9594804..d5292bd 100644 --- a/catalystcenter/data_source_golden_tag_image.go +++ b/catalystcenter/data_source_golden_tag_image.go @@ -97,30 +97,30 @@ func dataSourceGoldenTagImageRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetGoldenTagStatusOfAnImage") + log.Printf("[DEBUG] Selected method: GetGoldenTagStatusOfAnImageV1") vvSiteID := vSiteID.(string) vvDeviceFamilyIDentifier := vDeviceFamilyIDentifier.(string) vvDeviceRole := vDeviceRole.(string) vvImageID := vImageID.(string) - response1, restyResp1, err := client.SoftwareImageManagementSwim.GetGoldenTagStatusOfAnImage(vvSiteID, vvDeviceFamilyIDentifier, vvDeviceRole, vvImageID) + response1, restyResp1, err := client.SoftwareImageManagementSwim.GetGoldenTagStatusOfAnImageV1(vvSiteID, vvDeviceFamilyIDentifier, vvDeviceRole, vvImageID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetGoldenTagStatusOfAnImage", err, - "Failure at GetGoldenTagStatusOfAnImage, unexpected response", "")) + "Failure when executing 2 GetGoldenTagStatusOfAnImageV1", err, + "Failure at GetGoldenTagStatusOfAnImageV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetGoldenTagStatusOfAnImage response", + "Failure when setting GetGoldenTagStatusOfAnImageV1 response", err)) return diags } @@ -132,7 +132,7 @@ func dataSourceGoldenTagImageRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_golden_tag_image_details.go b/catalystcenter/data_source_golden_tag_image_details.go index 3b564c9..651255f 100644 --- a/catalystcenter/data_source_golden_tag_image_details.go +++ b/catalystcenter/data_source_golden_tag_image_details.go @@ -131,7 +131,7 @@ func dataSourceGoldenTagImageDetailsRead(ctx context.Context, d *schema.Resource return diags } -func flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageDetailsItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageDetailsItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_health_score_definitions.go b/catalystcenter/data_source_health_score_definitions.go index cdcd53f..451b11b 100644 --- a/catalystcenter/data_source_health_score_definitions.go +++ b/catalystcenter/data_source_health_score_definitions.go @@ -166,10 +166,10 @@ func dataSourceHealthScoreDefinitionsRead(ctx context.Context, d *schema.Resourc selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllHealthScoreDefinitionsForGivenFilters") + log.Printf("[DEBUG] Selected method: GetAllHealthScoreDefinitionsForGivenFiltersV1") - headerParams1 := catalystcentersdkgo.GetAllHealthScoreDefinitionsForGivenFiltersHeaderParams{} - queryParams1 := catalystcentersdkgo.GetAllHealthScoreDefinitionsForGivenFiltersQueryParams{} + headerParams1 := catalystcentersdkgo.GetAllHealthScoreDefinitionsForGivenFiltersV1HeaderParams{} + queryParams1 := catalystcentersdkgo.GetAllHealthScoreDefinitionsForGivenFiltersV1QueryParams{} if okDeviceType { queryParams1.DeviceType = vDeviceType.(string) @@ -193,15 +193,15 @@ func dataSourceHealthScoreDefinitionsRead(ctx context.Context, d *schema.Resourc headerParams1.XCaLLERID = vXCaLLERID.(string) } - response1, restyResp1, err := client.Devices.GetAllHealthScoreDefinitionsForGivenFilters(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Devices.GetAllHealthScoreDefinitionsForGivenFiltersV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllHealthScoreDefinitionsForGivenFilters", err, - "Failure at GetAllHealthScoreDefinitionsForGivenFilters, unexpected response", "")) + "Failure when executing 2 GetAllHealthScoreDefinitionsForGivenFiltersV1", err, + "Failure at GetAllHealthScoreDefinitionsForGivenFiltersV1, unexpected response", "")) return diags } @@ -209,33 +209,33 @@ func dataSourceHealthScoreDefinitionsRead(ctx context.Context, d *schema.Resourc } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetHealthScoreDefinitionForTheGivenID") + log.Printf("[DEBUG] Selected method: GetHealthScoreDefinitionForTheGivenIDV1") vvID := vID.(string) - headerParams2 := catalystcentersdkgo.GetHealthScoreDefinitionForTheGivenIDHeaderParams{} + headerParams2 := catalystcentersdkgo.GetHealthScoreDefinitionForTheGivenIDV1HeaderParams{} if okXCaLLERID { headerParams2.XCaLLERID = vXCaLLERID.(string) } - response2, restyResp2, err := client.Devices.GetHealthScoreDefinitionForTheGivenID(vvID, &headerParams2) + response2, restyResp2, err := client.Devices.GetHealthScoreDefinitionForTheGivenIDV1(vvID, &headerParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetHealthScoreDefinitionForTheGivenID", err, - "Failure at GetHealthScoreDefinitionForTheGivenID, unexpected response", "")) + "Failure when executing 2 GetHealthScoreDefinitionForTheGivenIDV1", err, + "Failure at GetHealthScoreDefinitionForTheGivenIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItems2 := flattenDevicesGetHealthScoreDefinitionForTheGivenIDItems(response2.Response) + vItems2 := flattenDevicesGetHealthScoreDefinitionForTheGivenIDV1Items(response2.Response) if err := d.Set("items", vItems2); err != nil { diags = append(diags, diagError( - "Failure when setting GetHealthScoreDefinitionForTheGivenID response", + "Failure when setting GetHealthScoreDefinitionForTheGivenIDV1 response", err)) return diags } @@ -247,7 +247,7 @@ func dataSourceHealthScoreDefinitionsRead(ctx context.Context, d *schema.Resourc return diags } -func flattenDevicesGetHealthScoreDefinitionForTheGivenIDItems(items *[]catalystcentersdkgo.ResponseDevicesGetHealthScoreDefinitionForTheGivenIDResponse) []map[string]interface{} { +func flattenDevicesGetHealthScoreDefinitionForTheGivenIDV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetHealthScoreDefinitionForTheGivenIDV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_health_score_definitions_count.go b/catalystcenter/data_source_health_score_definitions_count.go index 5403da4..503f6cc 100644 --- a/catalystcenter/data_source_health_score_definitions_count.go +++ b/catalystcenter/data_source_health_score_definitions_count.go @@ -80,10 +80,10 @@ func dataSourceHealthScoreDefinitionsCountRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFilters") + log.Printf("[DEBUG] Selected method: GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1") - headerParams1 := catalystcentersdkgo.GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersHeaderParams{} - queryParams1 := catalystcentersdkgo.GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersQueryParams{} + headerParams1 := catalystcentersdkgo.GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1HeaderParams{} + queryParams1 := catalystcentersdkgo.GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1QueryParams{} if okDeviceType { queryParams1.DeviceType = vDeviceType.(string) @@ -96,24 +96,24 @@ func dataSourceHealthScoreDefinitionsCountRead(ctx context.Context, d *schema.Re } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Devices.GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFilters(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Devices.GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFilters", err, - "Failure at GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFilters, unexpected response", "")) + "Failure when executing 2 GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1", err, + "Failure at GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersItem(response1.Response) + vItem1 := flattenDevicesGetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFilters response", + "Failure when setting GetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1 response", err)) return diags } @@ -125,7 +125,7 @@ func dataSourceHealthScoreDefinitionsCountRead(ctx context.Context, d *schema.Re return diags } -func flattenDevicesGetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersItem(item *catalystcentersdkgo.ResponseDevicesGetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersResponse) []map[string]interface{} { +func flattenDevicesGetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1Item(item *catalystcentersdkgo.ResponseDevicesGetTheCountOfHealthScoreDefinitionsBasedOnProvidedFiltersV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_images.go b/catalystcenter/data_source_images.go index 76748f8..1ac8621 100644 --- a/catalystcenter/data_source_images.go +++ b/catalystcenter/data_source_images.go @@ -22,19 +22,19 @@ list includes images that have been imported onto the disk, as well as the lates ReadContext: dataSourceImagesRead, Schema: map[string]*schema.Schema{ "golden": &schema.Schema{ - Description: `golden query parameter. When set to 'true', it will retrieve the images marked as tagged golden. When set to 'false', it will retrieve the images marked as not tagged golden. + Description: `golden query parameter. When set to *true*, it will retrieve the images marked as tagged golden. When set to *false*, it will retrieve the images marked as not tagged golden. `, Type: schema.TypeBool, Optional: true, }, "has_addon_images": &schema.Schema{ - Description: `hasAddonImages query parameter. When set to 'true', it will retrieve the images which have add-on images. When set to 'false', it will retrieve the images which do not have add-on images. + Description: `hasAddonImages query parameter. When set to *true*, it will retrieve the images which have add-on images. When set to *false*, it will retrieve the images which do not have add-on images. `, Type: schema.TypeBool, Optional: true, }, "imported": &schema.Schema{ - Description: `imported query parameter. When the value is set to 'true', it will include physically imported images. Conversely, when the value is set to 'false', it will include image records from the cloud. The identifier for cloud images can be utilized to download images from Cisco.com to the disk. + Description: `imported query parameter. When the value is set to *true*, it will include physically imported images. Conversely, when the value is set to *false*, it will include image records from the cloud. The identifier for cloud images can be utilized to download images from Cisco.com to the disk. `, Type: schema.TypeBool, Optional: true, @@ -46,7 +46,7 @@ list includes images that have been imported onto the disk, as well as the lates Optional: true, }, "is_addon_images": &schema.Schema{ - Description: `isAddonImages query parameter. When set to 'true', it will retrieve the images that an add-on image. When set to 'false', it will retrieve the images that are not add-on images + Description: `isAddonImages query parameter. When set to *true*, it will retrieve the images that an add-on image. When set to *false*, it will retrieve the images that are not add-on images `, Type: schema.TypeBool, Optional: true, @@ -70,19 +70,19 @@ list includes images that have been imported onto the disk, as well as the lates Optional: true, }, "product_name_ordinal": &schema.Schema{ - Description: `productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of API '/dna/intent/api/v1/siteWiseProductNames' + Description: `productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of API */dna/intent/api/v1/siteWiseProductNames* `, Type: schema.TypeFloat, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. Site identifier to get the list of all available products under the site. The default value is the global site. See https://developer.cisco.com/docs/dna-center/get-site for 'siteId' + Description: `siteId query parameter. Site identifier to get the list of all available products under the site. The default value is the global site. See https://developer.cisco.com/docs/dna-center/get-site for *siteId* `, Type: schema.TypeString, Optional: true, }, "supervisor_product_name_ordinal": &schema.Schema{ - Description: `supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The 'supervisorProductNameOrdinal' can be obtained from the response of API '/dna/intent/api/v1/siteWiseProductNames' + Description: `supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The *supervisorProductNameOrdinal* can be obtained from the response of API */dna/intent/api/v1/siteWiseProductNames* `, Type: schema.TypeFloat, Optional: true, @@ -101,7 +101,7 @@ list includes images that have been imported onto the disk, as well as the lates Schema: map[string]*schema.Schema{ "cisco_latest": &schema.Schema{ - Description: `'true' if the image is latest/suggested from Cisco.com + Description: `*true* if the image is latest/suggested from Cisco.com `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -152,7 +152,7 @@ list includes images that have been imported onto the disk, as well as the lates }, "has_addon_images": &schema.Schema{ - Description: `Software images that have an applicable list of add-on images. The value of 'true' will return software images with add-on images, while the value of 'false' will return software images without add-on images + Description: `Software images that have an applicable list of add-on images. The value of *true* will return software images with add-on images, while the value of *false* will return software images without add-on images `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -189,7 +189,7 @@ list includes images that have been imported onto the disk, as well as the lates }, "is_addon_image": &schema.Schema{ - Description: `The value of 'true' will indicate the image as an add-on image, while the value of 'false' will indicate software image + Description: `The value of *true* will indicate the image as an add-on image, while the value of *false* will indicate software image `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -197,7 +197,7 @@ list includes images that have been imported onto the disk, as well as the lates }, "is_golden_tagged": &schema.Schema{ - Description: `The value of 'true' will indicate the image marked as golden, while the value of 'false' will indicate the image not marked as golden + Description: `The value of *true* will indicate the image marked as golden, while the value of *false* will indicate the image not marked as golden `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -239,14 +239,14 @@ list includes images that have been imported onto the disk, as well as the lates }, "supervisor_product_name": &schema.Schema{ - Description: `Name of the Supervisor Engine Module, supported by the 'productName'. Example: The 'Cisco Catalyst 9404R Switch' chassis is capable of supporting different supervisor engine modules: the 'Cisco Catalyst 9400 Supervisor Engine-1', the 'Cisco Catalyst 9400 Supervisor Engine-1XL', the 'Cisco Catalyst 9400 Supervisor Engine-1XL-Y', etc. + Description: `Name of the Supervisor Engine Module, supported by the *productName*. Example: The *Cisco Catalyst 9404R Switch* chassis is capable of supporting different supervisor engine modules: the *Cisco Catalyst 9400 Supervisor Engine-1*, the *Cisco Catalyst 9400 Supervisor Engine-1XL*, the *Cisco Catalyst 9400 Supervisor Engine-1XL-Y*, etc. `, Type: schema.TypeString, Computed: true, }, "supervisor_product_name_ordinal": &schema.Schema{ - Description: `Supervisor Engine Module Ordinal, supported by the 'productNameOrdinal'. Example: The '286315691' chassis ordinal is capable of supporting different supervisor engine module ordinals: '286316172', '286316710', '286320394' etc. + Description: `Supervisor Engine Module Ordinal, supported by the *productNameOrdinal*. Example: The *286315691* chassis ordinal is capable of supporting different supervisor engine module ordinals: *286316172*, *286316710*, *286320394* etc. `, Type: schema.TypeFloat, Computed: true, @@ -294,8 +294,8 @@ func dataSourceImagesRead(ctx context.Context, d *schema.ResourceData, m interfa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsListOfSoftwareImages") - queryParams1 := catalystcentersdkgo.ReturnsListOfSoftwareImagesQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnsListOfSoftwareImagesV1") + queryParams1 := catalystcentersdkgo.ReturnsListOfSoftwareImagesV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -334,24 +334,24 @@ func dataSourceImagesRead(ctx context.Context, d *schema.ResourceData, m interfa queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsListOfSoftwareImages(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsListOfSoftwareImagesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsListOfSoftwareImages", err, - "Failure at ReturnsListOfSoftwareImages, unexpected response", "")) + "Failure when executing 2 ReturnsListOfSoftwareImagesV1", err, + "Failure at ReturnsListOfSoftwareImagesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsListOfSoftwareImages response", + "Failure when setting ReturnsListOfSoftwareImagesV1 response", err)) return diags } @@ -363,7 +363,7 @@ func dataSourceImagesRead(ctx context.Context, d *schema.ResourceData, m interfa return diags } -func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsListOfSoftwareImagesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -380,15 +380,15 @@ func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItems(items *[ respItem["integrity_status"] = item.IntegrityStatus respItem["is_addon_image"] = boolPtrToString(item.IsAddonImage) respItem["has_addon_images"] = boolPtrToString(item.HasAddonImages) - respItem["golden_tagging_details"] = flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItemsGoldenTaggingDetails(item.GoldenTaggingDetails) - respItem["product_names"] = flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItemsProductNames(item.ProductNames) + respItem["golden_tagging_details"] = flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1ItemsGoldenTaggingDetails(item.GoldenTaggingDetails) + respItem["product_names"] = flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1ItemsProductNames(item.ProductNames) respItem["is_golden_tagged"] = boolPtrToString(item.IsGoldenTagged) respItems = append(respItems, respItem) } return respItems } -func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItemsGoldenTaggingDetails(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsListOfSoftwareImagesResponseGoldenTaggingDetails) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1ItemsGoldenTaggingDetails(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1ResponseGoldenTaggingDetails) []map[string]interface{} { if items == nil { return nil } @@ -404,7 +404,7 @@ func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItemsGoldenTag return respItems } -func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesItemsProductNames(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsListOfSoftwareImagesResponseProductNames) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1ItemsProductNames(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsListOfSoftwareImagesV1ResponseProductNames) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_images_addon_images.go b/catalystcenter/data_source_images_addon_images.go index 70aded4..f29c05c 100644 --- a/catalystcenter/data_source_images_addon_images.go +++ b/catalystcenter/data_source_images_addon_images.go @@ -15,14 +15,14 @@ func dataSourceImagesAddonImages() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Software Image Management (SWIM). -- Retrieves the list of applicable add-on images if available for the given software image. 'id' can be obtained from +- Retrieves the list of applicable add-on images if available for the given software image. *id* can be obtained from the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. `, ReadContext: dataSourceImagesAddonImagesRead, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. Software image identifier. Check '/dna/intent/api/v1/images?hasAddonImages=true' API to get the same. + Description: `id path parameter. Software image identifier. Check */dna/intent/api/v1/images?hasAddonImages=true* API to get the same. `, Type: schema.TypeString, Required: true, @@ -35,7 +35,7 @@ the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. Schema: map[string]*schema.Schema{ "cisco_latest": &schema.Schema{ - Description: `'true' if the image is latest/suggested from Cisco.com + Description: `*true* if the image is latest/suggested from Cisco.com `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -86,7 +86,7 @@ the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. }, "has_addon_images": &schema.Schema{ - Description: `Software images that have an applicable list of add-on images. The value of 'true' will return software images with add-on images, while the value of 'false' will return software images without add-on images + Description: `Software images that have an applicable list of add-on images. The value of *true* will return software images with add-on images, while the value of *false* will return software images without add-on images `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -123,7 +123,7 @@ the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. }, "is_addon_image": &schema.Schema{ - Description: `The value of 'true' will indicate the image as an add-on image, while the value of 'false' will indicate software image + Description: `The value of *true* will indicate the image as an add-on image, while the value of *false* will indicate software image `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -131,7 +131,7 @@ the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. }, "is_golden_tagged": &schema.Schema{ - Description: `The value of 'true' will indicate the image marked as golden, while the value of 'false' will indicate the image not marked as golden + Description: `The value of *true* will indicate the image marked as golden, while the value of *false* will indicate the image not marked as golden `, // Type: schema.TypeBool, Type: schema.TypeString, @@ -173,14 +173,14 @@ the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. }, "supervisor_product_name": &schema.Schema{ - Description: `Name of the Supervisor Engine Module, supported by the 'productName'. Example: The 'Cisco Catalyst 9404R Switch' chassis is capable of supporting different supervisor engine modules: the 'Cisco Catalyst 9400 Supervisor Engine-1', the 'Cisco Catalyst 9400 Supervisor Engine-1XL', the 'Cisco Catalyst 9400 Supervisor Engine-1XL-Y', etc. + Description: `Name of the Supervisor Engine Module, supported by the *productName*. Example: The *Cisco Catalyst 9404R Switch* chassis is capable of supporting different supervisor engine modules: the *Cisco Catalyst 9400 Supervisor Engine-1*, the *Cisco Catalyst 9400 Supervisor Engine-1XL*, the *Cisco Catalyst 9400 Supervisor Engine-1XL-Y*, etc. `, Type: schema.TypeString, Computed: true, }, "supervisor_product_name_ordinal": &schema.Schema{ - Description: `Supervisor Engine Module Ordinal, supported by the 'productNameOrdinal'. Example: The '286315691' chassis ordinal is capable of supporting different supervisor engine module ordinals: '286316172', '286316710', '286320394' etc. + Description: `Supervisor Engine Module Ordinal, supported by the *productNameOrdinal*. Example: The *286315691* chassis ordinal is capable of supporting different supervisor engine module ordinals: *286316172*, *286316710*, *286320394* etc. `, Type: schema.TypeFloat, Computed: true, @@ -217,27 +217,27 @@ func dataSourceImagesAddonImagesRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveApplicableAddOnImagesForTheGivenSoftwareImage") + log.Printf("[DEBUG] Selected method: RetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1") vvID := vID.(string) - response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrieveApplicableAddOnImagesForTheGivenSoftwareImage(vvID) + response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveApplicableAddOnImagesForTheGivenSoftwareImage", err, - "Failure at RetrieveApplicableAddOnImagesForTheGivenSoftwareImage, unexpected response", "")) + "Failure when executing 2 RetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1", err, + "Failure at RetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveApplicableAddOnImagesForTheGivenSoftwareImage response", + "Failure when setting RetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1 response", err)) return diags } @@ -249,7 +249,7 @@ func dataSourceImagesAddonImagesRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1Response) []map[string]interface{} { if items == nil { return nil } @@ -266,15 +266,15 @@ func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenS respItem["integrity_status"] = item.IntegrityStatus respItem["is_addon_image"] = boolPtrToString(item.IsAddonImage) respItem["has_addon_images"] = boolPtrToString(item.HasAddonImages) - respItem["golden_tagging_details"] = flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageItemsGoldenTaggingDetails(item.GoldenTaggingDetails) - respItem["product_names"] = flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageItemsProductNames(item.ProductNames) + respItem["golden_tagging_details"] = flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1ItemsGoldenTaggingDetails(item.GoldenTaggingDetails) + respItem["product_names"] = flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1ItemsProductNames(item.ProductNames) respItem["is_golden_tagged"] = boolPtrToString(item.IsGoldenTagged) respItems = append(respItems, respItem) } return respItems } -func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageItemsGoldenTaggingDetails(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageResponseGoldenTaggingDetails) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1ItemsGoldenTaggingDetails(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1ResponseGoldenTaggingDetails) []map[string]interface{} { if items == nil { return nil } @@ -290,7 +290,7 @@ func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenS return respItems } -func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageItemsProductNames(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageResponseProductNames) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1ItemsProductNames(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveApplicableAddOnImagesForTheGivenSoftwareImageV1ResponseProductNames) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_images_addon_images_count.go b/catalystcenter/data_source_images_addon_images_count.go index cf8e7a0..da32f50 100644 --- a/catalystcenter/data_source_images_addon_images_count.go +++ b/catalystcenter/data_source_images_addon_images_count.go @@ -15,14 +15,14 @@ func dataSourceImagesAddonImagesCount() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Software Image Management (SWIM). -- Count of add-on images available for the given software image identifier, 'id' can be obtained from the response of +- Count of add-on images available for the given software image identifier, *id* can be obtained from the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. `, ReadContext: dataSourceImagesAddonImagesCountRead, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. Software image identifier. Check API '/dna/intent/api/v1/images' for id from response. + Description: `id path parameter. Software image identifier. Check API */dna/intent/api/v1/images* for id from response. `, Type: schema.TypeString, Required: true, @@ -55,27 +55,27 @@ func dataSourceImagesAddonImagesCountRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsCountOfAddOnImages") + log.Printf("[DEBUG] Selected method: ReturnsCountOfAddOnImagesV1") vvID := vID.(string) - response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsCountOfAddOnImages(vvID) + response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsCountOfAddOnImagesV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsCountOfAddOnImages", err, - "Failure at ReturnsCountOfAddOnImages, unexpected response", "")) + "Failure when executing 2 ReturnsCountOfAddOnImagesV1", err, + "Failure at ReturnsCountOfAddOnImagesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimReturnsCountOfAddOnImagesItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimReturnsCountOfAddOnImagesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsCountOfAddOnImages response", + "Failure when setting ReturnsCountOfAddOnImagesV1 response", err)) return diags } @@ -87,7 +87,7 @@ func dataSourceImagesAddonImagesCountRead(ctx context.Context, d *schema.Resourc return diags } -func flattenSoftwareImageManagementSwimReturnsCountOfAddOnImagesItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsCountOfAddOnImagesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsCountOfAddOnImagesV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsCountOfAddOnImagesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_images_count.go b/catalystcenter/data_source_images_count.go index 244b420..3f54a26 100644 --- a/catalystcenter/data_source_images_count.go +++ b/catalystcenter/data_source_images_count.go @@ -15,25 +15,25 @@ func dataSourceImagesCount() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Software Image Management (SWIM). -- Returns the count of software images for given 'siteId'. The default value of siteId is global +- Returns the count of software images for given *siteId*. The default value of siteId is global `, ReadContext: dataSourceImagesCountRead, Schema: map[string]*schema.Schema{ "golden": &schema.Schema{ - Description: `golden query parameter. When set to 'true', it will retrieve the images marked tagged golden. When set to 'false', it will retrieve the images marked not tagged golden. + Description: `golden query parameter. When set to *true*, it will retrieve the images marked tagged golden. When set to *false*, it will retrieve the images marked not tagged golden. `, Type: schema.TypeString, Optional: true, }, "has_addon_images": &schema.Schema{ - Description: `hasAddonImages query parameter. When set to 'true', it will retrieve the images which have add-on images. When set to 'false', it will retrieve the images which do not have add-on images. + Description: `hasAddonImages query parameter. When set to *true*, it will retrieve the images which have add-on images. When set to *false*, it will retrieve the images which do not have add-on images. `, Type: schema.TypeBool, Optional: true, }, "imported": &schema.Schema{ - Description: `imported query parameter. When the value is set to 'true', it will include physically imported images. Conversely, when the value is set to 'false', it will include image records from the cloud. The identifier for cloud images can be utilised to download images from Cisco.com to the disk. + Description: `imported query parameter. When the value is set to *true*, it will include physically imported images. Conversely, when the value is set to *false*, it will include image records from the cloud. The identifier for cloud images can be utilised to download images from Cisco.com to the disk. `, Type: schema.TypeBool, Optional: true, @@ -45,7 +45,7 @@ func dataSourceImagesCount() *schema.Resource { Optional: true, }, "is_addon_images": &schema.Schema{ - Description: `isAddonImages query parameter. When set to 'true', it will retrieve the images that an add-on image. When set to 'false', it will retrieve the images that are not add-on images + Description: `isAddonImages query parameter. When set to *true*, it will retrieve the images that an add-on image. When set to *false*, it will retrieve the images that are not add-on images `, Type: schema.TypeBool, Optional: true, @@ -57,7 +57,7 @@ func dataSourceImagesCount() *schema.Resource { Optional: true, }, "product_name_ordinal": &schema.Schema{ - Description: `productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of the API '/dna/intent/api/v1/siteWiseProductNames'. + Description: `productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of the API */dna/intent/api/v1/siteWiseProductNames*. `, Type: schema.TypeFloat, Optional: true, @@ -69,7 +69,7 @@ func dataSourceImagesCount() *schema.Resource { Optional: true, }, "supervisor_product_name_ordinal": &schema.Schema{ - Description: `supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The 'supervisorProductNameOrdinal' can be obtained from the response of API '/dna/intent/api/v1/siteWiseProductNames' + Description: `supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The *supervisorProductNameOrdinal* can be obtained from the response of API */dna/intent/api/v1/siteWiseProductNames* `, Type: schema.TypeFloat, Optional: true, @@ -117,8 +117,8 @@ func dataSourceImagesCountRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsCountOfSoftwareImages") - queryParams1 := catalystcentersdkgo.ReturnsCountOfSoftwareImagesQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnsCountOfSoftwareImagesV1") + queryParams1 := catalystcentersdkgo.ReturnsCountOfSoftwareImagesV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -151,24 +151,24 @@ func dataSourceImagesCountRead(ctx context.Context, d *schema.ResourceData, m in queryParams1.IsAddonImages = vIsAddonImages.(bool) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsCountOfSoftwareImages(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsCountOfSoftwareImagesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsCountOfSoftwareImages", err, - "Failure at ReturnsCountOfSoftwareImages, unexpected response", "")) + "Failure when executing 2 ReturnsCountOfSoftwareImagesV1", err, + "Failure at ReturnsCountOfSoftwareImagesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimReturnsCountOfSoftwareImagesItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimReturnsCountOfSoftwareImagesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsCountOfSoftwareImages response", + "Failure when setting ReturnsCountOfSoftwareImagesV1 response", err)) return diags } @@ -180,7 +180,7 @@ func dataSourceImagesCountRead(ctx context.Context, d *schema.ResourceData, m in return diags } -func flattenSoftwareImageManagementSwimReturnsCountOfSoftwareImagesItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsCountOfSoftwareImagesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsCountOfSoftwareImagesV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsCountOfSoftwareImagesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_images_distribution_server_settings.go b/catalystcenter/data_source_images_distribution_server_settings.go index f6bc749..82cc475 100644 --- a/catalystcenter/data_source_images_distribution_server_settings.go +++ b/catalystcenter/data_source_images_distribution_server_settings.go @@ -76,26 +76,26 @@ func dataSourceImagesDistributionServerSettingsRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveImageDistributionServers") + log.Printf("[DEBUG] Selected method: RetrieveImageDistributionServersV1") - response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrieveImageDistributionServers() + response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrieveImageDistributionServersV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveImageDistributionServers", err, - "Failure at RetrieveImageDistributionServers, unexpected response", "")) + "Failure when executing 2 RetrieveImageDistributionServersV1", err, + "Failure at RetrieveImageDistributionServersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimRetrieveImageDistributionServersItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimRetrieveImageDistributionServersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveImageDistributionServers response", + "Failure when setting RetrieveImageDistributionServersV1 response", err)) return diags } @@ -107,7 +107,7 @@ func dataSourceImagesDistributionServerSettingsRead(ctx context.Context, d *sche return diags } -func flattenSoftwareImageManagementSwimRetrieveImageDistributionServersItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrieveImageDistributionServersV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_images_site_wise_product_names.go b/catalystcenter/data_source_images_site_wise_product_names.go index b77db9d..4a4d51f 100644 --- a/catalystcenter/data_source_images_site_wise_product_names.go +++ b/catalystcenter/data_source_images_site_wise_product_names.go @@ -16,19 +16,19 @@ func dataSourceImagesSiteWiseProductNames() *schema.Resource { Description: `It performs read operation on Software Image Management (SWIM). - Returns a list of network device product names and associated sites for a given image identifier. Refer -'/dna/intent/api/v1/images' API for obtaining 'imageId'. +*/dna/intent/api/v1/images* API for obtaining *imageId*. `, ReadContext: dataSourceImagesSiteWiseProductNamesRead, Schema: map[string]*schema.Schema{ "assigned": &schema.Schema{ - Description: `assigned query parameter. Filter with the assigned/unassigned, 'ASSIGNED' option will filter network device products that are associated with the given image. The 'NOT_ASSIGNED' option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED + Description: `assigned query parameter. Filter with the assigned/unassigned, *ASSIGNED* option will filter network device products that are associated with the given image. The *NOT_ASSIGNED* option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED `, Type: schema.TypeString, Optional: true, }, "image_id": &schema.Schema{ - Description: `imageId path parameter. Software image identifier. Refer '/dna/intent/api/v1/images' API for obtaining 'imageId' + Description: `imageId path parameter. Software image identifier. Refer */dna/intent/api/v1/images* API for obtaining *imageId* `, Type: schema.TypeString, Required: true, @@ -58,7 +58,7 @@ func dataSourceImagesSiteWiseProductNames() *schema.Resource { Optional: true, }, "recommended": &schema.Schema{ - Description: `recommended query parameter. Filter with recommended source. If 'CISCO' then the network device product assigned was recommended by Cisco and 'USER' then the user has manually assigned. Available values: CISCO, USER + Description: `recommended query parameter. Filter with recommended source. If *CISCO* then the network device product assigned was recommended by Cisco and *USER* then the user has manually assigned. Available values: CISCO, USER `, Type: schema.TypeString, Optional: true, @@ -138,9 +138,9 @@ func dataSourceImagesSiteWiseProductNamesRead(ctx context.Context, d *schema.Res selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage") + log.Printf("[DEBUG] Selected method: RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1") vvImageID := vImageID.(string) - queryParams1 := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageQueryParams{} + queryParams1 := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1QueryParams{} if okProductName { queryParams1.ProductName = vProductName.(string) @@ -161,24 +161,24 @@ func dataSourceImagesSiteWiseProductNamesRead(ctx context.Context, d *schema.Res queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage(vvImageID, &queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1(vvImageID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage", err, - "Failure at RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage, unexpected response", "")) + "Failure when executing 2 RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1", err, + "Failure at RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage response", + "Failure when setting RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1 response", err)) return diags } @@ -190,7 +190,7 @@ func dataSourceImagesSiteWiseProductNamesRead(ctx context.Context, d *schema.Res return diags } -func flattenSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_images_site_wise_product_names_count.go b/catalystcenter/data_source_images_site_wise_product_names_count.go index b37501a..63bf01f 100644 --- a/catalystcenter/data_source_images_site_wise_product_names_count.go +++ b/catalystcenter/data_source_images_site_wise_product_names_count.go @@ -15,20 +15,20 @@ func dataSourceImagesSiteWiseProductNamesCount() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Software Image Management (SWIM). -- Returns count of assigned network device product for a given image identifier. Refer '/dna/intent/api/v1/images' API -for obtaining 'imageId' +- Returns count of assigned network device product for a given image identifier. Refer */dna/intent/api/v1/images* API +for obtaining *imageId* `, ReadContext: dataSourceImagesSiteWiseProductNamesCountRead, Schema: map[string]*schema.Schema{ "assigned": &schema.Schema{ - Description: `assigned query parameter. Filter with the assigned/unassigned, 'ASSIGNED' option will filter network device products that are associated with the given image. The 'NOT_ASSIGNED' option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED + Description: `assigned query parameter. Filter with the assigned/unassigned, *ASSIGNED* option will filter network device products that are associated with the given image. The *NOT_ASSIGNED* option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED `, Type: schema.TypeString, Optional: true, }, "image_id": &schema.Schema{ - Description: `imageId path parameter. Software image identifier. Refer '/dna/intent/api/v/images' API for obtaining 'imageId' + Description: `imageId path parameter. Software image identifier. Refer */dna/intent/api/v/images* API for obtaining *imageId* `, Type: schema.TypeString, Required: true, @@ -46,7 +46,7 @@ for obtaining 'imageId' Optional: true, }, "recommended": &schema.Schema{ - Description: `recommended query parameter. Filter with recommended source. If 'CISCO' then the network device product assigned was recommended by Cisco and 'USER' then the user has manually assigned. Available values : CISCO, USER + Description: `recommended query parameter. Filter with recommended source. If *CISCO* then the network device product assigned was recommended by Cisco and *USER* then the user has manually assigned. Available values : CISCO, USER `, Type: schema.TypeString, Optional: true, @@ -83,9 +83,9 @@ func dataSourceImagesSiteWiseProductNamesCountRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheCountOfAssignedNetworkDeviceProducts") + log.Printf("[DEBUG] Selected method: RetrievesTheCountOfAssignedNetworkDeviceProductsV1") vvImageID := vImageID.(string) - queryParams1 := catalystcentersdkgo.RetrievesTheCountOfAssignedNetworkDeviceProductsQueryParams{} + queryParams1 := catalystcentersdkgo.RetrievesTheCountOfAssignedNetworkDeviceProductsV1QueryParams{} if okProductName { queryParams1.ProductName = vProductName.(string) @@ -100,24 +100,24 @@ func dataSourceImagesSiteWiseProductNamesCountRead(ctx context.Context, d *schem queryParams1.Assigned = vAssigned.(string) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrievesTheCountOfAssignedNetworkDeviceProducts(vvImageID, &queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrievesTheCountOfAssignedNetworkDeviceProductsV1(vvImageID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheCountOfAssignedNetworkDeviceProducts", err, - "Failure at RetrievesTheCountOfAssignedNetworkDeviceProducts, unexpected response", "")) + "Failure when executing 2 RetrievesTheCountOfAssignedNetworkDeviceProductsV1", err, + "Failure at RetrievesTheCountOfAssignedNetworkDeviceProductsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimRetrievesTheCountOfAssignedNetworkDeviceProductsItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimRetrievesTheCountOfAssignedNetworkDeviceProductsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheCountOfAssignedNetworkDeviceProducts response", + "Failure when setting RetrievesTheCountOfAssignedNetworkDeviceProductsV1 response", err)) return diags } @@ -129,7 +129,7 @@ func dataSourceImagesSiteWiseProductNamesCountRead(ctx context.Context, d *schem return diags } -func flattenSoftwareImageManagementSwimRetrievesTheCountOfAssignedNetworkDeviceProductsItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesTheCountOfAssignedNetworkDeviceProductsResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrievesTheCountOfAssignedNetworkDeviceProductsV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesTheCountOfAssignedNetworkDeviceProductsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_integration_settings_instances_itsm.go b/catalystcenter/data_source_integration_settings_instances_itsm.go index a8b9273..1a457a6 100644 --- a/catalystcenter/data_source_integration_settings_instances_itsm.go +++ b/catalystcenter/data_source_integration_settings_instances_itsm.go @@ -149,27 +149,27 @@ func dataSourceIntegrationSettingsInstancesItsmRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetItsmIntegrationSettingByID") + log.Printf("[DEBUG] Selected method: GetItsmIntegrationSettingByIDV1") vvInstanceID := vInstanceID.(string) - response1, restyResp1, err := client.ItsmIntegration.GetItsmIntegrationSettingByID(vvInstanceID) + response1, restyResp1, err := client.ItsmIntegration.GetItsmIntegrationSettingByIDV1(vvInstanceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetItsmIntegrationSettingByID", err, - "Failure at GetItsmIntegrationSettingByID, unexpected response", "")) + "Failure when executing 2 GetItsmIntegrationSettingByIDV1", err, + "Failure at GetItsmIntegrationSettingByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenItsmIntegrationGetItsmIntegrationSettingByIDItem(response1) + vItem1 := flattenItsmIntegrationGetItsmIntegrationSettingByIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetItsmIntegrationSettingByID response", + "Failure when setting GetItsmIntegrationSettingByIDV1 response", err)) return diags } @@ -181,7 +181,7 @@ func dataSourceIntegrationSettingsInstancesItsmRead(ctx context.Context, d *sche return diags } -func flattenItsmIntegrationGetItsmIntegrationSettingByIDItem(item *catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationSettingByID) []map[string]interface{} { +func flattenItsmIntegrationGetItsmIntegrationSettingByIDV1Item(item *catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationSettingByIDV1) []map[string]interface{} { if item == nil { return nil } @@ -194,7 +194,7 @@ func flattenItsmIntegrationGetItsmIntegrationSettingByIDItem(item *catalystcente respItem["name"] = item.Name respItem["unique_key"] = item.UniqueKey respItem["description"] = item.Description - respItem["data"] = flattenItsmIntegrationGetItsmIntegrationSettingByIDItemData(item.Data) + respItem["data"] = flattenItsmIntegrationGetItsmIntegrationSettingByIDV1ItemData(item.Data) respItem["updated_date"] = item.UpdatedDate respItem["updated_by"] = item.UpdatedBy respItem["tenant_id"] = item.TenantID @@ -203,12 +203,12 @@ func flattenItsmIntegrationGetItsmIntegrationSettingByIDItem(item *catalystcente } } -func flattenItsmIntegrationGetItsmIntegrationSettingByIDItemData(item *catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationSettingByIDData) []map[string]interface{} { +func flattenItsmIntegrationGetItsmIntegrationSettingByIDV1ItemData(item *catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationSettingByIDV1Data) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["connection_settings"] = flattenItsmIntegrationGetItsmIntegrationSettingByIDItemDataConnectionSettings(item.ConnectionSettings) + respItem["connection_settings"] = flattenItsmIntegrationGetItsmIntegrationSettingByIDV1ItemDataConnectionSettings(item.ConnectionSettings) return []map[string]interface{}{ respItem, @@ -216,7 +216,7 @@ func flattenItsmIntegrationGetItsmIntegrationSettingByIDItemData(item *catalystc } -func flattenItsmIntegrationGetItsmIntegrationSettingByIDItemDataConnectionSettings(item *catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationSettingByIDDataConnectionSettings) []map[string]interface{} { +func flattenItsmIntegrationGetItsmIntegrationSettingByIDV1ItemDataConnectionSettings(item *catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationSettingByIDV1DataConnectionSettings) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_integration_settings_itsm_instances.go b/catalystcenter/data_source_integration_settings_itsm_instances.go index 2f9c14c..5dae67c 100644 --- a/catalystcenter/data_source_integration_settings_itsm_instances.go +++ b/catalystcenter/data_source_integration_settings_itsm_instances.go @@ -121,26 +121,26 @@ func dataSourceIntegrationSettingsItsmInstancesRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllItsmIntegrationSettings") + log.Printf("[DEBUG] Selected method: GetAllItsmIntegrationSettingsV1") - response1, restyResp1, err := client.ItsmIntegration.GetAllItsmIntegrationSettings() + response1, restyResp1, err := client.ItsmIntegration.GetAllItsmIntegrationSettingsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllItsmIntegrationSettings", err, - "Failure at GetAllItsmIntegrationSettings, unexpected response", "")) + "Failure when executing 2 GetAllItsmIntegrationSettingsV1", err, + "Failure at GetAllItsmIntegrationSettingsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenItsmIntegrationGetAllItsmIntegrationSettingsItems(response1) + vItems1 := flattenItsmIntegrationGetAllItsmIntegrationSettingsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllItsmIntegrationSettings response", + "Failure when setting GetAllItsmIntegrationSettingsV1 response", err)) return diags } @@ -152,7 +152,7 @@ func dataSourceIntegrationSettingsItsmInstancesRead(ctx context.Context, d *sche return diags } -func flattenItsmIntegrationGetAllItsmIntegrationSettingsItems(items *catalystcentersdkgo.ResponseItsmIntegrationGetAllItsmIntegrationSettings) []map[string]interface{} { +func flattenItsmIntegrationGetAllItsmIntegrationSettingsV1Items(items *catalystcentersdkgo.ResponseItsmIntegrationGetAllItsmIntegrationSettingsV1) []map[string]interface{} { if items == nil { return nil } @@ -169,7 +169,7 @@ func flattenItsmIntegrationGetAllItsmIntegrationSettingsItems(items *catalystcen respItem["created_date"] = item.CreatedDate respItem["created_by"] = item.CreatedBy respItem["updated_by"] = item.UpdatedBy - respItem["software_version_log"] = flattenItsmIntegrationGetAllItsmIntegrationSettingsItemsSoftwareVersionLog(item.SoftwareVersionLog) + respItem["software_version_log"] = flattenItsmIntegrationGetAllItsmIntegrationSettingsV1ItemsSoftwareVersionLog(item.SoftwareVersionLog) respItem["schema_version"] = item.SchemaVersion respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -177,7 +177,7 @@ func flattenItsmIntegrationGetAllItsmIntegrationSettingsItems(items *catalystcen return respItems } -func flattenItsmIntegrationGetAllItsmIntegrationSettingsItemsSoftwareVersionLog(items *[]catalystcentersdkgo.ResponseItemItsmIntegrationGetAllItsmIntegrationSettingsSoftwareVersionLog) []interface{} { +func flattenItsmIntegrationGetAllItsmIntegrationSettingsV1ItemsSoftwareVersionLog(items *[]catalystcentersdkgo.ResponseItemItsmIntegrationGetAllItsmIntegrationSettingsV1SoftwareVersionLog) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_integration_settings_status.go b/catalystcenter/data_source_integration_settings_status.go index 50e888a..807e15e 100644 --- a/catalystcenter/data_source_integration_settings_status.go +++ b/catalystcenter/data_source_integration_settings_status.go @@ -84,26 +84,26 @@ func dataSourceIntegrationSettingsStatusRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetItsmIntegrationStatus") + log.Printf("[DEBUG] Selected method: GetItsmIntegrationStatusV1") - response1, restyResp1, err := client.ItsmIntegration.GetItsmIntegrationStatus() + response1, restyResp1, err := client.ItsmIntegration.GetItsmIntegrationStatusV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetItsmIntegrationStatus", err, - "Failure at GetItsmIntegrationStatus, unexpected response", "")) + "Failure when executing 2 GetItsmIntegrationStatusV1", err, + "Failure at GetItsmIntegrationStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenItsmIntegrationGetItsmIntegrationStatusItems(response1.Response) + vItems1 := flattenItsmIntegrationGetItsmIntegrationStatusV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetItsmIntegrationStatus response", + "Failure when setting GetItsmIntegrationStatusV1 response", err)) return diags } @@ -115,7 +115,7 @@ func dataSourceIntegrationSettingsStatusRead(ctx context.Context, d *schema.Reso return diags } -func flattenItsmIntegrationGetItsmIntegrationStatusItems(items *[]catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationStatusResponse) []map[string]interface{} { +func flattenItsmIntegrationGetItsmIntegrationStatusV1Items(items *[]catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationStatusV1Response) []map[string]interface{} { if items == nil { return nil } @@ -125,13 +125,13 @@ func flattenItsmIntegrationGetItsmIntegrationStatusItems(items *[]catalystcenter respItem["id"] = item.ID respItem["name"] = item.Name respItem["status"] = item.Status - respItem["configurations"] = flattenItsmIntegrationGetItsmIntegrationStatusItemsConfigurations(item.Configurations) + respItem["configurations"] = flattenItsmIntegrationGetItsmIntegrationStatusV1ItemsConfigurations(item.Configurations) respItems = append(respItems, respItem) } return respItems } -func flattenItsmIntegrationGetItsmIntegrationStatusItemsConfigurations(items *[]catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationStatusResponseConfigurations) []map[string]interface{} { +func flattenItsmIntegrationGetItsmIntegrationStatusV1ItemsConfigurations(items *[]catalystcentersdkgo.ResponseItsmIntegrationGetItsmIntegrationStatusV1ResponseConfigurations) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_intent_custom_issue_definitions.go b/catalystcenter/data_source_intent_custom_issue_definitions.go index 21902f2..fcb7bef 100644 --- a/catalystcenter/data_source_intent_custom_issue_definitions.go +++ b/catalystcenter/data_source_intent_custom_issue_definitions.go @@ -176,31 +176,31 @@ func dataSourceIntentCustomIssueDefinitionsRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionID") + log.Printf("[DEBUG] Selected method: GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1") vvID := vID.(string) - headerParams1 := catalystcentersdkgo.GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDHeaderParams{} + headerParams1 := catalystcentersdkgo.GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionID(vvID, &headerParams1) + response1, restyResp1, err := client.Issues.GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1(vvID, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionID", err, - "Failure at GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionID, unexpected response", "")) + "Failure when executing 2 GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1", err, + "Failure at GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDItem(response1.Response) + vItem1 := flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionID response", + "Failure when setting GetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1 response", err)) return diags } @@ -212,7 +212,7 @@ func dataSourceIntentCustomIssueDefinitionsRead(ctx context.Context, d *schema.R return diags } -func flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDItem(item *catalystcentersdkgo.ResponseIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDResponse) []map[string]interface{} { +func flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1Item(item *catalystcentersdkgo.ResponseIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1Response) []map[string]interface{} { if item == nil { return nil } @@ -222,7 +222,7 @@ func flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDI respItem["description"] = item.Description respItem["profile_id"] = item.ProfileID respItem["trigger_id"] = item.TriggerID - respItem["rules"] = flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDItemRules(item.Rules) + respItem["rules"] = flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1ItemRules(item.Rules) respItem["is_enabled"] = boolPtrToString(item.IsEnabled) respItem["priority"] = item.Priority respItem["is_deletable"] = boolPtrToString(item.IsDeletable) @@ -234,7 +234,7 @@ func flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDI } } -func flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDItemRules(items *[]catalystcentersdkgo.ResponseIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDResponseRules) []map[string]interface{} { +func flattenIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1ItemRules(items *[]catalystcentersdkgo.ResponseIssuesGetTheCustomIssueDefinitionForTheGivenCustomIssueDefinitionIDV1ResponseRules) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_interface.go b/catalystcenter/data_source_interface.go index 8d22ca2..203fe6c 100644 --- a/catalystcenter/data_source_interface.go +++ b/catalystcenter/data_source_interface.go @@ -114,27 +114,27 @@ func dataSourceInterfaceRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LegitOperationsForInterface") + log.Printf("[DEBUG] Selected method: LegitOperationsForInterfaceV1") vvInterfaceUUID := vInterfaceUUID.(string) - response1, restyResp1, err := client.Devices.LegitOperationsForInterface(vvInterfaceUUID) + response1, restyResp1, err := client.Devices.LegitOperationsForInterfaceV1(vvInterfaceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LegitOperationsForInterface", err, - "Failure at LegitOperationsForInterface, unexpected response", "")) + "Failure when executing 2 LegitOperationsForInterfaceV1", err, + "Failure at LegitOperationsForInterfaceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesLegitOperationsForInterfaceItem(response1.Response) + vItem1 := flattenDevicesLegitOperationsForInterfaceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LegitOperationsForInterface response", + "Failure when setting LegitOperationsForInterfaceV1 response", err)) return diags } @@ -146,20 +146,20 @@ func dataSourceInterfaceRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenDevicesLegitOperationsForInterfaceItem(item *catalystcentersdkgo.ResponseDevicesLegitOperationsForInterfaceResponse) []map[string]interface{} { +func flattenDevicesLegitOperationsForInterfaceV1Item(item *catalystcentersdkgo.ResponseDevicesLegitOperationsForInterfaceV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["interface_uuid"] = item.InterfaceUUID - respItem["properties"] = flattenDevicesLegitOperationsForInterfaceItemProperties(item.Properties) - respItem["operations"] = flattenDevicesLegitOperationsForInterfaceItemOperations(item.Operations) + respItem["properties"] = flattenDevicesLegitOperationsForInterfaceV1ItemProperties(item.Properties) + respItem["operations"] = flattenDevicesLegitOperationsForInterfaceV1ItemOperations(item.Operations) return []map[string]interface{}{ respItem, } } -func flattenDevicesLegitOperationsForInterfaceItemProperties(items *[]catalystcentersdkgo.ResponseDevicesLegitOperationsForInterfaceResponseProperties) []map[string]interface{} { +func flattenDevicesLegitOperationsForInterfaceV1ItemProperties(items *[]catalystcentersdkgo.ResponseDevicesLegitOperationsForInterfaceV1ResponseProperties) []map[string]interface{} { if items == nil { return nil } @@ -174,7 +174,7 @@ func flattenDevicesLegitOperationsForInterfaceItemProperties(items *[]catalystce return respItems } -func flattenDevicesLegitOperationsForInterfaceItemOperations(items *[]catalystcentersdkgo.ResponseDevicesLegitOperationsForInterfaceResponseOperations) []map[string]interface{} { +func flattenDevicesLegitOperationsForInterfaceV1ItemOperations(items *[]catalystcentersdkgo.ResponseDevicesLegitOperationsForInterfaceV1ResponseOperations) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_interface_network_device.go b/catalystcenter/data_source_interface_network_device.go index 9c15798..b713234 100644 --- a/catalystcenter/data_source_interface_network_device.go +++ b/catalystcenter/data_source_interface_network_device.go @@ -350,27 +350,27 @@ func dataSourceInterfaceNetworkDeviceRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetInterfaceInfoByID") + log.Printf("[DEBUG] Selected method: GetInterfaceInfoByIDV1") vvDeviceID := vDeviceID.(string) - response1, restyResp1, err := client.Devices.GetInterfaceInfoByID(vvDeviceID) + response1, restyResp1, err := client.Devices.GetInterfaceInfoByIDV1(vvDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfaceInfoByID", err, - "Failure at GetInterfaceInfoByID, unexpected response", "")) + "Failure when executing 2 GetInterfaceInfoByIDV1", err, + "Failure at GetInterfaceInfoByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetInterfaceInfoByIDItems(response1.Response) + vItems1 := flattenDevicesGetInterfaceInfoByIDV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfaceInfoByID response", + "Failure when setting GetInterfaceInfoByIDV1 response", err)) return diags } @@ -382,14 +382,14 @@ func dataSourceInterfaceNetworkDeviceRead(ctx context.Context, d *schema.Resourc return diags } -func flattenDevicesGetInterfaceInfoByIDItems(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDResponse) []map[string]interface{} { +func flattenDevicesGetInterfaceInfoByIDV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetInterfaceInfoByIDItemsAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetInterfaceInfoByIDV1ItemsAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -429,27 +429,27 @@ func flattenDevicesGetInterfaceInfoByIDItems(items *[]catalystcentersdkgo.Respon return respItems } -func flattenDevicesGetInterfaceInfoByIDItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDResponseAddresses) []map[string]interface{} { +func flattenDevicesGetInterfaceInfoByIDV1ItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetInterfaceInfoByIDItemsAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetInterfaceInfoByIDV1ItemsAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetInterfaceInfoByIDItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceInfoByIDV1ItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetInterfaceInfoByIDItemsAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetInterfaceInfoByIDItemsAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetInterfaceInfoByIDV1ItemsAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetInterfaceInfoByIDV1ItemsAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -458,7 +458,7 @@ func flattenDevicesGetInterfaceInfoByIDItemsAddressesAddress(item *catalystcente } -func flattenDevicesGetInterfaceInfoByIDItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceInfoByIDV1ItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -471,7 +471,7 @@ func flattenDevicesGetInterfaceInfoByIDItemsAddressesAddressIPAddress(item *cata } -func flattenDevicesGetInterfaceInfoByIDItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetInterfaceInfoByIDV1ItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceInfoByIDV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_interface_network_device_detail.go b/catalystcenter/data_source_interface_network_device_detail.go index 7295689..476360a 100644 --- a/catalystcenter/data_source_interface_network_device_detail.go +++ b/catalystcenter/data_source_interface_network_device_detail.go @@ -399,30 +399,30 @@ func dataSourceInterfaceNetworkDeviceDetailRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetInterfaceDetailsByDeviceIDAndInterfaceName") + log.Printf("[DEBUG] Selected method: GetInterfaceDetailsByDeviceIDAndInterfaceNameV1") vvDeviceID := vDeviceID.(string) - queryParams1 := catalystcentersdkgo.GetInterfaceDetailsByDeviceIDAndInterfaceNameQueryParams{} + queryParams1 := catalystcentersdkgo.GetInterfaceDetailsByDeviceIDAndInterfaceNameV1QueryParams{} queryParams1.Name = vName.(string) - response1, restyResp1, err := client.Devices.GetInterfaceDetailsByDeviceIDAndInterfaceName(vvDeviceID, &queryParams1) + response1, restyResp1, err := client.Devices.GetInterfaceDetailsByDeviceIDAndInterfaceNameV1(vvDeviceID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfaceDetailsByDeviceIDAndInterfaceName", err, - "Failure at GetInterfaceDetailsByDeviceIDAndInterfaceName, unexpected response", "")) + "Failure when executing 2 GetInterfaceDetailsByDeviceIDAndInterfaceNameV1", err, + "Failure at GetInterfaceDetailsByDeviceIDAndInterfaceNameV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItem(response1.Response) + vItem1 := flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfaceDetailsByDeviceIDAndInterfaceName response", + "Failure when setting GetInterfaceDetailsByDeviceIDAndInterfaceNameV1 response", err)) return diags } @@ -434,12 +434,12 @@ func dataSourceInterfaceNetworkDeviceDetailRead(ctx context.Context, d *schema.R return diags } -func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItem(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameResponse) []map[string]interface{} { +func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1Item(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -485,27 +485,27 @@ func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItem(item *catal } } -func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameResponseAddresses) []map[string]interface{} { +func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -514,7 +514,7 @@ func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAdd } -func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -527,7 +527,7 @@ func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAdd } -func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameItemAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ItemAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetInterfaceDetailsByDeviceIDAndInterfaceNameV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_interface_network_device_range.go b/catalystcenter/data_source_interface_network_device_range.go index c15f380..dc93757 100644 --- a/catalystcenter/data_source_interface_network_device_range.go +++ b/catalystcenter/data_source_interface_network_device_range.go @@ -364,29 +364,29 @@ func dataSourceInterfaceNetworkDeviceRangeRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceInterfacesBySpecifiedRange") + log.Printf("[DEBUG] Selected method: GetDeviceInterfacesBySpecifiedRangeV1") vvDeviceID := vDeviceID.(string) vvStartIndex := vStartIndex.(int) vvRecordsToReturn := vRecordsToReturn.(int) - response1, restyResp1, err := client.Devices.GetDeviceInterfacesBySpecifiedRange(vvDeviceID, vvStartIndex, vvRecordsToReturn) + response1, restyResp1, err := client.Devices.GetDeviceInterfacesBySpecifiedRangeV1(vvDeviceID, vvStartIndex, vvRecordsToReturn) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceInterfacesBySpecifiedRange", err, - "Failure at GetDeviceInterfacesBySpecifiedRange, unexpected response", "")) + "Failure when executing 2 GetDeviceInterfacesBySpecifiedRangeV1", err, + "Failure at GetDeviceInterfacesBySpecifiedRangeV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetDeviceInterfacesBySpecifiedRangeItems(response1.Response) + vItems1 := flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceInterfacesBySpecifiedRange response", + "Failure when setting GetDeviceInterfacesBySpecifiedRangeV1 response", err)) return diags } @@ -398,14 +398,14 @@ func dataSourceInterfaceNetworkDeviceRangeRead(ctx context.Context, d *schema.Re return diags } -func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItems(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeResponse) []map[string]interface{} { +func flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["addresses"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddresses(item.Addresses) + respItem["addresses"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddresses(item.Addresses) respItem["admin_status"] = item.AdminStatus respItem["class_name"] = item.ClassName respItem["description"] = item.Description @@ -445,27 +445,27 @@ func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItems(items *[]catalystcen return respItems } -func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeResponseAddresses) []map[string]interface{} { +func flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddresses(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeV1ResponseAddresses) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["address"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddress(item.Address) + respItem["address"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddressesAddress(item.Address) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeResponseAddressesAddress) []map[string]interface{} { +func flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddressesAddress(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeV1ResponseAddressesAddress) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ip_address"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddressIPAddress(item.IPAddress) - respItem["ip_mask"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddressIPMask(item.IPMask) + respItem["ip_address"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddressesAddressIPAddress(item.IPAddress) + respItem["ip_mask"] = flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddressesAddressIPMask(item.IPMask) respItem["is_inverse_mask"] = boolPtrToString(item.IsInverseMask) return []map[string]interface{}{ @@ -474,7 +474,7 @@ func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddress(item } -func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeResponseAddressesAddressIPAddress) []map[string]interface{} { +func flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddressesAddressIPAddress(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeV1ResponseAddressesAddressIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -487,7 +487,7 @@ func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddressIPAdd } -func flattenDevicesGetDeviceInterfacesBySpecifiedRangeItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeResponseAddressesAddressIPMask) []map[string]interface{} { +func flattenDevicesGetDeviceInterfacesBySpecifiedRangeV1ItemsAddressesAddressIPMask(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfacesBySpecifiedRangeV1ResponseAddressesAddressIPMask) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_interfaces.go b/catalystcenter/data_source_interfaces.go index 1092900..aab367d 100644 --- a/catalystcenter/data_source_interfaces.go +++ b/catalystcenter/data_source_interfaces.go @@ -60,19 +60,19 @@ attributes=name,description,duplexOper (multiple attributes with comma separator Optional: true, }, "interface_id": &schema.Schema{ - Description: `interfaceId query parameter. The list of Interface Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `interfaceId query parameter. The list of Interface Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c' (single interface uuid ) -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple Interface uuid with & separator) +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c* (single interface uuid ) +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple Interface uuid with & separator) `, Type: schema.TypeString, Optional: true, }, "interface_name": &schema.Schema{ - Description: `interfaceName query parameter. The list of Interface name (Ex. 'GigabitEthernet1/0/1') This field supports wildcard ('*') character-based search. Ex: '*1/0/1*' or '1/0/1*' or '*1/0/1' + Description: `interfaceName query parameter. The list of Interface name (Ex. *GigabitEthernet1/0/1*) This field supports wildcard (***) character-based search. Ex: **1/0/1** or *1/0/1** or **1/0/1* Examples: -'interfaceNames=GigabitEthernet1/0/1' (single interface name) -'interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1' (multiple interface names with & separator) +*interfaceNames=GigabitEthernet1/0/1* (single interface name) +*interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1* (multiple interface names with & separator) `, Type: schema.TypeString, Optional: true, @@ -84,30 +84,30 @@ Examples: Optional: true, }, "network_device_id": &schema.Schema{ - Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_ip_address": &schema.Schema{ - Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' + Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_mac_address": &schema.Schema{ - Description: `networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. '64:f6:9d:07:9a:00') -This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' + Description: `networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. *64:f6:9d:07:9a:00*) +This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: -'networkDeviceMacAddress=64:f6:9d:07:9a:00' -'networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77' (multiple networkDevice MAC addresses with & separator) +*networkDeviceMacAddress=64:f6:9d:07:9a:00* +*networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77* (multiple networkDevice MAC addresses with & separator) `, Type: schema.TypeString, Optional: true, @@ -125,30 +125,30 @@ Examples: Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) `, Type: schema.TypeString, Optional: true, @@ -161,7 +161,7 @@ Examples: }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -689,8 +689,8 @@ func dataSourceInterfacesRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevices") - queryParams1 := catalystcentersdkgo.GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesQueryParams{} + log.Printf("[DEBUG] Selected method: GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1") + queryParams1 := catalystcentersdkgo.GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -741,24 +741,24 @@ func dataSourceInterfacesRead(ctx context.Context, d *schema.ResourceData, m int queryParams1.InterfaceName = vInterfaceName.(string) } - response1, restyResp1, err := client.Devices.GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevices(&queryParams1) + response1, restyResp1, err := client.Devices.GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevices", err, - "Failure at GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevices, unexpected response", "")) + "Failure when executing 2 GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1", err, + "Failure at GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesItems(response1.Response) + vItems1 := flattenDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevices response", + "Failure when setting GetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1 response", err)) return diags } @@ -768,9 +768,9 @@ func dataSourceInterfacesRead(ctx context.Context, d *schema.ResourceData, m int } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsData") + log.Printf("[DEBUG] Selected method: GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1") vvID := vID.(string) - queryParams2 := catalystcentersdkgo.GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataQueryParams{} + queryParams2 := catalystcentersdkgo.GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1QueryParams{} if okStartTime { queryParams2.StartTime = vStartTime.(float64) @@ -785,24 +785,24 @@ func dataSourceInterfacesRead(ctx context.Context, d *schema.ResourceData, m int queryParams2.Attribute = vAttribute.(string) } - response2, restyResp2, err := client.Devices.GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsData(vvID, &queryParams2) + response2, restyResp2, err := client.Devices.GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1(vvID, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsData", err, - "Failure at GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsData, unexpected response", "")) + "Failure when executing 2 GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1", err, + "Failure at GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataItem(response2.Response) + vItem2 := flattenDevicesGetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsData response", + "Failure when setting GetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1 response", err)) return diags } @@ -814,7 +814,7 @@ func dataSourceInterfacesRead(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesItems(items *[]catalystcentersdkgo.ResponseDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesResponse) []map[string]interface{} { +func flattenDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -864,7 +864,7 @@ func flattenDevicesGetsInterfacesAlongWithStatisticsDataFromAllNetworkDevicesIte return respItems } -func flattenDevicesGetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataItem(item *catalystcentersdkgo.ResponseDevicesGetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataResponse) []map[string]interface{} { +func flattenDevicesGetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1Item(item *catalystcentersdkgo.ResponseDevicesGetTheInterfaceDataForTheGivenInterfaceIDinstanceUUIDAlongWithTheStatisticsDataV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_interfaces_count.go b/catalystcenter/data_source_interfaces_count.go index a6c4be0..9439559 100644 --- a/catalystcenter/data_source_interfaces_count.go +++ b/catalystcenter/data_source_interfaces_count.go @@ -29,84 +29,84 @@ specs/blob/main/Assurance/CE_Cat_Center_Org-interfaces-1.0.2-resolved.yaml Optional: true, }, "interface_id": &schema.Schema{ - Description: `interfaceId query parameter. The list of Interface Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `interfaceId query parameter. The list of Interface Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c' (single interface uuid ) -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple Interface uuid with & separator) +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c* (single interface uuid ) +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple Interface uuid with & separator) `, Type: schema.TypeString, Optional: true, }, "interface_name": &schema.Schema{ - Description: `interfaceName query parameter. The list of Interface name (Ex. 'GigabitEthernet1/0/1') This field supports wildcard ('*') character-based search. Ex: '*1/0/1*' or '1/0/1*' or '*1/0/1' + Description: `interfaceName query parameter. The list of Interface name (Ex. *GigabitEthernet1/0/1*) This field supports wildcard (***) character-based search. Ex: **1/0/1** or *1/0/1** or **1/0/1* Examples: -'interfaceNames=GigabitEthernet1/0/1' (single interface name) -'interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1' (multiple interface names with & separator) +*interfaceNames=GigabitEthernet1/0/1* (single interface name) +*interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1* (multiple interface names with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_id": &schema.Schema{ - Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') + Description: `networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_ip_address": &schema.Schema{ - Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' + Description: `networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) `, Type: schema.TypeString, Optional: true, }, "network_device_mac_address": &schema.Schema{ - Description: `networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. '64:f6:9d:07:9a:00') -This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' + Description: `networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. *64:f6:9d:07:9a:00*) +This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: -'networkDeviceMacAddress=64:f6:9d:07:9a:00' -'networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77' (multiple networkDevice MAC addresses with & separator) +*networkDeviceMacAddress=64:f6:9d:07:9a:00* +*networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77* (multiple networkDevice MAC addresses with & separator) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -147,8 +147,8 @@ func dataSourceInterfacesCountRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCount") - queryParams1 := catalystcentersdkgo.GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1") + queryParams1 := catalystcentersdkgo.GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -181,24 +181,24 @@ func dataSourceInterfacesCountRead(ctx context.Context, d *schema.ResourceData, queryParams1.InterfaceName = vInterfaceName.(string) } - response1, restyResp1, err := client.Devices.GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCount(&queryParams1) + response1, restyResp1, err := client.Devices.GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCount", err, - "Failure at GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCount, unexpected response", "")) + "Failure when executing 2 GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1", err, + "Failure at GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountItem(response1.Response) + vItem1 := flattenDevicesGetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCount response", + "Failure when setting GetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1 response", err)) return diags } @@ -210,7 +210,7 @@ func dataSourceInterfacesCountRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDevicesGetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountItem(item *catalystcentersdkgo.ResponseDevicesGetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountResponse) []map[string]interface{} { +func flattenDevicesGetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1Item(item *catalystcentersdkgo.ResponseDevicesGetsTheTotalNetworkDeviceInterfaceCountsInTheSpecifiedTimeRangeWhenThereIsNoStartAndEndTimeSpecifiedReturnsTheLatestInterfacesTotalCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_interfaces_members_associations.go b/catalystcenter/data_source_interfaces_members_associations.go index 85010df..b697023 100644 --- a/catalystcenter/data_source_interfaces_members_associations.go +++ b/catalystcenter/data_source_interfaces_members_associations.go @@ -86,8 +86,8 @@ func dataSourceInterfacesMembersAssociationsRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveTagsAssociatedWithTheInterfaces") - queryParams1 := catalystcentersdkgo.RetrieveTagsAssociatedWithTheInterfacesQueryParams{} + log.Printf("[DEBUG] Selected method: RetrieveTagsAssociatedWithTheInterfacesV1") + queryParams1 := catalystcentersdkgo.RetrieveTagsAssociatedWithTheInterfacesV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -96,24 +96,24 @@ func dataSourceInterfacesMembersAssociationsRead(ctx context.Context, d *schema. queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Tag.RetrieveTagsAssociatedWithTheInterfaces(&queryParams1) + response1, restyResp1, err := client.Tag.RetrieveTagsAssociatedWithTheInterfacesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveTagsAssociatedWithTheInterfaces", err, - "Failure at RetrieveTagsAssociatedWithTheInterfaces, unexpected response", "")) + "Failure when executing 2 RetrieveTagsAssociatedWithTheInterfacesV1", err, + "Failure at RetrieveTagsAssociatedWithTheInterfacesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTagRetrieveTagsAssociatedWithTheInterfacesItems(response1.Response) + vItems1 := flattenTagRetrieveTagsAssociatedWithTheInterfacesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveTagsAssociatedWithTheInterfaces response", + "Failure when setting RetrieveTagsAssociatedWithTheInterfacesV1 response", err)) return diags } @@ -124,31 +124,3 @@ func dataSourceInterfacesMembersAssociationsRead(ctx context.Context, d *schema. } return diags } - -func flattenTagRetrieveTagsAssociatedWithTheInterfacesItems(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithTheInterfacesResponse) []map[string]interface{} { - if items == nil { - return nil - } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["id"] = item.ID - respItem["tags"] = flattenTagRetrieveTagsAssociatedWithTheInterfacesItemsTags(item.Tags) - respItems = append(respItems, respItem) - } - return respItems -} - -func flattenTagRetrieveTagsAssociatedWithTheInterfacesItemsTags(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithTheInterfacesResponseTags) []map[string]interface{} { - if items == nil { - return nil - } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["id"] = item.ID - respItem["name"] = item.Name - respItems = append(respItems, respItem) - } - return respItems -} diff --git a/catalystcenter/data_source_interfaces_members_associations_count.go b/catalystcenter/data_source_interfaces_members_associations_count.go index 6486324..88c557e 100644 --- a/catalystcenter/data_source_interfaces_members_associations_count.go +++ b/catalystcenter/data_source_interfaces_members_associations_count.go @@ -79,7 +79,7 @@ func dataSourceInterfacesMembersAssociationsCountRead(ctx context.Context, d *sc return diags } -func flattenTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagItem(item *catalystcentersdkgo.ResponseTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagResponse) []map[string]interface{} { +func flattenTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagItem(item *catalystcentersdkgo.ResponseTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_ipam_server_setting.go b/catalystcenter/data_source_ipam_server_setting.go index 2f89d75..64c7687 100644 --- a/catalystcenter/data_source_ipam_server_setting.go +++ b/catalystcenter/data_source_ipam_server_setting.go @@ -108,7 +108,7 @@ func dataSourceIPamServerSettingRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenSystemSettingsRetrievesConfigurationDetailsOfTheExternalIPAMServerItem(item *catalystcentersdkgo.ResponseSystemSettingsRetrievesConfigurationDetailsOfTheExternalIPAMServerResponse) []map[string]interface{} { +func flattenSystemSettingsRetrievesConfigurationDetailsOfTheExternalIPAMServerItem(item *catalystcentersdkgo.ResponseSystemSettingsRetrievesConfigurationDetailsOfTheExternalIPAMServerV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_ise_integration_status.go b/catalystcenter/data_source_ise_integration_status.go index f845b35..b8f2b2c 100644 --- a/catalystcenter/data_source_ise_integration_status.go +++ b/catalystcenter/data_source_ise_integration_status.go @@ -120,26 +120,26 @@ func dataSourceIseIntegrationStatusRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CiscoIseServerIntegrationStatus") + log.Printf("[DEBUG] Selected method: CiscoIseServerIntegrationStatusV1") - response1, restyResp1, err := client.SystemSettings.CiscoIseServerIntegrationStatus() + response1, restyResp1, err := client.SystemSettings.CiscoIseServerIntegrationStatusV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CiscoIseServerIntegrationStatus", err, - "Failure at CiscoIseServerIntegrationStatus, unexpected response", "")) + "Failure when executing 2 CiscoIseServerIntegrationStatusV1", err, + "Failure at CiscoIseServerIntegrationStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSystemSettingsCiscoIseServerIntegrationStatusItem(response1) + vItem1 := flattenSystemSettingsCiscoIseServerIntegrationStatusV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CiscoIseServerIntegrationStatus response", + "Failure when setting CiscoIseServerIntegrationStatusV1 response", err)) return diags } @@ -151,7 +151,7 @@ func dataSourceIseIntegrationStatusRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenSystemSettingsCiscoIseServerIntegrationStatusItem(item *catalystcentersdkgo.ResponseSystemSettingsCiscoIseServerIntegrationStatus) []map[string]interface{} { +func flattenSystemSettingsCiscoIseServerIntegrationStatusV1Item(item *catalystcentersdkgo.ResponseSystemSettingsCiscoIseServerIntegrationStatusV1) []map[string]interface{} { if item == nil { return nil } @@ -159,13 +159,13 @@ func flattenSystemSettingsCiscoIseServerIntegrationStatusItem(item *catalystcent respItem["aaa_server_setting_id"] = item.AAAServerSettingID respItem["overall_status"] = item.OverallStatus respItem["overall_error_message"] = item.OverallErrorMessage - respItem["steps"] = flattenSystemSettingsCiscoIseServerIntegrationStatusItemSteps(item.Steps) + respItem["steps"] = flattenSystemSettingsCiscoIseServerIntegrationStatusV1ItemSteps(item.Steps) return []map[string]interface{}{ respItem, } } -func flattenSystemSettingsCiscoIseServerIntegrationStatusItemSteps(items *[]catalystcentersdkgo.ResponseSystemSettingsCiscoIseServerIntegrationStatusSteps) []map[string]interface{} { +func flattenSystemSettingsCiscoIseServerIntegrationStatusV1ItemSteps(items *[]catalystcentersdkgo.ResponseSystemSettingsCiscoIseServerIntegrationStatusV1Steps) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_issues.go b/catalystcenter/data_source_issues.go index f316292..85aa638 100644 --- a/catalystcenter/data_source_issues.go +++ b/catalystcenter/data_source_issues.go @@ -181,8 +181,8 @@ func dataSourceIssuesRead(ctx context.Context, d *schema.ResourceData, m interfa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: Issues") - queryParams1 := catalystcentersdkgo.IssuesQueryParams{} + log.Printf("[DEBUG] Selected method: IssuesV1") + queryParams1 := catalystcentersdkgo.IssuesV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -209,24 +209,24 @@ func dataSourceIssuesRead(ctx context.Context, d *schema.ResourceData, m interfa queryParams1.AiDriven = vAiDriven.(string) } - response1, restyResp1, err := client.Issues.Issues(&queryParams1) + response1, restyResp1, err := client.Issues.IssuesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 Issues", err, - "Failure at Issues, unexpected response", "")) + "Failure when executing 2 IssuesV1", err, + "Failure at IssuesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenIssuesIssuesItems(response1.Response) + vItems1 := flattenIssuesIssuesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting Issues response", + "Failure when setting IssuesV1 response", err)) return diags } @@ -238,7 +238,7 @@ func dataSourceIssuesRead(ctx context.Context, d *schema.ResourceData, m interfa return diags } -func flattenIssuesIssuesItems(items *[]catalystcentersdkgo.ResponseIssuesIssuesResponse) []map[string]interface{} { +func flattenIssuesIssuesV1Items(items *[]catalystcentersdkgo.ResponseIssuesIssuesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_issues_enrichment_details.go b/catalystcenter/data_source_issues_enrichment_details.go index 16f1f7d..be5bae5 100644 --- a/catalystcenter/data_source_issues_enrichment_details.go +++ b/catalystcenter/data_source_issues_enrichment_details.go @@ -164,9 +164,9 @@ func dataSourceIssuesEnrichmentDetailsRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetIssueEnrichmentDetails") + log.Printf("[DEBUG] Selected method: GetIssueEnrichmentDetailsV1") - headerParams1 := catalystcentersdkgo.GetIssueEnrichmentDetailsHeaderParams{} + headerParams1 := catalystcentersdkgo.GetIssueEnrichmentDetailsV1HeaderParams{} headerParams1.EntityType = vEntityType.(string) @@ -174,24 +174,24 @@ func dataSourceIssuesEnrichmentDetailsRead(ctx context.Context, d *schema.Resour headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Issues.GetIssueEnrichmentDetails(&headerParams1) + response1, restyResp1, err := client.Issues.GetIssueEnrichmentDetailsV1(&headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetIssueEnrichmentDetails", err, - "Failure at GetIssueEnrichmentDetails, unexpected response", "")) + "Failure when executing 2 GetIssueEnrichmentDetailsV1", err, + "Failure at GetIssueEnrichmentDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenIssuesGetIssueEnrichmentDetailsItem(response1.IssueDetails) + vItem1 := flattenIssuesGetIssueEnrichmentDetailsV1Item(response1.IssueDetails) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetIssueEnrichmentDetails response", + "Failure when setting GetIssueEnrichmentDetailsV1 response", err)) return diags } @@ -203,18 +203,18 @@ func dataSourceIssuesEnrichmentDetailsRead(ctx context.Context, d *schema.Resour return diags } -func flattenIssuesGetIssueEnrichmentDetailsItem(item *catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsIssueDetails) []map[string]interface{} { +func flattenIssuesGetIssueEnrichmentDetailsV1Item(item *catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsV1IssueDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["issue"] = flattenIssuesGetIssueEnrichmentDetailsItemIssue(item.Issue) + respItem["issue"] = flattenIssuesGetIssueEnrichmentDetailsV1ItemIssue(item.Issue) return []map[string]interface{}{ respItem, } } -func flattenIssuesGetIssueEnrichmentDetailsItemIssue(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsIssueDetailsIssue) []map[string]interface{} { +func flattenIssuesGetIssueEnrichmentDetailsV1ItemIssue(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsV1IssueDetailsIssue) []map[string]interface{} { if items == nil { return nil } @@ -232,14 +232,14 @@ func flattenIssuesGetIssueEnrichmentDetailsItemIssue(items *[]catalystcentersdkg respItem["issue_priority"] = item.IssuePriority respItem["issue_summary"] = item.IssueSummary respItem["issue_timestamp"] = item.IssueTimestamp - respItem["suggested_actions"] = flattenIssuesGetIssueEnrichmentDetailsItemIssueSuggestedActions(item.SuggestedActions) - respItem["impacted_hosts"] = flattenIssuesGetIssueEnrichmentDetailsItemIssueImpactedHosts(item.ImpactedHosts) + respItem["suggested_actions"] = flattenIssuesGetIssueEnrichmentDetailsV1ItemIssueSuggestedActions(item.SuggestedActions) + respItem["impacted_hosts"] = flattenIssuesGetIssueEnrichmentDetailsV1ItemIssueImpactedHosts(item.ImpactedHosts) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetIssueEnrichmentDetailsItemIssueSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsIssueDetailsIssueSuggestedActions) []map[string]interface{} { +func flattenIssuesGetIssueEnrichmentDetailsV1ItemIssueSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsV1IssueDetailsIssueSuggestedActions) []map[string]interface{} { if items == nil { return nil } @@ -247,13 +247,13 @@ func flattenIssuesGetIssueEnrichmentDetailsItemIssueSuggestedActions(items *[]ca for _, item := range *items { respItem := make(map[string]interface{}) respItem["message"] = item.Message - respItem["steps"] = flattenIssuesGetIssueEnrichmentDetailsItemIssueSuggestedActionsSteps(item.Steps) + respItem["steps"] = flattenIssuesGetIssueEnrichmentDetailsV1ItemIssueSuggestedActionsSteps(item.Steps) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetIssueEnrichmentDetailsItemIssueSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsIssueDetailsIssueSuggestedActionsSteps) []interface{} { +func flattenIssuesGetIssueEnrichmentDetailsV1ItemIssueSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsV1IssueDetailsIssueSuggestedActionsSteps) []interface{} { if items == nil { return nil } @@ -265,7 +265,7 @@ func flattenIssuesGetIssueEnrichmentDetailsItemIssueSuggestedActionsSteps(items return respItems } -func flattenIssuesGetIssueEnrichmentDetailsItemIssueImpactedHosts(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsIssueDetailsIssueImpactedHosts) []interface{} { +func flattenIssuesGetIssueEnrichmentDetailsV1ItemIssueImpactedHosts(items *[]catalystcentersdkgo.ResponseIssuesGetIssueEnrichmentDetailsV1IssueDetailsIssueImpactedHosts) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_itsm_cmdb_sync_status.go b/catalystcenter/data_source_itsm_cmdb_sync_status.go index 49a75f3..489e272 100644 --- a/catalystcenter/data_source_itsm_cmdb_sync_status.go +++ b/catalystcenter/data_source_itsm_cmdb_sync_status.go @@ -115,8 +115,8 @@ func dataSourceItsmCmdbSyncStatusRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetCmdbSyncStatus") - queryParams1 := catalystcentersdkgo.GetCmdbSyncStatusQueryParams{} + log.Printf("[DEBUG] Selected method: GetCmdbSyncStatusV1") + queryParams1 := catalystcentersdkgo.GetCmdbSyncStatusV1QueryParams{} if okStatus { queryParams1.Status = vStatus.(string) @@ -125,24 +125,24 @@ func dataSourceItsmCmdbSyncStatusRead(ctx context.Context, d *schema.ResourceDat queryParams1.Date = vDate.(string) } - response1, restyResp1, err := client.Itsm.GetCmdbSyncStatus(&queryParams1) + response1, restyResp1, err := client.Itsm.GetCmdbSyncStatusV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetCmdbSyncStatus", err, - "Failure at GetCmdbSyncStatus, unexpected response", "")) + "Failure when executing 2 GetCmdbSyncStatusV1", err, + "Failure at GetCmdbSyncStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenItsmGetCmdbSyncStatusItems(response1) + vItems1 := flattenItsmGetCmdbSyncStatusV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetCmdbSyncStatus response", + "Failure when setting GetCmdbSyncStatusV1 response", err)) return diags } @@ -154,7 +154,7 @@ func dataSourceItsmCmdbSyncStatusRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenItsmGetCmdbSyncStatusItems(items *catalystcentersdkgo.ResponseItsmGetCmdbSyncStatus) []map[string]interface{} { +func flattenItsmGetCmdbSyncStatusV1Items(items *catalystcentersdkgo.ResponseItsmGetCmdbSyncStatusV1) []map[string]interface{} { if items == nil { return nil } @@ -163,7 +163,7 @@ func flattenItsmGetCmdbSyncStatusItems(items *catalystcentersdkgo.ResponseItsmGe respItem := make(map[string]interface{}) respItem["success_count"] = item.SuccessCount respItem["failure_count"] = item.FailureCount - respItem["devices"] = flattenItsmGetCmdbSyncStatusItemsDevices(item.Devices) + respItem["devices"] = flattenItsmGetCmdbSyncStatusV1ItemsDevices(item.Devices) respItem["unknown_error_count"] = item.UnknownErrorCount respItem["message"] = item.Message respItem["sync_time"] = item.SyncTime @@ -172,7 +172,7 @@ func flattenItsmGetCmdbSyncStatusItems(items *catalystcentersdkgo.ResponseItsmGe return respItems } -func flattenItsmGetCmdbSyncStatusItemsDevices(items *[]catalystcentersdkgo.ResponseItemItsmGetCmdbSyncStatusDevices) []map[string]interface{} { +func flattenItsmGetCmdbSyncStatusV1ItemsDevices(items *[]catalystcentersdkgo.ResponseItemItsmGetCmdbSyncStatusV1Devices) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_itsm_integration_events_failed.go b/catalystcenter/data_source_itsm_integration_events_failed.go index 227a8bf..aa91c89 100644 --- a/catalystcenter/data_source_itsm_integration_events_failed.go +++ b/catalystcenter/data_source_itsm_integration_events_failed.go @@ -146,31 +146,31 @@ func dataSourceItsmIntegrationEventsFailedRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFailedItsmEvents") - queryParams1 := catalystcentersdkgo.GetFailedItsmEventsQueryParams{} + log.Printf("[DEBUG] Selected method: GetFailedItsmEventsV1") + queryParams1 := catalystcentersdkgo.GetFailedItsmEventsV1QueryParams{} if okInstanceID { queryParams1.InstanceID = vInstanceID.(string) } - response1, restyResp1, err := client.Itsm.GetFailedItsmEvents(&queryParams1) + response1, restyResp1, err := client.Itsm.GetFailedItsmEventsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFailedItsmEvents", err, - "Failure at GetFailedItsmEvents, unexpected response", "")) + "Failure when executing 2 GetFailedItsmEventsV1", err, + "Failure at GetFailedItsmEventsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenItsmGetFailedItsmEventsItems(response1) + vItems1 := flattenItsmGetFailedItsmEventsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFailedItsmEvents response", + "Failure when setting GetFailedItsmEventsV1 response", err)) return diags } @@ -182,7 +182,7 @@ func dataSourceItsmIntegrationEventsFailedRead(ctx context.Context, d *schema.Re return diags } -func flattenItsmGetFailedItsmEventsItems(items *catalystcentersdkgo.ResponseItsmGetFailedItsmEvents) []map[string]interface{} { +func flattenItsmGetFailedItsmEventsV1Items(items *catalystcentersdkgo.ResponseItsmGetFailedItsmEventsV1) []map[string]interface{} { if items == nil { return nil } @@ -199,14 +199,14 @@ func flattenItsmGetFailedItsmEventsItems(items *catalystcentersdkgo.ResponseItsm respItem["severity"] = item.Severity respItem["source"] = item.Source respItem["timestamp"] = item.Timestamp - respItem["enrichment_info"] = flattenItsmGetFailedItsmEventsItemsEnrichmentInfo(item.EnrichmentInfo) + respItem["enrichment_info"] = flattenItsmGetFailedItsmEventsV1ItemsEnrichmentInfo(item.EnrichmentInfo) respItem["description"] = item.Description respItems = append(respItems, respItem) } return respItems } -func flattenItsmGetFailedItsmEventsItemsEnrichmentInfo(item *catalystcentersdkgo.ResponseItemItsmGetFailedItsmEventsEnrichmentInfo) []map[string]interface{} { +func flattenItsmGetFailedItsmEventsV1ItemsEnrichmentInfo(item *catalystcentersdkgo.ResponseItemItsmGetFailedItsmEventsV1EnrichmentInfo) []map[string]interface{} { if item == nil { return nil } @@ -214,7 +214,7 @@ func flattenItsmGetFailedItsmEventsItemsEnrichmentInfo(item *catalystcentersdkgo respItem["event_status"] = item.EventStatus respItem["error_code"] = item.ErrorCode respItem["error_description"] = item.ErrorDescription - respItem["response_received_from_itsmsystem"] = flattenItsmGetFailedItsmEventsItemsEnrichmentInfoResponseReceivedFromITSmsystem(item.ResponseReceivedFromITSmsystem) + respItem["response_received_from_itsmsystem"] = flattenItsmGetFailedItsmEventsV1ItemsEnrichmentInfoResponseReceivedFromITSmsystem(item.ResponseReceivedFromITSmsystem) return []map[string]interface{}{ respItem, @@ -222,7 +222,7 @@ func flattenItsmGetFailedItsmEventsItemsEnrichmentInfo(item *catalystcentersdkgo } -func flattenItsmGetFailedItsmEventsItemsEnrichmentInfoResponseReceivedFromITSmsystem(item *catalystcentersdkgo.ResponseItemItsmGetFailedItsmEventsEnrichmentInfoResponseReceivedFromITSmsystem) interface{} { +func flattenItsmGetFailedItsmEventsV1ItemsEnrichmentInfoResponseReceivedFromITSmsystem(item *catalystcentersdkgo.ResponseItemItsmGetFailedItsmEventsV1EnrichmentInfoResponseReceivedFromITSmsystem) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_lan_automation_count.go b/catalystcenter/data_source_lan_automation_count.go index 72b81a3..a5fa1fd 100644 --- a/catalystcenter/data_source_lan_automation_count.go +++ b/catalystcenter/data_source_lan_automation_count.go @@ -47,26 +47,26 @@ func dataSourceLanAutomationCountRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LanAutomationSessionCount") + log.Printf("[DEBUG] Selected method: LanAutomationSessionCountV1") - response1, restyResp1, err := client.LanAutomation.LanAutomationSessionCount() + response1, restyResp1, err := client.LanAutomation.LanAutomationSessionCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationSessionCount", err, - "Failure at LanAutomationSessionCount, unexpected response", "")) + "Failure when executing 2 LanAutomationSessionCountV1", err, + "Failure at LanAutomationSessionCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLanAutomationLanAutomationSessionCountItem(response1.Response) + vItem1 := flattenLanAutomationLanAutomationSessionCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationSessionCount response", + "Failure when setting LanAutomationSessionCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceLanAutomationCountRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenLanAutomationLanAutomationSessionCountItem(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationSessionCountResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationSessionCountV1Item(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationSessionCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_lan_automation_log.go b/catalystcenter/data_source_lan_automation_log.go index 6079ad2..476bfcc 100644 --- a/catalystcenter/data_source_lan_automation_log.go +++ b/catalystcenter/data_source_lan_automation_log.go @@ -165,8 +165,8 @@ func dataSourceLanAutomationLogRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LanAutomationLog") - queryParams1 := catalystcentersdkgo.LanAutomationLogQueryParams{} + log.Printf("[DEBUG] Selected method: LanAutomationLogV1") + queryParams1 := catalystcentersdkgo.LanAutomationLogV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -175,24 +175,24 @@ func dataSourceLanAutomationLogRead(ctx context.Context, d *schema.ResourceData, queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.LanAutomation.LanAutomationLog(&queryParams1) + response1, restyResp1, err := client.LanAutomation.LanAutomationLogV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationLog", err, - "Failure at LanAutomationLog, unexpected response", "")) + "Failure when executing 2 LanAutomationLogV1", err, + "Failure at LanAutomationLogV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenLanAutomationLanAutomationLogItems(response1.Response) + vItems1 := flattenLanAutomationLanAutomationLogV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationLog response", + "Failure when setting LanAutomationLogV1 response", err)) return diags } @@ -202,27 +202,27 @@ func dataSourceLanAutomationLogRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: LanAutomationLogByID") + log.Printf("[DEBUG] Selected method: LanAutomationLogByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.LanAutomation.LanAutomationLogByID(vvID) + response2, restyResp2, err := client.LanAutomation.LanAutomationLogByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationLogByID", err, - "Failure at LanAutomationLogByID, unexpected response", "")) + "Failure when executing 2 LanAutomationLogByIDV1", err, + "Failure at LanAutomationLogByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenLanAutomationLanAutomationLogByIDItem(response2.Response) + vItem2 := flattenLanAutomationLanAutomationLogByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationLogByID response", + "Failure when setting LanAutomationLogByIDV1 response", err)) return diags } @@ -234,7 +234,7 @@ func dataSourceLanAutomationLogRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenLanAutomationLanAutomationLogItems(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationLogV1Items(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogV1Response) []map[string]interface{} { if items == nil { return nil } @@ -242,13 +242,13 @@ func flattenLanAutomationLanAutomationLogItems(items *[]catalystcentersdkgo.Resp for _, item := range *items { respItem := make(map[string]interface{}) respItem["nw_orch_id"] = item.NwOrchID - respItem["entry"] = flattenLanAutomationLanAutomationLogItemsEntry(item.Entry) + respItem["entry"] = flattenLanAutomationLanAutomationLogV1ItemsEntry(item.Entry) respItems = append(respItems, respItem) } return respItems } -func flattenLanAutomationLanAutomationLogItemsEntry(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogResponseEntry) []map[string]interface{} { +func flattenLanAutomationLanAutomationLogV1ItemsEntry(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogV1ResponseEntry) []map[string]interface{} { if items == nil { return nil } @@ -264,7 +264,7 @@ func flattenLanAutomationLanAutomationLogItemsEntry(items *[]catalystcentersdkgo return respItems } -func flattenLanAutomationLanAutomationLogByIDItem(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogByIDResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationLogByIDV1Item(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogByIDV1Response) []map[string]interface{} { if items == nil { return nil } @@ -272,13 +272,13 @@ func flattenLanAutomationLanAutomationLogByIDItem(items *[]catalystcentersdkgo.R for _, item := range *items { respItem := make(map[string]interface{}) respItem["nw_orch_id"] = item.NwOrchID - respItem["entry"] = flattenLanAutomationLanAutomationLogByIDItemEntry(item.Entry) + respItem["entry"] = flattenLanAutomationLanAutomationLogByIDV1ItemEntry(item.Entry) respItems = append(respItems, respItem) } return respItems } -func flattenLanAutomationLanAutomationLogByIDItemEntry(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogByIDResponseEntry) []map[string]interface{} { +func flattenLanAutomationLanAutomationLogByIDV1ItemEntry(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogByIDV1ResponseEntry) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_lan_automation_log_by_serial_number.go b/catalystcenter/data_source_lan_automation_log_by_serial_number.go index a2ccdf1..1d75e9e 100644 --- a/catalystcenter/data_source_lan_automation_log_by_serial_number.go +++ b/catalystcenter/data_source_lan_automation_log_by_serial_number.go @@ -106,33 +106,33 @@ func dataSourceLanAutomationLogBySerialNumberRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LanAutomationLogsForIndividualDevices") + log.Printf("[DEBUG] Selected method: LanAutomationLogsForIndividualDevicesV1") vvID := vID.(string) vvSerialNumber := vSerialNumber.(string) - queryParams1 := catalystcentersdkgo.LanAutomationLogsForIndividualDevicesQueryParams{} + queryParams1 := catalystcentersdkgo.LanAutomationLogsForIndividualDevicesV1QueryParams{} if okLogLevel { queryParams1.LogLevel = vLogLevel.(string) } - response1, restyResp1, err := client.LanAutomation.LanAutomationLogsForIndividualDevices(vvID, vvSerialNumber, &queryParams1) + response1, restyResp1, err := client.LanAutomation.LanAutomationLogsForIndividualDevicesV1(vvID, vvSerialNumber, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationLogsForIndividualDevices", err, - "Failure at LanAutomationLogsForIndividualDevices, unexpected response", "")) + "Failure when executing 2 LanAutomationLogsForIndividualDevicesV1", err, + "Failure at LanAutomationLogsForIndividualDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenLanAutomationLanAutomationLogsForIndividualDevicesItems(response1.Response) + vItems1 := flattenLanAutomationLanAutomationLogsForIndividualDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationLogsForIndividualDevices response", + "Failure when setting LanAutomationLogsForIndividualDevicesV1 response", err)) return diags } @@ -144,7 +144,7 @@ func dataSourceLanAutomationLogBySerialNumberRead(ctx context.Context, d *schema return diags } -func flattenLanAutomationLanAutomationLogsForIndividualDevicesItems(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogsForIndividualDevicesResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationLogsForIndividualDevicesV1Items(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogsForIndividualDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -152,14 +152,14 @@ func flattenLanAutomationLanAutomationLogsForIndividualDevicesItems(items *[]cat for _, item := range *items { respItem := make(map[string]interface{}) respItem["nw_orch_id"] = item.NwOrchID - respItem["logs"] = flattenLanAutomationLanAutomationLogsForIndividualDevicesItemsLogs(item.Logs) + respItem["logs"] = flattenLanAutomationLanAutomationLogsForIndividualDevicesV1ItemsLogs(item.Logs) respItem["serial_number"] = item.SerialNumber respItems = append(respItems, respItem) } return respItems } -func flattenLanAutomationLanAutomationLogsForIndividualDevicesItemsLogs(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogsForIndividualDevicesResponseLogs) []map[string]interface{} { +func flattenLanAutomationLanAutomationLogsForIndividualDevicesV1ItemsLogs(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationLogsForIndividualDevicesV1ResponseLogs) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_lan_automation_sessions.go b/catalystcenter/data_source_lan_automation_sessions.go index 01ae7fa..48f30f4 100644 --- a/catalystcenter/data_source_lan_automation_sessions.go +++ b/catalystcenter/data_source_lan_automation_sessions.go @@ -64,26 +64,26 @@ func dataSourceLanAutomationSessionsRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LanAutomationActiveSessions") + log.Printf("[DEBUG] Selected method: LanAutomationActiveSessionsV1") - response1, restyResp1, err := client.LanAutomation.LanAutomationActiveSessions() + response1, restyResp1, err := client.LanAutomation.LanAutomationActiveSessionsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationActiveSessions", err, - "Failure at LanAutomationActiveSessions, unexpected response", "")) + "Failure when executing 2 LanAutomationActiveSessionsV1", err, + "Failure at LanAutomationActiveSessionsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLanAutomationLanAutomationActiveSessionsItem(response1.Response) + vItem1 := flattenLanAutomationLanAutomationActiveSessionsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationActiveSessions response", + "Failure when setting LanAutomationActiveSessionsV1 response", err)) return diags } @@ -95,7 +95,7 @@ func dataSourceLanAutomationSessionsRead(ctx context.Context, d *schema.Resource return diags } -func flattenLanAutomationLanAutomationActiveSessionsItem(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationActiveSessionsResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationActiveSessionsV1Item(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationActiveSessionsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_lan_automation_status.go b/catalystcenter/data_source_lan_automation_status.go index d78b202..55f579a 100644 --- a/catalystcenter/data_source_lan_automation_status.go +++ b/catalystcenter/data_source_lan_automation_status.go @@ -401,8 +401,8 @@ func dataSourceLanAutomationStatusRead(ctx context.Context, d *schema.ResourceDa selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LanAutomationStatus") - queryParams1 := catalystcentersdkgo.LanAutomationStatusQueryParams{} + log.Printf("[DEBUG] Selected method: LanAutomationStatusV1") + queryParams1 := catalystcentersdkgo.LanAutomationStatusV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -411,24 +411,24 @@ func dataSourceLanAutomationStatusRead(ctx context.Context, d *schema.ResourceDa queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.LanAutomation.LanAutomationStatus(&queryParams1) + response1, restyResp1, err := client.LanAutomation.LanAutomationStatusV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationStatus", err, - "Failure at LanAutomationStatus, unexpected response", "")) + "Failure when executing 2 LanAutomationStatusV1", err, + "Failure at LanAutomationStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenLanAutomationLanAutomationStatusItems(response1.Response) + vItems1 := flattenLanAutomationLanAutomationStatusV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationStatus response", + "Failure when setting LanAutomationStatusV1 response", err)) return diags } @@ -438,27 +438,27 @@ func dataSourceLanAutomationStatusRead(ctx context.Context, d *schema.ResourceDa } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: LanAutomationStatusByID") + log.Printf("[DEBUG] Selected method: LanAutomationStatusByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.LanAutomation.LanAutomationStatusByID(vvID) + response2, restyResp2, err := client.LanAutomation.LanAutomationStatusByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LanAutomationStatusByID", err, - "Failure at LanAutomationStatusByID, unexpected response", "")) + "Failure when executing 2 LanAutomationStatusByIDV1", err, + "Failure at LanAutomationStatusByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenLanAutomationLanAutomationStatusByIDItem(response2.Response) + vItem2 := flattenLanAutomationLanAutomationStatusByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationStatusByID response", + "Failure when setting LanAutomationStatusByIDV1 response", err)) return diags } @@ -470,7 +470,7 @@ func dataSourceLanAutomationStatusRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenLanAutomationLanAutomationStatusItems(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationStatusV1Items(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusV1Response) []map[string]interface{} { if items == nil { return nil } @@ -480,24 +480,24 @@ func flattenLanAutomationLanAutomationStatusItems(items *[]catalystcentersdkgo.R respItem["id"] = item.ID respItem["discovered_device_site_name_hierarchy"] = item.DiscoveredDeviceSiteNameHierarchy respItem["primary_device_managment_ipaddress"] = item.PrimaryDeviceManagmentIPAddress - respItem["ip_pools"] = flattenLanAutomationLanAutomationStatusItemsIPPools(item.IPPools) + respItem["ip_pools"] = flattenLanAutomationLanAutomationStatusV1ItemsIPPools(item.IPPools) respItem["primary_device_interface_names"] = item.PrimaryDeviceInterfaceNames respItem["status"] = item.Status respItem["action"] = item.Action respItem["creation_time"] = item.CreationTime respItem["multicast_enabled"] = boolPtrToString(item.MulticastEnabled) respItem["peer_device_managment_ipaddress"] = item.PeerDeviceManagmentIPAddress - respItem["discovered_device_list"] = flattenLanAutomationLanAutomationStatusItemsDiscoveredDeviceList(item.DiscoveredDeviceList) + respItem["discovered_device_list"] = flattenLanAutomationLanAutomationStatusV1ItemsDiscoveredDeviceList(item.DiscoveredDeviceList) respItem["redistribute_isis_to_bgp"] = boolPtrToString(item.RedistributeIsisToBgp) respItem["discovery_level"] = item.DiscoveryLevel respItem["discovery_timeout"] = item.DiscoveryTimeout - respItem["discovery_devices"] = flattenLanAutomationLanAutomationStatusItemsDiscoveryDevices(item.DiscoveryDevices) + respItem["discovery_devices"] = flattenLanAutomationLanAutomationStatusV1ItemsDiscoveryDevices(item.DiscoveryDevices) respItems = append(respItems, respItem) } return respItems } -func flattenLanAutomationLanAutomationStatusItemsIPPools(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusResponseIPPools) []map[string]interface{} { +func flattenLanAutomationLanAutomationStatusV1ItemsIPPools(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusV1ResponseIPPools) []map[string]interface{} { if items == nil { return nil } @@ -511,7 +511,7 @@ func flattenLanAutomationLanAutomationStatusItemsIPPools(items *[]catalystcenter return respItems } -func flattenLanAutomationLanAutomationStatusItemsDiscoveredDeviceList(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusResponseDiscoveredDeviceList) []map[string]interface{} { +func flattenLanAutomationLanAutomationStatusV1ItemsDiscoveredDeviceList(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusV1ResponseDiscoveredDeviceList) []map[string]interface{} { if items == nil { return nil } @@ -527,7 +527,7 @@ func flattenLanAutomationLanAutomationStatusItemsDiscoveredDeviceList(items *[]c return respItems } -func flattenLanAutomationLanAutomationStatusItemsDiscoveryDevices(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusResponseDiscoveryDevices) []interface{} { +func flattenLanAutomationLanAutomationStatusV1ItemsDiscoveryDevices(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusV1ResponseDiscoveryDevices) []interface{} { if items == nil { return nil } @@ -539,7 +539,7 @@ func flattenLanAutomationLanAutomationStatusItemsDiscoveryDevices(items *[]catal return respItems } -func flattenLanAutomationLanAutomationStatusByIDItem(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationStatusByIDV1Item(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDV1Response) []map[string]interface{} { if items == nil { return nil } @@ -549,24 +549,24 @@ func flattenLanAutomationLanAutomationStatusByIDItem(items *[]catalystcentersdkg respItem["id"] = item.ID respItem["discovered_device_site_name_hierarchy"] = item.DiscoveredDeviceSiteNameHierarchy respItem["primary_device_managment_ipaddress"] = item.PrimaryDeviceManagmentIPAddress - respItem["ip_pools"] = flattenLanAutomationLanAutomationStatusByIDItemIPPools(item.IPPools) + respItem["ip_pools"] = flattenLanAutomationLanAutomationStatusByIDV1ItemIPPools(item.IPPools) respItem["primary_device_interface_names"] = item.PrimaryDeviceInterfaceNames respItem["status"] = item.Status respItem["action"] = item.Action respItem["creation_time"] = item.CreationTime respItem["multicast_enabled"] = boolPtrToString(item.MulticastEnabled) respItem["peer_device_managment_ipaddress"] = item.PeerDeviceManagmentIPAddress - respItem["discovered_device_list"] = flattenLanAutomationLanAutomationStatusByIDItemDiscoveredDeviceList(item.DiscoveredDeviceList) + respItem["discovered_device_list"] = flattenLanAutomationLanAutomationStatusByIDV1ItemDiscoveredDeviceList(item.DiscoveredDeviceList) respItem["redistribute_isis_to_bgp"] = boolPtrToString(item.RedistributeIsisToBgp) respItem["discovery_level"] = item.DiscoveryLevel respItem["discovery_timeout"] = item.DiscoveryTimeout - respItem["discovery_devices"] = flattenLanAutomationLanAutomationStatusByIDItemDiscoveryDevices(item.DiscoveryDevices) + respItem["discovery_devices"] = flattenLanAutomationLanAutomationStatusByIDV1ItemDiscoveryDevices(item.DiscoveryDevices) respItems = append(respItems, respItem) } return respItems } -func flattenLanAutomationLanAutomationStatusByIDItemIPPools(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDResponseIPPools) []map[string]interface{} { +func flattenLanAutomationLanAutomationStatusByIDV1ItemIPPools(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDV1ResponseIPPools) []map[string]interface{} { if items == nil { return nil } @@ -580,7 +580,7 @@ func flattenLanAutomationLanAutomationStatusByIDItemIPPools(items *[]catalystcen return respItems } -func flattenLanAutomationLanAutomationStatusByIDItemDiscoveredDeviceList(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDResponseDiscoveredDeviceList) []map[string]interface{} { +func flattenLanAutomationLanAutomationStatusByIDV1ItemDiscoveredDeviceList(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDV1ResponseDiscoveredDeviceList) []map[string]interface{} { if items == nil { return nil } @@ -596,7 +596,7 @@ func flattenLanAutomationLanAutomationStatusByIDItemDiscoveredDeviceList(items * return respItems } -func flattenLanAutomationLanAutomationStatusByIDItemDiscoveryDevices(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDResponseDiscoveryDevices) []interface{} { +func flattenLanAutomationLanAutomationStatusByIDV1ItemDiscoveryDevices(items *[]catalystcentersdkgo.ResponseLanAutomationLanAutomationStatusByIDV1ResponseDiscoveryDevices) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_license_device.go b/catalystcenter/data_source_license_device.go index edec217..5c0bafd 100644 --- a/catalystcenter/data_source_license_device.go +++ b/catalystcenter/data_source_license_device.go @@ -69,26 +69,26 @@ func dataSourceLicenseDeviceRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SmartAccountDetails") + log.Printf("[DEBUG] Selected method: SmartAccountDetailsV1") - response1, restyResp1, err := client.Licenses.SmartAccountDetails() + response1, restyResp1, err := client.Licenses.SmartAccountDetailsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SmartAccountDetails", err, - "Failure at SmartAccountDetails, unexpected response", "")) + "Failure when executing 2 SmartAccountDetailsV1", err, + "Failure at SmartAccountDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenLicensesSmartAccountDetailsItems(response1.Response) + vItems1 := flattenLicensesSmartAccountDetailsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting SmartAccountDetails response", + "Failure when setting SmartAccountDetailsV1 response", err)) return diags } @@ -99,3 +99,19 @@ func dataSourceLicenseDeviceRead(ctx context.Context, d *schema.ResourceData, m } return diags } + +func flattenLicensesSmartAccountDetailsV1Items(items *[]catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["name"] = item.Name + respItem["id"] = item.ID + respItem["domain"] = item.Domain + respItem["is_active_smart_account"] = boolPtrToString(item.IsActiveSmartAccount) + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_license_device_count.go b/catalystcenter/data_source_license_device_count.go index 88854d8..058deb8 100644 --- a/catalystcenter/data_source_license_device_count.go +++ b/catalystcenter/data_source_license_device_count.go @@ -89,8 +89,8 @@ func dataSourceLicenseDeviceCountRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: DeviceCountDetails") - queryParams1 := catalystcentersdkgo.DeviceCountDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: DeviceCountDetailsV1") + queryParams1 := catalystcentersdkgo.DeviceCountDetailsV1QueryParams{} if okDeviceType { queryParams1.DeviceType = vDeviceType.(string) @@ -108,24 +108,24 @@ func dataSourceLicenseDeviceCountRead(ctx context.Context, d *schema.ResourceDat queryParams1.SmartAccountID = vSmartAccountID.(string) } - response1, restyResp1, err := client.Licenses.DeviceCountDetails(&queryParams1) + response1, restyResp1, err := client.Licenses.DeviceCountDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 DeviceCountDetails", err, - "Failure at DeviceCountDetails, unexpected response", "")) + "Failure when executing 2 DeviceCountDetailsV1", err, + "Failure at DeviceCountDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLicensesDeviceCountDetailsItem(response1) + vItem1 := flattenLicensesDeviceCountDetailsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeviceCountDetails response", + "Failure when setting DeviceCountDetailsV1 response", err)) return diags } @@ -137,7 +137,7 @@ func dataSourceLicenseDeviceCountRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenLicensesDeviceCountDetailsItem(item *catalystcentersdkgo.ResponseLicensesDeviceCountDetails) []map[string]interface{} { +func flattenLicensesDeviceCountDetailsV1Item(item *catalystcentersdkgo.ResponseLicensesDeviceCountDetailsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_license_device_license_details.go b/catalystcenter/data_source_license_device_license_details.go index 91a1555..f183d30 100644 --- a/catalystcenter/data_source_license_device_license_details.go +++ b/catalystcenter/data_source_license_device_license_details.go @@ -336,27 +336,27 @@ func dataSourceLicenseDeviceLicenseDetailsRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: DeviceLicenseDetails") + log.Printf("[DEBUG] Selected method: DeviceLicenseDetailsV1") vvDeviceUUID := vDeviceUUID.(string) - response1, restyResp1, err := client.Licenses.DeviceLicenseDetails(vvDeviceUUID) + response1, restyResp1, err := client.Licenses.DeviceLicenseDetailsV1(vvDeviceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 DeviceLicenseDetails", err, - "Failure at DeviceLicenseDetails, unexpected response", "")) + "Failure when executing 2 DeviceLicenseDetailsV1", err, + "Failure at DeviceLicenseDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLicensesDeviceLicenseDetailsItem(response1) + vItem1 := flattenLicensesDeviceLicenseDetailsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeviceLicenseDetails response", + "Failure when setting DeviceLicenseDetailsV1 response", err)) return diags } @@ -368,7 +368,7 @@ func dataSourceLicenseDeviceLicenseDetailsRead(ctx context.Context, d *schema.Re return diags } -func flattenLicensesDeviceLicenseDetailsItem(item *catalystcentersdkgo.ResponseLicensesDeviceLicenseDetails) []map[string]interface{} { +func flattenLicensesDeviceLicenseDetailsV1Item(item *catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsV1) []map[string]interface{} { if item == nil { return nil } @@ -391,16 +391,16 @@ func flattenLicensesDeviceLicenseDetailsItem(item *catalystcentersdkgo.ResponseL respItem["feature_license"] = item.FeatureLicense respItem["has_sup_cards"] = boolPtrToString(item.HasSupCards) respItem["udi"] = item.Udi - respItem["stacked_devices"] = flattenLicensesDeviceLicenseDetailsItemStackedDevices(item.StackedDevices) + respItem["stacked_devices"] = flattenLicensesDeviceLicenseDetailsV1ItemStackedDevices(item.StackedDevices) respItem["is_stacked_device"] = boolPtrToString(item.IsStackedDevice) - respItem["access_points"] = flattenLicensesDeviceLicenseDetailsItemAccessPoints(item.AccessPoints) - respItem["chassis_details"] = flattenLicensesDeviceLicenseDetailsItemChassisDetails(item.ChassisDetails) + respItem["access_points"] = flattenLicensesDeviceLicenseDetailsV1ItemAccessPoints(item.AccessPoints) + respItem["chassis_details"] = flattenLicensesDeviceLicenseDetailsV1ItemChassisDetails(item.ChassisDetails) return []map[string]interface{}{ respItem, } } -func flattenLicensesDeviceLicenseDetailsItemStackedDevices(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsStackedDevices) []map[string]interface{} { +func flattenLicensesDeviceLicenseDetailsV1ItemStackedDevices(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsV1StackedDevices) []map[string]interface{} { if items == nil { return nil } @@ -416,7 +416,7 @@ func flattenLicensesDeviceLicenseDetailsItemStackedDevices(items *[]catalystcent return respItems } -func flattenLicensesDeviceLicenseDetailsItemAccessPoints(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsAccessPoints) []map[string]interface{} { +func flattenLicensesDeviceLicenseDetailsV1ItemAccessPoints(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsV1AccessPoints) []map[string]interface{} { if items == nil { return nil } @@ -430,14 +430,14 @@ func flattenLicensesDeviceLicenseDetailsItemAccessPoints(items *[]catalystcenter return respItems } -func flattenLicensesDeviceLicenseDetailsItemChassisDetails(item *catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsChassisDetails) []map[string]interface{} { +func flattenLicensesDeviceLicenseDetailsV1ItemChassisDetails(item *catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsV1ChassisDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["board_serial_number"] = item.BoardSerialNumber - respItem["modules"] = flattenLicensesDeviceLicenseDetailsItemChassisDetailsModules(item.Modules) - respItem["supervisor_cards"] = flattenLicensesDeviceLicenseDetailsItemChassisDetailsSupervisorCards(item.SupervisorCards) + respItem["modules"] = flattenLicensesDeviceLicenseDetailsV1ItemChassisDetailsModules(item.Modules) + respItem["supervisor_cards"] = flattenLicensesDeviceLicenseDetailsV1ItemChassisDetailsSupervisorCards(item.SupervisorCards) respItem["port"] = item.Port return []map[string]interface{}{ @@ -446,7 +446,7 @@ func flattenLicensesDeviceLicenseDetailsItemChassisDetails(item *catalystcenters } -func flattenLicensesDeviceLicenseDetailsItemChassisDetailsModules(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsChassisDetailsModules) []map[string]interface{} { +func flattenLicensesDeviceLicenseDetailsV1ItemChassisDetailsModules(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsV1ChassisDetailsModules) []map[string]interface{} { if items == nil { return nil } @@ -462,7 +462,7 @@ func flattenLicensesDeviceLicenseDetailsItemChassisDetailsModules(items *[]catal return respItems } -func flattenLicensesDeviceLicenseDetailsItemChassisDetailsSupervisorCards(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsChassisDetailsSupervisorCards) []map[string]interface{} { +func flattenLicensesDeviceLicenseDetailsV1ItemChassisDetailsSupervisorCards(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseDetailsV1ChassisDetailsSupervisorCards) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_license_device_license_summary.go b/catalystcenter/data_source_license_device_license_summary.go index a860390..3eb5abf 100644 --- a/catalystcenter/data_source_license_device_license_summary.go +++ b/catalystcenter/data_source_license_device_license_summary.go @@ -358,8 +358,8 @@ func dataSourceLicenseDeviceLicenseSummaryRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: DeviceLicenseSummary") - queryParams1 := catalystcentersdkgo.DeviceLicenseSummaryQueryParams{} + log.Printf("[DEBUG] Selected method: DeviceLicenseSummaryV1") + queryParams1 := catalystcentersdkgo.DeviceLicenseSummaryV1QueryParams{} queryParams1.PageNumber = vPageNumber.(float64) @@ -389,24 +389,24 @@ func dataSourceLicenseDeviceLicenseSummaryRead(ctx context.Context, d *schema.Re queryParams1.DeviceUUID = vDeviceUUID.(string) } - response1, restyResp1, err := client.Licenses.DeviceLicenseSummary(&queryParams1) + response1, restyResp1, err := client.Licenses.DeviceLicenseSummaryV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 DeviceLicenseSummary", err, - "Failure at DeviceLicenseSummary, unexpected response", "")) + "Failure when executing 2 DeviceLicenseSummaryV1", err, + "Failure at DeviceLicenseSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenLicensesDeviceLicenseSummaryItems(response1.Response) + vItems1 := flattenLicensesDeviceLicenseSummaryV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting DeviceLicenseSummary response", + "Failure when setting DeviceLicenseSummaryV1 response", err)) return diags } @@ -418,7 +418,7 @@ func dataSourceLicenseDeviceLicenseSummaryRead(ctx context.Context, d *schema.Re return diags } -func flattenLicensesDeviceLicenseSummaryItems(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseSummaryResponse) []map[string]interface{} { +func flattenLicensesDeviceLicenseSummaryV1Items(items *[]catalystcentersdkgo.ResponseLicensesDeviceLicenseSummaryV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_license_setting.go b/catalystcenter/data_source_license_setting.go index 717120e..6bea5d2 100644 --- a/catalystcenter/data_source_license_setting.go +++ b/catalystcenter/data_source_license_setting.go @@ -57,26 +57,26 @@ func dataSourceLicenseSettingRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveLicenseSetting") + log.Printf("[DEBUG] Selected method: RetrieveLicenseSettingV1") - response1, restyResp1, err := client.Licenses.RetrieveLicenseSetting() + response1, restyResp1, err := client.Licenses.RetrieveLicenseSettingV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveLicenseSetting", err, - "Failure at RetrieveLicenseSetting, unexpected response", "")) + "Failure when executing 2 RetrieveLicenseSettingV1", err, + "Failure at RetrieveLicenseSettingV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLicensesRetrieveLicenseSettingItem(response1.Response) + vItem1 := flattenLicensesRetrieveLicenseSettingV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveLicenseSetting response", + "Failure when setting RetrieveLicenseSettingV1 response", err)) return diags } @@ -88,7 +88,7 @@ func dataSourceLicenseSettingRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenLicensesRetrieveLicenseSettingItem(item *catalystcentersdkgo.ResponseLicensesRetrieveLicenseSettingResponse) []map[string]interface{} { +func flattenLicensesRetrieveLicenseSettingV1Item(item *catalystcentersdkgo.ResponseLicensesRetrieveLicenseSettingV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_license_smart_account_details.go b/catalystcenter/data_source_license_smart_account_details.go index 3ff4606..03f3af8 100644 --- a/catalystcenter/data_source_license_smart_account_details.go +++ b/catalystcenter/data_source_license_smart_account_details.go @@ -99,7 +99,7 @@ func dataSourceLicenseSmartAccountDetailsRead(ctx context.Context, d *schema.Res return diags } -func flattenLicensesSmartAccountDetailsItems(items *[]catalystcentersdkgo.ResponseLicensesSmartAccountDetailsResponse) []map[string]interface{} { +func flattenLicensesSmartAccountDetailsItems(items *[]catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -115,7 +115,7 @@ func flattenLicensesSmartAccountDetailsItems(items *[]catalystcentersdkgo.Respon return respItems } -func flattenLicensesSmartAccountDetailsItem(item *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsResponse) []map[string]interface{} { +func flattenLicensesSmartAccountDetailsItem(item *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_license_term_details.go b/catalystcenter/data_source_license_term_details.go index c996f0a..293e8fc 100644 --- a/catalystcenter/data_source_license_term_details.go +++ b/catalystcenter/data_source_license_term_details.go @@ -110,31 +110,31 @@ func dataSourceLicenseTermDetailsRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LicenseTermDetails") + log.Printf("[DEBUG] Selected method: LicenseTermDetailsV1") vvSmartAccountID := vSmartAccountID.(string) vvVirtualAccountName := vVirtualAccountName.(string) - queryParams1 := catalystcentersdkgo.LicenseTermDetailsQueryParams{} + queryParams1 := catalystcentersdkgo.LicenseTermDetailsV1QueryParams{} queryParams1.DeviceType = vDeviceType.(string) - response1, restyResp1, err := client.Licenses.LicenseTermDetails(vvSmartAccountID, vvVirtualAccountName, &queryParams1) + response1, restyResp1, err := client.Licenses.LicenseTermDetailsV1(vvSmartAccountID, vvVirtualAccountName, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LicenseTermDetails", err, - "Failure at LicenseTermDetails, unexpected response", "")) + "Failure when executing 2 LicenseTermDetailsV1", err, + "Failure at LicenseTermDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenLicensesLicenseTermDetailsItems(response1.LicenseDetails) + vItems1 := flattenLicensesLicenseTermDetailsV1Items(response1.LicenseDetails) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting LicenseTermDetails response", + "Failure when setting LicenseTermDetailsV1 response", err)) return diags } @@ -146,7 +146,7 @@ func dataSourceLicenseTermDetailsRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenLicensesLicenseTermDetailsItems(items *[]catalystcentersdkgo.ResponseLicensesLicenseTermDetailsLicenseDetails) []map[string]interface{} { +func flattenLicensesLicenseTermDetailsV1Items(items *[]catalystcentersdkgo.ResponseLicensesLicenseTermDetailsV1LicenseDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_license_usage_details.go b/catalystcenter/data_source_license_usage_details.go index 628fd92..4823d4f 100644 --- a/catalystcenter/data_source_license_usage_details.go +++ b/catalystcenter/data_source_license_usage_details.go @@ -295,31 +295,31 @@ func dataSourceLicenseUsageDetailsRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: LicenseUsageDetails") + log.Printf("[DEBUG] Selected method: LicenseUsageDetailsV1") vvSmartAccountID := vSmartAccountID.(string) vvVirtualAccountName := vVirtualAccountName.(string) - queryParams1 := catalystcentersdkgo.LicenseUsageDetailsQueryParams{} + queryParams1 := catalystcentersdkgo.LicenseUsageDetailsV1QueryParams{} queryParams1.DeviceType = vDeviceType.(string) - response1, restyResp1, err := client.Licenses.LicenseUsageDetails(vvSmartAccountID, vvVirtualAccountName, &queryParams1) + response1, restyResp1, err := client.Licenses.LicenseUsageDetailsV1(vvSmartAccountID, vvVirtualAccountName, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 LicenseUsageDetails", err, - "Failure at LicenseUsageDetails, unexpected response", "")) + "Failure when executing 2 LicenseUsageDetailsV1", err, + "Failure at LicenseUsageDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLicensesLicenseUsageDetailsItem(response1) + vItem1 := flattenLicensesLicenseUsageDetailsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LicenseUsageDetails response", + "Failure when setting LicenseUsageDetailsV1 response", err)) return diags } @@ -331,29 +331,29 @@ func dataSourceLicenseUsageDetailsRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenLicensesLicenseUsageDetailsItem(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetails) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1Item(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["purchased_dna_license"] = flattenLicensesLicenseUsageDetailsItemPurchasedDnaLicense(item.PurchasedDnaLicense) - respItem["purchased_network_license"] = flattenLicensesLicenseUsageDetailsItemPurchasedNetworkLicense(item.PurchasedNetworkLicense) - respItem["used_dna_license"] = flattenLicensesLicenseUsageDetailsItemUsedDnaLicense(item.UsedDnaLicense) - respItem["used_network_license"] = flattenLicensesLicenseUsageDetailsItemUsedNetworkLicense(item.UsedNetworkLicense) - respItem["purchased_ise_license"] = flattenLicensesLicenseUsageDetailsItemPurchasedIseLicense(item.PurchasedIseLicense) - respItem["used_ise_license"] = flattenLicensesLicenseUsageDetailsItemUsedIseLicense(item.UsedIseLicense) + respItem["purchased_dna_license"] = flattenLicensesLicenseUsageDetailsV1ItemPurchasedDnaLicense(item.PurchasedDnaLicense) + respItem["purchased_network_license"] = flattenLicensesLicenseUsageDetailsV1ItemPurchasedNetworkLicense(item.PurchasedNetworkLicense) + respItem["used_dna_license"] = flattenLicensesLicenseUsageDetailsV1ItemUsedDnaLicense(item.UsedDnaLicense) + respItem["used_network_license"] = flattenLicensesLicenseUsageDetailsV1ItemUsedNetworkLicense(item.UsedNetworkLicense) + respItem["purchased_ise_license"] = flattenLicensesLicenseUsageDetailsV1ItemPurchasedIseLicense(item.PurchasedIseLicense) + respItem["used_ise_license"] = flattenLicensesLicenseUsageDetailsV1ItemUsedIseLicense(item.UsedIseLicense) return []map[string]interface{}{ respItem, } } -func flattenLicensesLicenseUsageDetailsItemPurchasedDnaLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsPurchasedDnaLicense) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemPurchasedDnaLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1PurchasedDnaLicense) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_license_count"] = item.TotalLicenseCount - respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsItemPurchasedDnaLicenseLicenseCountByType(item.LicenseCountByType) + respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsV1ItemPurchasedDnaLicenseLicenseCountByType(item.LicenseCountByType) return []map[string]interface{}{ respItem, @@ -361,7 +361,7 @@ func flattenLicensesLicenseUsageDetailsItemPurchasedDnaLicense(item *catalystcen } -func flattenLicensesLicenseUsageDetailsItemPurchasedDnaLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsPurchasedDnaLicenseLicenseCountByType) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemPurchasedDnaLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1PurchasedDnaLicenseLicenseCountByType) []map[string]interface{} { if items == nil { return nil } @@ -375,13 +375,13 @@ func flattenLicensesLicenseUsageDetailsItemPurchasedDnaLicenseLicenseCountByType return respItems } -func flattenLicensesLicenseUsageDetailsItemPurchasedNetworkLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsPurchasedNetworkLicense) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemPurchasedNetworkLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1PurchasedNetworkLicense) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_license_count"] = item.TotalLicenseCount - respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsItemPurchasedNetworkLicenseLicenseCountByType(item.LicenseCountByType) + respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsV1ItemPurchasedNetworkLicenseLicenseCountByType(item.LicenseCountByType) return []map[string]interface{}{ respItem, @@ -389,7 +389,7 @@ func flattenLicensesLicenseUsageDetailsItemPurchasedNetworkLicense(item *catalys } -func flattenLicensesLicenseUsageDetailsItemPurchasedNetworkLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsPurchasedNetworkLicenseLicenseCountByType) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemPurchasedNetworkLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1PurchasedNetworkLicenseLicenseCountByType) []map[string]interface{} { if items == nil { return nil } @@ -403,13 +403,13 @@ func flattenLicensesLicenseUsageDetailsItemPurchasedNetworkLicenseLicenseCountBy return respItems } -func flattenLicensesLicenseUsageDetailsItemUsedDnaLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsUsedDnaLicense) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemUsedDnaLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1UsedDnaLicense) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_license_count"] = item.TotalLicenseCount - respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsItemUsedDnaLicenseLicenseCountByType(item.LicenseCountByType) + respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsV1ItemUsedDnaLicenseLicenseCountByType(item.LicenseCountByType) return []map[string]interface{}{ respItem, @@ -417,7 +417,7 @@ func flattenLicensesLicenseUsageDetailsItemUsedDnaLicense(item *catalystcentersd } -func flattenLicensesLicenseUsageDetailsItemUsedDnaLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsUsedDnaLicenseLicenseCountByType) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemUsedDnaLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1UsedDnaLicenseLicenseCountByType) []map[string]interface{} { if items == nil { return nil } @@ -431,13 +431,13 @@ func flattenLicensesLicenseUsageDetailsItemUsedDnaLicenseLicenseCountByType(item return respItems } -func flattenLicensesLicenseUsageDetailsItemUsedNetworkLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsUsedNetworkLicense) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemUsedNetworkLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1UsedNetworkLicense) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_license_count"] = item.TotalLicenseCount - respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsItemUsedNetworkLicenseLicenseCountByType(item.LicenseCountByType) + respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsV1ItemUsedNetworkLicenseLicenseCountByType(item.LicenseCountByType) return []map[string]interface{}{ respItem, @@ -445,7 +445,7 @@ func flattenLicensesLicenseUsageDetailsItemUsedNetworkLicense(item *catalystcent } -func flattenLicensesLicenseUsageDetailsItemUsedNetworkLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsUsedNetworkLicenseLicenseCountByType) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemUsedNetworkLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1UsedNetworkLicenseLicenseCountByType) []map[string]interface{} { if items == nil { return nil } @@ -459,13 +459,13 @@ func flattenLicensesLicenseUsageDetailsItemUsedNetworkLicenseLicenseCountByType( return respItems } -func flattenLicensesLicenseUsageDetailsItemPurchasedIseLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsPurchasedIseLicense) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemPurchasedIseLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1PurchasedIseLicense) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_license_count"] = item.TotalLicenseCount - respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsItemPurchasedIseLicenseLicenseCountByType(item.LicenseCountByType) + respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsV1ItemPurchasedIseLicenseLicenseCountByType(item.LicenseCountByType) return []map[string]interface{}{ respItem, @@ -473,7 +473,7 @@ func flattenLicensesLicenseUsageDetailsItemPurchasedIseLicense(item *catalystcen } -func flattenLicensesLicenseUsageDetailsItemPurchasedIseLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsPurchasedIseLicenseLicenseCountByType) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemPurchasedIseLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1PurchasedIseLicenseLicenseCountByType) []map[string]interface{} { if items == nil { return nil } @@ -487,13 +487,13 @@ func flattenLicensesLicenseUsageDetailsItemPurchasedIseLicenseLicenseCountByType return respItems } -func flattenLicensesLicenseUsageDetailsItemUsedIseLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsUsedIseLicense) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemUsedIseLicense(item *catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1UsedIseLicense) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_license_count"] = item.TotalLicenseCount - respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsItemUsedIseLicenseLicenseCountByType(item.LicenseCountByType) + respItem["license_count_by_type"] = flattenLicensesLicenseUsageDetailsV1ItemUsedIseLicenseLicenseCountByType(item.LicenseCountByType) return []map[string]interface{}{ respItem, @@ -501,7 +501,7 @@ func flattenLicensesLicenseUsageDetailsItemUsedIseLicense(item *catalystcentersd } -func flattenLicensesLicenseUsageDetailsItemUsedIseLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsUsedIseLicenseLicenseCountByType) []map[string]interface{} { +func flattenLicensesLicenseUsageDetailsV1ItemUsedIseLicenseLicenseCountByType(items *[]catalystcentersdkgo.ResponseLicensesLicenseUsageDetailsV1UsedIseLicenseLicenseCountByType) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_license_virtual_account_details.go b/catalystcenter/data_source_license_virtual_account_details.go index 8a1b09b..ca74399 100644 --- a/catalystcenter/data_source_license_virtual_account_details.go +++ b/catalystcenter/data_source_license_virtual_account_details.go @@ -84,27 +84,27 @@ func dataSourceLicenseVirtualAccountDetailsRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: VirtualAccountDetails") + log.Printf("[DEBUG] Selected method: VirtualAccountDetailsV1") vvSmartAccountID := vSmartAccountID.(string) - response1, restyResp1, err := client.Licenses.VirtualAccountDetails(vvSmartAccountID) + response1, restyResp1, err := client.Licenses.VirtualAccountDetailsV1(vvSmartAccountID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 VirtualAccountDetails", err, - "Failure at VirtualAccountDetails, unexpected response", "")) + "Failure when executing 2 VirtualAccountDetailsV1", err, + "Failure at VirtualAccountDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLicensesVirtualAccountDetailsItem(response1) + vItem1 := flattenLicensesVirtualAccountDetailsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting VirtualAccountDetails response", + "Failure when setting VirtualAccountDetailsV1 response", err)) return diags } @@ -116,20 +116,20 @@ func dataSourceLicenseVirtualAccountDetailsRead(ctx context.Context, d *schema.R return diags } -func flattenLicensesVirtualAccountDetailsItem(item *catalystcentersdkgo.ResponseLicensesVirtualAccountDetails) []map[string]interface{} { +func flattenLicensesVirtualAccountDetailsV1Item(item *catalystcentersdkgo.ResponseLicensesVirtualAccountDetailsV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["smart_account_id"] = item.SmartAccountID respItem["smart_account_name"] = item.SmartAccountName - respItem["virtual_account_details"] = flattenLicensesVirtualAccountDetailsItemVirtualAccountDetails(item.VirtualAccountDetails) + respItem["virtual_account_details"] = flattenLicensesVirtualAccountDetailsV1ItemVirtualAccountDetails(item.VirtualAccountDetails) return []map[string]interface{}{ respItem, } } -func flattenLicensesVirtualAccountDetailsItemVirtualAccountDetails(items *[]catalystcentersdkgo.ResponseLicensesVirtualAccountDetailsVirtualAccountDetails) []map[string]interface{} { +func flattenLicensesVirtualAccountDetailsV1ItemVirtualAccountDetails(items *[]catalystcentersdkgo.ResponseLicensesVirtualAccountDetailsV1VirtualAccountDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_maps_import_status.go b/catalystcenter/data_source_maps_import_status.go index 1c70e1a..3ef7570 100644 --- a/catalystcenter/data_source_maps_import_status.go +++ b/catalystcenter/data_source_maps_import_status.go @@ -198,27 +198,27 @@ func dataSourceMapsImportStatusRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ImportMapArchiveImportStatus") + log.Printf("[DEBUG] Selected method: ImportMapArchiveImportStatusV1") vvImportContextUUID := vImportContextUUID.(string) - response1, restyResp1, err := client.Sites.ImportMapArchiveImportStatus(vvImportContextUUID) + response1, restyResp1, err := client.Sites.ImportMapArchiveImportStatusV1(vvImportContextUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ImportMapArchiveImportStatus", err, - "Failure at ImportMapArchiveImportStatus, unexpected response", "")) + "Failure when executing 2 ImportMapArchiveImportStatusV1", err, + "Failure at ImportMapArchiveImportStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSitesImportMapArchiveImportStatusItem(response1) + vItem1 := flattenSitesImportMapArchiveImportStatusV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportMapArchiveImportStatus response", + "Failure when setting ImportMapArchiveImportStatusV1 response", err)) return diags } @@ -230,35 +230,35 @@ func dataSourceMapsImportStatusRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenSitesImportMapArchiveImportStatusItem(item *catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatus) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1Item(item *catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["audit_log"] = flattenSitesImportMapArchiveImportStatusItemAuditLog(item.AuditLog) + respItem["audit_log"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLog(item.AuditLog) respItem["status"] = item.Status - respItem["uuid"] = flattenSitesImportMapArchiveImportStatusItemUUID(item.UUID) + respItem["uuid"] = flattenSitesImportMapArchiveImportStatusV1ItemUUID(item.UUID) return []map[string]interface{}{ respItem, } } -func flattenSitesImportMapArchiveImportStatusItemAuditLog(item *catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLog) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLog(item *catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLog) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["children"] = flattenSitesImportMapArchiveImportStatusItemAuditLogChildren(item.Children) - respItem["entities_count"] = flattenSitesImportMapArchiveImportStatusItemAuditLogEntitiesCount(item.EntitiesCount) + respItem["children"] = item.Children + respItem["entities_count"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLogEntitiesCount(item.EntitiesCount) respItem["entity_name"] = item.EntityName respItem["entity_type"] = item.EntityType - respItem["error_entities_count"] = flattenSitesImportMapArchiveImportStatusItemAuditLogErrorEntitiesCount(item.ErrorEntitiesCount) - respItem["errors"] = flattenSitesImportMapArchiveImportStatusItemAuditLogErrors(item.Errors) - respItem["infos"] = flattenSitesImportMapArchiveImportStatusItemAuditLogInfos(item.Infos) - respItem["matching_entities_count"] = flattenSitesImportMapArchiveImportStatusItemAuditLogMatchingEntitiesCount(item.MatchingEntitiesCount) + respItem["error_entities_count"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLogErrorEntitiesCount(item.ErrorEntitiesCount) + respItem["errors"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLogErrors(item.Errors) + respItem["infos"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLogInfos(item.Infos) + respItem["matching_entities_count"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLogMatchingEntitiesCount(item.MatchingEntitiesCount) respItem["sub_tasks_root_task_id"] = item.SubTasksRootTaskID respItem["successfully_imported_floors"] = item.SuccessfullyImportedFloors - respItem["warnings"] = flattenSitesImportMapArchiveImportStatusItemAuditLogWarnings(item.Warnings) + respItem["warnings"] = flattenSitesImportMapArchiveImportStatusV1ItemAuditLogWarnings(item.Warnings) return []map[string]interface{}{ respItem, @@ -266,19 +266,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLog(item *catalystcentersd } -func flattenSitesImportMapArchiveImportStatusItemAuditLogChildren(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogChildren) []interface{} { - if items == nil { - return nil - } - var respItems []interface{} - for _, item := range *items { - respItem := item - respItems = append(respItems, responseInterfaceToString(respItem)) - } - return respItems -} - -func flattenSitesImportMapArchiveImportStatusItemAuditLogEntitiesCount(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogEntitiesCount) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLogEntitiesCount(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLogEntitiesCount) []map[string]interface{} { if items == nil { return nil } @@ -291,7 +279,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLogEntitiesCount(items *[] return respItems } -func flattenSitesImportMapArchiveImportStatusItemAuditLogErrorEntitiesCount(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogErrorEntitiesCount) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLogErrorEntitiesCount(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLogErrorEntitiesCount) []map[string]interface{} { if items == nil { return nil } @@ -304,7 +292,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLogErrorEntitiesCount(item return respItems } -func flattenSitesImportMapArchiveImportStatusItemAuditLogErrors(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogErrors) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLogErrors(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLogErrors) []map[string]interface{} { if items == nil { return nil } @@ -317,7 +305,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLogErrors(items *[]catalys return respItems } -func flattenSitesImportMapArchiveImportStatusItemAuditLogInfos(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogInfos) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLogInfos(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLogInfos) []map[string]interface{} { if items == nil { return nil } @@ -330,7 +318,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLogInfos(items *[]catalyst return respItems } -func flattenSitesImportMapArchiveImportStatusItemAuditLogMatchingEntitiesCount(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogMatchingEntitiesCount) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLogMatchingEntitiesCount(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLogMatchingEntitiesCount) []map[string]interface{} { if items == nil { return nil } @@ -343,7 +331,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLogMatchingEntitiesCount(i return respItems } -func flattenSitesImportMapArchiveImportStatusItemAuditLogWarnings(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusAuditLogWarnings) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemAuditLogWarnings(items *[]catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1AuditLogWarnings) []map[string]interface{} { if items == nil { return nil } @@ -356,7 +344,7 @@ func flattenSitesImportMapArchiveImportStatusItemAuditLogWarnings(items *[]catal return respItems } -func flattenSitesImportMapArchiveImportStatusItemUUID(item *catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusUUID) []map[string]interface{} { +func flattenSitesImportMapArchiveImportStatusV1ItemUUID(item *catalystcentersdkgo.ResponseSitesImportMapArchiveImportStatusV1UUID) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_maps_supported_access_points.go b/catalystcenter/data_source_maps_supported_access_points.go index 8a410d5..2fbd073 100644 --- a/catalystcenter/data_source_maps_supported_access_points.go +++ b/catalystcenter/data_source_maps_supported_access_points.go @@ -67,26 +67,26 @@ func dataSourceMapsSupportedAccessPointsRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: MapsSupportedAccessPoints") + log.Printf("[DEBUG] Selected method: MapsSupportedAccessPointsV1") - response1, restyResp1, err := client.Sites.MapsSupportedAccessPoints() + response1, restyResp1, err := client.Sites.MapsSupportedAccessPointsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 MapsSupportedAccessPoints", err, - "Failure at MapsSupportedAccessPoints, unexpected response", "")) + "Failure when executing 2 MapsSupportedAccessPointsV1", err, + "Failure at MapsSupportedAccessPointsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSitesMapsSupportedAccessPointsItems(response1) + vItems1 := flattenSitesMapsSupportedAccessPointsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting MapsSupportedAccessPoints response", + "Failure when setting MapsSupportedAccessPointsV1 response", err)) return diags } @@ -98,21 +98,21 @@ func dataSourceMapsSupportedAccessPointsRead(ctx context.Context, d *schema.Reso return diags } -func flattenSitesMapsSupportedAccessPointsItems(items *catalystcentersdkgo.ResponseSitesMapsSupportedAccessPoints) []map[string]interface{} { +func flattenSitesMapsSupportedAccessPointsV1Items(items *catalystcentersdkgo.ResponseSitesMapsSupportedAccessPointsV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["antenna_patterns"] = flattenSitesMapsSupportedAccessPointsItemsAntennaPatterns(item.AntennaPatterns) + respItem["antenna_patterns"] = flattenSitesMapsSupportedAccessPointsV1ItemsAntennaPatterns(item.AntennaPatterns) respItem["ap_type"] = item.ApType respItems = append(respItems, respItem) } return respItems } -func flattenSitesMapsSupportedAccessPointsItemsAntennaPatterns(items *[]catalystcentersdkgo.ResponseItemSitesMapsSupportedAccessPointsAntennaPatterns) []map[string]interface{} { +func flattenSitesMapsSupportedAccessPointsV1ItemsAntennaPatterns(items *[]catalystcentersdkgo.ResponseItemSitesMapsSupportedAccessPointsV1AntennaPatterns) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network.go b/catalystcenter/data_source_network.go index 8b84e14..7810bda 100644 --- a/catalystcenter/data_source_network.go +++ b/catalystcenter/data_source_network.go @@ -126,31 +126,31 @@ func dataSourceNetworkRead(ctx context.Context, d *schema.ResourceData, m interf selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetwork") - queryParams1 := catalystcentersdkgo.GetNetworkQueryParams{} + log.Printf("[DEBUG] Selected method: GetNetworkV1") + queryParams1 := catalystcentersdkgo.GetNetworkV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) } - response1, restyResp1, err := client.NetworkSettings.GetNetwork(&queryParams1) + response1, restyResp1, err := client.NetworkSettings.GetNetworkV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetwork", err, - "Failure at GetNetwork, unexpected response", "")) + "Failure when executing 2 GetNetworkV1", err, + "Failure at GetNetworkV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenNetworkSettingsGetNetworkItems(response1.Response) + vItems1 := flattenNetworkSettingsGetNetworkV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetwork response", + "Failure when setting GetNetworkV1 response", err)) return diags } @@ -162,7 +162,7 @@ func dataSourceNetworkRead(ctx context.Context, d *schema.ResourceData, m interf return diags } -func flattenNetworkSettingsGetNetworkItems(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkResponse) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkV1Items(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkV1Response) []map[string]interface{} { if items == nil { return nil } @@ -175,7 +175,7 @@ func flattenNetworkSettingsGetNetworkItems(items *[]catalystcentersdkgo.Response respItem["type"] = item.Type respItem["key"] = item.Key respItem["version"] = item.Version - respItem["value"] = flattenNetworkSettingsGetNetworkItemsValue(item.Value) + respItem["value"] = flattenNetworkSettingsGetNetworkV1ItemsValue(item.Value) respItem["group_uuid"] = item.GroupUUID respItem["inherited_group_uuid"] = item.InheritedGroupUUID respItem["inherited_group_name"] = item.InheritedGroupName @@ -184,7 +184,7 @@ func flattenNetworkSettingsGetNetworkItems(items *[]catalystcentersdkgo.Response return respItems } -func flattenNetworkSettingsGetNetworkItemsValue(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkResponseValue) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkV1ItemsValue(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkV1ResponseValue) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device.go b/catalystcenter/data_source_network_device.go index d2c3334..7132388 100644 --- a/catalystcenter/data_source_network_device.go +++ b/catalystcenter/data_source_network_device.go @@ -405,27 +405,27 @@ func dataSourceNetworkDeviceRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceByID") + log.Printf("[DEBUG] Selected method: GetDeviceByIDV1") vvID := vID.(string) - response1, restyResp1, err := client.Devices.GetDeviceByID(vvID) + response1, restyResp1, err := client.Devices.GetDeviceByIDV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceByID", err, - "Failure at GetDeviceByID, unexpected response", "")) + "Failure when executing 2 GetDeviceByIDV1", err, + "Failure at GetDeviceByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceByIDItem(response1.Response) + vItem1 := flattenDevicesGetDeviceByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceByID response", + "Failure when setting GetDeviceByIDV1 response", err)) return diags } @@ -437,7 +437,7 @@ func dataSourceNetworkDeviceRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDevicesGetDeviceByIDItem(item *catalystcentersdkgo.ResponseDevicesGetDeviceByIDResponse) []map[string]interface{} { +func flattenDevicesGetDeviceByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_by_ip.go b/catalystcenter/data_source_network_device_by_ip.go index f453621..94dd1a8 100644 --- a/catalystcenter/data_source_network_device_by_ip.go +++ b/catalystcenter/data_source_network_device_by_ip.go @@ -405,27 +405,27 @@ func dataSourceNetworkDeviceByIPRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetworkDeviceByIP") + log.Printf("[DEBUG] Selected method: GetNetworkDeviceByIPV1") vvIPAddress := vIPAddress.(string) - response1, restyResp1, err := client.Devices.GetNetworkDeviceByIP(vvIPAddress) + response1, restyResp1, err := client.Devices.GetNetworkDeviceByIPV1(vvIPAddress) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetworkDeviceByIP", err, - "Failure at GetNetworkDeviceByIP, unexpected response", "")) + "Failure when executing 2 GetNetworkDeviceByIPV1", err, + "Failure at GetNetworkDeviceByIPV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetNetworkDeviceByIPItem(response1.Response) + vItem1 := flattenDevicesGetNetworkDeviceByIPV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetworkDeviceByIP response", + "Failure when setting GetNetworkDeviceByIPV1 response", err)) return diags } diff --git a/catalystcenter/data_source_network_device_by_serial_number.go b/catalystcenter/data_source_network_device_by_serial_number.go index 3d25b7b..f4794a0 100644 --- a/catalystcenter/data_source_network_device_by_serial_number.go +++ b/catalystcenter/data_source_network_device_by_serial_number.go @@ -405,27 +405,27 @@ func dataSourceNetworkDeviceBySerialNumberRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceBySerialNumber") + log.Printf("[DEBUG] Selected method: GetDeviceBySerialNumberV1") vvSerialNumber := vSerialNumber.(string) - response1, restyResp1, err := client.Devices.GetDeviceBySerialNumber(vvSerialNumber) + response1, restyResp1, err := client.Devices.GetDeviceBySerialNumberV1(vvSerialNumber) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceBySerialNumber", err, - "Failure at GetDeviceBySerialNumber, unexpected response", "")) + "Failure when executing 2 GetDeviceBySerialNumberV1", err, + "Failure at GetDeviceBySerialNumberV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceBySerialNumberItem(response1.Response) + vItem1 := flattenDevicesGetDeviceBySerialNumberV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceBySerialNumber response", + "Failure when setting GetDeviceBySerialNumberV1 response", err)) return diags } @@ -437,7 +437,7 @@ func dataSourceNetworkDeviceBySerialNumberRead(ctx context.Context, d *schema.Re return diags } -func flattenDevicesGetDeviceBySerialNumberItem(item *catalystcentersdkgo.ResponseDevicesGetDeviceBySerialNumberResponse) []map[string]interface{} { +func flattenDevicesGetDeviceBySerialNumberV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceBySerialNumberV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_chassis_details.go b/catalystcenter/data_source_network_device_chassis_details.go index 693784d..b6a92fe 100644 --- a/catalystcenter/data_source_network_device_chassis_details.go +++ b/catalystcenter/data_source_network_device_chassis_details.go @@ -145,27 +145,27 @@ func dataSourceNetworkDeviceChassisDetailsRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetChassisDetailsForDevice") + log.Printf("[DEBUG] Selected method: GetChassisDetailsForDeviceV1") vvDeviceID := vDeviceID.(string) - response1, restyResp1, err := client.Devices.GetChassisDetailsForDevice(vvDeviceID) + response1, restyResp1, err := client.Devices.GetChassisDetailsForDeviceV1(vvDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetChassisDetailsForDevice", err, - "Failure at GetChassisDetailsForDevice, unexpected response", "")) + "Failure when executing 2 GetChassisDetailsForDeviceV1", err, + "Failure at GetChassisDetailsForDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetChassisDetailsForDeviceItems(response1.Response) + vItems1 := flattenDevicesGetChassisDetailsForDeviceV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetChassisDetailsForDevice response", + "Failure when setting GetChassisDetailsForDeviceV1 response", err)) return diags } @@ -177,7 +177,7 @@ func dataSourceNetworkDeviceChassisDetailsRead(ctx context.Context, d *schema.Re return diags } -func flattenDevicesGetChassisDetailsForDeviceItems(items *[]catalystcentersdkgo.ResponseDevicesGetChassisDetailsForDeviceResponse) []map[string]interface{} { +func flattenDevicesGetChassisDetailsForDeviceV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetChassisDetailsForDeviceV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_config.go b/catalystcenter/data_source_network_device_config.go index c3828f3..509e798 100644 --- a/catalystcenter/data_source_network_device_config.go +++ b/catalystcenter/data_source_network_device_config.go @@ -13,231 +13,100 @@ import ( func dataSourceNetworkDeviceConfig() *schema.Resource { return &schema.Resource{ - Description: `It performs read operation on Configuration Archive. + Description: `It performs read operation on Devices. -- Returns the historical device configurations (running configuration , startup configuration , vlan if applicable) by -specified criteria +- Returns the config for all devices. This data source has been deprecated and will not be available in a Cisco Catalyst +Center release after Nov 1st 2024 23:59:59 GMT. + +- Returns the device config by specified device ID `, ReadContext: dataSourceNetworkDeviceConfigRead, Schema: map[string]*schema.Schema{ - "created_by": &schema.Schema{ - Description: `createdBy query parameter. Comma separated values for createdBy SCHEDULED, USER, CONFIG_CHANGE_EVENT, SCHEDULED_FIRST_TIME, DR_CALL_BACK, PRE_DEPLOY -`, - Type: schema.TypeString, - Optional: true, - }, - "created_time": &schema.Schema{ - Description: `createdTime query parameter. Supported with logical filters GT,GTE,LT,LTE & BT : time in milliseconds (epoc format) -`, - Type: schema.TypeString, - Optional: true, - }, - "device_id": &schema.Schema{ - Description: `deviceId query parameter. comma separated device id for example cf35b0a1-407f-412f-b2f4-f0c3156695f9,aaa38191-0c22-4158-befd-779a09d7cec1 . if device id is not provided it will fetch for all devices -`, - Type: schema.TypeString, - Optional: true, - }, - "file_type": &schema.Schema{ - Description: `fileType query parameter. Config File Type can be RUNNINGCONFIG or STARTUPCONFIG -`, - Type: schema.TypeString, - Optional: true, - }, - "limit": &schema.Schema{ - Description: `limit query parameter.`, - Type: schema.TypeFloat, - Optional: true, - }, - "offset": &schema.Schema{ - Description: `offset query parameter.`, - Type: schema.TypeFloat, + "network_device_id": &schema.Schema{ + Description: `networkDeviceId path parameter.`, + Type: schema.TypeString, Optional: true, }, - "items": &schema.Schema{ + "item": &schema.Schema{ Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "device_id": &schema.Schema{ - Description: `UUID of the device. -`, + "response": &schema.Schema{ Type: schema.TypeString, Computed: true, }, - "device_name": &schema.Schema{ - Description: `Hostname of the device. -`, + "version": &schema.Schema{ Type: schema.TypeString, Computed: true, }, + }, + }, + }, - "ip_address": &schema.Schema{ - Description: `IP address of the device. -`, - Type: schema.TypeString, + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute_info": &schema.Schema{ + Type: schema.TypeString, //TEST, Computed: true, }, - "versions": &schema.Schema{ - Type: schema.TypeList, + "cdp_neighbors": &schema.Schema{ + Type: schema.TypeString, Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "config_change_type": &schema.Schema{ - Description: `Source of configuration change (OUT_OF_BAND - Change was made outside Catalyst Center, IN_BAND - Change was made from Catalyst Center, NOT_APPLICABLE - System Triggered) -`, - Type: schema.TypeString, - Computed: true, - }, - - "created_by": &schema.Schema{ - Description: `Reason for archive collection (CONFIG_CHANGE_EVENT - Syslog event based colletion, SCHEDULED - Weekly scheduled collection, SCHEDULED_FIRST_TIME-First Time Managed collection,DR_CALL_BACK- Post Disaster Recovery collection, USER- On Demand Trigger, PRE_DEPLOY- Predeploy collection) -`, - Type: schema.TypeString, - Computed: true, - }, - - "created_time": &schema.Schema{ - Description: `Source of configuration change (OUT_OF_BAND - Change was made outside Catalyst Center, IN_BAND - Change was made from Catalyst Center, NOT_APPLICABLE - System Triggered) -`, - Type: schema.TypeFloat, - Computed: true, - }, - - "files": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "download_path": &schema.Schema{ - Description: `File download path (deprecated). -`, - Type: schema.TypeString, - Computed: true, - }, - - "file_id": &schema.Schema{ - Description: `Unique file ID. -`, - Type: schema.TypeString, - Computed: true, - }, - - "file_type": &schema.Schema{ - Description: `Type of configuration file (RUNNINGCONFIG, STARTUPCONFIG, or VLAN). -`, - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - - "id": &schema.Schema{ - Description: `Unique version ID. -`, - Type: schema.TypeString, - Computed: true, - }, + }, - "last_updated_time": &schema.Schema{ - Description: `Latest time stamp when the collected configuration is verified to be running on the device. LastUpdatedTime and createdTime will differ when verified configs are the same. -`, - Type: schema.TypeFloat, - Computed: true, - }, + "health_monitor": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "startup_running_status": &schema.Schema{ - Description: `Sync status of running and startup configurations (IN_SYNC - if both startup and running config are same excluding dynamic configurations, OUT_OF_SYNC - otherwise). -`, - Type: schema.TypeString, - Computed: true, - }, - - "syslog_config_event_dto": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "config_method": &schema.Schema{ - Description: `Connection mode used to do the changes pn the device (if available in Syslog). -`, - Type: schema.TypeString, - Computed: true, - }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "device_uuid": &schema.Schema{ - Description: `UUID of the device as recieved in syslog. -`, - Type: schema.TypeString, - Computed: true, - }, + "intf_description": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "login_ip_address": &schema.Schema{ - Description: `IP address from which the configuration changes were made (if available in Syslog). -`, - Type: schema.TypeString, - Computed: true, - }, + "inventory": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "out_of_band": &schema.Schema{ - Description: `True if configuration changes were made from outside of the Catalist Center. False otherwise. -`, - // Type: schema.TypeBool, - Type: schema.TypeString, - Computed: true, - }, + "ip_intf_brief": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "process_name": &schema.Schema{ - Description: `Name of the process that made configuration change (only available when configuration got changed by a program such as YANG suite ) -`, - Type: schema.TypeString, - Computed: true, - }, + "mac_address_table": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "syslog_time": &schema.Schema{ - Description: `Time of configuration change as recorded in the syslog. -`, - Type: schema.TypeFloat, - Computed: true, - }, + "running_config": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "terminal_name": &schema.Schema{ - Description: `Name of the terminal used to make changes on the device (if available in Syslog). -`, - Type: schema.TypeString, - Computed: true, - }, + "snmp": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, - "user_name": &schema.Schema{ - Description: `Name of the user who made the configuration change (if available in Syslog). -`, - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - - "tags": &schema.Schema{ - Description: `Labels added to a configuration version. -`, - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, + "version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, }, }, }, @@ -250,55 +119,35 @@ func dataSourceNetworkDeviceConfigRead(ctx context.Context, d *schema.ResourceDa client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - vDeviceID, okDeviceID := d.GetOk("device_id") - vFileType, okFileType := d.GetOk("file_type") - vCreatedTime, okCreatedTime := d.GetOk("created_time") - vCreatedBy, okCreatedBy := d.GetOk("created_by") - vOffset, okOffset := d.GetOk("offset") - vLimit, okLimit := d.GetOk("limit") - - selectedMethod := 1 - if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetConfigurationArchiveDetails") - queryParams1 := catalystcentersdkgo.GetConfigurationArchiveDetailsQueryParams{} + vNetworkDeviceID, okNetworkDeviceID := d.GetOk("network_device_id") - if okDeviceID { - queryParams1.DeviceID = vDeviceID.(string) - } - if okFileType { - queryParams1.FileType = vFileType.(string) - } - if okCreatedTime { - queryParams1.CreatedTime = vCreatedTime.(string) - } - if okCreatedBy { - queryParams1.CreatedBy = vCreatedBy.(string) - } - if okOffset { - queryParams1.Offset = vOffset.(float64) - } - if okLimit { - queryParams1.Limit = vLimit.(float64) - } + method1 := []bool{} + log.Printf("[DEBUG] Selecting method. Method 1 %v", method1) + method2 := []bool{okNetworkDeviceID} + log.Printf("[DEBUG] Selecting method. Method 2 %v", method2) - response1, restyResp1, err := client.ConfigurationArchive.GetConfigurationArchiveDetails(&queryParams1) + selectedMethod := pickMethod([][]bool{method1, method2}) + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetDeviceConfigForAllDevicesV1") + + response1, restyResp1, err := client.Devices.GetDeviceConfigForAllDevicesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetConfigurationArchiveDetails", err, - "Failure at GetConfigurationArchiveDetails, unexpected response", "")) + "Failure when executing 2 GetDeviceConfigForAllDevicesV1", err, + "Failure at GetDeviceConfigForAllDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenConfigurationArchiveGetConfigurationArchiveDetailsItems(response1) + vItems1 := flattenDevicesGetDeviceConfigForAllDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetConfigurationArchiveDetails response", + "Failure when setting GetDeviceConfigForAllDevicesV1 response", err)) return diags } @@ -307,77 +156,80 @@ func dataSourceNetworkDeviceConfigRead(ctx context.Context, d *schema.ResourceDa return diags } - return diags -} + if selectedMethod == 2 { + log.Printf("[DEBUG] Selected method: GetDeviceConfigByIDV1") + vvNetworkDeviceID := vNetworkDeviceID.(string) + + response2, restyResp2, err := client.Devices.GetDeviceConfigByIDV1(vvNetworkDeviceID) + + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetDeviceConfigByIDV1", err, + "Failure at GetDeviceConfigByIDV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) + + vItem2 := flattenDevicesGetDeviceConfigByIDV1Item(response2) + if err := d.Set("item", vItem2); err != nil { + diags = append(diags, diagError( + "Failure when setting GetDeviceConfigByIDV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags -func flattenConfigurationArchiveGetConfigurationArchiveDetailsItems(items *catalystcentersdkgo.ResponseConfigurationArchiveGetConfigurationArchiveDetails) []map[string]interface{} { - if items == nil { - return nil - } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["ip_address"] = item.IPAddress - respItem["device_id"] = item.DeviceID - respItem["versions"] = flattenConfigurationArchiveGetConfigurationArchiveDetailsItemsVersions(item.Versions) - respItem["device_name"] = item.DeviceName - respItems = append(respItems, respItem) } - return respItems + return diags } -func flattenConfigurationArchiveGetConfigurationArchiveDetailsItemsVersions(items *[]catalystcentersdkgo.ResponseItemConfigurationArchiveGetConfigurationArchiveDetailsVersions) []map[string]interface{} { +func flattenDevicesGetDeviceConfigForAllDevicesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceConfigForAllDevicesV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["files"] = flattenConfigurationArchiveGetConfigurationArchiveDetailsItemsVersionsFiles(item.Files) - respItem["created_by"] = item.CreatedBy - respItem["config_change_type"] = item.ConfigChangeType - respItem["syslog_config_event_dto"] = flattenConfigurationArchiveGetConfigurationArchiveDetailsItemsVersionsSyslogConfigEventDto(item.SyslogConfigEventDto) - respItem["created_time"] = item.CreatedTime - respItem["startup_running_status"] = item.StartupRunningStatus + respItem["attribute_info"] = flattenDevicesGetDeviceConfigForAllDevicesV1ItemsAttributeInfo(item.AttributeInfo) + respItem["cdp_neighbors"] = item.CdpNeighbors + respItem["health_monitor"] = item.HealthMonitor respItem["id"] = item.ID - respItem["tags"] = item.Tags - respItem["last_updated_time"] = item.LastUpdatedTime + respItem["intf_description"] = item.IntfDescription + respItem["inventory"] = item.Inventory + respItem["ip_intf_brief"] = item.IPIntfBrief + respItem["mac_address_table"] = item.MacAddressTable + respItem["running_config"] = item.RunningConfig + respItem["snmp"] = item.SNMP + respItem["version"] = item.Version respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationArchiveGetConfigurationArchiveDetailsItemsVersionsFiles(items *[]catalystcentersdkgo.ResponseItemConfigurationArchiveGetConfigurationArchiveDetailsVersionsFiles) []map[string]interface{} { - if items == nil { +func flattenDevicesGetDeviceConfigForAllDevicesV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetDeviceConfigForAllDevicesV1ResponseAttributeInfo) interface{} { + if item == nil { return nil } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["file_type"] = item.FileType - respItem["file_id"] = item.FileID - respItem["download_path"] = item.DownloadPath - respItems = append(respItems, respItem) - } - return respItems + respItem := *item + + return responseInterfaceToString(respItem) + } -func flattenConfigurationArchiveGetConfigurationArchiveDetailsItemsVersionsSyslogConfigEventDto(items *[]catalystcentersdkgo.ResponseItemConfigurationArchiveGetConfigurationArchiveDetailsVersionsSyslogConfigEventDto) []map[string]interface{} { - if items == nil { +func flattenDevicesGetDeviceConfigByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceConfigByIDV1) []map[string]interface{} { + if item == nil { return nil } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["user_name"] = item.UserName - respItem["device_uuid"] = item.DeviceUUID - respItem["out_of_band"] = boolPtrToString(item.OutOfBand) - respItem["config_method"] = item.ConfigMethod - respItem["terminal_name"] = item.TerminalName - respItem["login_ip_address"] = item.LoginIPAddress - respItem["process_name"] = item.ProcessName - respItem["syslog_time"] = item.SyslogTime - respItems = append(respItems, respItem) + respItem := make(map[string]interface{}) + respItem["response"] = item.Response + respItem["version"] = item.Version + return []map[string]interface{}{ + respItem, } - return respItems } diff --git a/catalystcenter/data_source_network_device_config_count.go b/catalystcenter/data_source_network_device_config_count.go index 2d89cd0..541b94d 100644 --- a/catalystcenter/data_source_network_device_config_count.go +++ b/catalystcenter/data_source_network_device_config_count.go @@ -50,26 +50,26 @@ func dataSourceNetworkDeviceConfigCountRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceConfigCount") + log.Printf("[DEBUG] Selected method: GetDeviceConfigCountV1") - response1, restyResp1, err := client.Devices.GetDeviceConfigCount() + response1, restyResp1, err := client.Devices.GetDeviceConfigCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceConfigCount", err, - "Failure at GetDeviceConfigCount, unexpected response", "")) + "Failure when executing 2 GetDeviceConfigCountV1", err, + "Failure at GetDeviceConfigCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceConfigCountItem(response1) + vItem1 := flattenDevicesGetDeviceConfigCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceConfigCount response", + "Failure when setting GetDeviceConfigCountV1 response", err)) return diags } @@ -81,7 +81,7 @@ func dataSourceNetworkDeviceConfigCountRead(ctx context.Context, d *schema.Resou return diags } -func flattenDevicesGetDeviceConfigCountItem(item *catalystcentersdkgo.ResponseDevicesGetDeviceConfigCount) []map[string]interface{} { +func flattenDevicesGetDeviceConfigCountV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceConfigCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_config_task.go b/catalystcenter/data_source_network_device_config_task.go index c88040c..18fcf7c 100644 --- a/catalystcenter/data_source_network_device_config_task.go +++ b/catalystcenter/data_source_network_device_config_task.go @@ -131,29 +131,29 @@ func dataSourceNetworkDeviceConfigTaskRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetConfigTaskDetails") - queryParams1 := catalystcentersdkgo.GetConfigTaskDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetConfigTaskDetailsV1") + queryParams1 := catalystcentersdkgo.GetConfigTaskDetailsV1QueryParams{} queryParams1.ParentTaskID = vParentTaskID.(string) - response1, restyResp1, err := client.Compliance.GetConfigTaskDetails(&queryParams1) + response1, restyResp1, err := client.Compliance.GetConfigTaskDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetConfigTaskDetails", err, - "Failure at GetConfigTaskDetails, unexpected response", "")) + "Failure when executing 2 GetConfigTaskDetailsV1", err, + "Failure at GetConfigTaskDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenComplianceGetConfigTaskDetailsItems(response1.Response) + vItems1 := flattenComplianceGetConfigTaskDetailsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetConfigTaskDetails response", + "Failure when setting GetConfigTaskDetailsV1 response", err)) return diags } @@ -165,7 +165,7 @@ func dataSourceNetworkDeviceConfigTaskRead(ctx context.Context, d *schema.Resour return diags } -func flattenComplianceGetConfigTaskDetailsItems(items *[]catalystcentersdkgo.ResponseComplianceGetConfigTaskDetailsResponse) []map[string]interface{} { +func flattenComplianceGetConfigTaskDetailsV1Items(items *[]catalystcentersdkgo.ResponseComplianceGetConfigTaskDetailsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_count.go b/catalystcenter/data_source_network_device_count.go index ba596a7..f6ebe47 100644 --- a/catalystcenter/data_source_network_device_count.go +++ b/catalystcenter/data_source_network_device_count.go @@ -101,18 +101,18 @@ func dataSourceNetworkDeviceCountRead(ctx context.Context, d *schema.ResourceDat selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceInterfaceCount") + log.Printf("[DEBUG] Selected method: GetDeviceInterfaceCountV1") vvDeviceID := vDeviceID.(string) - response1, restyResp1, err := client.Devices.GetDeviceInterfaceCount(vvDeviceID) + response1, restyResp1, err := client.Devices.GetDeviceInterfaceCountV1(vvDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceInterfaceCount", err, - "Failure at GetDeviceInterfaceCount, unexpected response", "")) + "Failure when executing 2 GetDeviceInterfaceCountV1", err, + "Failure at GetDeviceInterfaceCountV1, unexpected response", "")) return diags } @@ -120,8 +120,8 @@ func dataSourceNetworkDeviceCountRead(ctx context.Context, d *schema.ResourceDat } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetDeviceCount2") - queryParams2 := catalystcentersdkgo.GetDeviceCount2QueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceCountKnowYourNetworkV1") + queryParams2 := catalystcentersdkgo.GetDeviceCountKnowYourNetworkV1QueryParams{} if okHostname { queryParams2.Hostname = interfaceToSliceString(vHostname) @@ -136,24 +136,24 @@ func dataSourceNetworkDeviceCountRead(ctx context.Context, d *schema.ResourceDat queryParams2.LocationName = interfaceToSliceString(vLocationName) } - response2, restyResp2, err := client.Devices.GetDeviceCount2(&queryParams2) + response2, restyResp2, err := client.Devices.GetDeviceCountKnowYourNetworkV1(&queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceCount2", err, - "Failure at GetDeviceCount2, unexpected response", "")) + "Failure when executing 2 GetDeviceCountKnowYourNetworkV1", err, + "Failure at GetDeviceCountKnowYourNetworkV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetDeviceCount2Item(response2) + vItem2 := flattenDevicesGetDeviceCountKnowYourNetworkV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceCount2 response", + "Failure when setting GetDeviceCountKnowYourNetworkV1 response", err)) return diags } @@ -165,7 +165,7 @@ func dataSourceNetworkDeviceCountRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenDevicesGetDeviceCount2Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceCount2) []map[string]interface{} { +func flattenDevicesGetDeviceCountKnowYourNetworkV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceCountKnowYourNetworkV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_custom_prompt.go b/catalystcenter/data_source_network_device_custom_prompt.go index 0b0ff45..b40ac07 100644 --- a/catalystcenter/data_source_network_device_custom_prompt.go +++ b/catalystcenter/data_source_network_device_custom_prompt.go @@ -68,26 +68,26 @@ func dataSourceNetworkDeviceCustomPromptRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CustomPromptSupportGETAPI") + log.Printf("[DEBUG] Selected method: CustomPromptSupportGETAPIV1") - response1, restyResp1, err := client.SystemSettings.CustomPromptSupportGETAPI() + response1, restyResp1, err := client.SystemSettings.CustomPromptSupportGETAPIV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CustomPromptSupportGETAPI", err, - "Failure at CustomPromptSupportGETAPI, unexpected response", "")) + "Failure when executing 2 CustomPromptSupportGETAPIV1", err, + "Failure at CustomPromptSupportGETAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSystemSettingsCustomPromptSupportGETAPIItem(response1.Response) + vItem1 := flattenSystemSettingsCustomPromptSupportGETAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CustomPromptSupportGETAPI response", + "Failure when setting CustomPromptSupportGETAPIV1 response", err)) return diags } @@ -99,7 +99,7 @@ func dataSourceNetworkDeviceCustomPromptRead(ctx context.Context, d *schema.Reso return diags } -func flattenSystemSettingsCustomPromptSupportGETAPIItem(item *catalystcentersdkgo.ResponseSystemSettingsCustomPromptSupportGETAPIResponse) []map[string]interface{} { +func flattenSystemSettingsCustomPromptSupportGETAPIV1Item(item *catalystcentersdkgo.ResponseSystemSettingsCustomPromptSupportGETAPIV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_equipment.go b/catalystcenter/data_source_network_device_equipment.go index 35ef961..3573fd2 100644 --- a/catalystcenter/data_source_network_device_equipment.go +++ b/catalystcenter/data_source_network_device_equipment.go @@ -102,32 +102,32 @@ func dataSourceNetworkDeviceEquipmentRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheDetailsOfPhysicalComponentsOfTheGivenDevice") + log.Printf("[DEBUG] Selected method: GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1") vvDeviceUUID := vDeviceUUID.(string) - queryParams1 := catalystcentersdkgo.GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceQueryParams{} + queryParams1 := catalystcentersdkgo.GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1QueryParams{} if okType { queryParams1.Type = vType.(string) } - response1, restyResp1, err := client.Devices.GetTheDetailsOfPhysicalComponentsOfTheGivenDevice(vvDeviceUUID, &queryParams1) + response1, restyResp1, err := client.Devices.GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1(vvDeviceUUID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheDetailsOfPhysicalComponentsOfTheGivenDevice", err, - "Failure at GetTheDetailsOfPhysicalComponentsOfTheGivenDevice, unexpected response", "")) + "Failure when executing 2 GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1", err, + "Failure at GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetTheDetailsOfPhysicalComponentsOfTheGivenDeviceItems(response1.Response) + vItems1 := flattenDevicesGetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheDetailsOfPhysicalComponentsOfTheGivenDevice response", + "Failure when setting GetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1 response", err)) return diags } @@ -139,7 +139,7 @@ func dataSourceNetworkDeviceEquipmentRead(ctx context.Context, d *schema.Resourc return diags } -func flattenDevicesGetTheDetailsOfPhysicalComponentsOfTheGivenDeviceItems(items *[]catalystcentersdkgo.ResponseDevicesGetTheDetailsOfPhysicalComponentsOfTheGivenDeviceResponse) []map[string]interface{} { +func flattenDevicesGetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetTheDetailsOfPhysicalComponentsOfTheGivenDeviceV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_functional_capability.go b/catalystcenter/data_source_network_device_functional_capability.go index cfc4544..3a76382 100644 --- a/catalystcenter/data_source_network_device_functional_capability.go +++ b/catalystcenter/data_source_network_device_functional_capability.go @@ -239,8 +239,8 @@ func dataSourceNetworkDeviceFunctionalCapabilityRead(ctx context.Context, d *sch selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFunctionalCapabilityForDevices") - queryParams1 := catalystcentersdkgo.GetFunctionalCapabilityForDevicesQueryParams{} + log.Printf("[DEBUG] Selected method: GetFunctionalCapabilityForDevicesV1") + queryParams1 := catalystcentersdkgo.GetFunctionalCapabilityForDevicesV1QueryParams{} if okDeviceID { queryParams1.DeviceID = vDeviceID.(string) @@ -249,24 +249,24 @@ func dataSourceNetworkDeviceFunctionalCapabilityRead(ctx context.Context, d *sch queryParams1.FunctionName = interfaceToSliceString(vFunctionName) } - response1, restyResp1, err := client.Devices.GetFunctionalCapabilityForDevices(&queryParams1) + response1, restyResp1, err := client.Devices.GetFunctionalCapabilityForDevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFunctionalCapabilityForDevices", err, - "Failure at GetFunctionalCapabilityForDevices, unexpected response", "")) + "Failure when executing 2 GetFunctionalCapabilityForDevicesV1", err, + "Failure at GetFunctionalCapabilityForDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetFunctionalCapabilityForDevicesItems(response1.Response) + vItems1 := flattenDevicesGetFunctionalCapabilityForDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFunctionalCapabilityForDevices response", + "Failure when setting GetFunctionalCapabilityForDevicesV1 response", err)) return diags } @@ -276,27 +276,27 @@ func dataSourceNetworkDeviceFunctionalCapabilityRead(ctx context.Context, d *sch } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetFunctionalCapabilityByID") + log.Printf("[DEBUG] Selected method: GetFunctionalCapabilityByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Devices.GetFunctionalCapabilityByID(vvID) + response2, restyResp2, err := client.Devices.GetFunctionalCapabilityByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFunctionalCapabilityByID", err, - "Failure at GetFunctionalCapabilityByID, unexpected response", "")) + "Failure when executing 2 GetFunctionalCapabilityByIDV1", err, + "Failure at GetFunctionalCapabilityByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetFunctionalCapabilityByIDItem(response2.Response) + vItem2 := flattenDevicesGetFunctionalCapabilityByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetFunctionalCapabilityByID response", + "Failure when setting GetFunctionalCapabilityByIDV1 response", err)) return diags } @@ -308,23 +308,23 @@ func dataSourceNetworkDeviceFunctionalCapabilityRead(ctx context.Context, d *sch return diags } -func flattenDevicesGetFunctionalCapabilityForDevicesItems(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesResponse) []map[string]interface{} { +func flattenDevicesGetFunctionalCapabilityForDevicesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityForDevicesItemsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsAttributeInfo(item.AttributeInfo) respItem["device_id"] = item.DeviceID - respItem["functional_capability"] = flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapability(item.FunctionalCapability) + respItem["functional_capability"] = flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapability(item.FunctionalCapability) respItem["id"] = item.ID respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetFunctionalCapabilityForDevicesItemsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesResponseAttributeInfo) interface{} { +func flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesV1ResponseAttributeInfo) interface{} { if item == nil { return nil } @@ -334,15 +334,15 @@ func flattenDevicesGetFunctionalCapabilityForDevicesItemsAttributeInfo(item *cat } -func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapability(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesResponseFunctionalCapability) []map[string]interface{} { +func flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapability(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesV1ResponseFunctionalCapability) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityAttributeInfo(item.AttributeInfo) - respItem["function_details"] = flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityFunctionDetails(item.FunctionDetails) + respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapabilityAttributeInfo(item.AttributeInfo) + respItem["function_details"] = flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapabilityFunctionDetails(item.FunctionDetails) respItem["function_name"] = item.FunctionName respItem["function_op_state"] = item.FunctionOpState respItem["id"] = item.ID @@ -351,7 +351,7 @@ func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapability(it return respItems } -func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesResponseFunctionalCapabilityAttributeInfo) interface{} { +func flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapabilityAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesV1ResponseFunctionalCapabilityAttributeInfo) interface{} { if item == nil { return nil } @@ -361,14 +361,14 @@ func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityAtt } -func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityFunctionDetails(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesResponseFunctionalCapabilityFunctionDetails) []map[string]interface{} { +func flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapabilityFunctionDetails(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesV1ResponseFunctionalCapabilityFunctionDetails) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityFunctionDetailsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapabilityFunctionDetailsAttributeInfo(item.AttributeInfo) respItem["id"] = item.ID respItem["property_name"] = item.PropertyName respItem["string_value"] = item.StringValue @@ -377,7 +377,7 @@ func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityFun return respItems } -func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityFunctionDetailsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesResponseFunctionalCapabilityFunctionDetailsAttributeInfo) interface{} { +func flattenDevicesGetFunctionalCapabilityForDevicesV1ItemsFunctionalCapabilityFunctionDetailsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityForDevicesV1ResponseFunctionalCapabilityFunctionDetailsAttributeInfo) interface{} { if item == nil { return nil } @@ -387,13 +387,13 @@ func flattenDevicesGetFunctionalCapabilityForDevicesItemsFunctionalCapabilityFun } -func flattenDevicesGetFunctionalCapabilityByIDItem(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDResponse) []map[string]interface{} { +func flattenDevicesGetFunctionalCapabilityByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityByIDItemAttributeInfo(item.AttributeInfo) - respItem["function_details"] = flattenDevicesGetFunctionalCapabilityByIDItemFunctionDetails(item.FunctionDetails) + respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityByIDV1ItemAttributeInfo(item.AttributeInfo) + respItem["function_details"] = flattenDevicesGetFunctionalCapabilityByIDV1ItemFunctionDetails(item.FunctionDetails) respItem["function_name"] = item.FunctionName respItem["function_op_state"] = item.FunctionOpState respItem["id"] = item.ID @@ -402,7 +402,7 @@ func flattenDevicesGetFunctionalCapabilityByIDItem(item *catalystcentersdkgo.Res } } -func flattenDevicesGetFunctionalCapabilityByIDItemAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDResponseAttributeInfo) interface{} { +func flattenDevicesGetFunctionalCapabilityByIDV1ItemAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDV1ResponseAttributeInfo) interface{} { if item == nil { return nil } @@ -412,14 +412,14 @@ func flattenDevicesGetFunctionalCapabilityByIDItemAttributeInfo(item *catalystce } -func flattenDevicesGetFunctionalCapabilityByIDItemFunctionDetails(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDResponseFunctionDetails) []map[string]interface{} { +func flattenDevicesGetFunctionalCapabilityByIDV1ItemFunctionDetails(items *[]catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDV1ResponseFunctionDetails) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityByIDItemFunctionDetailsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDevicesGetFunctionalCapabilityByIDV1ItemFunctionDetailsAttributeInfo(item.AttributeInfo) respItem["id"] = item.ID respItem["property_name"] = item.PropertyName respItem["string_value"] = item.StringValue @@ -428,7 +428,7 @@ func flattenDevicesGetFunctionalCapabilityByIDItemFunctionDetails(items *[]catal return respItems } -func flattenDevicesGetFunctionalCapabilityByIDItemFunctionDetailsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDResponseFunctionDetailsAttributeInfo) interface{} { +func flattenDevicesGetFunctionalCapabilityByIDV1ItemFunctionDetailsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetFunctionalCapabilityByIDV1ResponseFunctionDetailsAttributeInfo) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_global_polling_interval.go b/catalystcenter/data_source_network_device_global_polling_interval.go index ed471f6..e58236e 100644 --- a/catalystcenter/data_source_network_device_global_polling_interval.go +++ b/catalystcenter/data_source_network_device_global_polling_interval.go @@ -50,26 +50,26 @@ func dataSourceNetworkDeviceGlobalPollingIntervalRead(ctx context.Context, d *sc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPollingIntervalForAllDevices") + log.Printf("[DEBUG] Selected method: GetPollingIntervalForAllDevicesV1") - response1, restyResp1, err := client.Devices.GetPollingIntervalForAllDevices() + response1, restyResp1, err := client.Devices.GetPollingIntervalForAllDevicesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPollingIntervalForAllDevices", err, - "Failure at GetPollingIntervalForAllDevices, unexpected response", "")) + "Failure when executing 2 GetPollingIntervalForAllDevicesV1", err, + "Failure at GetPollingIntervalForAllDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetPollingIntervalForAllDevicesItem(response1) + vItem1 := flattenDevicesGetPollingIntervalForAllDevicesV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPollingIntervalForAllDevices response", + "Failure when setting GetPollingIntervalForAllDevicesV1 response", err)) return diags } @@ -81,7 +81,7 @@ func dataSourceNetworkDeviceGlobalPollingIntervalRead(ctx context.Context, d *sc return diags } -func flattenDevicesGetPollingIntervalForAllDevicesItem(item *catalystcentersdkgo.ResponseDevicesGetPollingIntervalForAllDevices) []map[string]interface{} { +func flattenDevicesGetPollingIntervalForAllDevicesV1Item(item *catalystcentersdkgo.ResponseDevicesGetPollingIntervalForAllDevicesV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_image_updates.go b/catalystcenter/data_source_network_device_image_updates.go index 7c38fe3..d5437b8 100644 --- a/catalystcenter/data_source_network_device_image_updates.go +++ b/catalystcenter/data_source_network_device_image_updates.go @@ -201,8 +201,8 @@ func dataSourceNetworkDeviceImageUpdatesRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetworkDeviceImageUpdates") - queryParams1 := catalystcentersdkgo.GetNetworkDeviceImageUpdatesQueryParams{} + log.Printf("[DEBUG] Selected method: GetNetworkDeviceImageUpdatesV1") + queryParams1 := catalystcentersdkgo.GetNetworkDeviceImageUpdatesV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -244,24 +244,24 @@ func dataSourceNetworkDeviceImageUpdatesRead(ctx context.Context, d *schema.Reso queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.GetNetworkDeviceImageUpdates(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.GetNetworkDeviceImageUpdatesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetworkDeviceImageUpdates", err, - "Failure at GetNetworkDeviceImageUpdates, unexpected response", "")) + "Failure when executing 2 GetNetworkDeviceImageUpdatesV1", err, + "Failure at GetNetworkDeviceImageUpdatesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimGetNetworkDeviceImageUpdatesItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimGetNetworkDeviceImageUpdatesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetworkDeviceImageUpdates response", + "Failure when setting GetNetworkDeviceImageUpdatesV1 response", err)) return diags } @@ -273,7 +273,7 @@ func dataSourceNetworkDeviceImageUpdatesRead(ctx context.Context, d *schema.Reso return diags } -func flattenSoftwareImageManagementSwimGetNetworkDeviceImageUpdatesItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetNetworkDeviceImageUpdatesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetNetworkDeviceImageUpdatesV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetNetworkDeviceImageUpdatesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_image_updates_count.go b/catalystcenter/data_source_network_device_image_updates_count.go index bc1cfde..0880df0 100644 --- a/catalystcenter/data_source_network_device_image_updates_count.go +++ b/catalystcenter/data_source_network_device_image_updates_count.go @@ -110,8 +110,8 @@ func dataSourceNetworkDeviceImageUpdatesCountRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CountOfNetworkDeviceImageUpdates") - queryParams1 := catalystcentersdkgo.CountOfNetworkDeviceImageUpdatesQueryParams{} + log.Printf("[DEBUG] Selected method: CountOfNetworkDeviceImageUpdatesV1") + queryParams1 := catalystcentersdkgo.CountOfNetworkDeviceImageUpdatesV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -141,24 +141,24 @@ func dataSourceNetworkDeviceImageUpdatesCountRead(ctx context.Context, d *schema queryParams1.EndTime = vEndTime.(float64) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.CountOfNetworkDeviceImageUpdates(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.CountOfNetworkDeviceImageUpdatesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CountOfNetworkDeviceImageUpdates", err, - "Failure at CountOfNetworkDeviceImageUpdates, unexpected response", "")) + "Failure when executing 2 CountOfNetworkDeviceImageUpdatesV1", err, + "Failure at CountOfNetworkDeviceImageUpdatesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimCountOfNetworkDeviceImageUpdatesItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimCountOfNetworkDeviceImageUpdatesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountOfNetworkDeviceImageUpdates response", + "Failure when setting CountOfNetworkDeviceImageUpdatesV1 response", err)) return diags } @@ -170,7 +170,7 @@ func dataSourceNetworkDeviceImageUpdatesCountRead(ctx context.Context, d *schema return diags } -func flattenSoftwareImageManagementSwimCountOfNetworkDeviceImageUpdatesItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimCountOfNetworkDeviceImageUpdatesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimCountOfNetworkDeviceImageUpdatesV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimCountOfNetworkDeviceImageUpdatesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_interface_neighbor.go b/catalystcenter/data_source_network_device_interface_neighbor.go index dfe7c7d..3394888 100644 --- a/catalystcenter/data_source_network_device_interface_neighbor.go +++ b/catalystcenter/data_source_network_device_interface_neighbor.go @@ -78,28 +78,28 @@ func dataSourceNetworkDeviceInterfaceNeighborRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetConnectedDeviceDetail") + log.Printf("[DEBUG] Selected method: GetConnectedDeviceDetailV1") vvDeviceUUID := vDeviceUUID.(string) vvInterfaceUUID := vInterfaceUUID.(string) - response1, restyResp1, err := client.Devices.GetConnectedDeviceDetail(vvDeviceUUID, vvInterfaceUUID) + response1, restyResp1, err := client.Devices.GetConnectedDeviceDetailV1(vvDeviceUUID, vvInterfaceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetConnectedDeviceDetail", err, - "Failure at GetConnectedDeviceDetail, unexpected response", "")) + "Failure when executing 2 GetConnectedDeviceDetailV1", err, + "Failure at GetConnectedDeviceDetailV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetConnectedDeviceDetailItem(response1.Response) + vItem1 := flattenDevicesGetConnectedDeviceDetailV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetConnectedDeviceDetail response", + "Failure when setting GetConnectedDeviceDetailV1 response", err)) return diags } @@ -111,7 +111,7 @@ func dataSourceNetworkDeviceInterfaceNeighborRead(ctx context.Context, d *schema return diags } -func flattenDevicesGetConnectedDeviceDetailItem(item *catalystcentersdkgo.ResponseDevicesGetConnectedDeviceDetailResponse) []map[string]interface{} { +func flattenDevicesGetConnectedDeviceDetailV1Item(item *catalystcentersdkgo.ResponseDevicesGetConnectedDeviceDetailV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_interface_poe.go b/catalystcenter/data_source_network_device_interface_poe.go index 55be360..7c6cf60 100644 --- a/catalystcenter/data_source_network_device_interface_poe.go +++ b/catalystcenter/data_source_network_device_interface_poe.go @@ -97,32 +97,32 @@ func dataSourceNetworkDeviceInterfacePoeRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsPoeInterfaceDetailsForTheDevice") + log.Printf("[DEBUG] Selected method: ReturnsPoeInterfaceDetailsForTheDeviceV1") vvDeviceUUID := vDeviceUUID.(string) - queryParams1 := catalystcentersdkgo.ReturnsPoeInterfaceDetailsForTheDeviceQueryParams{} + queryParams1 := catalystcentersdkgo.ReturnsPoeInterfaceDetailsForTheDeviceV1QueryParams{} if okInterfaceNameList { queryParams1.InterfaceNameList = vInterfaceNameList.(string) } - response1, restyResp1, err := client.Devices.ReturnsPoeInterfaceDetailsForTheDevice(vvDeviceUUID, &queryParams1) + response1, restyResp1, err := client.Devices.ReturnsPoeInterfaceDetailsForTheDeviceV1(vvDeviceUUID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsPoeInterfaceDetailsForTheDevice", err, - "Failure at ReturnsPoeInterfaceDetailsForTheDevice, unexpected response", "")) + "Failure when executing 2 ReturnsPoeInterfaceDetailsForTheDeviceV1", err, + "Failure at ReturnsPoeInterfaceDetailsForTheDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesReturnsPoeInterfaceDetailsForTheDeviceItems(response1.Response) + vItems1 := flattenDevicesReturnsPoeInterfaceDetailsForTheDeviceV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsPoeInterfaceDetailsForTheDevice response", + "Failure when setting ReturnsPoeInterfaceDetailsForTheDeviceV1 response", err)) return diags } @@ -134,7 +134,7 @@ func dataSourceNetworkDeviceInterfacePoeRead(ctx context.Context, d *schema.Reso return diags } -func flattenDevicesReturnsPoeInterfaceDetailsForTheDeviceItems(items *[]catalystcentersdkgo.ResponseDevicesReturnsPoeInterfaceDetailsForTheDeviceResponse) []map[string]interface{} { +func flattenDevicesReturnsPoeInterfaceDetailsForTheDeviceV1Items(items *[]catalystcentersdkgo.ResponseDevicesReturnsPoeInterfaceDetailsForTheDeviceV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_inventory_insight_link_mismatch.go b/catalystcenter/data_source_network_device_inventory_insight_link_mismatch.go index 2ff9b7f..07f37a5 100644 --- a/catalystcenter/data_source_network_device_inventory_insight_link_mismatch.go +++ b/catalystcenter/data_source_network_device_inventory_insight_link_mismatch.go @@ -298,9 +298,9 @@ func dataSourceNetworkDeviceInventoryInsightLinkMismatchRead(ctx context.Context selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: InventoryInsightDeviceLinkMismatchAPI") + log.Printf("[DEBUG] Selected method: InventoryInsightDeviceLinkMismatchAPIV1") vvSiteID := vSiteID.(string) - queryParams1 := catalystcentersdkgo.InventoryInsightDeviceLinkMismatchAPIQueryParams{} + queryParams1 := catalystcentersdkgo.InventoryInsightDeviceLinkMismatchAPIV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(int) @@ -317,24 +317,24 @@ func dataSourceNetworkDeviceInventoryInsightLinkMismatchRead(ctx context.Context queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.Devices.InventoryInsightDeviceLinkMismatchAPI(vvSiteID, &queryParams1) + response1, restyResp1, err := client.Devices.InventoryInsightDeviceLinkMismatchAPIV1(vvSiteID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 InventoryInsightDeviceLinkMismatchAPI", err, - "Failure at InventoryInsightDeviceLinkMismatchAPI, unexpected response", "")) + "Failure when executing 2 InventoryInsightDeviceLinkMismatchAPIV1", err, + "Failure at InventoryInsightDeviceLinkMismatchAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesInventoryInsightDeviceLinkMismatchAPIItems(response1.Response) + vItems1 := flattenDevicesInventoryInsightDeviceLinkMismatchAPIV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting InventoryInsightDeviceLinkMismatchAPI response", + "Failure when setting InventoryInsightDeviceLinkMismatchAPIV1 response", err)) return diags } @@ -346,7 +346,7 @@ func dataSourceNetworkDeviceInventoryInsightLinkMismatchRead(ctx context.Context return diags } -func flattenDevicesInventoryInsightDeviceLinkMismatchAPIItems(items *[]catalystcentersdkgo.ResponseDevicesInventoryInsightDeviceLinkMismatchApIResponse) []map[string]interface{} { +func flattenDevicesInventoryInsightDeviceLinkMismatchAPIV1Items(items *[]catalystcentersdkgo.ResponseDevicesInventoryInsightDeviceLinkMismatchAPIV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_ip_address.go b/catalystcenter/data_source_network_device_ip_address.go index 6a0bee6..4f68d23 100644 --- a/catalystcenter/data_source_network_device_ip_address.go +++ b/catalystcenter/data_source_network_device_ip_address.go @@ -405,27 +405,27 @@ func dataSourceNetworkDeviceIPAddressRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetworkDeviceByIP") + log.Printf("[DEBUG] Selected method: GetNetworkDeviceByIPV1") vvIPAddress := vIPAddress.(string) - response1, restyResp1, err := client.Devices.GetNetworkDeviceByIP(vvIPAddress) + response1, restyResp1, err := client.Devices.GetNetworkDeviceByIPV1(vvIPAddress) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetworkDeviceByIP", err, - "Failure at GetNetworkDeviceByIP, unexpected response", "")) + "Failure when executing 2 GetNetworkDeviceByIPV1", err, + "Failure at GetNetworkDeviceByIPV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetNetworkDeviceByIPItem(response1.Response) + vItem1 := flattenDevicesGetNetworkDeviceByIPV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetworkDeviceByIP response", + "Failure when setting GetNetworkDeviceByIPV1 response", err)) return diags } @@ -437,7 +437,7 @@ func dataSourceNetworkDeviceIPAddressRead(ctx context.Context, d *schema.Resourc return diags } -func flattenDevicesGetNetworkDeviceByIPItem(item *catalystcentersdkgo.ResponseDevicesGetNetworkDeviceByIPResponse) []map[string]interface{} { +func flattenDevicesGetNetworkDeviceByIPV1Item(item *catalystcentersdkgo.ResponseDevicesGetNetworkDeviceByIPV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_lexicographically_sorted.go b/catalystcenter/data_source_network_device_lexicographically_sorted.go index 8cbcf17..e7aecb2 100644 --- a/catalystcenter/data_source_network_device_lexicographically_sorted.go +++ b/catalystcenter/data_source_network_device_lexicographically_sorted.go @@ -181,8 +181,8 @@ func dataSourceNetworkDeviceLexicographicallySortedRead(ctx context.Context, d * selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute") - queryParams1 := catalystcentersdkgo.GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeV1") + queryParams1 := catalystcentersdkgo.GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeV1QueryParams{} if okVrfName { queryParams1.VrfName = vVrfName.(string) @@ -251,13 +251,12 @@ func dataSourceNetworkDeviceLexicographicallySortedRead(ctx context.Context, d * queryParams1.Limit = vLimit.(int) } - response1, err := client.Devices.GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute(&queryParams1) + response1, err := client.Devices.GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeV1(&queryParams1) if err != nil || response1 == nil { - diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute", err, - "Failure at GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute, unexpected response", "")) + "Failure when executing 2 GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeV1", err, + "Failure at GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeV1, unexpected response", "")) return diags } @@ -266,7 +265,7 @@ func dataSourceNetworkDeviceLexicographicallySortedRead(ctx context.Context, d * vItem1 := response1.String() if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute response", + "Failure when setting GetDeviceValuesThatMatchFullyOrPartiallyAnAttributeV1 response", err)) return diags } diff --git a/catalystcenter/data_source_network_device_linecard_details.go b/catalystcenter/data_source_network_device_linecard_details.go index 74a14fa..560ee6b 100644 --- a/catalystcenter/data_source_network_device_linecard_details.go +++ b/catalystcenter/data_source_network_device_linecard_details.go @@ -75,27 +75,27 @@ func dataSourceNetworkDeviceLinecardDetailsRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetLinecardDetails") + log.Printf("[DEBUG] Selected method: GetLinecardDetailsV1") vvDeviceUUID := vDeviceUUID.(string) - response1, restyResp1, err := client.Devices.GetLinecardDetails(vvDeviceUUID) + response1, restyResp1, err := client.Devices.GetLinecardDetailsV1(vvDeviceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetLinecardDetails", err, - "Failure at GetLinecardDetails, unexpected response", "")) + "Failure when executing 2 GetLinecardDetailsV1", err, + "Failure at GetLinecardDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetLinecardDetailsItems(response1.Response) + vItems1 := flattenDevicesGetLinecardDetailsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetLinecardDetails response", + "Failure when setting GetLinecardDetailsV1 response", err)) return diags } @@ -107,7 +107,7 @@ func dataSourceNetworkDeviceLinecardDetailsRead(ctx context.Context, d *schema.R return diags } -func flattenDevicesGetLinecardDetailsItems(items *[]catalystcentersdkgo.ResponseDevicesGetLinecardDetailsResponse) []map[string]interface{} { +func flattenDevicesGetLinecardDetailsV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetLinecardDetailsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_list.go b/catalystcenter/data_source_network_device_list.go index 4ea9db2..5de3c88 100644 --- a/catalystcenter/data_source_network_device_list.go +++ b/catalystcenter/data_source_network_device_list.go @@ -707,8 +707,8 @@ func dataSourceNetworkDeviceListRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceList") - queryParams1 := catalystcentersdkgo.GetDeviceListQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceListV1") + queryParams1 := catalystcentersdkgo.GetDeviceListV1QueryParams{} if okHostname { queryParams1.Hostname = interfaceToSliceString(vHostname) @@ -813,24 +813,24 @@ func dataSourceNetworkDeviceListRead(ctx context.Context, d *schema.ResourceData queryParams1.Limit = vLimit.(int) } - response1, restyResp1, err := client.Devices.GetDeviceList(&queryParams1) + response1, restyResp1, err := client.Devices.GetDeviceListV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceList", err, - "Failure at GetDeviceList, unexpected response", "")) + "Failure when executing 2 GetDeviceListV1", err, + "Failure at GetDeviceListV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetDeviceListItems(response1.Response) + vItems1 := flattenDevicesGetDeviceListV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceList response", + "Failure when setting GetDeviceListV1 response", err)) return diags } @@ -842,7 +842,7 @@ func dataSourceNetworkDeviceListRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenDevicesGetDeviceListItems(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceListResponse) []map[string]interface{} { +func flattenDevicesGetDeviceListV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceListV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_meraki_organization.go b/catalystcenter/data_source_network_device_meraki_organization.go index 7eca942..ec67b7d 100644 --- a/catalystcenter/data_source_network_device_meraki_organization.go +++ b/catalystcenter/data_source_network_device_meraki_organization.go @@ -60,27 +60,27 @@ func dataSourceNetworkDeviceMerakiOrganizationRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetOrganizationListForMeraki") + log.Printf("[DEBUG] Selected method: GetOrganizationListForMerakiV1") vvID := vID.(string) - response1, restyResp1, err := client.Devices.GetOrganizationListForMeraki(vvID) + response1, restyResp1, err := client.Devices.GetOrganizationListForMerakiV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetOrganizationListForMeraki", err, - "Failure at GetOrganizationListForMeraki, unexpected response", "")) + "Failure when executing 2 GetOrganizationListForMerakiV1", err, + "Failure at GetOrganizationListForMerakiV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetOrganizationListForMerakiItems(response1) + vItems1 := flattenDevicesGetOrganizationListForMerakiV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetOrganizationListForMeraki response", + "Failure when setting GetOrganizationListForMerakiV1 response", err)) return diags } @@ -92,7 +92,7 @@ func dataSourceNetworkDeviceMerakiOrganizationRead(ctx context.Context, d *schem return diags } -func flattenDevicesGetOrganizationListForMerakiItems(items *catalystcentersdkgo.ResponseDevicesGetOrganizationListForMeraki) []map[string]interface{} { +func flattenDevicesGetOrganizationListForMerakiV1Items(items *catalystcentersdkgo.ResponseDevicesGetOrganizationListForMerakiV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_module.go b/catalystcenter/data_source_network_device_module.go index f7a2259..6adaf39 100644 --- a/catalystcenter/data_source_network_device_module.go +++ b/catalystcenter/data_source_network_device_module.go @@ -341,8 +341,8 @@ func dataSourceNetworkDeviceModuleRead(ctx context.Context, d *schema.ResourceDa selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetModules") - queryParams1 := catalystcentersdkgo.GetModulesQueryParams{} + log.Printf("[DEBUG] Selected method: GetModulesV1") + queryParams1 := catalystcentersdkgo.GetModulesV1QueryParams{} if okDeviceID { queryParams1.DeviceID = vDeviceID.(string) @@ -366,24 +366,24 @@ func dataSourceNetworkDeviceModuleRead(ctx context.Context, d *schema.ResourceDa queryParams1.OperationalStateCodeList = interfaceToSliceString(vOperationalStateCodeList) } - response1, restyResp1, err := client.Devices.GetModules(&queryParams1) + response1, restyResp1, err := client.Devices.GetModulesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetModules", err, - "Failure at GetModules, unexpected response", "")) + "Failure when executing 2 GetModulesV1", err, + "Failure at GetModulesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetModulesItems(response1.Response) + vItems1 := flattenDevicesGetModulesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetModules response", + "Failure when setting GetModulesV1 response", err)) return diags } @@ -393,27 +393,27 @@ func dataSourceNetworkDeviceModuleRead(ctx context.Context, d *schema.ResourceDa } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetModuleInfoByID") + log.Printf("[DEBUG] Selected method: GetModuleInfoByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Devices.GetModuleInfoByID(vvID) + response2, restyResp2, err := client.Devices.GetModuleInfoByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetModuleInfoByID", err, - "Failure at GetModuleInfoByID, unexpected response", "")) + "Failure when executing 2 GetModuleInfoByIDV1", err, + "Failure at GetModuleInfoByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetModuleInfoByIDItem(response2.Response) + vItem2 := flattenDevicesGetModuleInfoByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetModuleInfoByID response", + "Failure when setting GetModuleInfoByIDV1 response", err)) return diags } @@ -425,7 +425,7 @@ func dataSourceNetworkDeviceModuleRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenDevicesGetModulesItems(items *[]catalystcentersdkgo.ResponseDevicesGetModulesResponse) []map[string]interface{} { +func flattenDevicesGetModulesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetModulesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -434,7 +434,7 @@ func flattenDevicesGetModulesItems(items *[]catalystcentersdkgo.ResponseDevicesG respItem := make(map[string]interface{}) respItem["assembly_number"] = item.AssemblyNumber respItem["assembly_revision"] = item.AssemblyRevision - respItem["attribute_info"] = flattenDevicesGetModulesItemsAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDevicesGetModulesV1ItemsAttributeInfo(item.AttributeInfo) respItem["containment_entity"] = item.ContainmentEntity respItem["description"] = item.Description respItem["entity_physical_index"] = item.EntityPhysicalIndex @@ -453,7 +453,7 @@ func flattenDevicesGetModulesItems(items *[]catalystcentersdkgo.ResponseDevicesG return respItems } -func flattenDevicesGetModulesItemsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetModulesResponseAttributeInfo) interface{} { +func flattenDevicesGetModulesV1ItemsAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetModulesV1ResponseAttributeInfo) interface{} { if item == nil { return nil } @@ -463,14 +463,14 @@ func flattenDevicesGetModulesItemsAttributeInfo(item *catalystcentersdkgo.Respon } -func flattenDevicesGetModuleInfoByIDItem(item *catalystcentersdkgo.ResponseDevicesGetModuleInfoByIDResponse) []map[string]interface{} { +func flattenDevicesGetModuleInfoByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetModuleInfoByIDV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["assembly_number"] = item.AssemblyNumber respItem["assembly_revision"] = item.AssemblyRevision - respItem["attribute_info"] = flattenDevicesGetModuleInfoByIDItemAttributeInfo(item.AttributeInfo) + respItem["attribute_info"] = flattenDevicesGetModuleInfoByIDV1ItemAttributeInfo(item.AttributeInfo) respItem["containment_entity"] = item.ContainmentEntity respItem["description"] = item.Description respItem["entity_physical_index"] = item.EntityPhysicalIndex @@ -489,7 +489,7 @@ func flattenDevicesGetModuleInfoByIDItem(item *catalystcentersdkgo.ResponseDevic } } -func flattenDevicesGetModuleInfoByIDItemAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetModuleInfoByIDResponseAttributeInfo) interface{} { +func flattenDevicesGetModuleInfoByIDV1ItemAttributeInfo(item *catalystcentersdkgo.ResponseDevicesGetModuleInfoByIDV1ResponseAttributeInfo) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_module_count.go b/catalystcenter/data_source_network_device_module_count.go index 17f647b..e646e32 100644 --- a/catalystcenter/data_source_network_device_module_count.go +++ b/catalystcenter/data_source_network_device_module_count.go @@ -92,8 +92,8 @@ func dataSourceNetworkDeviceModuleCountRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetModuleCount") - queryParams1 := catalystcentersdkgo.GetModuleCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetModuleCountV1") + queryParams1 := catalystcentersdkgo.GetModuleCountV1QueryParams{} queryParams1.DeviceID = vDeviceID.(string) @@ -110,24 +110,24 @@ func dataSourceNetworkDeviceModuleCountRead(ctx context.Context, d *schema.Resou queryParams1.OperationalStateCodeList = interfaceToSliceString(vOperationalStateCodeList) } - response1, restyResp1, err := client.Devices.GetModuleCount(&queryParams1) + response1, restyResp1, err := client.Devices.GetModuleCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetModuleCount", err, - "Failure at GetModuleCount, unexpected response", "")) + "Failure when executing 2 GetModuleCountV1", err, + "Failure at GetModuleCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetModuleCountItem(response1) + vItem1 := flattenDevicesGetModuleCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetModuleCount response", + "Failure when setting GetModuleCountV1 response", err)) return diags } @@ -139,7 +139,7 @@ func dataSourceNetworkDeviceModuleCountRead(ctx context.Context, d *schema.Resou return diags } -func flattenDevicesGetModuleCountItem(item *catalystcentersdkgo.ResponseDevicesGetModuleCount) []map[string]interface{} { +func flattenDevicesGetModuleCountV1Item(item *catalystcentersdkgo.ResponseDevicesGetModuleCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_poe.go b/catalystcenter/data_source_network_device_poe.go index 91a100b..ecdb3d1 100644 --- a/catalystcenter/data_source_network_device_poe.go +++ b/catalystcenter/data_source_network_device_poe.go @@ -68,27 +68,27 @@ func dataSourceNetworkDevicePoeRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: PoeDetails") + log.Printf("[DEBUG] Selected method: PoeDetailsV1") vvDeviceUUID := vDeviceUUID.(string) - response1, restyResp1, err := client.Devices.PoeDetails(vvDeviceUUID) + response1, restyResp1, err := client.Devices.PoeDetailsV1(vvDeviceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 PoeDetails", err, - "Failure at PoeDetails, unexpected response", "")) + "Failure when executing 2 PoeDetailsV1", err, + "Failure at PoeDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesPoeDetailsItem(response1.Response) + vItem1 := flattenDevicesPoeDetailsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting PoeDetails response", + "Failure when setting PoeDetailsV1 response", err)) return diags } @@ -100,7 +100,7 @@ func dataSourceNetworkDevicePoeRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDevicesPoeDetailsItem(item *catalystcentersdkgo.ResponseDevicesPoeDetailsResponse) []map[string]interface{} { +func flattenDevicesPoeDetailsV1Item(item *catalystcentersdkgo.ResponseDevicesPoeDetailsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_polling_interval.go b/catalystcenter/data_source_network_device_polling_interval.go index a92a36d..3dcfc40 100644 --- a/catalystcenter/data_source_network_device_polling_interval.go +++ b/catalystcenter/data_source_network_device_polling_interval.go @@ -57,27 +57,27 @@ func dataSourceNetworkDevicePollingIntervalRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPollingIntervalByID") + log.Printf("[DEBUG] Selected method: GetPollingIntervalByIDV1") vvID := vID.(string) - response1, restyResp1, err := client.Devices.GetPollingIntervalByID(vvID) + response1, restyResp1, err := client.Devices.GetPollingIntervalByIDV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPollingIntervalByID", err, - "Failure at GetPollingIntervalByID, unexpected response", "")) + "Failure when executing 2 GetPollingIntervalByIDV1", err, + "Failure at GetPollingIntervalByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetPollingIntervalByIDItem(response1) + vItem1 := flattenDevicesGetPollingIntervalByIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPollingIntervalByID response", + "Failure when setting GetPollingIntervalByIDV1 response", err)) return diags } @@ -89,7 +89,7 @@ func dataSourceNetworkDevicePollingIntervalRead(ctx context.Context, d *schema.R return diags } -func flattenDevicesGetPollingIntervalByIDItem(item *catalystcentersdkgo.ResponseDevicesGetPollingIntervalByID) []map[string]interface{} { +func flattenDevicesGetPollingIntervalByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetPollingIntervalByIDV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_range.go b/catalystcenter/data_source_network_device_range.go index 8ea91ac..54ffb17 100644 --- a/catalystcenter/data_source_network_device_range.go +++ b/catalystcenter/data_source_network_device_range.go @@ -413,28 +413,28 @@ func dataSourceNetworkDeviceRangeRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetworkDeviceByPaginationRange") + log.Printf("[DEBUG] Selected method: GetNetworkDeviceByPaginationRangeV1") vvStartIndex := vStartIndex.(int) vvRecordsToReturn := vRecordsToReturn.(int) - response1, restyResp1, err := client.Devices.GetNetworkDeviceByPaginationRange(vvStartIndex, vvRecordsToReturn) + response1, restyResp1, err := client.Devices.GetNetworkDeviceByPaginationRangeV1(vvStartIndex, vvRecordsToReturn) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetworkDeviceByPaginationRange", err, - "Failure at GetNetworkDeviceByPaginationRange, unexpected response", "")) + "Failure when executing 2 GetNetworkDeviceByPaginationRangeV1", err, + "Failure at GetNetworkDeviceByPaginationRangeV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetNetworkDeviceByPaginationRangeItems(response1.Response) + vItems1 := flattenDevicesGetNetworkDeviceByPaginationRangeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetworkDeviceByPaginationRange response", + "Failure when setting GetNetworkDeviceByPaginationRangeV1 response", err)) return diags } @@ -446,7 +446,7 @@ func dataSourceNetworkDeviceRangeRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenDevicesGetNetworkDeviceByPaginationRangeItems(items *[]catalystcentersdkgo.ResponseDevicesGetNetworkDeviceByPaginationRangeResponse) []map[string]interface{} { +func flattenDevicesGetNetworkDeviceByPaginationRangeV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetNetworkDeviceByPaginationRangeV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_register_for_wsa.go b/catalystcenter/data_source_network_device_register_for_wsa.go index 8dc0399..c4f4383 100644 --- a/catalystcenter/data_source_network_device_register_for_wsa.go +++ b/catalystcenter/data_source_network_device_register_for_wsa.go @@ -90,8 +90,8 @@ func dataSourceNetworkDeviceRegisterForWsaRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDevicesRegisteredForWsaNotification") - queryParams1 := catalystcentersdkgo.GetDevicesRegisteredForWsaNotificationQueryParams{} + log.Printf("[DEBUG] Selected method: GetDevicesRegisteredForWsaNotificationV1") + queryParams1 := catalystcentersdkgo.GetDevicesRegisteredForWsaNotificationV1QueryParams{} if okSerialNumber { queryParams1.SerialNumber = vSerialNumber.(string) @@ -100,24 +100,24 @@ func dataSourceNetworkDeviceRegisterForWsaRead(ctx context.Context, d *schema.Re queryParams1.Macaddress = vMacaddress.(string) } - response1, restyResp1, err := client.Devices.GetDevicesRegisteredForWsaNotification(&queryParams1) + response1, restyResp1, err := client.Devices.GetDevicesRegisteredForWsaNotificationV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDevicesRegisteredForWsaNotification", err, - "Failure at GetDevicesRegisteredForWsaNotification, unexpected response", "")) + "Failure when executing 2 GetDevicesRegisteredForWsaNotificationV1", err, + "Failure at GetDevicesRegisteredForWsaNotificationV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDevicesRegisteredForWsaNotificationItem(response1.Response) + vItem1 := flattenDevicesGetDevicesRegisteredForWsaNotificationV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDevicesRegisteredForWsaNotification response", + "Failure when setting GetDevicesRegisteredForWsaNotificationV1 response", err)) return diags } @@ -129,7 +129,7 @@ func dataSourceNetworkDeviceRegisterForWsaRead(ctx context.Context, d *schema.Re return diags } -func flattenDevicesGetDevicesRegisteredForWsaNotificationItem(item *catalystcentersdkgo.ResponseDevicesGetDevicesRegisteredForWsaNotificationResponse) []map[string]interface{} { +func flattenDevicesGetDevicesRegisteredForWsaNotificationV1Item(item *catalystcentersdkgo.ResponseDevicesGetDevicesRegisteredForWsaNotificationV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_stack_details.go b/catalystcenter/data_source_network_device_stack_details.go index e58cb6d..1fbf2f5 100644 --- a/catalystcenter/data_source_network_device_stack_details.go +++ b/catalystcenter/data_source_network_device_stack_details.go @@ -358,27 +358,27 @@ func dataSourceNetworkDeviceStackDetailsRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetStackDetailsForDevice") + log.Printf("[DEBUG] Selected method: GetStackDetailsForDeviceV1") vvDeviceID := vDeviceID.(string) - response1, restyResp1, err := client.Devices.GetStackDetailsForDevice(vvDeviceID) + response1, restyResp1, err := client.Devices.GetStackDetailsForDeviceV1(vvDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetStackDetailsForDevice", err, - "Failure at GetStackDetailsForDevice, unexpected response", "")) + "Failure when executing 2 GetStackDetailsForDeviceV1", err, + "Failure at GetStackDetailsForDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetStackDetailsForDeviceItem(response1.Response) + vItem1 := flattenDevicesGetStackDetailsForDeviceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetStackDetailsForDevice response", + "Failure when setting GetStackDetailsForDeviceV1 response", err)) return diags } @@ -390,21 +390,21 @@ func dataSourceNetworkDeviceStackDetailsRead(ctx context.Context, d *schema.Reso return diags } -func flattenDevicesGetStackDetailsForDeviceItem(item *catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponse) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1Item(item *catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["device_id"] = item.DeviceID - respItem["stack_port_info"] = flattenDevicesGetStackDetailsForDeviceItemStackPortInfo(item.StackPortInfo) - respItem["stack_switch_info"] = flattenDevicesGetStackDetailsForDeviceItemStackSwitchInfo(item.StackSwitchInfo) - respItem["svl_switch_info"] = flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfo(item.SvlSwitchInfo) + respItem["stack_port_info"] = flattenDevicesGetStackDetailsForDeviceV1ItemStackPortInfo(item.StackPortInfo) + respItem["stack_switch_info"] = flattenDevicesGetStackDetailsForDeviceV1ItemStackSwitchInfo(item.StackSwitchInfo) + respItem["svl_switch_info"] = flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfo(item.SvlSwitchInfo) return []map[string]interface{}{ respItem, } } -func flattenDevicesGetStackDetailsForDeviceItemStackPortInfo(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseStackPortInfo) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemStackPortInfo(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseStackPortInfo) []map[string]interface{} { if items == nil { return nil } @@ -425,7 +425,7 @@ func flattenDevicesGetStackDetailsForDeviceItemStackPortInfo(items *[]catalystce return respItems } -func flattenDevicesGetStackDetailsForDeviceItemStackSwitchInfo(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseStackSwitchInfo) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemStackSwitchInfo(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseStackSwitchInfo) []map[string]interface{} { if items == nil { return nil } @@ -448,7 +448,7 @@ func flattenDevicesGetStackDetailsForDeviceItemStackSwitchInfo(items *[]catalyst return respItems } -func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfo(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseSvlSwitchInfo) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfo(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseSvlSwitchInfo) []map[string]interface{} { if items == nil { return nil } @@ -460,13 +460,13 @@ func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfo(items *[]catalystce respItem["domain_number"] = item.DomainNumber respItem["in_dad_recovery_mode"] = boolPtrToString(item.InDadRecoveryMode) respItem["sw_virtual_status"] = item.SwVirtualStatus - respItem["switch_members"] = flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembers(item.SwitchMembers) + respItem["switch_members"] = flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembers(item.SwitchMembers) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembers(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseSvlSwitchInfoSwitchMembers) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembers(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseSvlSwitchInfoSwitchMembers) []map[string]interface{} { if items == nil { return nil } @@ -474,22 +474,22 @@ func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembers(items for _, item := range *items { respItem := make(map[string]interface{}) respItem["bandwidth"] = item.Bandwidth - respItem["svl_member_end_points"] = flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemberEndPoints(item.SvlMemberEndPoints) + respItem["svl_member_end_points"] = flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembersSvlMemberEndPoints(item.SvlMemberEndPoints) respItem["svl_member_number"] = item.SvlMemberNumber - respItem["svl_member_pep_settings"] = flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemberPepSettings(item.SvlMemberPepSettings) + respItem["svl_member_pep_settings"] = flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembersSvlMemberPepSettings(item.SvlMemberPepSettings) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemberEndPoints(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseSvlSwitchInfoSwitchMembersSvlMemberEndPoints) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembersSvlMemberEndPoints(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseSvlSwitchInfoSwitchMembersSvlMemberEndPoints) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["svl_member_end_point_ports"] = flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemberEndPointsSvlMemberEndPointPorts(item.SvlMemberEndPointPorts) + respItem["svl_member_end_point_ports"] = flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembersSvlMemberEndPointsSvlMemberEndPointPorts(item.SvlMemberEndPointPorts) respItem["svl_number"] = item.SvlNumber respItem["svl_status"] = item.SvlStatus respItems = append(respItems, respItem) @@ -497,7 +497,7 @@ func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemb return respItems } -func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemberEndPointsSvlMemberEndPointPorts(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseSvlSwitchInfoSwitchMembersSvlMemberEndPointsSvlMemberEndPointPorts) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembersSvlMemberEndPointsSvlMemberEndPointPorts(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseSvlSwitchInfoSwitchMembersSvlMemberEndPointsSvlMemberEndPointPorts) []map[string]interface{} { if items == nil { return nil } @@ -512,7 +512,7 @@ func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemb return respItems } -func flattenDevicesGetStackDetailsForDeviceItemSvlSwitchInfoSwitchMembersSvlMemberPepSettings(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceResponseSvlSwitchInfoSwitchMembersSvlMemberPepSettings) []map[string]interface{} { +func flattenDevicesGetStackDetailsForDeviceV1ItemSvlSwitchInfoSwitchMembersSvlMemberPepSettings(items *[]catalystcentersdkgo.ResponseDevicesGetStackDetailsForDeviceV1ResponseSvlSwitchInfoSwitchMembersSvlMemberPepSettings) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_summary.go b/catalystcenter/data_source_network_device_summary.go index ba78921..e9dc843 100644 --- a/catalystcenter/data_source_network_device_summary.go +++ b/catalystcenter/data_source_network_device_summary.go @@ -68,27 +68,27 @@ func dataSourceNetworkDeviceSummaryRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceSummary") + log.Printf("[DEBUG] Selected method: GetDeviceSummaryV1") vvID := vID.(string) - response1, restyResp1, err := client.Devices.GetDeviceSummary(vvID) + response1, restyResp1, err := client.Devices.GetDeviceSummaryV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceSummary", err, - "Failure at GetDeviceSummary, unexpected response", "")) + "Failure when executing 2 GetDeviceSummaryV1", err, + "Failure at GetDeviceSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceSummaryItem(response1.Response) + vItem1 := flattenDevicesGetDeviceSummaryV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceSummary response", + "Failure when setting GetDeviceSummaryV1 response", err)) return diags } @@ -100,7 +100,7 @@ func dataSourceNetworkDeviceSummaryRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenDevicesGetDeviceSummaryItem(item *catalystcentersdkgo.ResponseDevicesGetDeviceSummaryResponse) []map[string]interface{} { +func flattenDevicesGetDeviceSummaryV1Item(item *catalystcentersdkgo.ResponseDevicesGetDeviceSummaryV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_device_supervisor_card_details.go b/catalystcenter/data_source_network_device_supervisor_card_details.go index a8cac30..baf3abe 100644 --- a/catalystcenter/data_source_network_device_supervisor_card_details.go +++ b/catalystcenter/data_source_network_device_supervisor_card_details.go @@ -75,27 +75,27 @@ func dataSourceNetworkDeviceSupervisorCardDetailsRead(ctx context.Context, d *sc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSupervisorCardDetail") + log.Printf("[DEBUG] Selected method: GetSupervisorCardDetailV1") vvDeviceUUID := vDeviceUUID.(string) - response1, restyResp1, err := client.Devices.GetSupervisorCardDetail(vvDeviceUUID) + response1, restyResp1, err := client.Devices.GetSupervisorCardDetailV1(vvDeviceUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSupervisorCardDetail", err, - "Failure at GetSupervisorCardDetail, unexpected response", "")) + "Failure when executing 2 GetSupervisorCardDetailV1", err, + "Failure at GetSupervisorCardDetailV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetSupervisorCardDetailItems(response1.Response) + vItems1 := flattenDevicesGetSupervisorCardDetailV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSupervisorCardDetail response", + "Failure when setting GetSupervisorCardDetailV1 response", err)) return diags } @@ -107,7 +107,7 @@ func dataSourceNetworkDeviceSupervisorCardDetailsRead(ctx context.Context, d *sc return diags } -func flattenDevicesGetSupervisorCardDetailItems(items *[]catalystcentersdkgo.ResponseDevicesGetSupervisorCardDetailResponse) []map[string]interface{} { +func flattenDevicesGetSupervisorCardDetailV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetSupervisorCardDetailV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_user_defined_field.go b/catalystcenter/data_source_network_device_user_defined_field.go index 38ac597..b07974f 100644 --- a/catalystcenter/data_source_network_device_user_defined_field.go +++ b/catalystcenter/data_source_network_device_user_defined_field.go @@ -76,8 +76,8 @@ func dataSourceNetworkDeviceUserDefinedFieldRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllUserDefinedFields") - queryParams1 := catalystcentersdkgo.GetAllUserDefinedFieldsQueryParams{} + log.Printf("[DEBUG] Selected method: GetAllUserDefinedFieldsV1") + queryParams1 := catalystcentersdkgo.GetAllUserDefinedFieldsV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -86,24 +86,24 @@ func dataSourceNetworkDeviceUserDefinedFieldRead(ctx context.Context, d *schema. queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.Devices.GetAllUserDefinedFields(&queryParams1) + response1, restyResp1, err := client.Devices.GetAllUserDefinedFieldsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllUserDefinedFields", err, - "Failure at GetAllUserDefinedFields, unexpected response", "")) + "Failure when executing 2 GetAllUserDefinedFieldsV1", err, + "Failure at GetAllUserDefinedFieldsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetAllUserDefinedFieldsItems(response1.Response) + vItems1 := flattenDevicesGetAllUserDefinedFieldsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllUserDefinedFields response", + "Failure when setting GetAllUserDefinedFieldsV1 response", err)) return diags } @@ -115,7 +115,7 @@ func dataSourceNetworkDeviceUserDefinedFieldRead(ctx context.Context, d *schema. return diags } -func flattenDevicesGetAllUserDefinedFieldsItems(items *[]catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFieldsResponse) []map[string]interface{} { +func flattenDevicesGetAllUserDefinedFieldsV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFieldsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_vlan.go b/catalystcenter/data_source_network_device_vlan.go index 1d9a988..b0008b9 100644 --- a/catalystcenter/data_source_network_device_vlan.go +++ b/catalystcenter/data_source_network_device_vlan.go @@ -109,32 +109,32 @@ func dataSourceNetworkDeviceVLANRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceInterfaceVLANs") + log.Printf("[DEBUG] Selected method: GetDeviceInterfaceVLANsV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetDeviceInterfaceVLANsQueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceInterfaceVLANsV1QueryParams{} if okInterfaceType { queryParams1.InterfaceType = vInterfaceType.(string) } - response1, restyResp1, err := client.Devices.GetDeviceInterfaceVLANs(vvID, &queryParams1) + response1, restyResp1, err := client.Devices.GetDeviceInterfaceVLANsV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceInterfaceVLANs", err, - "Failure at GetDeviceInterfaceVLANs, unexpected response", "")) + "Failure when executing 2 GetDeviceInterfaceVLANsV1", err, + "Failure at GetDeviceInterfaceVLANsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetDeviceInterfaceVLANsItems(response1.Response) + vItems1 := flattenDevicesGetDeviceInterfaceVLANsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceInterfaceVLANs response", + "Failure when setting GetDeviceInterfaceVLANsV1 response", err)) return diags } @@ -146,7 +146,7 @@ func dataSourceNetworkDeviceVLANRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenDevicesGetDeviceInterfaceVLANsItems(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceVLANsResponse) []map[string]interface{} { +func flattenDevicesGetDeviceInterfaceVLANsV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceVLANsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_device_wireless_lan.go b/catalystcenter/data_source_network_device_wireless_lan.go index a7fc6a9..660b810 100644 --- a/catalystcenter/data_source_network_device_wireless_lan.go +++ b/catalystcenter/data_source_network_device_wireless_lan.go @@ -137,27 +137,27 @@ func dataSourceNetworkDeviceWirelessLanRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetWirelessLanControllerDetailsByID") + log.Printf("[DEBUG] Selected method: GetWirelessLanControllerDetailsByIDV1") vvID := vID.(string) - response1, restyResp1, err := client.Devices.GetWirelessLanControllerDetailsByID(vvID) + response1, restyResp1, err := client.Devices.GetWirelessLanControllerDetailsByIDV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWirelessLanControllerDetailsByID", err, - "Failure at GetWirelessLanControllerDetailsByID, unexpected response", "")) + "Failure when executing 2 GetWirelessLanControllerDetailsByIDV1", err, + "Failure at GetWirelessLanControllerDetailsByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetWirelessLanControllerDetailsByIDItem(response1) + vItem1 := flattenDevicesGetWirelessLanControllerDetailsByIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetWirelessLanControllerDetailsByID response", + "Failure when setting GetWirelessLanControllerDetailsByIDV1 response", err)) return diags } @@ -169,7 +169,7 @@ func dataSourceNetworkDeviceWirelessLanRead(ctx context.Context, d *schema.Resou return diags } -func flattenDevicesGetWirelessLanControllerDetailsByIDItem(item *catalystcentersdkgo.ResponseDevicesGetWirelessLanControllerDetailsByID) []map[string]interface{} { +func flattenDevicesGetWirelessLanControllerDetailsByIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetWirelessLanControllerDetailsByIDV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices.go b/catalystcenter/data_source_network_devices.go index 20a14f6..8a840df 100644 --- a/catalystcenter/data_source_network_devices.go +++ b/catalystcenter/data_source_network_devices.go @@ -67,9 +67,9 @@ healthScore=good, healthScore=good&healthScore=fair (multiple entity healthscore Optional: true, }, "mac_address": &schema.Schema{ - Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) + Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) `, Type: schema.TypeString, Optional: true, @@ -82,7 +82,7 @@ healthScore=good, healthScore=good&healthScore=fair (multiple entity healthscore }, "management_ip_address": &schema.Schema{ Description: `managementIpAddress query parameter. The list of entity management IP Address. It can be either Ipv4 or Ipv6 address or combination of both(Ex. "121.1.1.10") -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: managementIpAddresses=121.1.1.10 managementIpAddresses=121.1.1.10&managementIpAddresses=172.20.1.10&managementIpAddresses=200:10&=managementIpAddresses172.20.3.4 (multiple entity IP Address with & separator) `, Type: schema.TypeString, @@ -107,43 +107,43 @@ Examples: managementIpAddresses=121.1.1.10 managementIpAddresses=121.1.1.10&mana Optional: true, }, "serial_number": &schema.Schema{ - Description: `serialNumber query parameter. The list of network device serial numbers. This field supports wildcard ('*') character-based search. Ex: '*MS1SV*' or 'MS1SV*' or '*MS1SV' Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) + Description: `serialNumber query parameter. The list of network device serial numbers. This field supports wildcard (***) character-based search. Ex: **MS1SV** or *MS1SV** or **MS1SV* Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) `, Type: schema.TypeString, Optional: true, }, "software_version": &schema.Schema{ - Description: `softwareVersion query parameter. The list of network device software version This field supports wildcard ('*') character-based search. Ex: '*17.8*' or '*17.8' or '17.8*' Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) + Description: `softwareVersion query parameter. The list of network device software version This field supports wildcard (***) character-based search. Ex: **17.8** or **17.8* or *17.8** Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) `, Type: schema.TypeString, Optional: true, @@ -156,19 +156,19 @@ Examples: }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, }, "type": &schema.Schema{ - Description: `type query parameter. The list of network device type This field supports wildcard ('*') character-based search. Ex: '*9407R*' or '*9407R' or '9407R*' Examples: type=SwitchesCisco Catalyst 9407R Switch (single network device types ) type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) + Description: `type query parameter. The list of network device type This field supports wildcard (***) character-based search. Ex: **9407R** or **9407R* or *9407R** Examples: type=SwitchesCisco Catalyst 9407R Switch (single network device types ) type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) `, Type: schema.TypeString, Optional: true, }, "view": &schema.Schema{ - Description: `view query parameter. The List of Network Device model views. Please refer to '''NetworkDeviceView''' for the supported list + Description: `view query parameter. The List of Network Device model views. Please refer to ***NetworkDeviceView*** for the supported list `, Type: schema.TypeString, Optional: true, @@ -1670,8 +1670,8 @@ func dataSourceNetworkDevicesRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParameters") - queryParams1 := catalystcentersdkgo.GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersQueryParams{} + log.Printf("[DEBUG] Selected method: GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1") + queryParams1 := catalystcentersdkgo.GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -1737,24 +1737,24 @@ func dataSourceNetworkDevicesRead(ctx context.Context, d *schema.ResourceData, m queryParams1.Attribute = vAttribute.(string) } - response1, restyResp1, err := client.Devices.GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParameters(&queryParams1) + response1, restyResp1, err := client.Devices.GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParameters", err, - "Failure at GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParameters, unexpected response", "")) + "Failure when executing 2 GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1", err, + "Failure at GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItems(response1.Response) + vItems1 := flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParameters response", + "Failure when setting GetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1 response", err)) return diags } @@ -1764,9 +1764,9 @@ func dataSourceNetworkDevicesRead(ctx context.Context, d *schema.ResourceData, m } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetTheDeviceDataForTheGivenDeviceIDUUID") + log.Printf("[DEBUG] Selected method: GetTheDeviceDataForTheGivenDeviceIDUUIDV1") vvID := vID.(string) - queryParams2 := catalystcentersdkgo.GetTheDeviceDataForTheGivenDeviceIDUUIDQueryParams{} + queryParams2 := catalystcentersdkgo.GetTheDeviceDataForTheGivenDeviceIDUUIDV1QueryParams{} if okStartTime { queryParams2.StartTime = vStartTime.(float64) @@ -1781,24 +1781,24 @@ func dataSourceNetworkDevicesRead(ctx context.Context, d *schema.ResourceData, m queryParams2.Attribute = vAttribute.(string) } - response2, restyResp2, err := client.Devices.GetTheDeviceDataForTheGivenDeviceIDUUID(vvID, &queryParams2) + response2, restyResp2, err := client.Devices.GetTheDeviceDataForTheGivenDeviceIDUUIDV1(vvID, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheDeviceDataForTheGivenDeviceIDUUID", err, - "Failure at GetTheDeviceDataForTheGivenDeviceIDUUID, unexpected response", "")) + "Failure when executing 2 GetTheDeviceDataForTheGivenDeviceIDUUIDV1", err, + "Failure at GetTheDeviceDataForTheGivenDeviceIDUUIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItem(response2.Response) + vItem2 := flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheDeviceDataForTheGivenDeviceIDUUID response", + "Failure when setting GetTheDeviceDataForTheGivenDeviceIDUUIDV1 response", err)) return diags } @@ -1810,7 +1810,7 @@ func dataSourceNetworkDevicesRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItems(items *[]catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersResponse) []map[string]interface{} { +func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1Response) []map[string]interface{} { if items == nil { return nil } @@ -1856,16 +1856,16 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI respItem["wireless_client_count"] = item.WirelessClientCount respItem["port_count"] = item.PortCount respItem["client_count"] = item.ClientCount - respItem["ap_details"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsApDetails(item.ApDetails) - respItem["metrics_details"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsMetricsDetails(item.MetricsDetails) - respItem["fabric_details"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsFabricDetails(item.FabricDetails) - respItem["aggregate_attributes"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsAggregateAttributes(item.AggregateAttributes) + respItem["ap_details"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsApDetails(item.ApDetails) + respItem["metrics_details"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsMetricsDetails(item.MetricsDetails) + respItem["fabric_details"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsFabricDetails(item.FabricDetails) + respItem["aggregate_attributes"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsApDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersResponseApDetails) []map[string]interface{} { +func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsApDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ResponseApDetails) []map[string]interface{} { if item == nil { return nil } @@ -1896,7 +1896,7 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI respItem["flex_group"] = item.FlexGroup respItem["power_calendar_profile"] = item.PowerCalendarProfile respItem["ap_group"] = item.ApGroup - respItem["radios"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsApDetailsRadios(item.Radios) + respItem["radios"] = flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsApDetailsRadios(item.Radios) return []map[string]interface{}{ respItem, @@ -1904,7 +1904,7 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI } -func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsApDetailsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersResponseApDetailsRadios) []map[string]interface{} { +func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsApDetailsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ResponseApDetailsRadios) []map[string]interface{} { if items == nil { return nil } @@ -1924,7 +1924,7 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI return respItems } -func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsMetricsDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersResponseMetricsDetails) []map[string]interface{} { +func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsMetricsDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ResponseMetricsDetails) []map[string]interface{} { if item == nil { return nil } @@ -1965,7 +1965,7 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI } -func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsFabricDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersResponseFabricDetails) []map[string]interface{} { +func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsFabricDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ResponseFabricDetails) []map[string]interface{} { if item == nil { return nil } @@ -1980,7 +1980,7 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI } -func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersResponseAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } @@ -1995,7 +1995,7 @@ func flattenDevicesGetsTheNetworkDeviceDetailsBasedOnTheProvidedQueryParametersI return respItems } -func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItem(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDResponse) []map[string]interface{} { +func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1Item(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1Response) []map[string]interface{} { if item == nil { return nil } @@ -2039,16 +2039,16 @@ func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItem(item *catalystcen respItem["wireless_client_count"] = item.WirelessClientCount respItem["port_count"] = item.PortCount respItem["client_count"] = item.ClientCount - respItem["ap_details"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetails(item.ApDetails) - respItem["metrics_details"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemMetricsDetails(item.MetricsDetails) - respItem["fabric_details"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemFabricDetails(item.FabricDetails) - respItem["aggregate_attributes"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemAggregateAttributes(item.AggregateAttributes) + respItem["ap_details"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemApDetails(item.ApDetails) + respItem["metrics_details"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemMetricsDetails(item.MetricsDetails) + respItem["fabric_details"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemFabricDetails(item.FabricDetails) + respItem["aggregate_attributes"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemAggregateAttributes(item.AggregateAttributes) return []map[string]interface{}{ respItem, } } -func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetails(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDResponseApDetails) []map[string]interface{} { +func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemApDetails(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ResponseApDetails) []map[string]interface{} { if item == nil { return nil } @@ -2079,7 +2079,7 @@ func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetails(item *ca respItem["flex_group"] = item.FlexGroup respItem["power_calendar_profile"] = item.PowerCalendarProfile respItem["ap_group"] = item.ApGroup - respItem["radios"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetailsRadios(item.Radios) + respItem["radios"] = flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemApDetailsRadios(item.Radios) return []map[string]interface{}{ respItem, @@ -2087,7 +2087,7 @@ func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetails(item *ca } -func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetailsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDResponseApDetailsRadios) []map[string]interface{} { +func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemApDetailsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ResponseApDetailsRadios) []map[string]interface{} { if items == nil { return nil } @@ -2107,7 +2107,7 @@ func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemApDetailsRadios(it return respItems } -func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemMetricsDetails(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDResponseMetricsDetails) []map[string]interface{} { +func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemMetricsDetails(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ResponseMetricsDetails) []map[string]interface{} { if item == nil { return nil } @@ -2148,7 +2148,7 @@ func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemMetricsDetails(ite } -func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemFabricDetails(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDResponseFabricDetails) []map[string]interface{} { +func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemFabricDetails(item *catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ResponseFabricDetails) []map[string]interface{} { if item == nil { return nil } @@ -2163,7 +2163,7 @@ func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemFabricDetails(item } -func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDItemAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDResponseAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ItemAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetTheDeviceDataForTheGivenDeviceIDUUIDV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_assigned_to_site.go b/catalystcenter/data_source_network_devices_assigned_to_site.go index 272a5ce..42f8b6e 100644 --- a/catalystcenter/data_source_network_devices_assigned_to_site.go +++ b/catalystcenter/data_source_network_devices_assigned_to_site.go @@ -90,8 +90,8 @@ func dataSourceNetworkDevicesAssignedToSiteRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteAssignedNetworkDevices") - queryParams1 := catalystcentersdkgo.GetSiteAssignedNetworkDevicesQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteAssignedNetworkDevicesV1") + queryParams1 := catalystcentersdkgo.GetSiteAssignedNetworkDevicesV1QueryParams{} queryParams1.SiteID = vSiteID.(string) @@ -102,24 +102,24 @@ func dataSourceNetworkDevicesAssignedToSiteRead(ctx context.Context, d *schema.R queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SiteDesign.GetSiteAssignedNetworkDevices(&queryParams1) + response1, restyResp1, err := client.SiteDesign.GetSiteAssignedNetworkDevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteAssignedNetworkDevices", err, - "Failure at GetSiteAssignedNetworkDevices, unexpected response", "")) + "Failure when executing 2 GetSiteAssignedNetworkDevicesV1", err, + "Failure at GetSiteAssignedNetworkDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSiteDesignGetSiteAssignedNetworkDevicesItems(response1.Response) + vItems1 := flattenSiteDesignGetSiteAssignedNetworkDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteAssignedNetworkDevices response", + "Failure when setting GetSiteAssignedNetworkDevicesV1 response", err)) return diags } @@ -131,7 +131,7 @@ func dataSourceNetworkDevicesAssignedToSiteRead(ctx context.Context, d *schema.R return diags } -func flattenSiteDesignGetSiteAssignedNetworkDevicesItems(items *[]catalystcentersdkgo.ResponseSiteDesignGetSiteAssignedNetworkDevicesResponse) []map[string]interface{} { +func flattenSiteDesignGetSiteAssignedNetworkDevicesV1Items(items *[]catalystcentersdkgo.ResponseSiteDesignGetSiteAssignedNetworkDevicesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_assigned_to_site_count.go b/catalystcenter/data_source_network_devices_assigned_to_site_count.go index 3b2bef6..0d62b6a 100644 --- a/catalystcenter/data_source_network_devices_assigned_to_site_count.go +++ b/catalystcenter/data_source_network_devices_assigned_to_site_count.go @@ -54,29 +54,29 @@ func dataSourceNetworkDevicesAssignedToSiteCountRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteAssignedNetworkDevicesCount") - queryParams1 := catalystcentersdkgo.GetSiteAssignedNetworkDevicesCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteAssignedNetworkDevicesCountV1") + queryParams1 := catalystcentersdkgo.GetSiteAssignedNetworkDevicesCountV1QueryParams{} queryParams1.SiteID = vSiteID.(string) - response1, restyResp1, err := client.SiteDesign.GetSiteAssignedNetworkDevicesCount(&queryParams1) + response1, restyResp1, err := client.SiteDesign.GetSiteAssignedNetworkDevicesCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteAssignedNetworkDevicesCount", err, - "Failure at GetSiteAssignedNetworkDevicesCount, unexpected response", "")) + "Failure when executing 2 GetSiteAssignedNetworkDevicesCountV1", err, + "Failure at GetSiteAssignedNetworkDevicesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetSiteAssignedNetworkDevicesCountItem(response1.Response) + vItem1 := flattenSiteDesignGetSiteAssignedNetworkDevicesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteAssignedNetworkDevicesCount response", + "Failure when setting GetSiteAssignedNetworkDevicesCountV1 response", err)) return diags } @@ -88,7 +88,7 @@ func dataSourceNetworkDevicesAssignedToSiteCountRead(ctx context.Context, d *sch return diags } -func flattenSiteDesignGetSiteAssignedNetworkDevicesCountItem(item *catalystcentersdkgo.ResponseSiteDesignGetSiteAssignedNetworkDevicesCountResponse) []map[string]interface{} { +func flattenSiteDesignGetSiteAssignedNetworkDevicesCountV1Item(item *catalystcentersdkgo.ResponseSiteDesignGetSiteAssignedNetworkDevicesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_assigned_to_site_id.go b/catalystcenter/data_source_network_devices_assigned_to_site_id.go index 1391205..489b8fa 100644 --- a/catalystcenter/data_source_network_devices_assigned_to_site_id.go +++ b/catalystcenter/data_source_network_devices_assigned_to_site_id.go @@ -76,27 +76,27 @@ func dataSourceNetworkDevicesAssignedToSiteIDRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteAssignedNetworkDevice") + log.Printf("[DEBUG] Selected method: GetSiteAssignedNetworkDeviceV1") vvID := vID.(string) - response1, restyResp1, err := client.SiteDesign.GetSiteAssignedNetworkDevice(vvID) + response1, restyResp1, err := client.SiteDesign.GetSiteAssignedNetworkDeviceV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteAssignedNetworkDevice", err, - "Failure at GetSiteAssignedNetworkDevice, unexpected response", "")) + "Failure when executing 2 GetSiteAssignedNetworkDeviceV1", err, + "Failure at GetSiteAssignedNetworkDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetSiteAssignedNetworkDeviceItem(response1.Response) + vItem1 := flattenSiteDesignGetSiteAssignedNetworkDeviceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteAssignedNetworkDevice response", + "Failure when setting GetSiteAssignedNetworkDeviceV1 response", err)) return diags } @@ -108,7 +108,7 @@ func dataSourceNetworkDevicesAssignedToSiteIDRead(ctx context.Context, d *schema return diags } -func flattenSiteDesignGetSiteAssignedNetworkDeviceItem(item *catalystcentersdkgo.ResponseSiteDesignGetSiteAssignedNetworkDeviceResponse) []map[string]interface{} { +func flattenSiteDesignGetSiteAssignedNetworkDeviceV1Item(item *catalystcentersdkgo.ResponseSiteDesignGetSiteAssignedNetworkDeviceV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_count.go b/catalystcenter/data_source_network_devices_count.go index af39f83..26f891c 100644 --- a/catalystcenter/data_source_network_devices_count.go +++ b/catalystcenter/data_source_network_devices_count.go @@ -54,9 +54,9 @@ AssuranceNetworkDevices-1.0.2-resolved.yaml Optional: true, }, "mac_address": &schema.Schema{ - Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) + Description: `macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) `, Type: schema.TypeString, Optional: true, @@ -69,7 +69,7 @@ AssuranceNetworkDevices-1.0.2-resolved.yaml }, "management_ip_address": &schema.Schema{ Description: `managementIpAddress query parameter. The list of entity management IP Address. It can be either Ipv4 or Ipv6 address or combination of both(Ex. "121.1.1.10") -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: managementIpAddresses=121.1.1.10 managementIpAddresses=121.1.1.10&managementIpAddresses=172.20.1.10&managementIpAddresses=200:10&=managementIpAddresses172.20.3.4 (multiple entity IP Address with & separator) `, Type: schema.TypeString, @@ -82,62 +82,62 @@ Examples: managementIpAddresses=121.1.1.10 managementIpAddresses=121.1.1.10&mana Optional: true, }, "serial_number": &schema.Schema{ - Description: `serialNumber query parameter. The list of network device serial numbers. This field supports wildcard ('*') character-based search. Ex: '*MS1SV*' or 'MS1SV*' or '*MS1SV' Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) + Description: `serialNumber query parameter. The list of network device serial numbers. This field supports wildcard (***) character-based search. Ex: **MS1SV** or *MS1SV** or **MS1SV* Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The UUID of the site. (Ex. 'flooruuid') + Description: `siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) `, Type: schema.TypeString, Optional: true, }, "software_version": &schema.Schema{ - Description: `softwareVersion query parameter. The list of network device software version This field supports wildcard ('*') character-based search. Ex: '*17.8*' or '*17.8' or '17.8*' Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) + Description: `softwareVersion query parameter. The list of network device software version This field supports wildcard (***) character-based search. Ex: **17.8** or **17.8* or *17.8** Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, }, "type": &schema.Schema{ - Description: `type query parameter. The list of network device type This field supports wildcard ('*') character-based search. Ex: '*9407R*' or '*9407R' or '9407R*'Examples:type=SwitchesCisco Catalyst 9407R Switch (single network device types )type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) + Description: `type query parameter. The list of network device type This field supports wildcard (***) character-based search. Ex: **9407R** or **9407R* or *9407R**Examples:type=SwitchesCisco Catalyst 9407R Switch (single network device types )type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) `, Type: schema.TypeString, Optional: true, }, "view": &schema.Schema{ - Description: `view query parameter. The List of Network Device model views. Please refer to '''NetworkDeviceView''' for the supported list + Description: `view query parameter. The List of Network Device model views. Please refer to ***NetworkDeviceView*** for the supported list `, Type: schema.TypeString, Optional: true, @@ -185,8 +185,8 @@ func dataSourceNetworkDevicesCountRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParameters") - queryParams1 := catalystcentersdkgo.GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersQueryParams{} + log.Printf("[DEBUG] Selected method: GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1") + queryParams1 := catalystcentersdkgo.GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -240,24 +240,24 @@ func dataSourceNetworkDevicesCountRead(ctx context.Context, d *schema.ResourceDa queryParams1.Attribute = vAttribute.(string) } - response1, restyResp1, err := client.Devices.GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParameters(&queryParams1) + response1, restyResp1, err := client.Devices.GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParameters", err, - "Failure at GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParameters, unexpected response", "")) + "Failure when executing 2 GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1", err, + "Failure at GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersItem(response1.Response) + vItem1 := flattenDevicesGetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParameters response", + "Failure when setting GetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1 response", err)) return diags } @@ -269,7 +269,7 @@ func dataSourceNetworkDevicesCountRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenDevicesGetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersItem(item *catalystcentersdkgo.ResponseDevicesGetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersResponse) []map[string]interface{} { +func flattenDevicesGetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1Item(item *catalystcentersdkgo.ResponseDevicesGetsTheTotalNetworkDeviceCountsBasedOnTheProvidedQueryParametersV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_device_controllability_settings.go b/catalystcenter/data_source_network_devices_device_controllability_settings.go index feedbe3..acbd819 100644 --- a/catalystcenter/data_source_network_devices_device_controllability_settings.go +++ b/catalystcenter/data_source_network_devices_device_controllability_settings.go @@ -72,26 +72,26 @@ func dataSourceNetworkDevicesDeviceControllabilitySettingsRead(ctx context.Conte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceControllabilitySettings") + log.Printf("[DEBUG] Selected method: GetDeviceControllabilitySettingsV1") - response1, restyResp1, err := client.SiteDesign.GetDeviceControllabilitySettings() + response1, restyResp1, err := client.SiteDesign.GetDeviceControllabilitySettingsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceControllabilitySettings", err, - "Failure at GetDeviceControllabilitySettings, unexpected response", "")) + "Failure when executing 2 GetDeviceControllabilitySettingsV1", err, + "Failure at GetDeviceControllabilitySettingsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetDeviceControllabilitySettingsItem(response1.Response) + vItem1 := flattenSiteDesignGetDeviceControllabilitySettingsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceControllabilitySettings response", + "Failure when setting GetDeviceControllabilitySettingsV1 response", err)) return diags } @@ -103,7 +103,7 @@ func dataSourceNetworkDevicesDeviceControllabilitySettingsRead(ctx context.Conte return diags } -func flattenSiteDesignGetDeviceControllabilitySettingsItem(item *catalystcentersdkgo.ResponseSiteDesignGetDeviceControllabilitySettingsResponse) []map[string]interface{} { +func flattenSiteDesignGetDeviceControllabilitySettingsV1Item(item *catalystcentersdkgo.ResponseSiteDesignGetDeviceControllabilitySettingsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_members_associations.go b/catalystcenter/data_source_network_devices_members_associations.go index b327c7c..1a873ba 100644 --- a/catalystcenter/data_source_network_devices_members_associations.go +++ b/catalystcenter/data_source_network_devices_members_associations.go @@ -87,7 +87,7 @@ func dataSourceNetworkDevicesMembersAssociationsRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveTagsAssociatedWithNetworkDevices") - queryParams1 := catalystcentersdkgo.RetrieveTagsAssociatedWithNetworkDevicesQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTagsAssociatedWithNetworkDevicesV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -125,7 +125,7 @@ func dataSourceNetworkDevicesMembersAssociationsRead(ctx context.Context, d *sch return diags } -func flattenTagRetrieveTagsAssociatedWithNetworkDevicesItems(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithNetworkDevicesResponse) []map[string]interface{} { +func flattenTagRetrieveTagsAssociatedWithNetworkDevicesItems(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithNetworkDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -139,7 +139,7 @@ func flattenTagRetrieveTagsAssociatedWithNetworkDevicesItems(items *[]catalystce return respItems } -func flattenTagRetrieveTagsAssociatedWithNetworkDevicesItemsTags(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithNetworkDevicesResponseTags) []map[string]interface{} { +func flattenTagRetrieveTagsAssociatedWithNetworkDevicesItemsTags(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithNetworkDevicesV1ResponseTags) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_members_associations_count.go b/catalystcenter/data_source_network_devices_members_associations_count.go index d11b6a6..47c84d3 100644 --- a/catalystcenter/data_source_network_devices_members_associations_count.go +++ b/catalystcenter/data_source_network_devices_members_associations_count.go @@ -79,7 +79,7 @@ func dataSourceNetworkDevicesMembersAssociationsCountRead(ctx context.Context, d return diags } -func flattenTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagItem(item *catalystcentersdkgo.ResponseTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagResponse) []map[string]interface{} { +func flattenTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagItem(item *catalystcentersdkgo.ResponseTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_network_profiles_for_sites.go b/catalystcenter/data_source_network_devices_network_profiles_for_sites.go index 85fbd3b..1e71e58 100644 --- a/catalystcenter/data_source_network_devices_network_profiles_for_sites.go +++ b/catalystcenter/data_source_network_devices_network_profiles_for_sites.go @@ -23,7 +23,7 @@ func dataSourceNetworkDevicesNetworkProfilesForSites() *schema.Resource { ReadContext: dataSourceNetworkDevicesNetworkProfilesForSitesRead, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `id path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Optional: true, @@ -138,8 +138,8 @@ func dataSourceNetworkDevicesNetworkProfilesForSitesRead(ctx context.Context, d selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheListOfNetworkProfilesForSites") - queryParams1 := catalystcentersdkgo.RetrievesTheListOfNetworkProfilesForSitesQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesTheListOfNetworkProfilesForSitesV1") + queryParams1 := catalystcentersdkgo.RetrievesTheListOfNetworkProfilesForSitesV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -157,24 +157,24 @@ func dataSourceNetworkDevicesNetworkProfilesForSitesRead(ctx context.Context, d queryParams1.Type = vType.(string) } - response1, restyResp1, err := client.SiteDesign.RetrievesTheListOfNetworkProfilesForSites(&queryParams1) + response1, restyResp1, err := client.SiteDesign.RetrievesTheListOfNetworkProfilesForSitesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheListOfNetworkProfilesForSites", err, - "Failure at RetrievesTheListOfNetworkProfilesForSites, unexpected response", "")) + "Failure when executing 2 RetrievesTheListOfNetworkProfilesForSitesV1", err, + "Failure at RetrievesTheListOfNetworkProfilesForSitesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSiteDesignRetrievesTheListOfNetworkProfilesForSitesItems(response1.Response) + vItems1 := flattenSiteDesignRetrievesTheListOfNetworkProfilesForSitesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfNetworkProfilesForSites response", + "Failure when setting RetrievesTheListOfNetworkProfilesForSitesV1 response", err)) return diags } @@ -184,27 +184,27 @@ func dataSourceNetworkDevicesNetworkProfilesForSitesRead(ctx context.Context, d } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: RetrieveANetworkProfileForSitesByID") + log.Printf("[DEBUG] Selected method: RetrieveANetworkProfileForSitesByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.SiteDesign.RetrieveANetworkProfileForSitesByID(vvID) + response2, restyResp2, err := client.SiteDesign.RetrieveANetworkProfileForSitesByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveANetworkProfileForSitesByID", err, - "Failure at RetrieveANetworkProfileForSitesByID, unexpected response", "")) + "Failure when executing 2 RetrieveANetworkProfileForSitesByIDV1", err, + "Failure at RetrieveANetworkProfileForSitesByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenSiteDesignRetrieveANetworkProfileForSitesByIDItem(response2.Response) + vItem2 := flattenSiteDesignRetrieveANetworkProfileForSitesByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveANetworkProfileForSitesByID response", + "Failure when setting RetrieveANetworkProfileForSitesByIDV1 response", err)) return diags } @@ -216,7 +216,7 @@ func dataSourceNetworkDevicesNetworkProfilesForSitesRead(ctx context.Context, d return diags } -func flattenSiteDesignRetrievesTheListOfNetworkProfilesForSitesItems(items *[]catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfNetworkProfilesForSitesResponse) []map[string]interface{} { +func flattenSiteDesignRetrievesTheListOfNetworkProfilesForSitesV1Items(items *[]catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfNetworkProfilesForSitesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -231,7 +231,7 @@ func flattenSiteDesignRetrievesTheListOfNetworkProfilesForSitesItems(items *[]ca return respItems } -func flattenSiteDesignRetrieveANetworkProfileForSitesByIDItem(item *catalystcentersdkgo.ResponseSiteDesignRetrieveANetworkProfileForSitesByIDResponse) []map[string]interface{} { +func flattenSiteDesignRetrieveANetworkProfileForSitesByIDV1Item(item *catalystcentersdkgo.ResponseSiteDesignRetrieveANetworkProfileForSitesByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_network_profiles_for_sites_count.go b/catalystcenter/data_source_network_devices_network_profiles_for_sites_count.go index 1e8440b..b2448b9 100644 --- a/catalystcenter/data_source_network_devices_network_profiles_for_sites_count.go +++ b/catalystcenter/data_source_network_devices_network_profiles_for_sites_count.go @@ -53,31 +53,31 @@ func dataSourceNetworkDevicesNetworkProfilesForSitesCountRead(ctx context.Contex selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheCountOfNetworkProfilesForSites") - queryParams1 := catalystcentersdkgo.RetrievesTheCountOfNetworkProfilesForSitesQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesTheCountOfNetworkProfilesForSitesV1") + queryParams1 := catalystcentersdkgo.RetrievesTheCountOfNetworkProfilesForSitesV1QueryParams{} if okType { queryParams1.Type = vType.(string) } - response1, restyResp1, err := client.SiteDesign.RetrievesTheCountOfNetworkProfilesForSites(&queryParams1) + response1, restyResp1, err := client.SiteDesign.RetrievesTheCountOfNetworkProfilesForSitesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheCountOfNetworkProfilesForSites", err, - "Failure at RetrievesTheCountOfNetworkProfilesForSites, unexpected response", "")) + "Failure when executing 2 RetrievesTheCountOfNetworkProfilesForSitesV1", err, + "Failure at RetrievesTheCountOfNetworkProfilesForSitesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignRetrievesTheCountOfNetworkProfilesForSitesItem(response1.Response) + vItem1 := flattenSiteDesignRetrievesTheCountOfNetworkProfilesForSitesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheCountOfNetworkProfilesForSites response", + "Failure when setting RetrievesTheCountOfNetworkProfilesForSitesV1 response", err)) return diags } @@ -89,7 +89,7 @@ func dataSourceNetworkDevicesNetworkProfilesForSitesCountRead(ctx context.Contex return diags } -func flattenSiteDesignRetrievesTheCountOfNetworkProfilesForSitesItem(item *catalystcentersdkgo.ResponseSiteDesignRetrievesTheCountOfNetworkProfilesForSitesResponse) []map[string]interface{} { +func flattenSiteDesignRetrievesTheCountOfNetworkProfilesForSitesV1Item(item *catalystcentersdkgo.ResponseSiteDesignRetrievesTheCountOfNetworkProfilesForSitesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_not_assigned_to_site.go b/catalystcenter/data_source_network_devices_not_assigned_to_site.go index 1510596..99675b1 100644 --- a/catalystcenter/data_source_network_devices_not_assigned_to_site.go +++ b/catalystcenter/data_source_network_devices_not_assigned_to_site.go @@ -64,8 +64,8 @@ func dataSourceNetworkDevicesNotAssignedToSiteRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteNotAssignedNetworkDevices") - queryParams1 := catalystcentersdkgo.GetSiteNotAssignedNetworkDevicesQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteNotAssignedNetworkDevicesV1") + queryParams1 := catalystcentersdkgo.GetSiteNotAssignedNetworkDevicesV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -74,24 +74,24 @@ func dataSourceNetworkDevicesNotAssignedToSiteRead(ctx context.Context, d *schem queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SiteDesign.GetSiteNotAssignedNetworkDevices(&queryParams1) + response1, restyResp1, err := client.SiteDesign.GetSiteNotAssignedNetworkDevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteNotAssignedNetworkDevices", err, - "Failure at GetSiteNotAssignedNetworkDevices, unexpected response", "")) + "Failure when executing 2 GetSiteNotAssignedNetworkDevicesV1", err, + "Failure at GetSiteNotAssignedNetworkDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetSiteNotAssignedNetworkDevicesItem(response1.Response) + vItem1 := flattenSiteDesignGetSiteNotAssignedNetworkDevicesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteNotAssignedNetworkDevices response", + "Failure when setting GetSiteNotAssignedNetworkDevicesV1 response", err)) return diags } @@ -103,7 +103,7 @@ func dataSourceNetworkDevicesNotAssignedToSiteRead(ctx context.Context, d *schem return diags } -func flattenSiteDesignGetSiteNotAssignedNetworkDevicesItem(item *catalystcentersdkgo.ResponseSiteDesignGetSiteNotAssignedNetworkDevicesResponse) []map[string]interface{} { +func flattenSiteDesignGetSiteNotAssignedNetworkDevicesV1Item(item *catalystcentersdkgo.ResponseSiteDesignGetSiteNotAssignedNetworkDevicesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_not_assigned_to_site_count.go b/catalystcenter/data_source_network_devices_not_assigned_to_site_count.go index 5438d43..abc790f 100644 --- a/catalystcenter/data_source_network_devices_not_assigned_to_site_count.go +++ b/catalystcenter/data_source_network_devices_not_assigned_to_site_count.go @@ -47,26 +47,26 @@ func dataSourceNetworkDevicesNotAssignedToSiteCountRead(ctx context.Context, d * selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteNotAssignedNetworkDevicesCount") + log.Printf("[DEBUG] Selected method: GetSiteNotAssignedNetworkDevicesCountV1") - response1, restyResp1, err := client.SiteDesign.GetSiteNotAssignedNetworkDevicesCount() + response1, restyResp1, err := client.SiteDesign.GetSiteNotAssignedNetworkDevicesCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteNotAssignedNetworkDevicesCount", err, - "Failure at GetSiteNotAssignedNetworkDevicesCount, unexpected response", "")) + "Failure when executing 2 GetSiteNotAssignedNetworkDevicesCountV1", err, + "Failure at GetSiteNotAssignedNetworkDevicesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetSiteNotAssignedNetworkDevicesCountItem(response1.Response) + vItem1 := flattenSiteDesignGetSiteNotAssignedNetworkDevicesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteNotAssignedNetworkDevicesCount response", + "Failure when setting GetSiteNotAssignedNetworkDevicesCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceNetworkDevicesNotAssignedToSiteCountRead(ctx context.Context, d * return diags } -func flattenSiteDesignGetSiteNotAssignedNetworkDevicesCountItem(item *catalystcentersdkgo.ResponseSiteDesignGetSiteNotAssignedNetworkDevicesCountResponse) []map[string]interface{} { +func flattenSiteDesignGetSiteNotAssignedNetworkDevicesCountV1Item(item *catalystcentersdkgo.ResponseSiteDesignGetSiteNotAssignedNetworkDevicesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_devices_resync_interval_settings_id.go b/catalystcenter/data_source_network_devices_resync_interval_settings_id.go index 934bc38..93d22fe 100644 --- a/catalystcenter/data_source_network_devices_resync_interval_settings_id.go +++ b/catalystcenter/data_source_network_devices_resync_interval_settings_id.go @@ -54,27 +54,27 @@ func dataSourceNetworkDevicesResyncIntervalSettingsIDRead(ctx context.Context, d selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetResyncIntervalForTheNetworkDevice") + log.Printf("[DEBUG] Selected method: GetResyncIntervalForTheNetworkDeviceV1") vvID := vID.(string) - response1, restyResp1, err := client.Devices.GetResyncIntervalForTheNetworkDevice(vvID) + response1, restyResp1, err := client.Devices.GetResyncIntervalForTheNetworkDeviceV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetResyncIntervalForTheNetworkDevice", err, - "Failure at GetResyncIntervalForTheNetworkDevice, unexpected response", "")) + "Failure when executing 2 GetResyncIntervalForTheNetworkDeviceV1", err, + "Failure at GetResyncIntervalForTheNetworkDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetResyncIntervalForTheNetworkDeviceItem(response1.Response) + vItem1 := flattenDevicesGetResyncIntervalForTheNetworkDeviceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetResyncIntervalForTheNetworkDevice response", + "Failure when setting GetResyncIntervalForTheNetworkDeviceV1 response", err)) return diags } @@ -86,7 +86,7 @@ func dataSourceNetworkDevicesResyncIntervalSettingsIDRead(ctx context.Context, d return diags } -func flattenDevicesGetResyncIntervalForTheNetworkDeviceItem(item *catalystcentersdkgo.ResponseDevicesGetResyncIntervalForTheNetworkDeviceResponse) []map[string]interface{} { +func flattenDevicesGetResyncIntervalForTheNetworkDeviceV1Item(item *catalystcentersdkgo.ResponseDevicesGetResyncIntervalForTheNetworkDeviceV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_network_profiles_for_sites_site_assignments.go b/catalystcenter/data_source_network_profiles_for_sites_site_assignments.go index 000c789..9ee08d4 100644 --- a/catalystcenter/data_source_network_profiles_for_sites_site_assignments.go +++ b/catalystcenter/data_source_network_profiles_for_sites_site_assignments.go @@ -35,7 +35,7 @@ profile. Optional: true, }, "profile_id": &schema.Schema{ - Description: `profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Required: true, @@ -69,9 +69,9 @@ func dataSourceNetworkProfilesForSitesSiteAssignmentsRead(ctx context.Context, d selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo") + log.Printf("[DEBUG] Selected method: RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1") vvProfileID := vProfileID.(string) - queryParams1 := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToQueryParams{} + queryParams1 := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -80,24 +80,24 @@ func dataSourceNetworkProfilesForSitesSiteAssignmentsRead(ctx context.Context, d queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SiteDesign.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(vvProfileID, &queryParams1) + response1, restyResp1, err := client.SiteDesign.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1(vvProfileID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo", err, - "Failure at RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo, unexpected response", "")) + "Failure when executing 2 RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1", err, + "Failure at RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToItems(response1.Response) + vItems1 := flattenSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo response", + "Failure when setting RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1 response", err)) return diags } @@ -109,7 +109,7 @@ func dataSourceNetworkProfilesForSitesSiteAssignmentsRead(ctx context.Context, d return diags } -func flattenSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToItems(items *[]catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToResponse) []map[string]interface{} { +func flattenSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Items(items *[]catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_network_profiles_for_sites_site_assignments_count.go b/catalystcenter/data_source_network_profiles_for_sites_site_assignments_count.go index 9139e11..7d7cbf7 100644 --- a/catalystcenter/data_source_network_profiles_for_sites_site_assignments_count.go +++ b/catalystcenter/data_source_network_profiles_for_sites_site_assignments_count.go @@ -21,7 +21,7 @@ func dataSourceNetworkProfilesForSitesSiteAssignmentsCount() *schema.Resource { ReadContext: dataSourceNetworkProfilesForSitesSiteAssignmentsCountRead, Schema: map[string]*schema.Schema{ "profile_id": &schema.Schema{ - Description: `profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Required: true, @@ -53,27 +53,27 @@ func dataSourceNetworkProfilesForSitesSiteAssignmentsCountRead(ctx context.Conte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo") + log.Printf("[DEBUG] Selected method: RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1") vvProfileID := vProfileID.(string) - response1, restyResp1, err := client.SiteDesign.RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(vvProfileID) + response1, restyResp1, err := client.SiteDesign.RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1(vvProfileID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo", err, - "Failure at RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo, unexpected response", "")) + "Failure when executing 2 RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1", err, + "Failure at RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignRetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToItem(response1.Response) + vItem1 := flattenSiteDesignRetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo response", + "Failure when setting RetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1 response", err)) return diags } @@ -85,7 +85,7 @@ func dataSourceNetworkProfilesForSitesSiteAssignmentsCountRead(ctx context.Conte return diags } -func flattenSiteDesignRetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToItem(item *catalystcentersdkgo.ResponseSiteDesignRetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToResponse) []map[string]interface{} { +func flattenSiteDesignRetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Item(item *catalystcentersdkgo.ResponseSiteDesignRetrievesTheCountOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_path_trace.go b/catalystcenter/data_source_path_trace.go index 83f3d50..60e3c8b 100644 --- a/catalystcenter/data_source_path_trace.go +++ b/catalystcenter/data_source_path_trace.go @@ -3965,8 +3965,8 @@ func dataSourcePathTraceRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesAllPreviousPathtracesSummary") - queryParams1 := catalystcentersdkgo.RetrievesAllPreviousPathtracesSummaryQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesAllPreviousPathtracesSummaryV1") + queryParams1 := catalystcentersdkgo.RetrievesAllPreviousPathtracesSummaryV1QueryParams{} if okPeriodicRefresh { queryParams1.PeriodicRefresh = vPeriodicRefresh.(bool) @@ -4014,24 +4014,24 @@ func dataSourcePathTraceRead(ctx context.Context, d *schema.ResourceData, m inte queryParams1.SortBy = vSortBy.(string) } - response1, restyResp1, err := client.PathTrace.RetrievesAllPreviousPathtracesSummary(&queryParams1) + response1, restyResp1, err := client.PathTrace.RetrievesAllPreviousPathtracesSummaryV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesAllPreviousPathtracesSummary", err, - "Failure at RetrievesAllPreviousPathtracesSummary, unexpected response", "")) + "Failure when executing 2 RetrievesAllPreviousPathtracesSummaryV1", err, + "Failure at RetrievesAllPreviousPathtracesSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenPathTraceRetrievesAllPreviousPathtracesSummaryItems(response1.Response) + vItems1 := flattenPathTraceRetrievesAllPreviousPathtracesSummaryV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesAllPreviousPathtracesSummary response", + "Failure when setting RetrievesAllPreviousPathtracesSummaryV1 response", err)) return diags } @@ -4041,27 +4041,27 @@ func dataSourcePathTraceRead(ctx context.Context, d *schema.ResourceData, m inte } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: RetrievesPreviousPathtrace") + log.Printf("[DEBUG] Selected method: RetrievesPreviousPathtraceV1") vvFlowAnalysisID := vFlowAnalysisID.(string) - response2, restyResp2, err := client.PathTrace.RetrievesPreviousPathtrace(vvFlowAnalysisID) + response2, restyResp2, err := client.PathTrace.RetrievesPreviousPathtraceV1(vvFlowAnalysisID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesPreviousPathtrace", err, - "Failure at RetrievesPreviousPathtrace, unexpected response", "")) + "Failure when executing 2 RetrievesPreviousPathtraceV1", err, + "Failure at RetrievesPreviousPathtraceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenPathTraceRetrievesPreviousPathtraceItem(response2.Response) + vItem2 := flattenPathTraceRetrievesPreviousPathtraceV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesPreviousPathtrace response", + "Failure when setting RetrievesPreviousPathtraceV1 response", err)) return diags } @@ -4073,7 +4073,7 @@ func dataSourcePathTraceRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenPathTraceRetrievesAllPreviousPathtracesSummaryItems(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesAllPreviousPathtracesSummaryResponse) []map[string]interface{} { +func flattenPathTraceRetrievesAllPreviousPathtracesSummaryV1Items(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesAllPreviousPathtracesSummaryV1Response) []map[string]interface{} { if items == nil { return nil } @@ -4099,23 +4099,23 @@ func flattenPathTraceRetrievesAllPreviousPathtracesSummaryItems(items *[]catalys return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItem(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponse) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1Item(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["detailed_status"] = flattenPathTraceRetrievesPreviousPathtraceItemDetailedStatus(item.DetailedStatus) + respItem["detailed_status"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemDetailedStatus(item.DetailedStatus) respItem["last_update"] = item.LastUpdate - respItem["network_elements"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElements(item.NetworkElements) - respItem["network_elements_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfo(item.NetworkElementsInfo) + respItem["network_elements"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElements(item.NetworkElements) + respItem["network_elements_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfo(item.NetworkElementsInfo) respItem["properties"] = item.Properties - respItem["request"] = flattenPathTraceRetrievesPreviousPathtraceItemRequest(item.Request) + respItem["request"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemRequest(item.Request) return []map[string]interface{}{ respItem, } } -func flattenPathTraceRetrievesPreviousPathtraceItemDetailedStatus(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseDetailedStatus) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemDetailedStatus(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseDetailedStatus) []map[string]interface{} { if item == nil { return nil } @@ -4129,30 +4129,30 @@ func flattenPathTraceRetrievesPreviousPathtraceItemDetailedStatus(item *catalyst } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElements(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElements) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElements(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElements) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["accuracy_list"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsAccuracyList(item.AccuracyList) - respItem["detailed_status"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDetailedStatus(item.DetailedStatus) - respItem["device_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatistics(item.DeviceStatistics) + respItem["accuracy_list"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsAccuracyList(item.AccuracyList) + respItem["detailed_status"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDetailedStatus(item.DetailedStatus) + respItem["device_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDeviceStatistics(item.DeviceStatistics) respItem["device_stats_collection"] = item.DeviceStatsCollection respItem["device_stats_collection_failure_reason"] = item.DeviceStatsCollectionFailureReason - respItem["egress_physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterface(item.EgressPhysicalInterface) - respItem["egress_virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterface(item.EgressVirtualInterface) - respItem["flex_connect"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnect(item.FlexConnect) + respItem["egress_physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterface(item.EgressPhysicalInterface) + respItem["egress_virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterface(item.EgressVirtualInterface) + respItem["flex_connect"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnect(item.FlexConnect) respItem["id"] = item.ID - respItem["ingress_physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterface(item.IngressPhysicalInterface) - respItem["ingress_virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterface(item.IngressVirtualInterface) + respItem["ingress_physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterface(item.IngressPhysicalInterface) + respItem["ingress_virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterface(item.IngressVirtualInterface) respItem["ip"] = item.IP respItem["link_information_source"] = item.LinkInformationSource respItem["name"] = item.Name respItem["perf_mon_collection"] = item.PerfMonCollection respItem["perf_mon_collection_failure_reason"] = item.PerfMonCollectionFailureReason - respItem["perf_mon_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsPerfMonStatistics(item.PerfMonStatistics) + respItem["perf_mon_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsPerfMonStatistics(item.PerfMonStatistics) respItem["role"] = item.Role respItem["ssid"] = item.SSID respItem["tunnels"] = item.Tunnels @@ -4163,7 +4163,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElements(items *[]cata return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsAccuracyList(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsAccuracyList) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsAccuracyList(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsAccuracyList) []map[string]interface{} { if items == nil { return nil } @@ -4177,7 +4177,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsAccuracyList(i return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDetailedStatus(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsDetailedStatus) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDetailedStatus(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsDetailedStatus) []map[string]interface{} { if item == nil { return nil } @@ -4191,13 +4191,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDetailedStatus } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsDeviceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDeviceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsDeviceStatistics) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["cpu_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisticsCPUStatistics(item.CPUStatistics) - respItem["memory_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisticsMemoryStatistics(item.MemoryStatistics) + respItem["cpu_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDeviceStatisticsCPUStatistics(item.CPUStatistics) + respItem["memory_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDeviceStatisticsMemoryStatistics(item.MemoryStatistics) return []map[string]interface{}{ respItem, @@ -4205,7 +4205,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisti } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisticsCPUStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsDeviceStatisticsCPUStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDeviceStatisticsCPUStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsDeviceStatisticsCPUStatistics) []map[string]interface{} { if item == nil { return nil } @@ -4221,7 +4221,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisti } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisticsMemoryStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsDeviceStatisticsMemoryStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsDeviceStatisticsMemoryStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsDeviceStatisticsMemoryStatistics) []map[string]interface{} { if item == nil { return nil } @@ -4236,19 +4236,19 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsDeviceStatisti } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -4260,13 +4260,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -4275,7 +4275,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -4283,28 +4283,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -4318,7 +4318,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -4344,7 +4344,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -4358,13 +4358,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -4378,7 +4378,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressPhysicalInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressPhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressPhysicalInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -4400,19 +4400,19 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressPhysical return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -4424,13 +4424,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -4439,7 +4439,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -4447,28 +4447,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -4482,7 +4482,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -4508,7 +4508,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -4522,13 +4522,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -4542,7 +4542,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsEgressVirtualInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsEgressVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsEgressVirtualInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -4564,15 +4564,15 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsEgressVirtualI return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnect(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnect) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnect(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnect) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["authentication"] = item.Authentication respItem["data_switching"] = item.DataSwitching - respItem["egress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysis(item.EgressACLAnalysis) - respItem["ingress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysis(item.IngressACLAnalysis) + respItem["egress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysis(item.EgressACLAnalysis) + respItem["ingress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysis(item.IngressACLAnalysis) respItem["wireless_lan_controller_id"] = item.WirelessLanControllerID respItem["wireless_lan_controller_name"] = item.WirelessLanControllerName @@ -4582,13 +4582,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnect(it } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectEgressACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectEgressACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -4597,7 +4597,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgr } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectEgressACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectEgressACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -4605,28 +4605,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgr for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -4640,13 +4640,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectEgr return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectIngressACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectIngressACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -4655,7 +4655,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIng } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectIngressACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectIngressACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -4663,28 +4663,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIng for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -4698,19 +4698,19 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsFlexConnectIng return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -4722,13 +4722,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -4737,7 +4737,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -4745,28 +4745,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -4780,7 +4780,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -4806,7 +4806,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -4820,13 +4820,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -4840,7 +4840,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressPhysicalInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressPhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressPhysicalInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -4862,19 +4862,19 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressPhysica return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -4886,13 +4886,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -4901,7 +4901,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -4909,28 +4909,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -4944,7 +4944,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -4970,7 +4970,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -4984,13 +4984,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -5004,7 +5004,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsIngressVirtualInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsIngressVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsIngressVirtualInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -5026,7 +5026,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsIngressVirtual return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsPerfMonStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsPerfMonStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsPerfMonStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsPerfMonStatistics) []map[string]interface{} { if items == nil { return nil } @@ -5056,28 +5056,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsPerfMonStatist return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfo) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["accuracy_list"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoAccuracyList(item.AccuracyList) - respItem["detailed_status"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDetailedStatus(item.DetailedStatus) - respItem["device_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStatistics(item.DeviceStatistics) + respItem["accuracy_list"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoAccuracyList(item.AccuracyList) + respItem["detailed_status"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDetailedStatus(item.DetailedStatus) + respItem["device_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDeviceStatistics(item.DeviceStatistics) respItem["device_stats_collection"] = item.DeviceStatsCollection respItem["device_stats_collection_failure_reason"] = item.DeviceStatsCollectionFailureReason - respItem["egress_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterface(item.EgressInterface) - respItem["flex_connect"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnect(item.FlexConnect) + respItem["egress_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterface(item.EgressInterface) + respItem["flex_connect"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnect(item.FlexConnect) respItem["id"] = item.ID - respItem["ingress_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterface(item.IngressInterface) + respItem["ingress_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterface(item.IngressInterface) respItem["ip"] = item.IP respItem["link_information_source"] = item.LinkInformationSource respItem["name"] = item.Name respItem["perf_mon_collection"] = item.PerfMonCollection respItem["perf_mon_collection_failure_reason"] = item.PerfMonCollectionFailureReason - respItem["perf_monitor_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoPerfMonitorStatistics(item.PerfMonitorStatistics) + respItem["perf_monitor_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoPerfMonitorStatistics(item.PerfMonitorStatistics) respItem["role"] = item.Role respItem["ssid"] = item.SSID respItem["tunnels"] = item.Tunnels @@ -5088,7 +5088,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfo(items *[] return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoAccuracyList(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoAccuracyList) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoAccuracyList(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoAccuracyList) []map[string]interface{} { if items == nil { return nil } @@ -5102,7 +5102,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoAccuracyLi return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDetailedStatus(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoDetailedStatus) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDetailedStatus(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoDetailedStatus) []map[string]interface{} { if item == nil { return nil } @@ -5116,13 +5116,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDetailedSt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoDeviceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDeviceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoDeviceStatistics) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["cpu_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStatisticsCPUStatistics(item.CPUStatistics) - respItem["memory_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStatisticsMemoryStatistics(item.MemoryStatistics) + respItem["cpu_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDeviceStatisticsCPUStatistics(item.CPUStatistics) + respItem["memory_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDeviceStatisticsMemoryStatistics(item.MemoryStatistics) return []map[string]interface{}{ respItem, @@ -5130,7 +5130,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStat } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStatisticsCPUStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoDeviceStatisticsCPUStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDeviceStatisticsCPUStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoDeviceStatisticsCPUStatistics) []map[string]interface{} { if item == nil { return nil } @@ -5146,7 +5146,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStat } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStatisticsMemoryStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoDeviceStatisticsMemoryStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoDeviceStatisticsMemoryStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoDeviceStatisticsMemoryStatistics) []map[string]interface{} { if item == nil { return nil } @@ -5161,13 +5161,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoDeviceStat } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterface(item.PhysicalInterface) - respItem["virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterface(item.VirtualInterface) + respItem["physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterface(item.PhysicalInterface) + respItem["virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterface(item.VirtualInterface) return []map[string]interface{}{ respItem, @@ -5175,19 +5175,19 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -5199,13 +5199,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -5214,7 +5214,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -5222,28 +5222,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -5257,7 +5257,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -5283,7 +5283,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -5297,13 +5297,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -5317,7 +5317,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfacePhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfacePhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfacePhysicalInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -5339,21 +5339,21 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterface(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterface(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterface) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -5363,13 +5363,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -5378,7 +5378,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -5386,28 +5386,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -5421,7 +5421,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -5447,7 +5447,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -5461,13 +5461,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -5481,7 +5481,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInterfaceVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoEgressInterfaceVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoEgressInterfaceVirtualInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -5503,15 +5503,15 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoEgressInte return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnect(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnect) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnect(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnect) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["authentication"] = item.Authentication respItem["data_switching"] = item.DataSwitching - respItem["egress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysis(item.EgressACLAnalysis) - respItem["ingress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysis(item.IngressACLAnalysis) + respItem["egress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysis(item.EgressACLAnalysis) + respItem["ingress_acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysis(item.IngressACLAnalysis) respItem["wireless_lan_controller_id"] = item.WirelessLanControllerID respItem["wireless_lan_controller_name"] = item.WirelessLanControllerName @@ -5521,13 +5521,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectEgressACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectEgressACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -5536,7 +5536,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -5544,28 +5544,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectEgressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -5579,13 +5579,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectIngressACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectIngressACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -5594,7 +5594,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -5602,28 +5602,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoFlexConnectIngressACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -5637,13 +5637,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoFlexConnec return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterface(item.PhysicalInterface) - respItem["virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterface(item.VirtualInterface) + respItem["physical_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterface(item.PhysicalInterface) + respItem["virtual_interface"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterface(item.VirtualInterface) return []map[string]interface{}{ respItem, @@ -5651,19 +5651,19 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterface(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterface) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -5675,13 +5675,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -5690,7 +5690,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -5698,28 +5698,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -5733,7 +5733,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -5759,7 +5759,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -5773,13 +5773,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -5793,7 +5793,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfacePhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfacePhysicalInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfacePhysicalInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -5815,21 +5815,21 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterface(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterface) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterface(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterface) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysis(item.ACLAnalysis) + respItem["acl_analysis"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysis(item.ACLAnalysis) respItem["id"] = item.ID - respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) + respItem["interface_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceInterfaceStatistics(item.InterfaceStatistics) respItem["interface_stats_collection"] = item.InterfaceStatsCollection respItem["interface_stats_collection_failure_reason"] = item.InterfaceStatsCollectionFailureReason respItem["name"] = item.Name - respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) - respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceQosStatistics(item.QosStatistics) + respItem["path_overlay_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfo(item.PathOverlayInfo) + respItem["qos_statistics"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceQosStatistics(item.QosStatistics) respItem["qos_stats_collection"] = item.QosStatsCollection respItem["qos_stats_collection_failure_reason"] = item.QosStatsCollectionFailureReason respItem["used_vlan"] = item.UsedVLAN @@ -5839,13 +5839,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysis) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysis(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["acl_name"] = item.ACLName - respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) + respItem["matching_aces"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAces(item.MatchingAces) respItem["result"] = item.Result return []map[string]interface{}{ @@ -5854,7 +5854,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAces(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAces) []map[string]interface{} { if items == nil { return nil } @@ -5862,28 +5862,28 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt for _, item := range *items { respItem := make(map[string]interface{}) respItem["ace"] = item.Ace - respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) + respItem["matching_ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(item.MatchingPorts) respItem["result"] = item.Result respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPorts) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) + respItem["ports"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(item.Ports) respItem["protocol"] = item.Protocol respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceACLAnalysisMatchingAcesMatchingPortsPorts) []map[string]interface{} { if items == nil { return nil } @@ -5897,7 +5897,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceInterfaceStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceInterfaceStatistics(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceInterfaceStatistics) []map[string]interface{} { if item == nil { return nil } @@ -5923,7 +5923,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfo(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfo) []map[string]interface{} { if items == nil { return nil } @@ -5937,13 +5937,13 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt respItem["protocol"] = item.Protocol respItem["source_ip"] = item.SourceIP respItem["source_port"] = item.SourcePort - respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) + respItem["vxlan_info"] = flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item.VxlanInfo) respItems = append(respItems, respItem) } return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfacePathOverlayInfoVxlanInfo) []map[string]interface{} { if item == nil { return nil } @@ -5957,7 +5957,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInterfaceVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceQosStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoIngressInterfaceVirtualInterfaceQosStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoIngressInterfaceVirtualInterfaceQosStatistics) []map[string]interface{} { if items == nil { return nil } @@ -5979,7 +5979,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoIngressInt return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoPerfMonitorStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseNetworkElementsInfoPerfMonitorStatistics) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemNetworkElementsInfoPerfMonitorStatistics(items *[]catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseNetworkElementsInfoPerfMonitorStatistics) []map[string]interface{} { if items == nil { return nil } @@ -6009,7 +6009,7 @@ func flattenPathTraceRetrievesPreviousPathtraceItemNetworkElementsInfoPerfMonito return respItems } -func flattenPathTraceRetrievesPreviousPathtraceItemRequest(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceResponseRequest) []map[string]interface{} { +func flattenPathTraceRetrievesPreviousPathtraceV1ItemRequest(item *catalystcentersdkgo.ResponsePathTraceRetrievesPreviousPathtraceV1ResponseRequest) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_planned_access_points.go b/catalystcenter/data_source_planned_access_points.go index 56b4727..b1b4d33 100644 --- a/catalystcenter/data_source_planned_access_points.go +++ b/catalystcenter/data_source_planned_access_points.go @@ -355,9 +355,9 @@ func dataSourcePlannedAccessPointsRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPlannedAccessPointsForFloor") + log.Printf("[DEBUG] Selected method: GetPlannedAccessPointsForFloorV1") vvFloorID := vFloorID.(string) - queryParams1 := catalystcentersdkgo.GetPlannedAccessPointsForFloorQueryParams{} + queryParams1 := catalystcentersdkgo.GetPlannedAccessPointsForFloorV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -369,24 +369,24 @@ func dataSourcePlannedAccessPointsRead(ctx context.Context, d *schema.ResourceDa queryParams1.Radios = vRadios.(bool) } - response1, restyResp1, err := client.Devices.GetPlannedAccessPointsForFloor(vvFloorID, &queryParams1) + response1, restyResp1, err := client.Devices.GetPlannedAccessPointsForFloorV1(vvFloorID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPlannedAccessPointsForFloor", err, - "Failure at GetPlannedAccessPointsForFloor, unexpected response", "")) + "Failure when executing 2 GetPlannedAccessPointsForFloorV1", err, + "Failure at GetPlannedAccessPointsForFloorV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDevicesGetPlannedAccessPointsForFloorItems(response1.Response) + vItems1 := flattenDevicesGetPlannedAccessPointsForFloorV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPlannedAccessPointsForFloor response", + "Failure when setting GetPlannedAccessPointsForFloorV1 response", err)) return diags } @@ -398,25 +398,25 @@ func dataSourcePlannedAccessPointsRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenDevicesGetPlannedAccessPointsForFloorItems(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponse) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForFloorItemsAttributes(item.Attributes) - respItem["location"] = flattenDevicesGetPlannedAccessPointsForFloorItemsLocation(item.Location) - respItem["position"] = flattenDevicesGetPlannedAccessPointsForFloorItemsPosition(item.Position) + respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForFloorV1ItemsAttributes(item.Attributes) + respItem["location"] = flattenDevicesGetPlannedAccessPointsForFloorV1ItemsLocation(item.Location) + respItem["position"] = flattenDevicesGetPlannedAccessPointsForFloorV1ItemsPosition(item.Position) respItem["radio_count"] = item.RadioCount - respItem["radios"] = flattenDevicesGetPlannedAccessPointsForFloorItemsRadios(item.Radios) + respItem["radios"] = flattenDevicesGetPlannedAccessPointsForFloorV1ItemsRadios(item.Radios) respItem["is_sensor"] = boolPtrToString(item.IsSensor) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetPlannedAccessPointsForFloorItemsAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponseAttributes) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1ItemsAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1ResponseAttributes) []map[string]interface{} { if item == nil { return nil } @@ -437,7 +437,7 @@ func flattenDevicesGetPlannedAccessPointsForFloorItemsAttributes(item *catalystc } -func flattenDevicesGetPlannedAccessPointsForFloorItemsLocation(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponseLocation) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1ItemsLocation(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1ResponseLocation) []map[string]interface{} { if item == nil { return nil } @@ -452,7 +452,7 @@ func flattenDevicesGetPlannedAccessPointsForFloorItemsLocation(item *catalystcen } -func flattenDevicesGetPlannedAccessPointsForFloorItemsPosition(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponsePosition) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1ItemsPosition(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1ResponsePosition) []map[string]interface{} { if item == nil { return nil } @@ -467,22 +467,22 @@ func flattenDevicesGetPlannedAccessPointsForFloorItemsPosition(item *catalystcen } -func flattenDevicesGetPlannedAccessPointsForFloorItemsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponseRadios) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1ItemsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1ResponseRadios) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForFloorItemsRadiosAttributes(item.Attributes) - respItem["antenna"] = flattenDevicesGetPlannedAccessPointsForFloorItemsRadiosAntenna(item.Antenna) + respItem["attributes"] = flattenDevicesGetPlannedAccessPointsForFloorV1ItemsRadiosAttributes(item.Attributes) + respItem["antenna"] = flattenDevicesGetPlannedAccessPointsForFloorV1ItemsRadiosAntenna(item.Antenna) respItem["is_sensor"] = boolPtrToString(item.IsSensor) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetPlannedAccessPointsForFloorItemsRadiosAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponseRadiosAttributes) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1ItemsRadiosAttributes(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1ResponseRadiosAttributes) []map[string]interface{} { if item == nil { return nil } @@ -503,7 +503,7 @@ func flattenDevicesGetPlannedAccessPointsForFloorItemsRadiosAttributes(item *cat } -func flattenDevicesGetPlannedAccessPointsForFloorItemsRadiosAntenna(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorResponseRadiosAntenna) []map[string]interface{} { +func flattenDevicesGetPlannedAccessPointsForFloorV1ItemsRadiosAntenna(item *catalystcentersdkgo.ResponseDevicesGetPlannedAccessPointsForFloorV1ResponseRadiosAntenna) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_platform_nodes_configuration_summary.go b/catalystcenter/data_source_platform_nodes_configuration_summary.go index f67641c..27b7465 100644 --- a/catalystcenter/data_source_platform_nodes_configuration_summary.go +++ b/catalystcenter/data_source_platform_nodes_configuration_summary.go @@ -15,7 +15,7 @@ func dataSourcePlatformNodesConfigurationSummary() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Platform Configuration. -- Provides details about the current Cisco Catalyst Center node configuration, such as API version, node name, NTP server, +- Provides details about the current Cisco DNA Center node configuration, such as API version, node name, NTP server, intracluster link, LACP mode, network static routes, DNS server, subnet mask, host IP, default gateway, and interface information. `, @@ -285,26 +285,26 @@ func dataSourcePlatformNodesConfigurationSummaryRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CiscoDnaCenterNodesConfigurationSummary") + log.Printf("[DEBUG] Selected method: CiscoDnaCenterNodesConfigurationSummaryV1") - response1, restyResp1, err := client.Platform.CiscoDnaCenterNodesConfigurationSummary() + response1, restyResp1, err := client.Platform.CiscoDnaCenterNodesConfigurationSummaryV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CiscoDnaCenterNodesConfigurationSummary", err, - "Failure at CiscoDnaCenterNodesConfigurationSummary, unexpected response", "")) + "Failure when executing 2 CiscoDnaCenterNodesConfigurationSummaryV1", err, + "Failure at CiscoDnaCenterNodesConfigurationSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItem(response1.Response) + vItem1 := flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CiscoDnaCenterNodesConfigurationSummary response", + "Failure when setting CiscoDnaCenterNodesConfigurationSummaryV1 response", err)) return diags } @@ -316,28 +316,28 @@ func dataSourcePlatformNodesConfigurationSummaryRead(ctx context.Context, d *sch return diags } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItem(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponse) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1Item(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["nodes"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodes(item.Nodes) + respItem["nodes"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodes(item.Nodes) return []map[string]interface{}{ respItem, } } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodes(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodes) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodes(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodes) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["ntp"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNtp(item.Ntp) - respItem["network"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetwork(item.Network) - respItem["proxy"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesProxy(item.Proxy) - respItem["platform"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesPlatform(item.Platform) + respItem["ntp"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNtp(item.Ntp) + respItem["network"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetwork(item.Network) + respItem["proxy"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesProxy(item.Proxy) + respItem["platform"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesPlatform(item.Platform) respItem["id"] = item.ID respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -345,7 +345,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodes(items *[]ca return respItems } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNtp(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesNtp) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNtp(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesNtp) []map[string]interface{} { if item == nil { return nil } @@ -358,7 +358,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNtp(item *ca } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetwork(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesNetwork) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetwork(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesNetwork) []map[string]interface{} { if items == nil { return nil } @@ -367,9 +367,9 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetwork(item respItem := make(map[string]interface{}) respItem["intra_cluster_link"] = boolPtrToString(item.IntraClusterLink) respItem["lacp_mode"] = boolPtrToString(item.LacpMode) - respItem["inet"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInet(item.Inet) + respItem["inet"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInet(item.Inet) respItem["interface"] = item.Interface - respItem["inet6"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInet6(item.Inet6) + respItem["inet6"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInet6(item.Inet6) respItem["lacp_supported"] = boolPtrToString(item.LacpSupported) respItem["slave"] = item.SLAve respItems = append(respItems, respItem) @@ -377,14 +377,14 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetwork(item return respItems } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInet(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesNetworkInet) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInet(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesNetworkInet) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["routes"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInetRoutes(item.Routes) + respItem["routes"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInetRoutes(item.Routes) respItem["gateway"] = item.Gateway - respItem["dns_servers"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInetDNSServers(item.DNSServers) + respItem["dns_servers"] = flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInetDNSServers(item.DNSServers) respItem["netmask"] = item.Netmask respItem["host_ip"] = item.HostIP @@ -394,7 +394,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInet( } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInetRoutes(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesNetworkInetRoutes) []interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInetRoutes(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesNetworkInetRoutes) []interface{} { if items == nil { return nil } @@ -406,7 +406,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInetR return respItems } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInetDNSServers(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesNetworkInetDNSServers) []interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInetDNSServers(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesNetworkInetDNSServers) []interface{} { if items == nil { return nil } @@ -418,7 +418,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInetD return respItems } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInet6(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesNetworkInet6) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesNetworkInet6(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesNetworkInet6) []map[string]interface{} { if item == nil { return nil } @@ -432,7 +432,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesNetworkInet6 } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesProxy(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesProxy) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesProxy(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesProxy) []map[string]interface{} { if item == nil { return nil } @@ -449,7 +449,7 @@ func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesProxy(item * } -func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryItemNodesPlatform(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryResponseNodesPlatform) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterNodesConfigurationSummaryV1ItemNodesPlatform(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterNodesConfigurationSummaryV1ResponseNodesPlatform) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_platform_release_summary.go b/catalystcenter/data_source_platform_release_summary.go index 64927fd..5dcb3f4 100644 --- a/catalystcenter/data_source_platform_release_summary.go +++ b/catalystcenter/data_source_platform_release_summary.go @@ -16,7 +16,7 @@ func dataSourcePlatformReleaseSummary() *schema.Resource { Description: `It performs read operation on Platform Configuration. - Provides information such as API version, mandatory core packages for installation or upgrade, optional packages, -Cisco Catalyst Center name and version, supported direct updates, and tenant ID. +Cisco DNA Center name and version, supported direct updates, and tenant ID. `, ReadContext: dataSourcePlatformReleaseSummaryRead, @@ -80,7 +80,7 @@ Cisco Catalyst Center name and version, supported direct updates, and tenant ID. }, "tenant_id": &schema.Schema{ - Description: `Tenant ID (for multi tenant Cisco Catalyst Center) + Description: `Tenant ID (for multi tenant Cisco DNA Center) `, Type: schema.TypeString, Computed: true, @@ -99,26 +99,26 @@ func dataSourcePlatformReleaseSummaryRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CiscoDnaCenterReleaseSummary") + log.Printf("[DEBUG] Selected method: CiscoDnaCenterReleaseSummaryV1") - response1, restyResp1, err := client.Platform.CiscoDnaCenterReleaseSummary() + response1, restyResp1, err := client.Platform.CiscoDnaCenterReleaseSummaryV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CiscoDnaCenterReleaseSummary", err, - "Failure at CiscoDnaCenterReleaseSummary, unexpected response", "")) + "Failure when executing 2 CiscoDnaCenterReleaseSummaryV1", err, + "Failure at CiscoDnaCenterReleaseSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenPlatformCiscoDnaCenterReleaseSummaryItem(response1.Response) + vItem1 := flattenPlatformCiscoDnaCenterReleaseSummaryV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CiscoDnaCenterReleaseSummary response", + "Failure when setting CiscoDnaCenterReleaseSummaryV1 response", err)) return diags } @@ -130,7 +130,7 @@ func dataSourcePlatformReleaseSummaryRead(ctx context.Context, d *schema.Resourc return diags } -func flattenPlatformCiscoDnaCenterReleaseSummaryItem(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterReleaseSummaryResponse) []map[string]interface{} { +func flattenPlatformCiscoDnaCenterReleaseSummaryV1Item(item *catalystcentersdkgo.ResponsePlatformCiscoDnaCenterReleaseSummaryV1Response) []map[string]interface{} { if item == nil { return nil } @@ -140,14 +140,14 @@ func flattenPlatformCiscoDnaCenterReleaseSummaryItem(item *catalystcentersdkgo.R respItem["name"] = item.Name respItem["installed_version"] = item.InstalledVersion respItem["system_version"] = item.SystemVersion - respItem["supported_direct_updates"] = flattenPlatformCiscoDnaCenterReleaseSummaryItemSupportedDirectUpdates(item.SupportedDirectUpdates) + respItem["supported_direct_updates"] = flattenPlatformCiscoDnaCenterReleaseSummaryV1ItemSupportedDirectUpdates(item.SupportedDirectUpdates) respItem["tenant_id"] = item.TenantID return []map[string]interface{}{ respItem, } } -func flattenPlatformCiscoDnaCenterReleaseSummaryItemSupportedDirectUpdates(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterReleaseSummaryResponseSupportedDirectUpdates) []interface{} { +func flattenPlatformCiscoDnaCenterReleaseSummaryV1ItemSupportedDirectUpdates(items *[]catalystcentersdkgo.ResponsePlatformCiscoDnaCenterReleaseSummaryV1ResponseSupportedDirectUpdates) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_pnp_device.go b/catalystcenter/data_source_pnp_device.go index bf056a9..3a1189a 100644 --- a/catalystcenter/data_source_pnp_device.go +++ b/catalystcenter/data_source_pnp_device.go @@ -3544,8 +3544,8 @@ func dataSourcePnpDeviceRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceList2") - queryParams1 := catalystcentersdkgo.GetDeviceList2QueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceListSiteManagementV1") + queryParams1 := catalystcentersdkgo.GetDeviceListSiteManagementV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(int) @@ -3602,24 +3602,24 @@ func dataSourcePnpDeviceRead(ctx context.Context, d *schema.ResourceData, m inte queryParams1.SiteName = vSiteName.(string) } - response1, restyResp1, err := client.DeviceOnboardingPnp.GetDeviceList2(&queryParams1) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetDeviceListSiteManagementV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceList2", err, - "Failure at GetDeviceList2, unexpected response", "")) + "Failure when executing 2 GetDeviceListSiteManagementV1", err, + "Failure at GetDeviceListSiteManagementV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDeviceOnboardingPnpGetDeviceList2Items(response1) + vItems1 := flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceList2 response", + "Failure when setting GetDeviceListSiteManagementV1 response", err)) return diags } @@ -3629,27 +3629,27 @@ func dataSourcePnpDeviceRead(ctx context.Context, d *schema.ResourceData, m inte } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetDeviceByID") + log.Printf("[DEBUG] Selected method: GetDeviceByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.DeviceOnboardingPnp.GetDeviceByID(vvID) + response2, restyResp2, err := client.DeviceOnboardingPnp.GetDeviceByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceByID", err, - "Failure at GetDeviceByID, unexpected response", "")) + "Failure when executing 2 GetDeviceByIDV1", err, + "Failure at GetDeviceByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDeviceOnboardingPnpGetDeviceByIDItem(response2) + vItem2 := flattenDeviceOnboardingPnpGetDeviceByIDV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceByID response", + "Failure when setting GetDeviceByIDV1 response", err)) return diags } @@ -3661,21 +3661,21 @@ func dataSourcePnpDeviceRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenDeviceOnboardingPnpGetDeviceList2Items(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceList2) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1Items(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceListSiteManagementV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["device_info"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfo(item.DeviceInfo) - respItem["system_reset_workflow"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflow(item.SystemResetWorkflow) - respItem["system_workflow"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflow(item.SystemWorkflow) - respItem["workflow"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflow(item.Workflow) - respItem["run_summary_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryList(item.RunSummaryList) - respItem["workflow_parameters"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParameters(item.WorkflowParameters) - respItem["day_zero_config"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDayZeroConfig(item.DayZeroConfig) - respItem["day_zero_config_preview"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDayZeroConfigPreview(item.DayZeroConfigPreview) + respItem["device_info"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfo(item.DeviceInfo) + respItem["system_reset_workflow"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemResetWorkflow(item.SystemResetWorkflow) + respItem["system_workflow"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemWorkflow(item.SystemWorkflow) + respItem["workflow"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflow(item.Workflow) + respItem["run_summary_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryList(item.RunSummaryList) + respItem["workflow_parameters"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowParameters(item.WorkflowParameters) + respItem["day_zero_config"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDayZeroConfig(item.DayZeroConfig) + respItem["day_zero_config_preview"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDayZeroConfigPreview(item.DayZeroConfigPreview) respItem["version"] = item.Version respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -3683,7 +3683,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2Items(items *catalystcentersdkgo.Re return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfo(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfo(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfo) []map[string]interface{} { if item == nil { return nil } @@ -3693,7 +3693,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfo(item *catalystcente respItem["stack"] = boolPtrToString(item.Stack) respItem["mode"] = item.Mode respItem["state"] = item.State - respItem["location"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoLocation(item.Location) + respItem["location"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoLocation(item.Location) respItem["description"] = item.Description respItem["onb_state"] = item.OnbState respItem["authenticated_mic_number"] = item.AuthenticatedMicNumber @@ -3714,25 +3714,25 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfo(item *catalystcente respItem["device_type"] = item.DeviceType respItem["agent_type"] = item.AgentType respItem["image_version"] = item.ImageVersion - respItem["file_system_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoFileSystemList(item.FileSystemList) - respItem["pnp_profile_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileList(item.PnpProfileList) + respItem["file_system_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoFileSystemList(item.FileSystemList) + respItem["pnp_profile_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileList(item.PnpProfileList) respItem["image_file"] = item.ImageFile - respItem["http_headers"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoHTTPHeaders(item.HTTPHeaders) - respItem["neighbor_links"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoNeighborLinks(item.NeighborLinks) + respItem["http_headers"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoHTTPHeaders(item.HTTPHeaders) + respItem["neighbor_links"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoNeighborLinks(item.NeighborLinks) respItem["last_sync_time"] = item.LastSyncTime - respItem["ip_interfaces"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfaces(item.IPInterfaces) + respItem["ip_interfaces"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoIPInterfaces(item.IPInterfaces) respItem["hostname"] = item.Hostname respItem["auth_status"] = item.AuthStatus - respItem["stack_info"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoStackInfo(item.StackInfo) + respItem["stack_info"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoStackInfo(item.StackInfo) respItem["reload_requested"] = boolPtrToString(item.ReloadRequested) respItem["added_on"] = item.AddedOn respItem["site_id"] = item.SiteID - respItem["aaa_credentials"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoAAACredentials(item.AAACredentials) + respItem["aaa_credentials"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoAAACredentials(item.AAACredentials) respItem["user_mic_numbers"] = item.UserMicNumbers respItem["user_sudi_serial_nos"] = item.UserSudiSerialNos respItem["addn_mac_addrs"] = item.AddnMacAddrs - respItem["pre_workflow_cli_ouputs"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPreWorkflowCliOuputs(item.PreWorkflowCliOuputs) - respItem["tags"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoTags(item.Tags) + respItem["pre_workflow_cli_ouputs"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPreWorkflowCliOuputs(item.PreWorkflowCliOuputs) + respItem["tags"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoTags(item.Tags) respItem["sudi_required"] = boolPtrToString(item.SudiRequired) respItem["smart_account_id"] = item.SmartAccountID respItem["virtual_account_id"] = item.VirtualAccountID @@ -3746,7 +3746,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfo(item *catalystcente } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoLocation(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoLocation) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoLocation(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoLocation) []map[string]interface{} { if item == nil { return nil } @@ -3763,7 +3763,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoLocation(item *catal } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoFileSystemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoFileSystemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoFileSystemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoFileSystemList) []map[string]interface{} { if items == nil { return nil } @@ -3781,7 +3781,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoFileSystemList(items return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileList) []map[string]interface{} { if items == nil { return nil } @@ -3791,22 +3791,22 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileList(items respItem["profile_name"] = item.ProfileName respItem["discovery_created"] = boolPtrToString(item.DiscoveryCreated) respItem["created_by"] = item.CreatedBy - respItem["primary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimaryEndpoint(item.PrimaryEndpoint) - respItem["secondary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecondaryEndpoint(item.SecondaryEndpoint) + respItem["primary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListPrimaryEndpoint(item.PrimaryEndpoint) + respItem["secondary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListSecondaryEndpoint(item.SecondaryEndpoint) respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimaryEndpoint(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileListPrimaryEndpoint) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListPrimaryEndpoint(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileListPrimaryEndpoint) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["port"] = item.Port respItem["protocol"] = item.Protocol - respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item.IPv4Address) - respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item.IPv6Address) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item.IPv4Address) + respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item.IPv6Address) respItem["fqdn"] = item.Fqdn respItem["certificate"] = item.Certificate @@ -3816,7 +3816,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimar } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileListPrimaryEndpointIPv4Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileListPrimaryEndpointIPv4Address) interface{} { if item == nil { return nil } @@ -3826,7 +3826,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimar } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileListPrimaryEndpointIPv6Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileListPrimaryEndpointIPv6Address) interface{} { if item == nil { return nil } @@ -3836,15 +3836,15 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListPrimar } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecondaryEndpoint(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileListSecondaryEndpoint) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListSecondaryEndpoint(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileListSecondaryEndpoint) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["port"] = item.Port respItem["protocol"] = item.Protocol - respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item.IPv4Address) - respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item.IPv6Address) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item.IPv4Address) + respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item.IPv6Address) respItem["fqdn"] = item.Fqdn respItem["certificate"] = item.Certificate @@ -3854,7 +3854,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecond } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileListSecondaryEndpointIPv4Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileListSecondaryEndpointIPv4Address) interface{} { if item == nil { return nil } @@ -3864,7 +3864,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecond } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPnpProfileListSecondaryEndpointIPv6Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPnpProfileListSecondaryEndpointIPv6Address) interface{} { if item == nil { return nil } @@ -3874,7 +3874,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPnpProfileListSecond } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoHTTPHeaders(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoHTTPHeaders) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoHTTPHeaders(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoHTTPHeaders) []map[string]interface{} { if items == nil { return nil } @@ -3888,7 +3888,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoHTTPHeaders(items *[ return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoNeighborLinks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoNeighborLinks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoNeighborLinks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoNeighborLinks) []map[string]interface{} { if items == nil { return nil } @@ -3909,7 +3909,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoNeighborLinks(items return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfaces(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoIPInterfaces) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoIPInterfaces(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoIPInterfaces) []map[string]interface{} { if items == nil { return nil } @@ -3918,15 +3918,15 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfaces(items * respItem := make(map[string]interface{}) respItem["status"] = item.Status respItem["mac_address"] = item.MacAddress - respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfacesIPv4Address(item.IPv4Address) - respItem["ipv6_address_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfacesIPv6AddressList(item.IPv6AddressList) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoIPInterfacesIPv4Address(item.IPv4Address) + respItem["ipv6_address_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoIPInterfacesIPv6AddressList(item.IPv6AddressList) respItem["name"] = item.Name respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfacesIPv4Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoIPInterfacesIPv4Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoIPInterfacesIPv4Address(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoIPInterfacesIPv4Address) interface{} { if item == nil { return nil } @@ -3936,7 +3936,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfacesIPv4Addr } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfacesIPv6AddressList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoIPInterfacesIPv6AddressList) []interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoIPInterfacesIPv6AddressList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoIPInterfacesIPv6AddressList) []interface{} { if items == nil { return nil } @@ -3948,14 +3948,14 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoIPInterfacesIPv6Addr return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoStackInfo(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoStackInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoStackInfo(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoStackInfo) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["supports_stack_workflows"] = boolPtrToString(item.SupportsStackWorkflows) respItem["is_full_ring"] = boolPtrToString(item.IsFullRing) - respItem["stack_member_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoStackInfoStackMemberList(item.StackMemberList) + respItem["stack_member_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoStackInfoStackMemberList(item.StackMemberList) respItem["stack_ring_protocol"] = item.StackRingProtocol respItem["valid_license_levels"] = item.ValidLicenseLevels respItem["total_member_count"] = item.TotalMemberCount @@ -3966,7 +3966,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoStackInfo(item *cata } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoStackInfoStackMemberList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoStackInfoStackMemberList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoStackInfoStackMemberList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoStackInfoStackMemberList) []map[string]interface{} { if items == nil { return nil } @@ -3990,7 +3990,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoStackInfoStackMember return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoAAACredentials(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoAAACredentials) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoAAACredentials(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoAAACredentials) []map[string]interface{} { if item == nil { return nil } @@ -4004,7 +4004,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoAAACredentials(item } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPreWorkflowCliOuputs(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoPreWorkflowCliOuputs) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoPreWorkflowCliOuputs(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoPreWorkflowCliOuputs) []map[string]interface{} { if items == nil { return nil } @@ -4018,7 +4018,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoPreWorkflowCliOuputs return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoTags(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DeviceInfoTags) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDeviceInfoTags(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DeviceInfoTags) interface{} { if item == nil { return nil } @@ -4028,7 +4028,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDeviceInfoTags(item *catalystc } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflow(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2SystemResetWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemResetWorkflow(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1SystemResetWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -4041,7 +4041,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflow(item *cata respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemResetWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -4059,7 +4059,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflow(item *cata } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2SystemResetWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemResetWorkflowTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1SystemResetWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -4072,7 +4072,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasks(items respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemResetWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -4080,7 +4080,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasks(items return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2SystemResetWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemResetWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1SystemResetWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4098,7 +4098,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemResetWorkflowTasksWorkIt return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflow(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2SystemWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemWorkflow(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1SystemWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -4111,7 +4111,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflow(item *catalystc respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -4129,7 +4129,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflow(item *catalystc } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2SystemWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemWorkflowTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1SystemWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -4142,7 +4142,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasks(items *[]c respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -4150,7 +4150,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasks(items *[]c return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2SystemWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsSystemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1SystemWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4168,7 +4168,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsSystemWorkflowTasksWorkItemLis return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflow(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2Workflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflow(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1Workflow) []map[string]interface{} { if item == nil { return nil } @@ -4181,7 +4181,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflow(item *catalystcenters respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -4199,7 +4199,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflow(item *catalystcenters } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2WorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1WorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -4212,7 +4212,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasks(items *[]catalys respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -4220,7 +4220,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasks(items *[]catalys return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2WorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1WorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4238,7 +4238,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowTasksWorkItemList(item return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2RunSummaryList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1RunSummaryList) []map[string]interface{} { if items == nil { return nil } @@ -4246,7 +4246,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryList(items *[]cataly for _, item := range *items { respItem := make(map[string]interface{}) respItem["details"] = item.Details - respItem["history_task_info"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfo(item.HistoryTaskInfo) + respItem["history_task_info"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryListHistoryTaskInfo(item.HistoryTaskInfo) respItem["error_flag"] = boolPtrToString(item.ErrorFlag) respItem["timestamp"] = item.Timestamp respItems = append(respItems, respItem) @@ -4254,15 +4254,15 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryList(items *[]cataly return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfo(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2RunSummaryListHistoryTaskInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryListHistoryTaskInfo(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1RunSummaryListHistoryTaskInfo) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["type"] = item.Type - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfoWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryListHistoryTaskInfoWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken - respItem["addn_details"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfoAddnDetails(item.AddnDetails) + respItem["addn_details"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryListHistoryTaskInfoAddnDetails(item.AddnDetails) respItem["name"] = item.Name return []map[string]interface{}{ @@ -4271,7 +4271,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfo( } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2RunSummaryListHistoryTaskInfoWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryListHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1RunSummaryListHistoryTaskInfoWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4289,7 +4289,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfoW return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2RunSummaryListHistoryTaskInfoAddnDetails) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsRunSummaryListHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1RunSummaryListHistoryTaskInfoAddnDetails) []map[string]interface{} { if items == nil { return nil } @@ -4303,7 +4303,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsRunSummaryListHistoryTaskInfoA return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParameters(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2WorkflowParameters) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowParameters(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1WorkflowParameters) []map[string]interface{} { if item == nil { return nil } @@ -4311,7 +4311,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParameters(item *catal respItem["top_of_stack_serial_number"] = item.TopOfStackSerialNumber respItem["license_level"] = item.LicenseLevel respItem["license_type"] = item.LicenseType - respItem["config_list"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParametersConfigList(item.ConfigList) + respItem["config_list"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowParametersConfigList(item.ConfigList) return []map[string]interface{}{ respItem, @@ -4319,21 +4319,21 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParameters(item *catal } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParametersConfigList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2WorkflowParametersConfigList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowParametersConfigList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1WorkflowParametersConfigList) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["config_parameters"] = flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParametersConfigListConfigParameters(item.ConfigParameters) + respItem["config_parameters"] = flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowParametersConfigListConfigParameters(item.ConfigParameters) respItem["config_id"] = item.ConfigID respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParametersConfigListConfigParameters(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2WorkflowParametersConfigListConfigParameters) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsWorkflowParametersConfigListConfigParameters(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1WorkflowParametersConfigListConfigParameters) []map[string]interface{} { if items == nil { return nil } @@ -4347,7 +4347,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsWorkflowParametersConfigListCo return respItems } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDayZeroConfig(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DayZeroConfig) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDayZeroConfig(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DayZeroConfig) []map[string]interface{} { if item == nil { return nil } @@ -4360,7 +4360,7 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDayZeroConfig(item *catalystce } -func flattenDeviceOnboardingPnpGetDeviceList2ItemsDayZeroConfigPreview(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2DayZeroConfigPreview) interface{} { +func flattenDeviceOnboardingPnpGetDeviceListSiteManagementV1ItemsDayZeroConfigPreview(item *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1DayZeroConfigPreview) interface{} { if item == nil { return nil } @@ -4370,20 +4370,20 @@ func flattenDeviceOnboardingPnpGetDeviceList2ItemsDayZeroConfigPreview(item *cat } -func flattenDeviceOnboardingPnpGetDeviceByIDItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByID) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["type_id"] = item.TypeID - respItem["device_info"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfo(item.DeviceInfo) - respItem["system_reset_workflow"] = flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflow(item.SystemResetWorkflow) - respItem["system_workflow"] = flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflow(item.SystemWorkflow) - respItem["workflow"] = flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflow(item.Workflow) - respItem["run_summary_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryList(item.RunSummaryList) - respItem["workflow_parameters"] = flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParameters(item.WorkflowParameters) - respItem["day_zero_config"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDayZeroConfig(item.DayZeroConfig) - respItem["day_zero_config_preview"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDayZeroConfigPreview(item.DayZeroConfigPreview) + respItem["device_info"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfo(item.DeviceInfo) + respItem["system_reset_workflow"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemResetWorkflow(item.SystemResetWorkflow) + respItem["system_workflow"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemWorkflow(item.SystemWorkflow) + respItem["workflow"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflow(item.Workflow) + respItem["run_summary_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryList(item.RunSummaryList) + respItem["workflow_parameters"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowParameters(item.WorkflowParameters) + respItem["day_zero_config"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDayZeroConfig(item.DayZeroConfig) + respItem["day_zero_config_preview"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDayZeroConfigPreview(item.DayZeroConfigPreview) respItem["version"] = item.Version respItem["tenant_id"] = item.TenantID return []map[string]interface{}{ @@ -4391,7 +4391,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItem(item *catalystcentersdkgo.Respo } } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfo) []map[string]interface{} { if item == nil { return nil } @@ -4401,7 +4401,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfo(item *catalystcenters respItem["stack"] = boolPtrToString(item.Stack) respItem["mode"] = item.Mode respItem["state"] = item.State - respItem["location"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoLocation(item.Location) + respItem["location"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoLocation(item.Location) respItem["description"] = item.Description respItem["onb_state"] = item.OnbState respItem["authenticated_mic_number"] = item.AuthenticatedMicNumber @@ -4422,25 +4422,25 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfo(item *catalystcenters respItem["device_type"] = item.DeviceType respItem["agent_type"] = item.AgentType respItem["image_version"] = item.ImageVersion - respItem["file_system_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoFileSystemList(item.FileSystemList) - respItem["pnp_profile_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileList(item.PnpProfileList) + respItem["file_system_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoFileSystemList(item.FileSystemList) + respItem["pnp_profile_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileList(item.PnpProfileList) respItem["image_file"] = item.ImageFile - respItem["http_headers"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoHTTPHeaders(item.HTTPHeaders) - respItem["neighbor_links"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoNeighborLinks(item.NeighborLinks) + respItem["http_headers"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoHTTPHeaders(item.HTTPHeaders) + respItem["neighbor_links"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoNeighborLinks(item.NeighborLinks) respItem["last_sync_time"] = item.LastSyncTime - respItem["ip_interfaces"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfaces(item.IPInterfaces) + respItem["ip_interfaces"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoIPInterfaces(item.IPInterfaces) respItem["hostname"] = item.Hostname respItem["auth_status"] = item.AuthStatus - respItem["stack_info"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoStackInfo(item.StackInfo) + respItem["stack_info"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoStackInfo(item.StackInfo) respItem["reload_requested"] = boolPtrToString(item.ReloadRequested) respItem["added_on"] = item.AddedOn respItem["site_id"] = item.SiteID - respItem["aaa_credentials"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoAAACredentials(item.AAACredentials) + respItem["aaa_credentials"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoAAACredentials(item.AAACredentials) respItem["user_mic_numbers"] = item.UserMicNumbers respItem["user_sudi_serial_nos"] = item.UserSudiSerialNos respItem["addn_mac_addrs"] = item.AddnMacAddrs - respItem["pre_workflow_cli_ouputs"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPreWorkflowCliOuputs(item.PreWorkflowCliOuputs) - respItem["tags"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoTags(item.Tags) + respItem["pre_workflow_cli_ouputs"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPreWorkflowCliOuputs(item.PreWorkflowCliOuputs) + respItem["tags"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoTags(item.Tags) respItem["sudi_required"] = boolPtrToString(item.SudiRequired) respItem["smart_account_id"] = item.SmartAccountID respItem["virtual_account_id"] = item.VirtualAccountID @@ -4454,7 +4454,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfo(item *catalystcenters } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoLocation(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoLocation) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoLocation(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoLocation) []map[string]interface{} { if item == nil { return nil } @@ -4471,7 +4471,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoLocation(item *catalys } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoFileSystemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoFileSystemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoFileSystemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoFileSystemList) []map[string]interface{} { if items == nil { return nil } @@ -4489,7 +4489,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoFileSystemList(items * return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileList) []map[string]interface{} { if items == nil { return nil } @@ -4499,22 +4499,22 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileList(items * respItem["profile_name"] = item.ProfileName respItem["discovery_created"] = boolPtrToString(item.DiscoveryCreated) respItem["created_by"] = item.CreatedBy - respItem["primary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryEndpoint(item.PrimaryEndpoint) - respItem["secondary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondaryEndpoint(item.SecondaryEndpoint) + respItem["primary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListPrimaryEndpoint(item.PrimaryEndpoint) + respItem["secondary_endpoint"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListSecondaryEndpoint(item.SecondaryEndpoint) respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileListPrimaryEndpoint) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListPrimaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileListPrimaryEndpoint) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["port"] = item.Port respItem["protocol"] = item.Protocol - respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item.IPv4Address) - respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item.IPv6Address) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item.IPv4Address) + respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item.IPv6Address) respItem["fqdn"] = item.Fqdn respItem["certificate"] = item.Certificate @@ -4524,7 +4524,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryE } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileListPrimaryEndpointIPv4Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileListPrimaryEndpointIPv4Address) interface{} { if item == nil { return nil } @@ -4534,7 +4534,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryE } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileListPrimaryEndpointIPv6Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileListPrimaryEndpointIPv6Address) interface{} { if item == nil { return nil } @@ -4544,15 +4544,15 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListPrimaryE } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileListSecondaryEndpoint) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListSecondaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileListSecondaryEndpoint) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["port"] = item.Port respItem["protocol"] = item.Protocol - respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item.IPv4Address) - respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item.IPv6Address) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item.IPv4Address) + respItem["ipv6_address"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item.IPv6Address) respItem["fqdn"] = item.Fqdn respItem["certificate"] = item.Certificate @@ -4562,7 +4562,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondar } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileListSecondaryEndpointIPv4Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileListSecondaryEndpointIPv4Address) interface{} { if item == nil { return nil } @@ -4572,7 +4572,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondar } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPnpProfileListSecondaryEndpointIPv6Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPnpProfileListSecondaryEndpointIPv6Address) interface{} { if item == nil { return nil } @@ -4582,7 +4582,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPnpProfileListSecondar } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoHTTPHeaders(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoHTTPHeaders) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoHTTPHeaders(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoHTTPHeaders) []map[string]interface{} { if items == nil { return nil } @@ -4596,7 +4596,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoHTTPHeaders(items *[]c return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoNeighborLinks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoNeighborLinks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoNeighborLinks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoNeighborLinks) []map[string]interface{} { if items == nil { return nil } @@ -4617,7 +4617,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoNeighborLinks(items *[ return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfaces(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoIPInterfaces) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoIPInterfaces(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoIPInterfaces) []map[string]interface{} { if items == nil { return nil } @@ -4626,15 +4626,15 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfaces(items *[] respItem := make(map[string]interface{}) respItem["status"] = item.Status respItem["mac_address"] = item.MacAddress - respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfacesIPv4Address(item.IPv4Address) - respItem["ipv6_address_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfacesIPv6AddressList(item.IPv6AddressList) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoIPInterfacesIPv4Address(item.IPv4Address) + respItem["ipv6_address_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoIPInterfacesIPv6AddressList(item.IPv6AddressList) respItem["name"] = item.Name respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfacesIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoIPInterfacesIPv4Address) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoIPInterfacesIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoIPInterfacesIPv4Address) interface{} { if item == nil { return nil } @@ -4644,7 +4644,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfacesIPv4Addres } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfacesIPv6AddressList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoIPInterfacesIPv6AddressList) []interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoIPInterfacesIPv6AddressList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoIPInterfacesIPv6AddressList) []interface{} { if items == nil { return nil } @@ -4656,14 +4656,14 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoIPInterfacesIPv6Addres return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoStackInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoStackInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoStackInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoStackInfo) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["supports_stack_workflows"] = boolPtrToString(item.SupportsStackWorkflows) respItem["is_full_ring"] = boolPtrToString(item.IsFullRing) - respItem["stack_member_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoStackInfoStackMemberList(item.StackMemberList) + respItem["stack_member_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoStackInfoStackMemberList(item.StackMemberList) respItem["stack_ring_protocol"] = item.StackRingProtocol respItem["valid_license_levels"] = item.ValidLicenseLevels respItem["total_member_count"] = item.TotalMemberCount @@ -4674,7 +4674,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoStackInfo(item *cataly } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoStackInfoStackMemberList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoStackInfoStackMemberList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoStackInfoStackMemberList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoStackInfoStackMemberList) []map[string]interface{} { if items == nil { return nil } @@ -4698,7 +4698,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoStackInfoStackMemberLi return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoAAACredentials(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoAAACredentials) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoAAACredentials(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoAAACredentials) []map[string]interface{} { if item == nil { return nil } @@ -4712,7 +4712,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoAAACredentials(item *c } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPreWorkflowCliOuputs(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoPreWorkflowCliOuputs) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoPreWorkflowCliOuputs(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoPreWorkflowCliOuputs) []map[string]interface{} { if items == nil { return nil } @@ -4726,7 +4726,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoPreWorkflowCliOuputs(i return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoTags(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDeviceInfoTags) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDeviceInfoTags(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DeviceInfoTags) interface{} { if item == nil { return nil } @@ -4736,7 +4736,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDeviceInfoTags(item *catalystcen } -func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDSystemResetWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemResetWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1SystemResetWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -4749,7 +4749,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflow(item *cataly respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemResetWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -4767,7 +4767,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflow(item *cataly } -func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDSystemResetWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemResetWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1SystemResetWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -4780,7 +4780,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasks(items * respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemResetWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -4788,7 +4788,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasks(items * return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDSystemResetWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemResetWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1SystemResetWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4806,7 +4806,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemResetWorkflowTasksWorkItem return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDSystemWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1SystemWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -4819,7 +4819,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflow(item *catalystcen respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -4837,7 +4837,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflow(item *catalystcen } -func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDSystemWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1SystemWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -4850,7 +4850,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasks(items *[]cat respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -4858,7 +4858,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasks(items *[]cat return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDSystemWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemSystemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1SystemWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4876,7 +4876,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemSystemWorkflowTasksWorkItemList( return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1Workflow) []map[string]interface{} { if item == nil { return nil } @@ -4889,7 +4889,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflow(item *catalystcentersdk respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -4907,7 +4907,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflow(item *catalystcentersdk } -func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1WorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -4920,7 +4920,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasks(items *[]catalystc respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -4928,7 +4928,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasks(items *[]catalystc return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1WorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4946,7 +4946,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowTasksWorkItemList(items return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDRunSummaryList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1RunSummaryList) []map[string]interface{} { if items == nil { return nil } @@ -4954,7 +4954,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryList(items *[]catalyst for _, item := range *items { respItem := make(map[string]interface{}) respItem["details"] = item.Details - respItem["history_task_info"] = flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfo(item.HistoryTaskInfo) + respItem["history_task_info"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryListHistoryTaskInfo(item.HistoryTaskInfo) respItem["error_flag"] = boolPtrToString(item.ErrorFlag) respItem["timestamp"] = item.Timestamp respItems = append(respItems, respItem) @@ -4962,15 +4962,15 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryList(items *[]catalyst return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDRunSummaryListHistoryTaskInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryListHistoryTaskInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1RunSummaryListHistoryTaskInfo) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["type"] = item.Type - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfoWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryListHistoryTaskInfoWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken - respItem["addn_details"] = flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfoAddnDetails(item.AddnDetails) + respItem["addn_details"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryListHistoryTaskInfoAddnDetails(item.AddnDetails) respItem["name"] = item.Name return []map[string]interface{}{ @@ -4979,7 +4979,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfo(it } -func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDRunSummaryListHistoryTaskInfoWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryListHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1RunSummaryListHistoryTaskInfoWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -4997,7 +4997,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfoWor return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDRunSummaryListHistoryTaskInfoAddnDetails) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemRunSummaryListHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1RunSummaryListHistoryTaskInfoAddnDetails) []map[string]interface{} { if items == nil { return nil } @@ -5011,7 +5011,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemRunSummaryListHistoryTaskInfoAdd return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParameters(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDWorkflowParameters) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowParameters(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1WorkflowParameters) []map[string]interface{} { if item == nil { return nil } @@ -5019,7 +5019,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParameters(item *catalys respItem["top_of_stack_serial_number"] = item.TopOfStackSerialNumber respItem["license_level"] = item.LicenseLevel respItem["license_type"] = item.LicenseType - respItem["config_list"] = flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParametersConfigList(item.ConfigList) + respItem["config_list"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowParametersConfigList(item.ConfigList) return []map[string]interface{}{ respItem, @@ -5027,21 +5027,21 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParameters(item *catalys } -func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParametersConfigList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDWorkflowParametersConfigList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowParametersConfigList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1WorkflowParametersConfigList) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["config_parameters"] = flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParametersConfigListConfigParameters(item.ConfigParameters) + respItem["config_parameters"] = flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowParametersConfigListConfigParameters(item.ConfigParameters) respItem["config_id"] = item.ConfigID respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParametersConfigListConfigParameters(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDWorkflowParametersConfigListConfigParameters) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemWorkflowParametersConfigListConfigParameters(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1WorkflowParametersConfigListConfigParameters) []map[string]interface{} { if items == nil { return nil } @@ -5055,7 +5055,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemWorkflowParametersConfigListConf return respItems } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDayZeroConfig(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDayZeroConfig) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDayZeroConfig(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DayZeroConfig) []map[string]interface{} { if item == nil { return nil } @@ -5068,7 +5068,7 @@ func flattenDeviceOnboardingPnpGetDeviceByIDItemDayZeroConfig(item *catalystcent } -func flattenDeviceOnboardingPnpGetDeviceByIDItemDayZeroConfigPreview(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDDayZeroConfigPreview) interface{} { +func flattenDeviceOnboardingPnpGetDeviceByIDV1ItemDayZeroConfigPreview(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceByIDV1DayZeroConfigPreview) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_pnp_device_count.go b/catalystcenter/data_source_pnp_device_count.go index 0604653..f69f760 100644 --- a/catalystcenter/data_source_pnp_device_count.go +++ b/catalystcenter/data_source_pnp_device_count.go @@ -153,8 +153,8 @@ func dataSourcePnpDeviceCountRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceCount") - queryParams1 := catalystcentersdkgo.GetDeviceCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceCountV1") + queryParams1 := catalystcentersdkgo.GetDeviceCountV1QueryParams{} if okSerialNumber { queryParams1.SerialNumber = interfaceToSliceString(vSerialNumber) @@ -190,24 +190,24 @@ func dataSourcePnpDeviceCountRead(ctx context.Context, d *schema.ResourceData, m queryParams1.LastContact = vLastContact.(bool) } - response1, restyResp1, err := client.DeviceOnboardingPnp.GetDeviceCount(&queryParams1) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetDeviceCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceCount", err, - "Failure at GetDeviceCount, unexpected response", "")) + "Failure when executing 2 GetDeviceCountV1", err, + "Failure at GetDeviceCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDeviceOnboardingPnpGetDeviceCountItem(response1) + vItem1 := flattenDeviceOnboardingPnpGetDeviceCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceCount response", + "Failure when setting GetDeviceCountV1 response", err)) return diags } @@ -219,7 +219,7 @@ func dataSourcePnpDeviceCountRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDeviceOnboardingPnpGetDeviceCountItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceCount) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceCountV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_pnp_device_history.go b/catalystcenter/data_source_pnp_device_history.go index 541b272..aeadf95 100644 --- a/catalystcenter/data_source_pnp_device_history.go +++ b/catalystcenter/data_source_pnp_device_history.go @@ -176,8 +176,8 @@ func dataSourcePnpDeviceHistoryRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceHistory") - queryParams1 := catalystcentersdkgo.GetDeviceHistoryQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceHistoryV1") + queryParams1 := catalystcentersdkgo.GetDeviceHistoryV1QueryParams{} queryParams1.SerialNumber = vSerialNumber.(string) @@ -188,24 +188,24 @@ func dataSourcePnpDeviceHistoryRead(ctx context.Context, d *schema.ResourceData, queryParams1.SortOrder = vSortOrder.(string) } - response1, restyResp1, err := client.DeviceOnboardingPnp.GetDeviceHistory(&queryParams1) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetDeviceHistoryV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceHistory", err, - "Failure at GetDeviceHistory, unexpected response", "")) + "Failure when executing 2 GetDeviceHistoryV1", err, + "Failure at GetDeviceHistoryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDeviceOnboardingPnpGetDeviceHistoryItems(response1.Response) + vItems1 := flattenDeviceOnboardingPnpGetDeviceHistoryV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceHistory response", + "Failure when setting GetDeviceHistoryV1 response", err)) return diags } @@ -217,7 +217,7 @@ func dataSourcePnpDeviceHistoryRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDeviceOnboardingPnpGetDeviceHistoryItems(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryResponse) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceHistoryV1Items(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryV1Response) []map[string]interface{} { if items == nil { return nil } @@ -226,14 +226,14 @@ func flattenDeviceOnboardingPnpGetDeviceHistoryItems(items *[]catalystcentersdkg respItem := make(map[string]interface{}) respItem["timestamp"] = item.Timestamp respItem["details"] = item.Details - respItem["history_task_info"] = flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfo(item.HistoryTaskInfo) + respItem["history_task_info"] = flattenDeviceOnboardingPnpGetDeviceHistoryV1ItemsHistoryTaskInfo(item.HistoryTaskInfo) respItem["error_flag"] = boolPtrToString(item.ErrorFlag) respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryResponseHistoryTaskInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceHistoryV1ItemsHistoryTaskInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryV1ResponseHistoryTaskInfo) []map[string]interface{} { if item == nil { return nil } @@ -241,8 +241,8 @@ func flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfo(item *cataly respItem["name"] = item.Name respItem["type"] = item.Type respItem["time_taken"] = item.TimeTaken - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfoWorkItemList(item.WorkItemList) - respItem["addn_details"] = flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfoAddnDetails(item.AddnDetails) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetDeviceHistoryV1ItemsHistoryTaskInfoWorkItemList(item.WorkItemList) + respItem["addn_details"] = flattenDeviceOnboardingPnpGetDeviceHistoryV1ItemsHistoryTaskInfoAddnDetails(item.AddnDetails) return []map[string]interface{}{ respItem, @@ -250,7 +250,7 @@ func flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfo(item *cataly } -func flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryResponseHistoryTaskInfoWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceHistoryV1ItemsHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryV1ResponseHistoryTaskInfoWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -268,7 +268,7 @@ func flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfoWorkItemList( return respItems } -func flattenDeviceOnboardingPnpGetDeviceHistoryItemsHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryResponseHistoryTaskInfoAddnDetails) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetDeviceHistoryV1ItemsHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetDeviceHistoryV1ResponseHistoryTaskInfoAddnDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_pnp_global_settings.go b/catalystcenter/data_source_pnp_global_settings.go index 3f4f598..48e5be6 100644 --- a/catalystcenter/data_source_pnp_global_settings.go +++ b/catalystcenter/data_source_pnp_global_settings.go @@ -333,26 +333,26 @@ func dataSourcePnpGlobalSettingsRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPnpGlobalSettings") + log.Printf("[DEBUG] Selected method: GetPnpGlobalSettingsV1") - response1, restyResp1, err := client.DeviceOnboardingPnp.GetPnpGlobalSettings() + response1, restyResp1, err := client.DeviceOnboardingPnp.GetPnpGlobalSettingsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPnpGlobalSettings", err, - "Failure at GetPnpGlobalSettings, unexpected response", "")) + "Failure when executing 2 GetPnpGlobalSettingsV1", err, + "Failure at GetPnpGlobalSettingsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDeviceOnboardingPnpGetPnpGlobalSettingsItem(response1) + vItem1 := flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPnpGlobalSettings response", + "Failure when setting GetPnpGlobalSettingsV1 response", err)) return diags } @@ -364,16 +364,16 @@ func dataSourcePnpGlobalSettingsRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettings) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["sava_mapping_list"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingList(item.SavaMappingList) - respItem["task_time_outs"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemTaskTimeOuts(item.TaskTimeOuts) + respItem["sava_mapping_list"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingList(item.SavaMappingList) + respItem["task_time_outs"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemTaskTimeOuts(item.TaskTimeOuts) respItem["tenant_id"] = item.TenantID - respItem["aaa_credentials"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemAAACredentials(item.AAACredentials) - respItem["default_profile"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemDefaultProfile(item.DefaultProfile) + respItem["aaa_credentials"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemAAACredentials(item.AAACredentials) + respItem["default_profile"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemDefaultProfile(item.DefaultProfile) respItem["accept_eula"] = boolPtrToString(item.AcceptEula) respItem["id"] = item.ID respItem["version"] = item.Version @@ -382,7 +382,7 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItem(item *catalystcentersdkg } } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsSavaMappingList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1SavaMappingList) []map[string]interface{} { if items == nil { return nil } @@ -391,10 +391,10 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingList(items *[] respItem := make(map[string]interface{}) respItem["sync_status"] = item.SyncStatus respItem["sync_start_time"] = item.SyncStartTime - respItem["sync_result"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListSyncResult(item.SyncResult) + respItem["sync_result"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingListSyncResult(item.SyncResult) respItem["last_sync"] = item.LastSync respItem["tenant_id"] = item.TenantID - respItem["profile"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListProfile(item.Profile) + respItem["profile"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingListProfile(item.Profile) respItem["token"] = item.Token respItem["expiry"] = item.Expiry respItem["cco_user"] = item.CcoUser @@ -407,12 +407,12 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingList(items *[] return respItems } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsSavaMappingListSyncResult) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingListSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1SavaMappingListSyncResult) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["sync_list"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListSyncResultSyncList(item.SyncList) + respItem["sync_list"] = flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingListSyncResultSyncList(item.SyncList) respItem["sync_msg"] = item.SyncMsg return []map[string]interface{}{ @@ -421,7 +421,7 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListSyncResult } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsSavaMappingListSyncResultSyncList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingListSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1SavaMappingListSyncResultSyncList) []map[string]interface{} { if items == nil { return nil } @@ -435,7 +435,7 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListSyncResult return respItems } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsSavaMappingListProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemSavaMappingListProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1SavaMappingListProfile) []map[string]interface{} { if item == nil { return nil } @@ -455,7 +455,7 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemSavaMappingListProfile(it } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemTaskTimeOuts(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsTaskTimeOuts) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemTaskTimeOuts(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1TaskTimeOuts) []map[string]interface{} { if item == nil { return nil } @@ -470,7 +470,7 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemTaskTimeOuts(item *cataly } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemAAACredentials(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsAAACredentials) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemAAACredentials(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1AAACredentials) []map[string]interface{} { if item == nil { return nil } @@ -484,7 +484,7 @@ func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemAAACredentials(item *cata } -func flattenDeviceOnboardingPnpGetPnpGlobalSettingsItemDefaultProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsDefaultProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1ItemDefaultProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetPnpGlobalSettingsV1DefaultProfile) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_pnp_smart_account_domains.go b/catalystcenter/data_source_pnp_smart_account_domains.go index e64beb4..ce77bdd 100644 --- a/catalystcenter/data_source_pnp_smart_account_domains.go +++ b/catalystcenter/data_source_pnp_smart_account_domains.go @@ -39,26 +39,26 @@ func dataSourcePnpSmartAccountDomainsRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSmartAccountList") + log.Printf("[DEBUG] Selected method: GetSmartAccountListV1") - response1, restyResp1, err := client.DeviceOnboardingPnp.GetSmartAccountList() + response1, restyResp1, err := client.DeviceOnboardingPnp.GetSmartAccountListV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSmartAccountList", err, - "Failure at GetSmartAccountList, unexpected response", "")) + "Failure when executing 2 GetSmartAccountListV1", err, + "Failure at GetSmartAccountListV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDeviceOnboardingPnpGetSmartAccountListItems(response1) + vItems1 := flattenDeviceOnboardingPnpGetSmartAccountListV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSmartAccountList response", + "Failure when setting GetSmartAccountListV1 response", err)) return diags } @@ -70,7 +70,7 @@ func dataSourcePnpSmartAccountDomainsRead(ctx context.Context, d *schema.Resourc return diags } -func flattenDeviceOnboardingPnpGetSmartAccountListItems(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSmartAccountList) []interface{} { +func flattenDeviceOnboardingPnpGetSmartAccountListV1Items(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSmartAccountListV1) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_pnp_virtual_account_sync_result.go b/catalystcenter/data_source_pnp_virtual_account_sync_result.go index fcf8c3f..6cebcc3 100644 --- a/catalystcenter/data_source_pnp_virtual_account_sync_result.go +++ b/catalystcenter/data_source_pnp_virtual_account_sync_result.go @@ -218,28 +218,28 @@ func dataSourcePnpVirtualAccountSyncResultRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSyncResultForVirtualAccount") + log.Printf("[DEBUG] Selected method: GetSyncResultForVirtualAccountV1") vvDomain := vDomain.(string) vvName := vName.(string) - response1, restyResp1, err := client.DeviceOnboardingPnp.GetSyncResultForVirtualAccount(vvDomain, vvName) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetSyncResultForVirtualAccountV1(vvDomain, vvName) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSyncResultForVirtualAccount", err, - "Failure at GetSyncResultForVirtualAccount, unexpected response", "")) + "Failure when executing 2 GetSyncResultForVirtualAccountV1", err, + "Failure at GetSyncResultForVirtualAccountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItem(response1) + vItem1 := flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSyncResultForVirtualAccount response", + "Failure when setting GetSyncResultForVirtualAccountV1 response", err)) return diags } @@ -251,7 +251,7 @@ func dataSourcePnpVirtualAccountSyncResultRead(ctx context.Context, d *schema.Re return diags } -func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccount) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountV1) []map[string]interface{} { if item == nil { return nil } @@ -259,9 +259,9 @@ func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItem(item *catalyst respItem["virtual_account_id"] = item.VirtualAccountID respItem["auto_sync_period"] = item.AutoSyncPeriod respItem["sync_result_str"] = item.SyncResultStr - respItem["profile"] = flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemProfile(item.Profile) + respItem["profile"] = flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1ItemProfile(item.Profile) respItem["cco_user"] = item.CcoUser - respItem["sync_result"] = flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemSyncResult(item.SyncResult) + respItem["sync_result"] = flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1ItemSyncResult(item.SyncResult) respItem["token"] = item.Token respItem["sync_start_time"] = item.SyncStartTime respItem["last_sync"] = item.LastSync @@ -274,7 +274,7 @@ func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItem(item *catalyst } } -func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1ItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountV1Profile) []map[string]interface{} { if item == nil { return nil } @@ -294,12 +294,12 @@ func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemProfile(item *c } -func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountSyncResult) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1ItemSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountV1SyncResult) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["sync_list"] = flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemSyncResultSyncList(item.SyncList) + respItem["sync_list"] = flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1ItemSyncResultSyncList(item.SyncList) respItem["sync_msg"] = item.SyncMsg return []map[string]interface{}{ @@ -308,7 +308,7 @@ func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemSyncResult(item } -func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountItemSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountSyncResultSyncList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetSyncResultForVirtualAccountV1ItemSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetSyncResultForVirtualAccountV1SyncResultSyncList) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_pnp_virtual_accounts.go b/catalystcenter/data_source_pnp_virtual_accounts.go index 577cac6..2418cd7 100644 --- a/catalystcenter/data_source_pnp_virtual_accounts.go +++ b/catalystcenter/data_source_pnp_virtual_accounts.go @@ -46,27 +46,27 @@ func dataSourcePnpVirtualAccountsRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVirtualAccountList") + log.Printf("[DEBUG] Selected method: GetVirtualAccountListV1") vvDomain := vDomain.(string) - response1, restyResp1, err := client.DeviceOnboardingPnp.GetVirtualAccountList(vvDomain) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetVirtualAccountListV1(vvDomain) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetVirtualAccountList", err, - "Failure at GetVirtualAccountList, unexpected response", "")) + "Failure when executing 2 GetVirtualAccountListV1", err, + "Failure at GetVirtualAccountListV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDeviceOnboardingPnpGetVirtualAccountListItems(response1) + vItems1 := flattenDeviceOnboardingPnpGetVirtualAccountListV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVirtualAccountList response", + "Failure when setting GetVirtualAccountListV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourcePnpVirtualAccountsRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenDeviceOnboardingPnpGetVirtualAccountListItems(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetVirtualAccountList) []interface{} { +func flattenDeviceOnboardingPnpGetVirtualAccountListV1Items(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetVirtualAccountListV1) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_pnp_workflow.go b/catalystcenter/data_source_pnp_workflow.go index 070421e..cc6612a 100644 --- a/catalystcenter/data_source_pnp_workflow.go +++ b/catalystcenter/data_source_pnp_workflow.go @@ -536,8 +536,8 @@ func dataSourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetWorkflows") - queryParams1 := catalystcentersdkgo.GetWorkflowsQueryParams{} + log.Printf("[DEBUG] Selected method: GetWorkflowsV1") + queryParams1 := catalystcentersdkgo.GetWorkflowsV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(int) @@ -558,24 +558,24 @@ func dataSourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m in queryParams1.Name = interfaceToSliceString(vName) } - response1, restyResp1, err := client.DeviceOnboardingPnp.GetWorkflows(&queryParams1) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetWorkflowsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWorkflows", err, - "Failure at GetWorkflows, unexpected response", "")) + "Failure when executing 2 GetWorkflowsV1", err, + "Failure at GetWorkflowsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDeviceOnboardingPnpGetWorkflowsItems(response1) + vItems1 := flattenDeviceOnboardingPnpGetWorkflowsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetWorkflows response", + "Failure when setting GetWorkflowsV1 response", err)) return diags } @@ -585,27 +585,27 @@ func dataSourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m in } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetWorkflowByID") + log.Printf("[DEBUG] Selected method: GetWorkflowByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.DeviceOnboardingPnp.GetWorkflowByID(vvID) + response2, restyResp2, err := client.DeviceOnboardingPnp.GetWorkflowByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWorkflowByID", err, - "Failure at GetWorkflowByID, unexpected response", "")) + "Failure when executing 2 GetWorkflowByIDV1", err, + "Failure at GetWorkflowByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDeviceOnboardingPnpGetWorkflowByIDItem(response2) + vItem2 := flattenDeviceOnboardingPnpGetWorkflowByIDV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetWorkflowByID response", + "Failure when setting GetWorkflowByIDV1 response", err)) return diags } @@ -617,7 +617,7 @@ func dataSourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m in return diags } -func flattenDeviceOnboardingPnpGetWorkflowsItems(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflows) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowsV1Items(items *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowsV1) []map[string]interface{} { if items == nil { return nil } @@ -632,7 +632,7 @@ func flattenDeviceOnboardingPnpGetWorkflowsItems(items *catalystcentersdkgo.Resp respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetWorkflowsItemsTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetWorkflowsV1ItemsTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -648,7 +648,7 @@ func flattenDeviceOnboardingPnpGetWorkflowsItems(items *catalystcentersdkgo.Resp return respItems } -func flattenDeviceOnboardingPnpGetWorkflowsItemsTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowsV1ItemsTasks(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsV1Tasks) []map[string]interface{} { if items == nil { return nil } @@ -661,7 +661,7 @@ func flattenDeviceOnboardingPnpGetWorkflowsItemsTasks(items *[]catalystcentersdk respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetWorkflowsItemsTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetWorkflowsV1ItemsTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -669,7 +669,7 @@ func flattenDeviceOnboardingPnpGetWorkflowsItemsTasks(items *[]catalystcentersdk return respItems } -func flattenDeviceOnboardingPnpGetWorkflowsItemsTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowsV1ItemsTasksWorkItemList(items *[]catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsV1TasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -687,7 +687,7 @@ func flattenDeviceOnboardingPnpGetWorkflowsItemsTasksWorkItemList(items *[]catal return respItems } -func flattenDeviceOnboardingPnpGetWorkflowByIDItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowByID) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowByIDV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowByIDV1) []map[string]interface{} { if item == nil { return nil } @@ -700,7 +700,7 @@ func flattenDeviceOnboardingPnpGetWorkflowByIDItem(item *catalystcentersdkgo.Res respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpGetWorkflowByIDItemTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpGetWorkflowByIDV1ItemTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -716,7 +716,7 @@ func flattenDeviceOnboardingPnpGetWorkflowByIDItem(item *catalystcentersdkgo.Res } } -func flattenDeviceOnboardingPnpGetWorkflowByIDItemTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowByIDTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowByIDV1ItemTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowByIDV1Tasks) []map[string]interface{} { if items == nil { return nil } @@ -729,7 +729,7 @@ func flattenDeviceOnboardingPnpGetWorkflowByIDItemTasks(items *[]catalystcenters respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpGetWorkflowByIDItemTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpGetWorkflowByIDV1ItemTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -737,7 +737,7 @@ func flattenDeviceOnboardingPnpGetWorkflowByIDItemTasks(items *[]catalystcenters return respItems } -func flattenDeviceOnboardingPnpGetWorkflowByIDItemTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowByIDTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowByIDV1ItemTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowByIDV1TasksWorkItemList) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_pnp_workflow_count.go b/catalystcenter/data_source_pnp_workflow_count.go index fd047c8..04bdacc 100644 --- a/catalystcenter/data_source_pnp_workflow_count.go +++ b/catalystcenter/data_source_pnp_workflow_count.go @@ -56,31 +56,31 @@ func dataSourcePnpWorkflowCountRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetWorkflowCount") - queryParams1 := catalystcentersdkgo.GetWorkflowCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetWorkflowCountV1") + queryParams1 := catalystcentersdkgo.GetWorkflowCountV1QueryParams{} if okName { queryParams1.Name = interfaceToSliceString(vName) } - response1, restyResp1, err := client.DeviceOnboardingPnp.GetWorkflowCount(&queryParams1) + response1, restyResp1, err := client.DeviceOnboardingPnp.GetWorkflowCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWorkflowCount", err, - "Failure at GetWorkflowCount, unexpected response", "")) + "Failure when executing 2 GetWorkflowCountV1", err, + "Failure at GetWorkflowCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDeviceOnboardingPnpGetWorkflowCountItem(response1) + vItem1 := flattenDeviceOnboardingPnpGetWorkflowCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetWorkflowCount response", + "Failure when setting GetWorkflowCountV1 response", err)) return diags } @@ -92,7 +92,7 @@ func dataSourcePnpWorkflowCountRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenDeviceOnboardingPnpGetWorkflowCountItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowCount) []map[string]interface{} { +func flattenDeviceOnboardingPnpGetWorkflowCountV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_product_names.go b/catalystcenter/data_source_product_names.go index 2d6fbc6..5d58638 100644 --- a/catalystcenter/data_source_product_names.go +++ b/catalystcenter/data_source_product_names.go @@ -153,8 +153,8 @@ func dataSourceProductNamesRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheListOfNetworkDeviceProductNames") - queryParams1 := catalystcentersdkgo.RetrievesTheListOfNetworkDeviceProductNamesQueryParams{} + log.Printf("[DEBUG] Selected method: RetrievesTheListOfNetworkDeviceProductNamesV1") + queryParams1 := catalystcentersdkgo.RetrievesTheListOfNetworkDeviceProductNamesV1QueryParams{} if okProductName { queryParams1.ProductName = vProductName.(string) @@ -169,24 +169,24 @@ func dataSourceProductNamesRead(ctx context.Context, d *schema.ResourceData, m i queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrievesTheListOfNetworkDeviceProductNames(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.RetrievesTheListOfNetworkDeviceProductNamesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheListOfNetworkDeviceProductNames", err, - "Failure at RetrievesTheListOfNetworkDeviceProductNames, unexpected response", "")) + "Failure when executing 2 RetrievesTheListOfNetworkDeviceProductNamesV1", err, + "Failure at RetrievesTheListOfNetworkDeviceProductNamesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNamesItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNamesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfNetworkDeviceProductNames response", + "Failure when setting RetrievesTheListOfNetworkDeviceProductNamesV1 response", err)) return diags } @@ -196,27 +196,27 @@ func dataSourceProductNamesRead(ctx context.Context, d *schema.ResourceData, m i } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: RetrieveNetworkDeviceProductName") + log.Printf("[DEBUG] Selected method: RetrieveNetworkDeviceProductNameV1") vvProductNameOrdinal := vProductNameOrdinal.(float64) - response2, restyResp2, err := client.SoftwareImageManagementSwim.RetrieveNetworkDeviceProductName(vvProductNameOrdinal) + response2, restyResp2, err := client.SoftwareImageManagementSwim.RetrieveNetworkDeviceProductNameV1(vvProductNameOrdinal) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveNetworkDeviceProductName", err, - "Failure at RetrieveNetworkDeviceProductName, unexpected response", "")) + "Failure when executing 2 RetrieveNetworkDeviceProductNameV1", err, + "Failure at RetrieveNetworkDeviceProductNameV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenSoftwareImageManagementSwimRetrieveNetworkDeviceProductNameItem(response2.Response) + vItem2 := flattenSoftwareImageManagementSwimRetrieveNetworkDeviceProductNameV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveNetworkDeviceProductName response", + "Failure when setting RetrieveNetworkDeviceProductNameV1 response", err)) return diags } @@ -228,7 +228,7 @@ func dataSourceProductNamesRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNamesItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNamesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNamesV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNamesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -244,7 +244,7 @@ func flattenSoftwareImageManagementSwimRetrievesTheListOfNetworkDeviceProductNam return respItems } -func flattenSoftwareImageManagementSwimRetrieveNetworkDeviceProductNameItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveNetworkDeviceProductNameResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimRetrieveNetworkDeviceProductNameV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveNetworkDeviceProductNameV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_product_names_count.go b/catalystcenter/data_source_product_names_count.go index cdc374c..43af85a 100644 --- a/catalystcenter/data_source_product_names_count.go +++ b/catalystcenter/data_source_product_names_count.go @@ -61,8 +61,8 @@ func dataSourceProductNamesCountRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: CountOfNetworkProductNames") - queryParams1 := catalystcentersdkgo.CountOfNetworkProductNamesQueryParams{} + log.Printf("[DEBUG] Selected method: CountOfNetworkProductNamesV1") + queryParams1 := catalystcentersdkgo.CountOfNetworkProductNamesV1QueryParams{} if okProductName { queryParams1.ProductName = vProductName.(string) @@ -71,24 +71,24 @@ func dataSourceProductNamesCountRead(ctx context.Context, d *schema.ResourceData queryParams1.ProductID = vProductID.(string) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.CountOfNetworkProductNames(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.CountOfNetworkProductNamesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 CountOfNetworkProductNames", err, - "Failure at CountOfNetworkProductNames, unexpected response", "")) + "Failure when executing 2 CountOfNetworkProductNamesV1", err, + "Failure at CountOfNetworkProductNamesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimCountOfNetworkProductNamesItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimCountOfNetworkProductNamesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountOfNetworkProductNames response", + "Failure when setting CountOfNetworkProductNamesV1 response", err)) return diags } @@ -100,7 +100,7 @@ func dataSourceProductNamesCountRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenSoftwareImageManagementSwimCountOfNetworkProductNamesItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimCountOfNetworkProductNamesResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimCountOfNetworkProductNamesV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimCountOfNetworkProductNamesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_profiling_rules_count.go b/catalystcenter/data_source_profiling_rules_count.go new file mode 100644 index 0000000..64c9694 --- /dev/null +++ b/catalystcenter/data_source_profiling_rules_count.go @@ -0,0 +1,100 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceProfilingRulesCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on AIEndpointAnalytics. + +- This data source fetches the count of profiling rules based on the filter values provided in the query parameters. The +filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. +`, + + ReadContext: dataSourceProfilingRulesCountRead, + Schema: map[string]*schema.Schema{ + "include_deleted": &schema.Schema{ + Description: `includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +`, + Type: schema.TypeBool, + Optional: true, + }, + "rule_type": &schema.Schema{ + Description: `ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. +`, + Type: schema.TypeString, + Optional: true, + }, + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "count": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceProfilingRulesCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vRuleType, okRuleType := d.GetOk("rule_type") + vIncludeDeleted, okIncludeDeleted := d.GetOk("include_deleted") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetCountOfProfilingRulesV1") + queryParams1 := catalystcentersdkgo.GetCountOfProfilingRulesV1QueryParams{} + + if okRuleType { + queryParams1.RuleType = vRuleType.(string) + } + if okIncludeDeleted { + queryParams1.IncludeDeleted = vIncludeDeleted.(bool) + } + + response1, restyResp1, err := client.AIEndpointAnalytics.GetCountOfProfilingRulesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetCountOfProfilingRulesV1", err, + "Failure at GetCountOfProfilingRulesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenAIEndpointAnalyticsGetCountOfProfilingRulesV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetCountOfProfilingRulesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} diff --git a/catalystcenter/data_source_projects_details.go b/catalystcenter/data_source_projects_details_v2.go similarity index 85% rename from catalystcenter/data_source_projects_details.go rename to catalystcenter/data_source_projects_details_v2.go index 49e1126..e8790fb 100644 --- a/catalystcenter/data_source_projects_details.go +++ b/catalystcenter/data_source_projects_details_v2.go @@ -11,14 +11,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceProjectsDetails() *schema.Resource { +func dataSourceProjectsDetailsV2() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Configuration Templates. - Get project(s) details `, - ReadContext: dataSourceProjectsDetailsRead, + ReadContext: dataSourceProjectsDetailsV2Read, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ Description: `id query parameter. Id of project to be searched @@ -136,7 +136,7 @@ func dataSourceProjectsDetails() *schema.Resource { } } -func dataSourceProjectsDetailsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceProjectsDetailsV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -148,8 +148,8 @@ func dataSourceProjectsDetailsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetProjectsDetails") - queryParams1 := catalystcentersdkgo.GetProjectsDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetProjectsDetailsV2") + queryParams1 := catalystcentersdkgo.GetProjectsDetailsV2QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -167,24 +167,24 @@ func dataSourceProjectsDetailsRead(ctx context.Context, d *schema.ResourceData, queryParams1.SortOrder = vSortOrder.(string) } - response1, restyResp1, err := client.ConfigurationTemplates.GetProjectsDetails(&queryParams1) + response1, restyResp1, err := client.ConfigurationTemplates.GetProjectsDetailsV2(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetProjectsDetails", err, - "Failure at GetProjectsDetails, unexpected response", "")) + "Failure when executing 2 GetProjectsDetailsV2", err, + "Failure at GetProjectsDetailsV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenConfigurationTemplatesGetProjectsDetailsItem(&response1.Response) + vItem1 := flattenConfigurationTemplatesGetProjectsDetailsV2Item(&response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetProjectsDetails response", + "Failure when setting GetProjectsDetailsV2 response", err)) return diags } @@ -196,7 +196,7 @@ func dataSourceProjectsDetailsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenConfigurationTemplatesGetProjectsDetailsItem(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetProjectsDetailsResponse) []map[string]interface{} { +func flattenConfigurationTemplatesGetProjectsDetailsV2Item(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetProjectsDetailsResponse) []map[string]interface{} { if items == nil { return nil } @@ -217,7 +217,7 @@ func flattenConfigurationTemplatesGetProjectsDetailsItem(items *[]catalystcenter return respItems } -func flattenConfigurationTemplatesGetProjectsDetailsItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetProjectsDetailsTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetProjectsDetailsItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetProjectsDetailsV2Tags) []map[string]interface{} { if items == nil { return nil } @@ -231,7 +231,7 @@ func flattenConfigurationTemplatesGetProjectsDetailsItemTags(items *[]catalystce return respItems } -func flattenConfigurationTemplatesGetProjectsDetailsItemTemplates(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetProjectsDetailsTemplates) interface{} { +func flattenConfigurationTemplatesGetProjectsDetailsItemTemplates(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetProjectsDetailsV2Templates) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_provisioning_settings.go b/catalystcenter/data_source_provisioning_settings.go index 1360ee2..c4bf644 100644 --- a/catalystcenter/data_source_provisioning_settings.go +++ b/catalystcenter/data_source_provisioning_settings.go @@ -56,26 +56,26 @@ func dataSourceProvisioningSettingsRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetProvisioningSettings") + log.Printf("[DEBUG] Selected method: GetProvisioningSettingsV1") - response1, restyResp1, err := client.SystemSettings.GetProvisioningSettings() + response1, restyResp1, err := client.SystemSettings.GetProvisioningSettingsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetProvisioningSettings", err, - "Failure at GetProvisioningSettings, unexpected response", "")) + "Failure when executing 2 GetProvisioningSettingsV1", err, + "Failure at GetProvisioningSettingsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSystemSettingsGetProvisioningSettingsItem(response1.Response) + vItem1 := flattenSystemSettingsGetProvisioningSettingsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetProvisioningSettings response", + "Failure when setting GetProvisioningSettingsV1 response", err)) return diags } @@ -87,7 +87,7 @@ func dataSourceProvisioningSettingsRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenSystemSettingsGetProvisioningSettingsItem(item *catalystcentersdkgo.ResponseSystemSettingsGetProvisioningSettingsResponse) []map[string]interface{} { +func flattenSystemSettingsGetProvisioningSettingsV1Item(item *catalystcentersdkgo.ResponseSystemSettingsGetProvisioningSettingsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_qos_device_interface.go b/catalystcenter/data_source_qos_device_interface.go index d5aca98..90c354c 100644 --- a/catalystcenter/data_source_qos_device_interface.go +++ b/catalystcenter/data_source_qos_device_interface.go @@ -327,31 +327,31 @@ func dataSourceQosDeviceInterfaceRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetQosDeviceInterfaceInfo") - queryParams1 := catalystcentersdkgo.GetQosDeviceInterfaceInfoQueryParams{} + log.Printf("[DEBUG] Selected method: GetQosDeviceInterfaceInfoV1") + queryParams1 := catalystcentersdkgo.GetQosDeviceInterfaceInfoV1QueryParams{} if okNetworkDeviceID { queryParams1.NetworkDeviceID = vNetworkDeviceID.(string) } - response1, restyResp1, err := client.ApplicationPolicy.GetQosDeviceInterfaceInfo(&queryParams1) + response1, restyResp1, err := client.ApplicationPolicy.GetQosDeviceInterfaceInfoV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetQosDeviceInterfaceInfo", err, - "Failure at GetQosDeviceInterfaceInfo, unexpected response", "")) + "Failure when executing 2 GetQosDeviceInterfaceInfoV1", err, + "Failure at GetQosDeviceInterfaceInfoV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenApplicationPolicyGetQosDeviceInterfaceInfoItems(response1.Response) + vItems1 := flattenApplicationPolicyGetQosDeviceInterfaceInfoV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetQosDeviceInterfaceInfo response", + "Failure when setting GetQosDeviceInterfaceInfoV1 response", err)) return diags } @@ -363,7 +363,7 @@ func dataSourceQosDeviceInterfaceRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenApplicationPolicyGetQosDeviceInterfaceInfoItems(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponse) []map[string]interface{} { +func flattenApplicationPolicyGetQosDeviceInterfaceInfoV1Items(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1Response) []map[string]interface{} { if items == nil { return nil } @@ -386,20 +386,20 @@ func flattenApplicationPolicyGetQosDeviceInterfaceInfoItems(items *[]catalystcen respItem["provisioning_state"] = item.ProvisioningState respItem["qualifier"] = item.Qualifier respItem["resource_version"] = item.ResourceVersion - respItem["target_id_list"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsTargetIDList(item.TargetIDList) + respItem["target_id_list"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsTargetIDList(item.TargetIDList) respItem["type"] = item.Type - respItem["cfs_change_info"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsCfsChangeInfo(item.CfsChangeInfo) - respItem["custom_provisions"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsCustomProvisions(item.CustomProvisions) + respItem["cfs_change_info"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsCfsChangeInfo(item.CfsChangeInfo) + respItem["custom_provisions"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsCustomProvisions(item.CustomProvisions) respItem["excluded_interfaces"] = item.ExcludedInterfaces respItem["is_excluded"] = boolPtrToString(item.IsExcluded) respItem["network_device_id"] = item.NetworkDeviceID - respItem["qos_device_interface_info"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsQosDeviceInterfaceInfo(item.QosDeviceInterfaceInfo) + respItem["qos_device_interface_info"] = flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsQosDeviceInterfaceInfo(item.QosDeviceInterfaceInfo) respItems = append(respItems, respItem) } return respItems } -func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponseTargetIDList) []interface{} { +func flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsTargetIDList(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1ResponseTargetIDList) []interface{} { if items == nil { return nil } @@ -411,7 +411,7 @@ func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsTargetIDList(items *[ return respItems } -func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponseCfsChangeInfo) []interface{} { +func flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsCfsChangeInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1ResponseCfsChangeInfo) []interface{} { if items == nil { return nil } @@ -423,7 +423,7 @@ func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsCfsChangeInfo(items * return respItems } -func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponseCustomProvisions) []interface{} { +func flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsCustomProvisions(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1ResponseCustomProvisions) []interface{} { if items == nil { return nil } @@ -435,7 +435,7 @@ func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsCustomProvisions(item return respItems } -func flattenApplicationPolicyGetQosDeviceInterfaceInfoItemsQosDeviceInterfaceInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponseQosDeviceInterfaceInfo) []map[string]interface{} { +func flattenApplicationPolicyGetQosDeviceInterfaceInfoV1ItemsQosDeviceInterfaceInfo(items *[]catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1ResponseQosDeviceInterfaceInfo) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_qos_device_interface_info_count.go b/catalystcenter/data_source_qos_device_interface_info_count.go index 30fe740..0a8138c 100644 --- a/catalystcenter/data_source_qos_device_interface_info_count.go +++ b/catalystcenter/data_source_qos_device_interface_info_count.go @@ -54,26 +54,26 @@ func dataSourceQosDeviceInterfaceInfoCountRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetQosDeviceInterfaceInfoCount") + log.Printf("[DEBUG] Selected method: GetQosDeviceInterfaceInfoCountV1") - response1, restyResp1, err := client.ApplicationPolicy.GetQosDeviceInterfaceInfoCount() + response1, restyResp1, err := client.ApplicationPolicy.GetQosDeviceInterfaceInfoCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetQosDeviceInterfaceInfoCount", err, - "Failure at GetQosDeviceInterfaceInfoCount, unexpected response", "")) + "Failure when executing 2 GetQosDeviceInterfaceInfoCountV1", err, + "Failure at GetQosDeviceInterfaceInfoCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenApplicationPolicyGetQosDeviceInterfaceInfoCountItem(response1) + vItem1 := flattenApplicationPolicyGetQosDeviceInterfaceInfoCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetQosDeviceInterfaceInfoCount response", + "Failure when setting GetQosDeviceInterfaceInfoCountV1 response", err)) return diags } @@ -85,7 +85,7 @@ func dataSourceQosDeviceInterfaceInfoCountRead(ctx context.Context, d *schema.Re return diags } -func flattenApplicationPolicyGetQosDeviceInterfaceInfoCountItem(item *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoCount) []map[string]interface{} { +func flattenApplicationPolicyGetQosDeviceInterfaceInfoCountV1Item(item *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_reports.go b/catalystcenter/data_source_reports.go index 59818d3..6301db2 100644 --- a/catalystcenter/data_source_reports.go +++ b/catalystcenter/data_source_reports.go @@ -649,8 +649,8 @@ func dataSourceReportsRead(ctx context.Context, d *schema.ResourceData, m interf selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetListOfScheduledReports") - queryParams1 := catalystcentersdkgo.GetListOfScheduledReportsQueryParams{} + log.Printf("[DEBUG] Selected method: GetListOfScheduledReportsV1") + queryParams1 := catalystcentersdkgo.GetListOfScheduledReportsV1QueryParams{} if okViewGroupID { queryParams1.ViewGroupID = vViewGroupID.(string) @@ -659,24 +659,24 @@ func dataSourceReportsRead(ctx context.Context, d *schema.ResourceData, m interf queryParams1.ViewID = vViewID.(string) } - response1, restyResp1, err := client.Reports.GetListOfScheduledReports(&queryParams1) + response1, restyResp1, err := client.Reports.GetListOfScheduledReportsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetListOfScheduledReports", err, - "Failure at GetListOfScheduledReports, unexpected response", "")) + "Failure when executing 2 GetListOfScheduledReportsV1", err, + "Failure at GetListOfScheduledReportsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenReportsGetListOfScheduledReportsItems(response1) + vItems1 := flattenReportsGetListOfScheduledReportsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetListOfScheduledReports response", + "Failure when setting GetListOfScheduledReportsV1 response", err)) return diags } @@ -686,27 +686,27 @@ func dataSourceReportsRead(ctx context.Context, d *schema.ResourceData, m interf } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetAScheduledReport") + log.Printf("[DEBUG] Selected method: GetAScheduledReportV1") vvReportID := vReportID.(string) - response2, restyResp2, err := client.Reports.GetAScheduledReport(vvReportID) + response2, restyResp2, err := client.Reports.GetAScheduledReportV1(vvReportID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAScheduledReport", err, - "Failure at GetAScheduledReport, unexpected response", "")) + "Failure when executing 2 GetAScheduledReportV1", err, + "Failure at GetAScheduledReportV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenReportsGetAScheduledReportItem(response2) + vItem2 := flattenReportsGetAScheduledReportV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetAScheduledReport response", + "Failure when setting GetAScheduledReportV1 response", err)) return diags } @@ -718,7 +718,7 @@ func dataSourceReportsRead(ctx context.Context, d *schema.ResourceData, m interf return diags } -func flattenReportsGetListOfScheduledReportsItems(items *catalystcentersdkgo.ResponseReportsGetListOfScheduledReports) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1Items(items *catalystcentersdkgo.ResponseReportsGetListOfScheduledReportsV1) []map[string]interface{} { if items == nil { return nil } @@ -727,14 +727,14 @@ func flattenReportsGetListOfScheduledReportsItems(items *catalystcentersdkgo.Res respItem := make(map[string]interface{}) respItem["tags"] = item.Tags respItem["data_category"] = item.DataCategory - respItem["deliveries"] = flattenReportsGetListOfScheduledReportsItemsDeliveries(item.Deliveries) + respItem["deliveries"] = flattenReportsGetListOfScheduledReportsV1ItemsDeliveries(item.Deliveries) respItem["execution_count"] = item.ExecutionCount - respItem["executions"] = flattenReportsGetListOfScheduledReportsItemsExecutions(item.Executions) + respItem["executions"] = flattenReportsGetListOfScheduledReportsV1ItemsExecutions(item.Executions) respItem["name"] = item.Name respItem["report_id"] = item.ReportID respItem["report_was_executed"] = boolPtrToString(item.ReportWasExecuted) - respItem["schedule"] = flattenReportsGetListOfScheduledReportsItemsSchedule(item.Schedule) - respItem["view"] = flattenReportsGetListOfScheduledReportsItemsView(item.View) + respItem["schedule"] = flattenReportsGetListOfScheduledReportsV1ItemsSchedule(item.Schedule) + respItem["view"] = flattenReportsGetListOfScheduledReportsV1ItemsView(item.View) respItem["view_group_id"] = item.ViewGroupID respItem["view_group_version"] = item.ViewGroupVersion respItems = append(respItems, respItem) @@ -742,7 +742,7 @@ func flattenReportsGetListOfScheduledReportsItems(items *catalystcentersdkgo.Res return respItems } -func flattenReportsGetListOfScheduledReportsItemsDeliveries(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsDeliveries) []interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsDeliveries(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1Deliveries) []interface{} { if items == nil { return nil } @@ -754,7 +754,7 @@ func flattenReportsGetListOfScheduledReportsItemsDeliveries(items *[]catalystcen return respItems } -func flattenReportsGetListOfScheduledReportsItemsExecutions(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsExecutions) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsExecutions(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1Executions) []map[string]interface{} { if items == nil { return nil } @@ -773,7 +773,7 @@ func flattenReportsGetListOfScheduledReportsItemsExecutions(items *[]catalystcen return respItems } -func flattenReportsGetListOfScheduledReportsItemsSchedule(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsSchedule) interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsSchedule(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1Schedule) interface{} { if item == nil { return nil } @@ -783,14 +783,14 @@ func flattenReportsGetListOfScheduledReportsItemsSchedule(item *catalystcentersd } -func flattenReportsGetListOfScheduledReportsItemsView(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsView) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsView(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1View) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["field_groups"] = flattenReportsGetListOfScheduledReportsItemsViewFieldGroups(item.FieldGroups) - respItem["filters"] = flattenReportsGetListOfScheduledReportsItemsViewFilters(item.Filters) - respItem["format"] = flattenReportsGetListOfScheduledReportsItemsViewFormat(item.Format) + respItem["field_groups"] = flattenReportsGetListOfScheduledReportsV1ItemsViewFieldGroups(item.FieldGroups) + respItem["filters"] = flattenReportsGetListOfScheduledReportsV1ItemsViewFilters(item.Filters) + respItem["format"] = flattenReportsGetListOfScheduledReportsV1ItemsViewFormat(item.Format) respItem["name"] = item.Name respItem["view_id"] = item.ViewID respItem["description"] = item.Description @@ -802,7 +802,7 @@ func flattenReportsGetListOfScheduledReportsItemsView(item *catalystcentersdkgo. } -func flattenReportsGetListOfScheduledReportsItemsViewFieldGroups(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsViewFieldGroups) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsViewFieldGroups(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1ViewFieldGroups) []map[string]interface{} { if items == nil { return nil } @@ -811,13 +811,13 @@ func flattenReportsGetListOfScheduledReportsItemsViewFieldGroups(items *[]cataly respItem := make(map[string]interface{}) respItem["field_group_display_name"] = item.FieldGroupDisplayName respItem["field_group_name"] = item.FieldGroupName - respItem["fields"] = flattenReportsGetListOfScheduledReportsItemsViewFieldGroupsFields(item.Fields) + respItem["fields"] = flattenReportsGetListOfScheduledReportsV1ItemsViewFieldGroupsFields(item.Fields) respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetListOfScheduledReportsItemsViewFieldGroupsFields(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsViewFieldGroupsFields) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsViewFieldGroupsFields(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1ViewFieldGroupsFields) []map[string]interface{} { if items == nil { return nil } @@ -831,7 +831,7 @@ func flattenReportsGetListOfScheduledReportsItemsViewFieldGroupsFields(items *[] return respItems } -func flattenReportsGetListOfScheduledReportsItemsViewFilters(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsViewFilters) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsViewFilters(items *[]catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1ViewFilters) []map[string]interface{} { if items == nil { return nil } @@ -841,13 +841,13 @@ func flattenReportsGetListOfScheduledReportsItemsViewFilters(items *[]catalystce respItem["display_name"] = item.DisplayName respItem["name"] = item.Name respItem["type"] = item.Type - respItem["value"] = flattenReportsGetListOfScheduledReportsItemsViewFiltersValue(item.Value) + respItem["value"] = flattenReportsGetListOfScheduledReportsV1ItemsViewFiltersValue(item.Value) respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetListOfScheduledReportsItemsViewFiltersValue(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsViewFiltersValue) interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsViewFiltersValue(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1ViewFiltersValue) interface{} { if item == nil { return nil } @@ -857,7 +857,7 @@ func flattenReportsGetListOfScheduledReportsItemsViewFiltersValue(item *catalyst } -func flattenReportsGetListOfScheduledReportsItemsViewFormat(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsViewFormat) []map[string]interface{} { +func flattenReportsGetListOfScheduledReportsV1ItemsViewFormat(item *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1ViewFormat) []map[string]interface{} { if item == nil { return nil } @@ -872,21 +872,21 @@ func flattenReportsGetListOfScheduledReportsItemsViewFormat(item *catalystcenter } -func flattenReportsGetAScheduledReportItem(item *catalystcentersdkgo.ResponseReportsGetAScheduledReport) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1Item(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["tags"] = item.Tags respItem["data_category"] = item.DataCategory - respItem["deliveries"] = flattenReportsGetAScheduledReportItemDeliveries(item.Deliveries) + respItem["deliveries"] = flattenReportsGetAScheduledReportV1ItemDeliveries(item.Deliveries) respItem["execution_count"] = item.ExecutionCount - respItem["executions"] = flattenReportsGetAScheduledReportItemExecutions(item.Executions) + respItem["executions"] = flattenReportsGetAScheduledReportV1ItemExecutions(item.Executions) respItem["name"] = item.Name respItem["report_id"] = item.ReportID respItem["report_was_executed"] = boolPtrToString(item.ReportWasExecuted) - respItem["schedule"] = flattenReportsGetAScheduledReportItemSchedule(item.Schedule) - respItem["view"] = flattenReportsGetAScheduledReportItemView(item.View) + respItem["schedule"] = flattenReportsGetAScheduledReportV1ItemSchedule(item.Schedule) + respItem["view"] = flattenReportsGetAScheduledReportV1ItemView(item.View) respItem["view_group_id"] = item.ViewGroupID respItem["view_group_version"] = item.ViewGroupVersion return []map[string]interface{}{ @@ -894,7 +894,7 @@ func flattenReportsGetAScheduledReportItem(item *catalystcentersdkgo.ResponseRep } } -func flattenReportsGetAScheduledReportItemDeliveries(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportDeliveries) []interface{} { +func flattenReportsGetAScheduledReportV1ItemDeliveries(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportV1Deliveries) []interface{} { if items == nil { return nil } @@ -906,7 +906,7 @@ func flattenReportsGetAScheduledReportItemDeliveries(items *[]catalystcentersdkg return respItems } -func flattenReportsGetAScheduledReportItemExecutions(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportExecutions) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1ItemExecutions(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportV1Executions) []map[string]interface{} { if items == nil { return nil } @@ -925,7 +925,7 @@ func flattenReportsGetAScheduledReportItemExecutions(items *[]catalystcentersdkg return respItems } -func flattenReportsGetAScheduledReportItemSchedule(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportSchedule) interface{} { +func flattenReportsGetAScheduledReportV1ItemSchedule(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportV1Schedule) interface{} { if item == nil { return nil } @@ -935,14 +935,14 @@ func flattenReportsGetAScheduledReportItemSchedule(item *catalystcentersdkgo.Res } -func flattenReportsGetAScheduledReportItemView(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportView) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1ItemView(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportV1View) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["field_groups"] = flattenReportsGetAScheduledReportItemViewFieldGroups(item.FieldGroups) - respItem["filters"] = flattenReportsGetAScheduledReportItemViewFilters(item.Filters) - respItem["format"] = flattenReportsGetAScheduledReportItemViewFormat(item.Format) + respItem["field_groups"] = flattenReportsGetAScheduledReportV1ItemViewFieldGroups(item.FieldGroups) + respItem["filters"] = flattenReportsGetAScheduledReportV1ItemViewFilters(item.Filters) + respItem["format"] = flattenReportsGetAScheduledReportV1ItemViewFormat(item.Format) respItem["name"] = item.Name respItem["view_id"] = item.ViewID respItem["description"] = item.Description @@ -954,7 +954,7 @@ func flattenReportsGetAScheduledReportItemView(item *catalystcentersdkgo.Respons } -func flattenReportsGetAScheduledReportItemViewFieldGroups(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportViewFieldGroups) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1ItemViewFieldGroups(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportV1ViewFieldGroups) []map[string]interface{} { if items == nil { return nil } @@ -963,13 +963,13 @@ func flattenReportsGetAScheduledReportItemViewFieldGroups(items *[]catalystcente respItem := make(map[string]interface{}) respItem["field_group_display_name"] = item.FieldGroupDisplayName respItem["field_group_name"] = item.FieldGroupName - respItem["fields"] = flattenReportsGetAScheduledReportItemViewFieldGroupsFields(item.Fields) + respItem["fields"] = flattenReportsGetAScheduledReportV1ItemViewFieldGroupsFields(item.Fields) respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetAScheduledReportItemViewFieldGroupsFields(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportViewFieldGroupsFields) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1ItemViewFieldGroupsFields(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportV1ViewFieldGroupsFields) []map[string]interface{} { if items == nil { return nil } @@ -983,7 +983,7 @@ func flattenReportsGetAScheduledReportItemViewFieldGroupsFields(items *[]catalys return respItems } -func flattenReportsGetAScheduledReportItemViewFilters(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportViewFilters) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1ItemViewFilters(items *[]catalystcentersdkgo.ResponseReportsGetAScheduledReportV1ViewFilters) []map[string]interface{} { if items == nil { return nil } @@ -993,13 +993,13 @@ func flattenReportsGetAScheduledReportItemViewFilters(items *[]catalystcentersdk respItem["display_name"] = item.DisplayName respItem["name"] = item.Name respItem["type"] = item.Type - respItem["value"] = flattenReportsGetAScheduledReportItemViewFiltersValue(item.Value) + respItem["value"] = flattenReportsGetAScheduledReportV1ItemViewFiltersValue(item.Value) respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetAScheduledReportItemViewFiltersValue(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportViewFiltersValue) interface{} { +func flattenReportsGetAScheduledReportV1ItemViewFiltersValue(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportV1ViewFiltersValue) interface{} { if item == nil { return nil } @@ -1009,7 +1009,7 @@ func flattenReportsGetAScheduledReportItemViewFiltersValue(item *catalystcenters } -func flattenReportsGetAScheduledReportItemViewFormat(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportViewFormat) []map[string]interface{} { +func flattenReportsGetAScheduledReportV1ItemViewFormat(item *catalystcentersdkgo.ResponseReportsGetAScheduledReportV1ViewFormat) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_reports_executions.go b/catalystcenter/data_source_reports_executions.go index 1f58cc7..49b6667 100644 --- a/catalystcenter/data_source_reports_executions.go +++ b/catalystcenter/data_source_reports_executions.go @@ -240,27 +240,27 @@ func dataSourceReportsExecutionsRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllExecutionDetailsForAGivenReport") + log.Printf("[DEBUG] Selected method: GetAllExecutionDetailsForAGivenReportV1") vvReportID := vReportID.(string) - response1, restyResp1, err := client.Reports.GetAllExecutionDetailsForAGivenReport(vvReportID) + response1, restyResp1, err := client.Reports.GetAllExecutionDetailsForAGivenReportV1(vvReportID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllExecutionDetailsForAGivenReport", err, - "Failure at GetAllExecutionDetailsForAGivenReport, unexpected response", "")) + "Failure when executing 2 GetAllExecutionDetailsForAGivenReportV1", err, + "Failure at GetAllExecutionDetailsForAGivenReportV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenReportsGetAllExecutionDetailsForAGivenReportItem(response1) + vItem1 := flattenReportsGetAllExecutionDetailsForAGivenReportV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllExecutionDetailsForAGivenReport response", + "Failure when setting GetAllExecutionDetailsForAGivenReportV1 response", err)) return diags } @@ -272,21 +272,21 @@ func dataSourceReportsExecutionsRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenReportsGetAllExecutionDetailsForAGivenReportItem(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReport) []map[string]interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1Item(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["tags"] = item.Tags respItem["data_category"] = item.DataCategory - respItem["deliveries"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemDeliveries(item.Deliveries) + respItem["deliveries"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemDeliveries(item.Deliveries) respItem["execution_count"] = item.ExecutionCount - respItem["executions"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemExecutions(item.Executions) + respItem["executions"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemExecutions(item.Executions) respItem["name"] = item.Name respItem["report_id"] = item.ReportID respItem["report_was_executed"] = boolPtrToString(item.ReportWasExecuted) - respItem["schedule"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemSchedule(item.Schedule) - respItem["view"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemView(item.View) + respItem["schedule"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemSchedule(item.Schedule) + respItem["view"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemView(item.View) respItem["view_group_id"] = item.ViewGroupID respItem["view_group_version"] = item.ViewGroupVersion return []map[string]interface{}{ @@ -294,7 +294,7 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItem(item *catalystcente } } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemDeliveries(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportDeliveries) []interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemDeliveries(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1Deliveries) []interface{} { if items == nil { return nil } @@ -306,7 +306,7 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItemDeliveries(items *[] return respItems } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemExecutions(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportExecutions) []map[string]interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemExecutions(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1Executions) []map[string]interface{} { if items == nil { return nil } @@ -325,7 +325,7 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItemExecutions(items *[] return respItems } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemSchedule(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportSchedule) interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemSchedule(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1Schedule) interface{} { if item == nil { return nil } @@ -335,14 +335,14 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItemSchedule(item *catal } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemView(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportView) []map[string]interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemView(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1View) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["field_groups"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFieldGroups(item.FieldGroups) - respItem["filters"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFilters(item.Filters) - respItem["format"] = flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFormat(item.Format) + respItem["field_groups"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemViewFieldGroups(item.FieldGroups) + respItem["filters"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemViewFilters(item.Filters) + respItem["format"] = flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemViewFormat(item.Format) respItem["name"] = item.Name respItem["view_id"] = item.ViewID respItem["description"] = item.Description @@ -354,7 +354,7 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItemView(item *catalystc } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFieldGroups(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportViewFieldGroups) []interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemViewFieldGroups(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1ViewFieldGroups) []interface{} { if items == nil { return nil } @@ -366,7 +366,7 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFieldGroups(item return respItems } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFilters(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportViewFilters) []interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemViewFilters(items *[]catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1ViewFilters) []interface{} { if items == nil { return nil } @@ -378,7 +378,7 @@ func flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFilters(items *[ return respItems } -func flattenReportsGetAllExecutionDetailsForAGivenReportItemViewFormat(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportViewFormat) interface{} { +func flattenReportsGetAllExecutionDetailsForAGivenReportV1ItemViewFormat(item *catalystcentersdkgo.ResponseReportsGetAllExecutionDetailsForAGivenReportV1ViewFormat) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_reports_executions_download.go b/catalystcenter/data_source_reports_executions_download.go index 508fe39..9454fd3 100644 --- a/catalystcenter/data_source_reports_executions_download.go +++ b/catalystcenter/data_source_reports_executions_download.go @@ -38,6 +38,11 @@ format available from content-disposition response header. Type: schema.TypeString, Required: true, }, + + "item": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -51,7 +56,7 @@ func dataSourceReportsExecutionsDownloadRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: DownloadReportContent") + log.Printf("[DEBUG] Selected method: DownloadReportContentV1") vvReportID := vReportID.(string) vvExecutionID := vExecutionID.(string) @@ -59,7 +64,8 @@ func dataSourceReportsExecutionsDownloadRead(ctx context.Context, d *schema.Reso if err != nil { diags = append(diags, diagError( - "Failure when executing DownloadReportContent", err)) + "Failure when setting DownloadReportContentV1 response", + err)) return diags } diff --git a/catalystcenter/data_source_reports_view_group.go b/catalystcenter/data_source_reports_view_group.go index e96a5f0..ec01f06 100644 --- a/catalystcenter/data_source_reports_view_group.go +++ b/catalystcenter/data_source_reports_view_group.go @@ -127,26 +127,26 @@ func dataSourceReportsViewGroupRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllViewGroups") + log.Printf("[DEBUG] Selected method: GetAllViewGroupsV1") - response1, restyResp1, err := client.Reports.GetAllViewGroups() + response1, restyResp1, err := client.Reports.GetAllViewGroupsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllViewGroups", err, - "Failure at GetAllViewGroups, unexpected response", "")) + "Failure when executing 2 GetAllViewGroupsV1", err, + "Failure at GetAllViewGroupsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenReportsGetAllViewGroupsItems(response1) + vItems1 := flattenReportsGetAllViewGroupsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllViewGroups response", + "Failure when setting GetAllViewGroupsV1 response", err)) return diags } @@ -156,27 +156,27 @@ func dataSourceReportsViewGroupRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetViewsForAGivenViewGroup") + log.Printf("[DEBUG] Selected method: GetViewsForAGivenViewGroupV1") vvViewGroupID := vViewGroupID.(string) - response2, restyResp2, err := client.Reports.GetViewsForAGivenViewGroup(vvViewGroupID) + response2, restyResp2, err := client.Reports.GetViewsForAGivenViewGroupV1(vvViewGroupID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetViewsForAGivenViewGroup", err, - "Failure at GetViewsForAGivenViewGroup, unexpected response", "")) + "Failure when executing 2 GetViewsForAGivenViewGroupV1", err, + "Failure at GetViewsForAGivenViewGroupV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenReportsGetViewsForAGivenViewGroupItem(response2) + vItem2 := flattenReportsGetViewsForAGivenViewGroupV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetViewsForAGivenViewGroup response", + "Failure when setting GetViewsForAGivenViewGroupV1 response", err)) return diags } @@ -188,7 +188,7 @@ func dataSourceReportsViewGroupRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenReportsGetAllViewGroupsItems(items *catalystcentersdkgo.ResponseReportsGetAllViewGroups) []map[string]interface{} { +func flattenReportsGetAllViewGroupsV1Items(items *catalystcentersdkgo.ResponseReportsGetAllViewGroupsV1) []map[string]interface{} { if items == nil { return nil } @@ -204,19 +204,19 @@ func flattenReportsGetAllViewGroupsItems(items *catalystcentersdkgo.ResponseRepo return respItems } -func flattenReportsGetViewsForAGivenViewGroupItem(item *catalystcentersdkgo.ResponseReportsGetViewsForAGivenViewGroup) []map[string]interface{} { +func flattenReportsGetViewsForAGivenViewGroupV1Item(item *catalystcentersdkgo.ResponseReportsGetViewsForAGivenViewGroupV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["view_group_id"] = item.ViewGroupID - respItem["views"] = flattenReportsGetViewsForAGivenViewGroupItemViews(item.Views) + respItem["views"] = flattenReportsGetViewsForAGivenViewGroupV1ItemViews(item.Views) return []map[string]interface{}{ respItem, } } -func flattenReportsGetViewsForAGivenViewGroupItemViews(items *[]catalystcentersdkgo.ResponseReportsGetViewsForAGivenViewGroupViews) []map[string]interface{} { +func flattenReportsGetViewsForAGivenViewGroupV1ItemViews(items *[]catalystcentersdkgo.ResponseReportsGetViewsForAGivenViewGroupV1Views) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_reports_view_group_view.go b/catalystcenter/data_source_reports_view_group_view.go index 248af19..34ffb2e 100644 --- a/catalystcenter/data_source_reports_view_group_view.go +++ b/catalystcenter/data_source_reports_view_group_view.go @@ -368,28 +368,28 @@ func dataSourceReportsViewGroupViewRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetViewDetailsForAGivenViewGroupView") + log.Printf("[DEBUG] Selected method: GetViewDetailsForAGivenViewGroupViewV1") vvViewGroupID := vViewGroupID.(string) vvViewID := vViewID.(string) - response1, restyResp1, err := client.Reports.GetViewDetailsForAGivenViewGroupView(vvViewGroupID, vvViewID) + response1, restyResp1, err := client.Reports.GetViewDetailsForAGivenViewGroupViewV1(vvViewGroupID, vvViewID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetViewDetailsForAGivenViewGroupView", err, - "Failure at GetViewDetailsForAGivenViewGroupView, unexpected response", "")) + "Failure when executing 2 GetViewDetailsForAGivenViewGroupViewV1", err, + "Failure at GetViewDetailsForAGivenViewGroupViewV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenReportsGetViewDetailsForAGivenViewGroupViewItem(response1) + vItem1 := flattenReportsGetViewDetailsForAGivenViewGroupViewV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetViewDetailsForAGivenViewGroupView response", + "Failure when setting GetViewDetailsForAGivenViewGroupViewV1 response", err)) return diags } @@ -401,17 +401,17 @@ func dataSourceReportsViewGroupViewRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItem(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupView) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1Item(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["deliveries"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemDeliveries(item.Deliveries) + respItem["deliveries"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemDeliveries(item.Deliveries) respItem["description"] = item.Description - respItem["field_groups"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFieldGroups(item.FieldGroups) - respItem["filters"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFilters(item.Filters) - respItem["formats"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFormats(item.Formats) - respItem["schedules"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemSchedules(item.Schedules) + respItem["field_groups"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFieldGroups(item.FieldGroups) + respItem["filters"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFilters(item.Filters) + respItem["formats"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFormats(item.Formats) + respItem["schedules"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemSchedules(item.Schedules) respItem["view_id"] = item.ViewID respItem["view_info"] = item.ViewInfo respItem["view_name"] = item.ViewName @@ -420,7 +420,7 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItem(item *catalystcenter } } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemDeliveries(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewDeliveries) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemDeliveries(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1Deliveries) []map[string]interface{} { if items == nil { return nil } @@ -434,7 +434,7 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemDeliveries(items *[]c return respItems } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFieldGroups(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFieldGroups) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFieldGroups(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FieldGroups) []map[string]interface{} { if items == nil { return nil } @@ -443,14 +443,14 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFieldGroups(items *[] respItem := make(map[string]interface{}) respItem["field_group_display_name"] = item.FieldGroupDisplayName respItem["field_group_name"] = item.FieldGroupName - respItem["fields"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFieldGroupsFields(item.Fields) + respItem["fields"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFieldGroupsFields(item.Fields) respItem["table_id"] = item.TableID respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFieldGroupsFields(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFieldGroupsFields) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFieldGroupsFields(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FieldGroupsFields) []map[string]interface{} { if items == nil { return nil } @@ -464,28 +464,28 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFieldGroupsFields(ite return respItems } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFilters(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFilters) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFilters(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1Filters) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["additional_info"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersAdditionalInfo(item.AdditionalInfo) + respItem["additional_info"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersAdditionalInfo(item.AdditionalInfo) respItem["cache_filter"] = boolPtrToString(item.CacheFilter) respItem["data_type"] = item.DataType respItem["display_name"] = item.DisplayName - respItem["filter_source"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersFilterSource(item.FilterSource) + respItem["filter_source"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersFilterSource(item.FilterSource) respItem["name"] = item.Name respItem["required"] = boolPtrToString(item.Required) - respItem["time_options"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersTimeOptions(item.TimeOptions) + respItem["time_options"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersTimeOptions(item.TimeOptions) respItem["type"] = item.Type respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersAdditionalInfo(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFiltersAdditionalInfo) interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersAdditionalInfo(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FiltersAdditionalInfo) interface{} { if item == nil { return nil } @@ -495,12 +495,12 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersAdditionalInfo } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersFilterSource(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFiltersFilterSource) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersFilterSource(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FiltersFilterSource) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["data_source"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersFilterSourceDataSource(item.DataSource) + respItem["data_source"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersFilterSourceDataSource(item.DataSource) respItem["display_value_path"] = item.DisplayValuePath respItem["root_path"] = item.RootPath respItem["value_path"] = item.ValuePath @@ -511,7 +511,7 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersFilterSource(i } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersFilterSourceDataSource(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFiltersFilterSourceDataSource) interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersFilterSourceDataSource(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FiltersFilterSourceDataSource) interface{} { if item == nil { return nil } @@ -521,7 +521,7 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersFilterSourceDa } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersTimeOptions(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFiltersTimeOptions) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFiltersTimeOptions(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FiltersTimeOptions) []map[string]interface{} { if items == nil { return nil } @@ -538,7 +538,7 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFiltersTimeOptions(it return respItems } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFormats(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFormats) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFormats(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1Formats) []map[string]interface{} { if items == nil { return nil } @@ -548,13 +548,13 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFormats(items *[]cata respItem["format"] = item.Format respItem["name"] = item.Name respItem["default"] = boolPtrToString(item.Default) - respItem["template"] = flattenReportsGetViewDetailsForAGivenViewGroupViewItemFormatsTemplate(item.Template) + respItem["template"] = flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFormatsTemplate(item.Template) respItems = append(respItems, respItem) } return respItems } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFormatsTemplate(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewFormatsTemplate) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemFormatsTemplate(item *catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1FormatsTemplate) []map[string]interface{} { if item == nil { return nil } @@ -567,7 +567,7 @@ func flattenReportsGetViewDetailsForAGivenViewGroupViewItemFormatsTemplate(item } -func flattenReportsGetViewDetailsForAGivenViewGroupViewItemSchedules(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewSchedules) []map[string]interface{} { +func flattenReportsGetViewDetailsForAGivenViewGroupViewV1ItemSchedules(items *[]catalystcentersdkgo.ResponseReportsGetViewDetailsForAGivenViewGroupViewV1Schedules) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_reserve_ip_subpool.go b/catalystcenter/data_source_reserve_ip_subpool.go index a7687ef..05190df 100644 --- a/catalystcenter/data_source_reserve_ip_subpool.go +++ b/catalystcenter/data_source_reserve_ip_subpool.go @@ -281,8 +281,8 @@ func dataSourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetReserveIPSubpool") - queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolQueryParams{} + log.Printf("[DEBUG] Selected method: GetReserveIPSubpoolV1") + queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -303,24 +303,24 @@ func dataSourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, queryParams1.GroupName = vGroupName.(string) } - response1, restyResp1, err := client.NetworkSettings.GetReserveIPSubpool(&queryParams1) + response1, restyResp1, err := client.NetworkSettings.GetReserveIPSubpoolV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetReserveIPSubpool", err, - "Failure at GetReserveIPSubpool, unexpected response", "")) + "Failure when executing 2 GetReserveIPSubpoolV1", err, + "Failure at GetReserveIPSubpoolV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenNetworkSettingsGetReserveIPSubpoolItems(response1.Response) + vItems1 := flattenNetworkSettingsGetReserveIPSubpoolV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetReserveIPSubpool response", + "Failure when setting GetReserveIPSubpoolV1 response", err)) return diags } @@ -332,7 +332,7 @@ func dataSourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenNetworkSettingsGetReserveIPSubpoolItems(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponse) []map[string]interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolV1Items(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1Response) []map[string]interface{} { if items == nil { return nil } @@ -341,7 +341,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItems(items *[]catalystcentersdkgo respItem := make(map[string]interface{}) respItem["id"] = item.ID respItem["group_name"] = item.GroupName - respItem["ip_pools"] = flattenNetworkSettingsGetReserveIPSubpoolItemsIPPools(item.IPPools) + respItem["ip_pools"] = flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPools(item.IPPools) respItem["site_id"] = item.SiteID respItem["site_hierarchy"] = item.SiteHierarchy respItem["type"] = item.Type @@ -350,8 +350,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItems(items *[]catalystcentersdkgo } return respItems } - -func flattenNetworkSettingsGetReserveIPSubpoolParameters(items *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpool) []map[string]interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolParameters(items *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpoolV1) []map[string]interface{} { if items == nil { return nil } @@ -405,8 +404,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolParametersDnsServers(items []strin } return respItems } - -func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPools(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponseIPPools) []map[string]interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPools(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1ResponseIPPools) []map[string]interface{} { if items == nil { return nil } @@ -414,7 +412,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPools(items *[]catalystcent for _, item := range *items { respItem := make(map[string]interface{}) respItem["ip_pool_name"] = item.IPPoolName - respItem["dhcp_server_ips"] = flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsDhcpServerIPs(item.DhcpServerIPs) + respItem["dhcp_server_ips"] = flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsDhcpServerIPs(item.DhcpServerIPs) respItem["gateways"] = item.Gateways respItem["create_time"] = item.CreateTime respItem["last_update_time"] = item.LastUpdateTime @@ -426,10 +424,10 @@ func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPools(items *[]catalystcent respItem["overlapping"] = boolPtrToString(item.Overlapping) respItem["configure_external_dhcp"] = boolPtrToString(item.ConfigureExternalDhcp) respItem["used_percentage"] = item.UsedPercentage - respItem["client_options"] = flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsClientOptions(item.ClientOptions) + respItem["client_options"] = flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsClientOptions(item.ClientOptions) respItem["group_uuid"] = item.GroupUUID - respItem["dns_server_ips"] = flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsDNSServerIPs(item.DNSServerIPs) - respItem["context"] = flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsContext(item.Context) + respItem["dns_server_ips"] = flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsDNSServerIPs(item.DNSServerIPs) + respItem["context"] = flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsContext(item.Context) respItem["ipv6"] = boolPtrToString(item.IPv6) respItem["id"] = item.ID respItem["ip_pool_cidr"] = item.IPPoolCidr @@ -438,7 +436,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPools(items *[]catalystcent return respItems } -func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsDhcpServerIPs(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponseIPPoolsDhcpServerIPs) []interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsDhcpServerIPs(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1ResponseIPPoolsDhcpServerIPs) []interface{} { if items == nil { return nil } @@ -450,7 +448,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsDhcpServerIPs(items *[ return respItems } -func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsClientOptions(item *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponseIPPoolsClientOptions) interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsClientOptions(item *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1ResponseIPPoolsClientOptions) interface{} { if item == nil { return nil } @@ -460,7 +458,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsClientOptions(item *ca } -func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsDNSServerIPs(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponseIPPoolsDNSServerIPs) []interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsDNSServerIPs(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1ResponseIPPoolsDNSServerIPs) []interface{} { if items == nil { return nil } @@ -472,7 +470,7 @@ func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsDNSServerIPs(items *[] return respItems } -func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPoolsContext(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponseIPPoolsContext) []map[string]interface{} { +func flattenNetworkSettingsGetReserveIPSubpoolV1ItemsIPPoolsContext(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1ResponseIPPoolsContext) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_role_permissions.go b/catalystcenter/data_source_role_permissions.go index 02dab39..cd93149 100644 --- a/catalystcenter/data_source_role_permissions.go +++ b/catalystcenter/data_source_role_permissions.go @@ -15,7 +15,7 @@ func dataSourceRolePermissions() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on User and Roles. -- Get permissions for a role from Cisco Catalyst Center System. +- Get permissions for a role from Cisco DNA Center System. `, ReadContext: dataSourceRolePermissionsRead, @@ -74,26 +74,26 @@ func dataSourceRolePermissionsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPermissionsAPI") + log.Printf("[DEBUG] Selected method: GetPermissionsAPIV1") - response1, restyResp1, err := client.UserandRoles.GetPermissionsAPI() + response1, restyResp1, err := client.UserandRoles.GetPermissionsAPIV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPermissionsAPI", err, - "Failure at GetPermissionsAPI, unexpected response", "")) + "Failure when executing 2 GetPermissionsAPIV1", err, + "Failure at GetPermissionsAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetPermissionsAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetPermissionsAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPermissionsAPI response", + "Failure when setting GetPermissionsAPIV1 response", err)) return diags } @@ -105,18 +105,18 @@ func dataSourceRolePermissionsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenUserandRolesGetPermissionsAPIItem(item *catalystcentersdkgo.ResponseUserandRolesGetPermissionsAPIResponse) []map[string]interface{} { +func flattenUserandRolesGetPermissionsAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesGetPermissionsAPIV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["resource_types"] = flattenUserandRolesGetPermissionsAPIItemResourceTypes(item.ResourceTypes) + respItem["resource_types"] = flattenUserandRolesGetPermissionsAPIV1ItemResourceTypes(item.ResourceTypes) return []map[string]interface{}{ respItem, } } -func flattenUserandRolesGetPermissionsAPIItemResourceTypes(items *[]catalystcentersdkgo.ResponseUserandRolesGetPermissionsAPIResponseResourceTypes) []map[string]interface{} { +func flattenUserandRolesGetPermissionsAPIV1ItemResourceTypes(items *[]catalystcentersdkgo.ResponseUserandRolesGetPermissionsAPIV1ResponseResourceTypes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_roles.go b/catalystcenter/data_source_roles.go index d72ec5d..6c4c6c1 100644 --- a/catalystcenter/data_source_roles.go +++ b/catalystcenter/data_source_roles.go @@ -15,7 +15,7 @@ func dataSourceRoles() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on User and Roles. -- Get all roles for the Cisco Catalyst Center System. +- Get all roles for the Cisco DNA Center System. `, ReadContext: dataSourceRolesRead, @@ -136,30 +136,30 @@ func dataSourceRolesRead(ctx context.Context, d *schema.ResourceData, m interfac selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetRolesAPI") + log.Printf("[DEBUG] Selected method: GetRolesAPIV1") - headerParams1 := catalystcentersdkgo.GetRolesAPIHeaderParams{} + headerParams1 := catalystcentersdkgo.GetRolesAPIV1HeaderParams{} headerParams1.InvokeSource = vInvokeSource.(string) - response1, restyResp1, err := client.UserandRoles.GetRolesAPI(&headerParams1) + response1, restyResp1, err := client.UserandRoles.GetRolesAPIV1(&headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetRolesAPI", err, - "Failure at GetRolesAPI, unexpected response", "")) + "Failure when executing 2 GetRolesAPIV1", err, + "Failure at GetRolesAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetRolesAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetRolesAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetRolesAPI response", + "Failure when setting GetRolesAPIV1 response", err)) return diags } @@ -171,26 +171,26 @@ func dataSourceRolesRead(ctx context.Context, d *schema.ResourceData, m interfac return diags } -func flattenUserandRolesGetRolesAPIItem(item *catalystcentersdkgo.ResponseUserandRolesGetRolesAPIResponse) []map[string]interface{} { +func flattenUserandRolesGetRolesAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesGetRolesAPIV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["roles"] = flattenUserandRolesGetRolesAPIItemRoles(item.Roles) + respItem["roles"] = flattenUserandRolesGetRolesAPIV1ItemRoles(item.Roles) return []map[string]interface{}{ respItem, } } -func flattenUserandRolesGetRolesAPIItemRoles(items *[]catalystcentersdkgo.ResponseUserandRolesGetRolesAPIResponseRoles) []map[string]interface{} { +func flattenUserandRolesGetRolesAPIV1ItemRoles(items *[]catalystcentersdkgo.ResponseUserandRolesGetRolesAPIV1ResponseRoles) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["resource_types"] = flattenUserandRolesGetRolesAPIItemRolesResourceTypes(item.ResourceTypes) - respItem["meta"] = flattenUserandRolesGetRolesAPIItemRolesMeta(item.Meta) + respItem["resource_types"] = flattenUserandRolesGetRolesAPIV1ItemRolesResourceTypes(item.ResourceTypes) + respItem["meta"] = flattenUserandRolesGetRolesAPIV1ItemRolesMeta(item.Meta) respItem["role_id"] = item.RoleID respItem["name"] = item.Name respItem["description"] = item.Description @@ -200,7 +200,7 @@ func flattenUserandRolesGetRolesAPIItemRoles(items *[]catalystcentersdkgo.Respon return respItems } -func flattenUserandRolesGetRolesAPIItemRolesResourceTypes(items *[]catalystcentersdkgo.ResponseUserandRolesGetRolesAPIResponseRolesResourceTypes) []map[string]interface{} { +func flattenUserandRolesGetRolesAPIV1ItemRolesResourceTypes(items *[]catalystcentersdkgo.ResponseUserandRolesGetRolesAPIV1ResponseRolesResourceTypes) []map[string]interface{} { if items == nil { return nil } @@ -214,7 +214,7 @@ func flattenUserandRolesGetRolesAPIItemRolesResourceTypes(items *[]catalystcente return respItems } -func flattenUserandRolesGetRolesAPIItemRolesMeta(item *catalystcentersdkgo.ResponseUserandRolesGetRolesAPIResponseRolesMeta) []map[string]interface{} { +func flattenUserandRolesGetRolesAPIV1ItemRolesMeta(item *catalystcentersdkgo.ResponseUserandRolesGetRolesAPIV1ResponseRolesMeta) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_anycast_gateways.go b/catalystcenter/data_source_sda_anycast_gateways.go index 73f008c..4dfc57d 100644 --- a/catalystcenter/data_source_sda_anycast_gateways.go +++ b/catalystcenter/data_source_sda_anycast_gateways.go @@ -230,8 +230,8 @@ func dataSourceSdaAnycastGatewaysRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAnycastGateways") - queryParams1 := catalystcentersdkgo.GetAnycastGatewaysQueryParams{} + log.Printf("[DEBUG] Selected method: GetAnycastGatewaysV1") + queryParams1 := catalystcentersdkgo.GetAnycastGatewaysV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -258,24 +258,24 @@ func dataSourceSdaAnycastGatewaysRead(ctx context.Context, d *schema.ResourceDat queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetAnycastGateways(&queryParams1) + response1, restyResp1, err := client.Sda.GetAnycastGatewaysV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAnycastGateways", err, - "Failure at GetAnycastGateways, unexpected response", "")) + "Failure when executing 2 GetAnycastGatewaysV1", err, + "Failure at GetAnycastGatewaysV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetAnycastGatewaysItems(response1.Response) + vItems1 := flattenSdaGetAnycastGatewaysV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAnycastGateways response", + "Failure when setting GetAnycastGatewaysV1 response", err)) return diags } @@ -287,7 +287,7 @@ func dataSourceSdaAnycastGatewaysRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenSdaGetAnycastGatewaysItems(items *[]catalystcentersdkgo.ResponseSdaGetAnycastGatewaysResponse) []map[string]interface{} { +func flattenSdaGetAnycastGatewaysV1Items(items *[]catalystcentersdkgo.ResponseSdaGetAnycastGatewaysV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_anycast_gateways_count.go b/catalystcenter/data_source_sda_anycast_gateways_count.go index 82b89a7..5c6ba88 100644 --- a/catalystcenter/data_source_sda_anycast_gateways_count.go +++ b/catalystcenter/data_source_sda_anycast_gateways_count.go @@ -82,8 +82,8 @@ func dataSourceSdaAnycastGatewaysCountRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAnycastGatewayCount") - queryParams1 := catalystcentersdkgo.GetAnycastGatewayCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetAnycastGatewayCountV1") + queryParams1 := catalystcentersdkgo.GetAnycastGatewayCountV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -101,24 +101,24 @@ func dataSourceSdaAnycastGatewaysCountRead(ctx context.Context, d *schema.Resour queryParams1.VLANID = vVLANID.(float64) } - response1, restyResp1, err := client.Sda.GetAnycastGatewayCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetAnycastGatewayCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAnycastGatewayCount", err, - "Failure at GetAnycastGatewayCount, unexpected response", "")) + "Failure when executing 2 GetAnycastGatewayCountV1", err, + "Failure at GetAnycastGatewayCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetAnycastGatewayCountItem(response1.Response) + vItem1 := flattenSdaGetAnycastGatewayCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAnycastGatewayCount response", + "Failure when setting GetAnycastGatewayCountV1 response", err)) return diags } @@ -130,7 +130,7 @@ func dataSourceSdaAnycastGatewaysCountRead(ctx context.Context, d *schema.Resour return diags } -func flattenSdaGetAnycastGatewayCountItem(item *catalystcentersdkgo.ResponseSdaGetAnycastGatewayCountResponse) []map[string]interface{} { +func flattenSdaGetAnycastGatewayCountV1Item(item *catalystcentersdkgo.ResponseSdaGetAnycastGatewayCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_authentication_profiles.go b/catalystcenter/data_source_sda_authentication_profiles.go index 9238360..a4ade63 100644 --- a/catalystcenter/data_source_sda_authentication_profiles.go +++ b/catalystcenter/data_source_sda_authentication_profiles.go @@ -126,8 +126,8 @@ func dataSourceSdaAuthenticationProfilesRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAuthenticationProfiles") - queryParams1 := catalystcentersdkgo.GetAuthenticationProfilesQueryParams{} + log.Printf("[DEBUG] Selected method: GetAuthenticationProfilesV1") + queryParams1 := catalystcentersdkgo.GetAuthenticationProfilesV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -142,24 +142,24 @@ func dataSourceSdaAuthenticationProfilesRead(ctx context.Context, d *schema.Reso queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetAuthenticationProfiles(&queryParams1) + response1, restyResp1, err := client.Sda.GetAuthenticationProfilesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAuthenticationProfiles", err, - "Failure at GetAuthenticationProfiles, unexpected response", "")) + "Failure when executing 2 GetAuthenticationProfilesV1", err, + "Failure at GetAuthenticationProfilesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetAuthenticationProfilesItems(response1.Response) + vItems1 := flattenSdaGetAuthenticationProfilesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAuthenticationProfiles response", + "Failure when setting GetAuthenticationProfilesV1 response", err)) return diags } @@ -171,7 +171,7 @@ func dataSourceSdaAuthenticationProfilesRead(ctx context.Context, d *schema.Reso return diags } -func flattenSdaGetAuthenticationProfilesItems(items *[]catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesResponse) []map[string]interface{} { +func flattenSdaGetAuthenticationProfilesV1Items(items *[]catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_device.go b/catalystcenter/data_source_sda_device.go index a15d8ad..1e48934 100644 --- a/catalystcenter/data_source_sda_device.go +++ b/catalystcenter/data_source_sda_device.go @@ -85,29 +85,29 @@ func dataSourceSdaDeviceRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceInfoFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetDeviceInfoFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceInfoFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetDeviceInfoFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) - response1, restyResp1, err := client.Sda.GetDeviceInfoFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetDeviceInfoFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceInfoFromSdaFabric", err, - "Failure at GetDeviceInfoFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetDeviceInfoFromSdaFabricV1", err, + "Failure at GetDeviceInfoFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetDeviceInfoFromSdaFabricItem(response1) + vItem1 := flattenSdaGetDeviceInfoFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceInfoFromSdaFabric response", + "Failure when setting GetDeviceInfoFromSdaFabricV1 response", err)) return diags } @@ -119,7 +119,7 @@ func dataSourceSdaDeviceRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenSdaGetDeviceInfoFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetDeviceInfoFromSdaFabric) []map[string]interface{} { +func flattenSdaGetDeviceInfoFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetDeviceInfoFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_device_role.go b/catalystcenter/data_source_sda_device_role.go index 1fd62a4..9415196 100644 --- a/catalystcenter/data_source_sda_device_role.go +++ b/catalystcenter/data_source_sda_device_role.go @@ -71,29 +71,29 @@ func dataSourceSdaDeviceRoleRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceRoleInSdaFabric") - queryParams1 := catalystcentersdkgo.GetDeviceRoleInSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetDeviceRoleInSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetDeviceRoleInSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) - response1, restyResp1, err := client.Sda.GetDeviceRoleInSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetDeviceRoleInSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceRoleInSdaFabric", err, - "Failure at GetDeviceRoleInSdaFabric, unexpected response", "")) + "Failure when executing 2 GetDeviceRoleInSdaFabricV1", err, + "Failure at GetDeviceRoleInSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetDeviceRoleInSdaFabricItem(response1) + vItem1 := flattenSdaGetDeviceRoleInSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceRoleInSdaFabric response", + "Failure when setting GetDeviceRoleInSdaFabricV1 response", err)) return diags } @@ -105,7 +105,7 @@ func dataSourceSdaDeviceRoleRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSdaGetDeviceRoleInSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetDeviceRoleInSdaFabric) []map[string]interface{} { +func flattenSdaGetDeviceRoleInSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetDeviceRoleInSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_extranet_policies.go b/catalystcenter/data_source_sda_extranet_policies.go index 428b27e..23bc130 100644 --- a/catalystcenter/data_source_sda_extranet_policies.go +++ b/catalystcenter/data_source_sda_extranet_policies.go @@ -102,8 +102,8 @@ func dataSourceSdaExtranetPoliciesRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetExtranetPolicies") - queryParams1 := catalystcentersdkgo.GetExtranetPoliciesQueryParams{} + log.Printf("[DEBUG] Selected method: GetExtranetPoliciesV1") + queryParams1 := catalystcentersdkgo.GetExtranetPoliciesV1QueryParams{} if okExtranetPolicyName { queryParams1.ExtranetPolicyName = vExtranetPolicyName.(string) @@ -115,24 +115,24 @@ func dataSourceSdaExtranetPoliciesRead(ctx context.Context, d *schema.ResourceDa queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetExtranetPolicies(&queryParams1) + response1, restyResp1, err := client.Sda.GetExtranetPoliciesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetExtranetPolicies", err, - "Failure at GetExtranetPolicies, unexpected response", "")) + "Failure when executing 2 GetExtranetPoliciesV1", err, + "Failure at GetExtranetPoliciesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetExtranetPoliciesItems(response1.Response) + vItems1 := flattenSdaGetExtranetPoliciesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetExtranetPolicies response", + "Failure when setting GetExtranetPoliciesV1 response", err)) return diags } @@ -144,7 +144,7 @@ func dataSourceSdaExtranetPoliciesRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSdaGetExtranetPoliciesItems(items *[]catalystcentersdkgo.ResponseSdaGetExtranetPoliciesResponse) []map[string]interface{} { +func flattenSdaGetExtranetPoliciesV1Items(items *[]catalystcentersdkgo.ResponseSdaGetExtranetPoliciesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_extranet_policies_count.go b/catalystcenter/data_source_sda_extranet_policies_count.go index 4f649fc..6720211 100644 --- a/catalystcenter/data_source_sda_extranet_policies_count.go +++ b/catalystcenter/data_source_sda_extranet_policies_count.go @@ -47,26 +47,26 @@ func dataSourceSdaExtranetPoliciesCountRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetExtranetPolicyCount") + log.Printf("[DEBUG] Selected method: GetExtranetPolicyCountV1") - response1, restyResp1, err := client.Sda.GetExtranetPolicyCount() + response1, restyResp1, err := client.Sda.GetExtranetPolicyCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetExtranetPolicyCount", err, - "Failure at GetExtranetPolicyCount, unexpected response", "")) + "Failure when executing 2 GetExtranetPolicyCountV1", err, + "Failure at GetExtranetPolicyCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetExtranetPolicyCountItem(response1.Response) + vItem1 := flattenSdaGetExtranetPolicyCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetExtranetPolicyCount response", + "Failure when setting GetExtranetPolicyCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceSdaExtranetPoliciesCountRead(ctx context.Context, d *schema.Resou return diags } -func flattenSdaGetExtranetPolicyCountItem(item *catalystcentersdkgo.ResponseSdaGetExtranetPolicyCountResponse) []map[string]interface{} { +func flattenSdaGetExtranetPolicyCountV1Item(item *catalystcentersdkgo.ResponseSdaGetExtranetPolicyCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_authentication_profile.go b/catalystcenter/data_source_sda_fabric_authentication_profile.go index ae8ec2f..815e4be 100644 --- a/catalystcenter/data_source_sda_fabric_authentication_profile.go +++ b/catalystcenter/data_source_sda_fabric_authentication_profile.go @@ -116,8 +116,8 @@ func dataSourceSdaFabricAuthenticationProfileRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDefaultAuthenticationProfileFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetDefaultAuthenticationProfileFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) @@ -125,24 +125,24 @@ func dataSourceSdaFabricAuthenticationProfileRead(ctx context.Context, d *schema queryParams1.AuthenticateTemplateName = vAuthenticateTemplateName.(string) } - response1, restyResp1, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDefaultAuthenticationProfileFromSdaFabric", err, - "Failure at GetDefaultAuthenticationProfileFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetDefaultAuthenticationProfileFromSdaFabricV1", err, + "Failure at GetDefaultAuthenticationProfileFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetDefaultAuthenticationProfileFromSdaFabricItem(response1) + vItem1 := flattenSdaGetDefaultAuthenticationProfileFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDefaultAuthenticationProfileFromSdaFabric response", + "Failure when setting GetDefaultAuthenticationProfileFromSdaFabricV1 response", err)) return diags } @@ -154,7 +154,7 @@ func dataSourceSdaFabricAuthenticationProfileRead(ctx context.Context, d *schema return diags } -func flattenSdaGetDefaultAuthenticationProfileFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetDefaultAuthenticationProfileFromSdaFabric) []map[string]interface{} { +func flattenSdaGetDefaultAuthenticationProfileFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetDefaultAuthenticationProfileFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } @@ -172,14 +172,3 @@ func flattenSdaGetDefaultAuthenticationProfileFromSdaFabricItem(item *catalystce respItem, } } - -func flattenSdaGetDefaultAuthenticationProfileFromSdaFabricPayload(item *catalystcentersdkgo.ResponseSdaGetDefaultAuthenticationProfileFromSdaFabric) []map[string]interface{} { - if item == nil { - return nil - } - respItem := make(map[string]interface{}) - respItem["payload"] = flattenSdaGetDefaultAuthenticationProfileFromSdaFabricItem(item) - return []map[string]interface{}{ - respItem, - } -} diff --git a/catalystcenter/data_source_sda_fabric_border_device.go b/catalystcenter/data_source_sda_fabric_border_device.go index a010f8b..93d9dde 100644 --- a/catalystcenter/data_source_sda_fabric_border_device.go +++ b/catalystcenter/data_source_sda_fabric_border_device.go @@ -793,29 +793,29 @@ func dataSourceSdaFabricBorderDeviceRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetBorderDeviceDetailFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetBorderDeviceDetailFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) - response1, restyResp1, err := client.Sda.GetBorderDeviceDetailFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetBorderDeviceDetailFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetBorderDeviceDetailFromSdaFabric", err, - "Failure at GetBorderDeviceDetailFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetBorderDeviceDetailFromSdaFabricV1", err, + "Failure at GetBorderDeviceDetailFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetBorderDeviceDetailFromSdaFabricItem(response1) + vItem1 := flattenSdaGetBorderDeviceDetailFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetBorderDeviceDetailFromSdaFabric response", + "Failure when setting GetBorderDeviceDetailFromSdaFabricV1 response", err)) return diags } @@ -827,20 +827,20 @@ func dataSourceSdaFabricBorderDeviceRead(ctx context.Context, d *schema.Resource return diags } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabric) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["status"] = item.Status respItem["description"] = item.Description - respItem["payload"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayload(item.Payload) + respItem["payload"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayload(item.Payload) return []map[string]interface{}{ respItem, } } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayload(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayload) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayload(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1Payload) []map[string]interface{} { if item == nil { return nil } @@ -862,24 +862,24 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayload(item *catalystcente respItem["namespace"] = item.Namespace respItem["provisioning_state"] = item.ProvisioningState respItem["resource_version"] = item.ResourceVersion - respItem["target_id_list"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadTargetIDList(item.TargetIDList) + respItem["target_id_list"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadTargetIDList(item.TargetIDList) respItem["type"] = item.Type - respItem["cfs_change_info"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadCfsChangeInfo(item.CfsChangeInfo) - respItem["custom_provisions"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadCustomProvisions(item.CustomProvisions) - respItem["configs"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadConfigs(item.Configs) - respItem["managed_sites"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadManagedSites(item.ManagedSites) + respItem["cfs_change_info"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadCfsChangeInfo(item.CfsChangeInfo) + respItem["custom_provisions"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadCustomProvisions(item.CustomProvisions) + respItem["configs"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadConfigs(item.Configs) + respItem["managed_sites"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadManagedSites(item.ManagedSites) respItem["network_device_id"] = item.NetworkDeviceID respItem["roles"] = item.Roles respItem["save_wan_connectivity_details_only"] = boolPtrToString(item.SaveWanConnectivityDetailsOnly) respItem["site_id"] = item.SiteID - respItem["akc_settings_cfs"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadAkcSettingsCfs(item.AkcSettingsCfs) - respItem["device_interface_info"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceInterfaceInfo(item.DeviceInterfaceInfo) - respItem["device_settings"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettings(item.DeviceSettings) - respItem["network_widesettings"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettings(item.NetworkWidesettings) - respItem["other_device"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadOtherDevice(item.OtherDevice) - respItem["transit_networks"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadTransitNetworks(item.TransitNetworks) - respItem["virtual_network"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadVirtualNetwork(item.VirtualNetwork) - respItem["wlan"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadWLAN(item.WLAN) + respItem["akc_settings_cfs"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadAkcSettingsCfs(item.AkcSettingsCfs) + respItem["device_interface_info"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceInterfaceInfo(item.DeviceInterfaceInfo) + respItem["device_settings"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettings(item.DeviceSettings) + respItem["network_widesettings"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettings(item.NetworkWidesettings) + respItem["other_device"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadOtherDevice(item.OtherDevice) + respItem["transit_networks"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadTransitNetworks(item.TransitNetworks) + respItem["virtual_network"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadVirtualNetwork(item.VirtualNetwork) + respItem["wlan"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadWLAN(item.WLAN) return []map[string]interface{}{ respItem, @@ -887,7 +887,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayload(item *catalystcente } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadTargetIDList(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadTargetIDList) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadTargetIDList(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadTargetIDList) []interface{} { if items == nil { return nil } @@ -899,7 +899,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadTargetIDList(items * return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadCfsChangeInfo(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadCfsChangeInfo) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadCfsChangeInfo(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadCfsChangeInfo) []interface{} { if items == nil { return nil } @@ -911,7 +911,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadCfsChangeInfo(items return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadCustomProvisions(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadCustomProvisions) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadCustomProvisions(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadCustomProvisions) []interface{} { if items == nil { return nil } @@ -923,7 +923,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadCustomProvisions(ite return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadConfigs(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadConfigs) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadConfigs(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadConfigs) []interface{} { if items == nil { return nil } @@ -935,7 +935,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadConfigs(items *[]cat return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadManagedSites(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadManagedSites) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadManagedSites(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadManagedSites) []interface{} { if items == nil { return nil } @@ -947,7 +947,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadManagedSites(items * return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadAkcSettingsCfs(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadAkcSettingsCfs) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadAkcSettingsCfs(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadAkcSettingsCfs) []interface{} { if items == nil { return nil } @@ -959,7 +959,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadAkcSettingsCfs(items return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceInterfaceInfo(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceInterfaceInfo) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceInterfaceInfo(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceInterfaceInfo) []interface{} { if items == nil { return nil } @@ -971,7 +971,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceInterfaceInfo( return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettings(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceSettings) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettings(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceSettings) []map[string]interface{} { if item == nil { return nil } @@ -982,7 +982,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettings(item respItem["instance_tenant_id"] = item.InstanceTenantID respItem["deploy_pending"] = item.DeployPending respItem["instance_version"] = item.InstanceVersion - respItem["connected_to"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsConnectedTo(item.ConnectedTo) + respItem["connected_to"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsConnectedTo(item.ConnectedTo) respItem["cpu"] = item.CPU respItem["dhcp_enabled"] = boolPtrToString(item.DhcpEnabled) respItem["external_connectivity_ip_pool"] = item.ExternalConnectivityIPPool @@ -991,7 +991,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettings(item respItem["memory"] = item.Memory respItem["node_type"] = item.NodeType respItem["storage"] = item.Storage - respItem["ext_connectivity_settings"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettings(item.ExtConnectivitySettings) + respItem["ext_connectivity_settings"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettings(item.ExtConnectivitySettings) return []map[string]interface{}{ respItem, @@ -999,7 +999,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettings(item } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsConnectedTo(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceSettingsConnectedTo) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsConnectedTo(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceSettingsConnectedTo) []interface{} { if items == nil { return nil } @@ -1011,7 +1011,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsConnec return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettings(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceSettingsExtConnectivitySettings) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettings(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceSettingsExtConnectivitySettings) []map[string]interface{} { if items == nil { return nil } @@ -1028,14 +1028,14 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtCon respItem["interface_uuid"] = item.InterfaceUUID respItem["policy_propagation_enabled"] = boolPtrToString(item.PolicyPropagationEnabled) respItem["policy_sgt_tag"] = item.PolicySgtTag - respItem["l2_handoff"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettingsL2Handoff(item.L2Handoff) - respItem["l3_handoff"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettingsL3Handoff(item.L3Handoff) + respItem["l2_handoff"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettingsL2Handoff(item.L2Handoff) + respItem["l3_handoff"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettingsL3Handoff(item.L3Handoff) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettingsL2Handoff(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceSettingsExtConnectivitySettingsL2Handoff) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettingsL2Handoff(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceSettingsExtConnectivitySettingsL2Handoff) []interface{} { if items == nil { return nil } @@ -1047,7 +1047,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtCon return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettingsL3Handoff(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceSettingsExtConnectivitySettingsL3Handoff) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettingsL3Handoff(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceSettingsExtConnectivitySettingsL3Handoff) []map[string]interface{} { if items == nil { return nil } @@ -1063,13 +1063,13 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtCon respItem["local_ip_address"] = item.LocalIPAddress respItem["remote_ip_address"] = item.RemoteIPAddress respItem["vlan_id"] = item.VLANID - respItem["virtual_network"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettingsL3HandoffVirtualNetwork(item.VirtualNetwork) + respItem["virtual_network"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettingsL3HandoffVirtualNetwork(item.VirtualNetwork) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtConnectivitySettingsL3HandoffVirtualNetwork(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadDeviceSettingsExtConnectivitySettingsL3HandoffVirtualNetwork) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadDeviceSettingsExtConnectivitySettingsL3HandoffVirtualNetwork(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadDeviceSettingsExtConnectivitySettingsL3HandoffVirtualNetwork) []map[string]interface{} { if item == nil { return nil } @@ -1082,7 +1082,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadDeviceSettingsExtCon } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettings(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettings) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettings(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettings) []map[string]interface{} { if item == nil { return nil } @@ -1093,16 +1093,16 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettings( respItem["instance_tenant_id"] = item.InstanceTenantID respItem["deploy_pending"] = item.DeployPending respItem["instance_version"] = item.InstanceVersion - respItem["aaa"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsAAA(item.AAA) - respItem["cmx"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsCmx(item.Cmx) - respItem["dhcp"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDhcp(item.Dhcp) - respItem["dns"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDNS(item.DNS) - respItem["ldap"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsLdap(item.Ldap) - respItem["native_vlan"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsNativeVLAN(item.NativeVLAN) - respItem["netflow"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsNetflow(item.Netflow) - respItem["ntp"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsNtp(item.Ntp) - respItem["snmp"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsSNMP(item.SNMP) - respItem["syslogs"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsSyslogs(item.Syslogs) + respItem["aaa"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsAAA(item.AAA) + respItem["cmx"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsCmx(item.Cmx) + respItem["dhcp"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDhcp(item.Dhcp) + respItem["dns"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDNS(item.DNS) + respItem["ldap"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsLdap(item.Ldap) + respItem["native_vlan"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsNativeVLAN(item.NativeVLAN) + respItem["netflow"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsNetflow(item.Netflow) + respItem["ntp"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsNtp(item.Ntp) + respItem["snmp"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsSNMP(item.SNMP) + respItem["syslogs"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsSyslogs(item.Syslogs) return []map[string]interface{}{ respItem, @@ -1110,7 +1110,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettings( } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsAAA(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsAAA) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsAAA(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsAAA) []interface{} { if items == nil { return nil } @@ -1122,7 +1122,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsA return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsCmx(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsCmx) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsCmx(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsCmx) []interface{} { if items == nil { return nil } @@ -1134,7 +1134,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsC return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDhcp(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsDhcp) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDhcp(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsDhcp) []map[string]interface{} { if items == nil { return nil } @@ -1142,13 +1142,13 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsD for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["ip_address"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDhcpIPAddress(item.IPAddress) + respItem["ip_address"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDhcpIPAddress(item.IPAddress) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDhcpIPAddress(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsDhcpIPAddress) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDhcpIPAddress(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsDhcpIPAddress) []map[string]interface{} { if item == nil { return nil } @@ -1164,7 +1164,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsD } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDNS(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsDNS) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDNS(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsDNS) []map[string]interface{} { if items == nil { return nil } @@ -1173,13 +1173,13 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsD respItem := make(map[string]interface{}) respItem["id"] = item.ID respItem["domain_name"] = item.DomainName - respItem["ip"] = flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDNSIP(item.IP) + respItem["ip"] = flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDNSIP(item.IP) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsDNSIP(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsDNSIP) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsDNSIP(item *catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsDNSIP) []map[string]interface{} { if item == nil { return nil } @@ -1195,7 +1195,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsD } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsLdap(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsLdap) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsLdap(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsLdap) []interface{} { if items == nil { return nil } @@ -1207,7 +1207,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsL return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsNativeVLAN(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsNativeVLAN) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsNativeVLAN(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsNativeVLAN) []interface{} { if items == nil { return nil } @@ -1219,7 +1219,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsN return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsNetflow(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsNetflow) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsNetflow(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsNetflow) []interface{} { if items == nil { return nil } @@ -1231,7 +1231,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsN return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsNtp(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsNtp) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsNtp(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsNtp) []interface{} { if items == nil { return nil } @@ -1243,7 +1243,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsN return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsSNMP(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsSNMP) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsSNMP(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsSNMP) []interface{} { if items == nil { return nil } @@ -1255,7 +1255,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsS return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsSyslogs(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadNetworkWidesettingsSyslogs) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadNetworkWidesettingsSyslogs(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadNetworkWidesettingsSyslogs) []interface{} { if items == nil { return nil } @@ -1267,7 +1267,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadNetworkWidesettingsS return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadOtherDevice(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadOtherDevice) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadOtherDevice(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadOtherDevice) []interface{} { if items == nil { return nil } @@ -1279,7 +1279,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadOtherDevice(items *[ return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadTransitNetworks(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadTransitNetworks) []map[string]interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadTransitNetworks(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadTransitNetworks) []map[string]interface{} { if items == nil { return nil } @@ -1292,7 +1292,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadTransitNetworks(item return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadVirtualNetwork(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadVirtualNetwork) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadVirtualNetwork(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadVirtualNetwork) []interface{} { if items == nil { return nil } @@ -1304,7 +1304,7 @@ func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadVirtualNetwork(items return respItems } -func flattenSdaGetBorderDeviceDetailFromSdaFabricItemPayloadWLAN(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricPayloadWLAN) []interface{} { +func flattenSdaGetBorderDeviceDetailFromSdaFabricV1ItemPayloadWLAN(items *[]catalystcentersdkgo.ResponseSdaGetBorderDeviceDetailFromSdaFabricV1PayloadWLAN) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_control_plane_device.go b/catalystcenter/data_source_sda_fabric_control_plane_device.go index 613cb16..df71bd7 100644 --- a/catalystcenter/data_source_sda_fabric_control_plane_device.go +++ b/catalystcenter/data_source_sda_fabric_control_plane_device.go @@ -95,29 +95,29 @@ func dataSourceSdaFabricControlPlaneDeviceRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetControlPlaneDeviceFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetControlPlaneDeviceFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) - response1, restyResp1, err := client.Sda.GetControlPlaneDeviceFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetControlPlaneDeviceFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetControlPlaneDeviceFromSdaFabric", err, - "Failure at GetControlPlaneDeviceFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetControlPlaneDeviceFromSdaFabricV1", err, + "Failure at GetControlPlaneDeviceFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetControlPlaneDeviceFromSdaFabricItem(response1) + vItem1 := flattenSdaGetControlPlaneDeviceFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetControlPlaneDeviceFromSdaFabric response", + "Failure when setting GetControlPlaneDeviceFromSdaFabricV1 response", err)) return diags } @@ -129,7 +129,7 @@ func dataSourceSdaFabricControlPlaneDeviceRead(ctx context.Context, d *schema.Re return diags } -func flattenSdaGetControlPlaneDeviceFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetControlPlaneDeviceFromSdaFabric) []map[string]interface{} { +func flattenSdaGetControlPlaneDeviceFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetControlPlaneDeviceFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices.go b/catalystcenter/data_source_sda_fabric_devices.go index 5976a3e..dd8bed1 100644 --- a/catalystcenter/data_source_sda_fabric_devices.go +++ b/catalystcenter/data_source_sda_fabric_devices.go @@ -171,8 +171,8 @@ func dataSourceSdaFabricDevicesRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevices") - queryParams1 := catalystcentersdkgo.GetFabricDevicesQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -189,24 +189,24 @@ func dataSourceSdaFabricDevicesRead(ctx context.Context, d *schema.ResourceData, queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetFabricDevices(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevices", err, - "Failure at GetFabricDevices, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesV1", err, + "Failure at GetFabricDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetFabricDevicesItems(response1.Response) + vItems1 := flattenSdaGetFabricDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevices response", + "Failure when setting GetFabricDevicesV1 response", err)) return diags } @@ -218,7 +218,7 @@ func dataSourceSdaFabricDevicesRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenSdaGetFabricDevicesItems(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesV1Items(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -229,19 +229,19 @@ func flattenSdaGetFabricDevicesItems(items *[]catalystcentersdkgo.ResponseSdaGet respItem["network_device_id"] = item.NetworkDeviceID respItem["fabric_id"] = item.FabricID respItem["device_roles"] = item.DeviceRoles - respItem["border_device_settings"] = flattenSdaGetFabricDevicesItemsBorderDeviceSettings(item.BorderDeviceSettings) + respItem["border_device_settings"] = flattenSdaGetFabricDevicesV1ItemsBorderDeviceSettings(item.BorderDeviceSettings) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetFabricDevicesItemsBorderDeviceSettings(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesResponseBorderDeviceSettings) []map[string]interface{} { +func flattenSdaGetFabricDevicesV1ItemsBorderDeviceSettings(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesV1ResponseBorderDeviceSettings) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["border_types"] = item.BorderTypes - respItem["layer3_settings"] = flattenSdaGetFabricDevicesItemsBorderDeviceSettingsLayer3Settings(item.Layer3Settings) + respItem["layer3_settings"] = flattenSdaGetFabricDevicesV1ItemsBorderDeviceSettingsLayer3Settings(item.Layer3Settings) return []map[string]interface{}{ respItem, @@ -249,7 +249,7 @@ func flattenSdaGetFabricDevicesItemsBorderDeviceSettings(item *catalystcentersdk } -func flattenSdaGetFabricDevicesItemsBorderDeviceSettingsLayer3Settings(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesResponseBorderDeviceSettingsLayer3Settings) []map[string]interface{} { +func flattenSdaGetFabricDevicesV1ItemsBorderDeviceSettingsLayer3Settings(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesV1ResponseBorderDeviceSettingsLayer3Settings) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_count.go b/catalystcenter/data_source_sda_fabric_devices_count.go index eec9fc6..bd3bfda 100644 --- a/catalystcenter/data_source_sda_fabric_devices_count.go +++ b/catalystcenter/data_source_sda_fabric_devices_count.go @@ -68,8 +68,8 @@ func dataSourceSdaFabricDevicesCountRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesCount") - queryParams1 := catalystcentersdkgo.GetFabricDevicesCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesCountV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesCountV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -80,24 +80,24 @@ func dataSourceSdaFabricDevicesCountRead(ctx context.Context, d *schema.Resource queryParams1.DeviceRoles = vDeviceRoles.(string) } - response1, restyResp1, err := client.Sda.GetFabricDevicesCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesCount", err, - "Failure at GetFabricDevicesCount, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesCountV1", err, + "Failure at GetFabricDevicesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetFabricDevicesCountItem(response1.Response) + vItem1 := flattenSdaGetFabricDevicesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesCount response", + "Failure when setting GetFabricDevicesCountV1 response", err)) return diags } @@ -109,7 +109,7 @@ func dataSourceSdaFabricDevicesCountRead(ctx context.Context, d *schema.Resource return diags } -func flattenSdaGetFabricDevicesCountItem(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesCountResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesCountV1Item(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs.go b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs.go index 6bb7c24..b5b05e2 100644 --- a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs.go +++ b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs.go @@ -110,8 +110,8 @@ func dataSourceSdaFabricDevicesLayer2HandoffsRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer2Handoffs") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer2HandoffsV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -125,24 +125,24 @@ func dataSourceSdaFabricDevicesLayer2HandoffsRead(ctx context.Context, d *schema queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetFabricDevicesLayer2Handoffs(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesLayer2HandoffsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesLayer2Handoffs", err, - "Failure at GetFabricDevicesLayer2Handoffs, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesLayer2HandoffsV1", err, + "Failure at GetFabricDevicesLayer2HandoffsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetFabricDevicesLayer2HandoffsItems(response1.Response) + vItems1 := flattenSdaGetFabricDevicesLayer2HandoffsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesLayer2Handoffs response", + "Failure when setting GetFabricDevicesLayer2HandoffsV1 response", err)) return diags } @@ -154,7 +154,7 @@ func dataSourceSdaFabricDevicesLayer2HandoffsRead(ctx context.Context, d *schema return diags } -func flattenSdaGetFabricDevicesLayer2HandoffsItems(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesLayer2HandoffsV1Items(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_count.go b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_count.go index 683a288..a96ff2b 100644 --- a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_count.go +++ b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_count.go @@ -61,8 +61,8 @@ func dataSourceSdaFabricDevicesLayer2HandoffsCountRead(ctx context.Context, d *s selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer2HandoffsCount") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer2HandoffsCountV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsCountV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -70,24 +70,24 @@ func dataSourceSdaFabricDevicesLayer2HandoffsCountRead(ctx context.Context, d *s queryParams1.NetworkDeviceID = vNetworkDeviceID.(string) } - response1, restyResp1, err := client.Sda.GetFabricDevicesLayer2HandoffsCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesLayer2HandoffsCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesLayer2HandoffsCount", err, - "Failure at GetFabricDevicesLayer2HandoffsCount, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesLayer2HandoffsCountV1", err, + "Failure at GetFabricDevicesLayer2HandoffsCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetFabricDevicesLayer2HandoffsCountItem(response1.Response) + vItem1 := flattenSdaGetFabricDevicesLayer2HandoffsCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesLayer2HandoffsCount response", + "Failure when setting GetFabricDevicesLayer2HandoffsCountV1 response", err)) return diags } @@ -99,7 +99,7 @@ func dataSourceSdaFabricDevicesLayer2HandoffsCountRead(ctx context.Context, d *s return diags } -func flattenSdaGetFabricDevicesLayer2HandoffsCountItem(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsCountResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesLayer2HandoffsCountV1Item(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits.go b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits.go index 8448760..e6e6305 100644 --- a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits.go +++ b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits.go @@ -159,8 +159,8 @@ func dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsRead(ctx context.Context, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithIPTransit") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithIPTransitV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -174,24 +174,24 @@ func dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsRead(ctx context.Context, queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithIPTransit(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithIPTransitV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithIPTransit", err, - "Failure at GetFabricDevicesLayer3HandoffsWithIPTransit, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithIPTransitV1", err, + "Failure at GetFabricDevicesLayer3HandoffsWithIPTransitV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitItems(response1.Response) + vItems1 := flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesLayer3HandoffsWithIPTransit response", + "Failure when setting GetFabricDevicesLayer3HandoffsWithIPTransitV1 response", err)) return diags } @@ -203,7 +203,7 @@ func dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsRead(ctx context.Context, return diags } -func flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitItems(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Items(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits_count.go b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits_count.go index 24b373c..6a0d796 100644 --- a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits_count.go +++ b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_ip_transits_count.go @@ -61,8 +61,8 @@ func dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsCountRead(ctx context.Con selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithIPTransitCount") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithIPTransitCountV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitCountV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -70,24 +70,24 @@ func dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsCountRead(ctx context.Con queryParams1.NetworkDeviceID = vNetworkDeviceID.(string) } - response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithIPTransitCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithIPTransitCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithIPTransitCount", err, - "Failure at GetFabricDevicesLayer3HandoffsWithIPTransitCount, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithIPTransitCountV1", err, + "Failure at GetFabricDevicesLayer3HandoffsWithIPTransitCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitCountItem(response1.Response) + vItem1 := flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesLayer3HandoffsWithIPTransitCount response", + "Failure when setting GetFabricDevicesLayer3HandoffsWithIPTransitCountV1 response", err)) return diags } @@ -99,7 +99,7 @@ func dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsCountRead(ctx context.Con return diags } -func flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitCountItem(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitCountResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitCountV1Item(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits.go b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits.go index b9ccb6e..1580fd0 100644 --- a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits.go +++ b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits.go @@ -119,8 +119,8 @@ func dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsRead(ctx context.Context selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithSdaTransit") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithSdaTransitQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithSdaTransitV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithSdaTransitV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -134,24 +134,24 @@ func dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsRead(ctx context.Context queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithSdaTransit(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithSdaTransitV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithSdaTransit", err, - "Failure at GetFabricDevicesLayer3HandoffsWithSdaTransit, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithSdaTransitV1", err, + "Failure at GetFabricDevicesLayer3HandoffsWithSdaTransitV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitItems(response1.Response) + vItems1 := flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesLayer3HandoffsWithSdaTransit response", + "Failure when setting GetFabricDevicesLayer3HandoffsWithSdaTransitV1 response", err)) return diags } @@ -163,7 +163,7 @@ func dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsRead(ctx context.Context return diags } -func flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitItems(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithSdaTransitResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitV1Items(items *[]catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithSdaTransitV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits_count.go b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits_count.go index ee83f1c..3abf7db 100644 --- a/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits_count.go +++ b/catalystcenter/data_source_sda_fabric_devices_layer2_handoffs_sda_transits_count.go @@ -61,8 +61,8 @@ func dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsCountRead(ctx context.Co selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithSdaTransitCount") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithSdaTransitCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithSdaTransitCountV1") + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithSdaTransitCountV1QueryParams{} queryParams1.FabricID = vFabricID.(string) @@ -70,24 +70,24 @@ func dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsCountRead(ctx context.Co queryParams1.NetworkDeviceID = vNetworkDeviceID.(string) } - response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithSdaTransitCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricDevicesLayer3HandoffsWithSdaTransitCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithSdaTransitCount", err, - "Failure at GetFabricDevicesLayer3HandoffsWithSdaTransitCount, unexpected response", "")) + "Failure when executing 2 GetFabricDevicesLayer3HandoffsWithSdaTransitCountV1", err, + "Failure at GetFabricDevicesLayer3HandoffsWithSdaTransitCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitCountItem(response1.Response) + vItem1 := flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricDevicesLayer3HandoffsWithSdaTransitCount response", + "Failure when setting GetFabricDevicesLayer3HandoffsWithSdaTransitCountV1 response", err)) return diags } @@ -99,7 +99,7 @@ func dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsCountRead(ctx context.Co return diags } -func flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitCountItem(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithSdaTransitCountResponse) []map[string]interface{} { +func flattenSdaGetFabricDevicesLayer3HandoffsWithSdaTransitCountV1Item(item *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithSdaTransitCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_edge_device.go b/catalystcenter/data_source_sda_fabric_edge_device.go index f9f9a02..01e433e 100644 --- a/catalystcenter/data_source_sda_fabric_edge_device.go +++ b/catalystcenter/data_source_sda_fabric_edge_device.go @@ -95,29 +95,29 @@ func dataSourceSdaFabricEdgeDeviceRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEdgeDeviceFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetEdgeDeviceFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) - response1, restyResp1, err := client.Sda.GetEdgeDeviceFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetEdgeDeviceFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEdgeDeviceFromSdaFabric", err, - "Failure at GetEdgeDeviceFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetEdgeDeviceFromSdaFabricV1", err, + "Failure at GetEdgeDeviceFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetEdgeDeviceFromSdaFabricItem(response1) + vItem1 := flattenSdaGetEdgeDeviceFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEdgeDeviceFromSdaFabric response", + "Failure when setting GetEdgeDeviceFromSdaFabricV1 response", err)) return diags } @@ -129,7 +129,7 @@ func dataSourceSdaFabricEdgeDeviceRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSdaGetEdgeDeviceFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetEdgeDeviceFromSdaFabric) []map[string]interface{} { +func flattenSdaGetEdgeDeviceFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetEdgeDeviceFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_site.go b/catalystcenter/data_source_sda_fabric_site.go index 0501a31..45bb7fd 100644 --- a/catalystcenter/data_source_sda_fabric_site.go +++ b/catalystcenter/data_source_sda_fabric_site.go @@ -89,29 +89,29 @@ func dataSourceSdaFabricSiteRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetSiteFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetSiteFromSdaFabricV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) - response1, restyResp1, err := client.Sda.GetSiteFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetSiteFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteFromSdaFabric", err, - "Failure at GetSiteFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetSiteFromSdaFabricV1", err, + "Failure at GetSiteFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetSiteFromSdaFabricItem(response1) + vItem1 := flattenSdaGetSiteFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteFromSdaFabric response", + "Failure when setting GetSiteFromSdaFabricV1 response", err)) return diags } @@ -123,7 +123,7 @@ func dataSourceSdaFabricSiteRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSdaGetSiteFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetSiteFromSdaFabric) []map[string]interface{} { +func flattenSdaGetSiteFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetSiteFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_sites.go b/catalystcenter/data_source_sda_fabric_sites.go index e6aa78d..6003237 100644 --- a/catalystcenter/data_source_sda_fabric_sites.go +++ b/catalystcenter/data_source_sda_fabric_sites.go @@ -97,8 +97,8 @@ func dataSourceSdaFabricSitesRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricSites") - queryParams1 := catalystcentersdkgo.GetFabricSitesQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricSitesV1") + queryParams1 := catalystcentersdkgo.GetFabricSitesV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -113,24 +113,24 @@ func dataSourceSdaFabricSitesRead(ctx context.Context, d *schema.ResourceData, m queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetFabricSites(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricSitesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricSites", err, - "Failure at GetFabricSites, unexpected response", "")) + "Failure when executing 2 GetFabricSitesV1", err, + "Failure at GetFabricSitesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetFabricSitesItems(response1.Response) + vItems1 := flattenSdaGetFabricSitesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricSites response", + "Failure when setting GetFabricSitesV1 response", err)) return diags } @@ -142,7 +142,7 @@ func dataSourceSdaFabricSitesRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSdaGetFabricSitesItems(items *[]catalystcentersdkgo.ResponseSdaGetFabricSitesResponse) []map[string]interface{} { +func flattenSdaGetFabricSitesV1Items(items *[]catalystcentersdkgo.ResponseSdaGetFabricSitesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_sites_count.go b/catalystcenter/data_source_sda_fabric_sites_count.go index 4fb8ac0..f4c605b 100644 --- a/catalystcenter/data_source_sda_fabric_sites_count.go +++ b/catalystcenter/data_source_sda_fabric_sites_count.go @@ -47,26 +47,26 @@ func dataSourceSdaFabricSitesCountRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricSiteCount") + log.Printf("[DEBUG] Selected method: GetFabricSiteCountV1") - response1, restyResp1, err := client.Sda.GetFabricSiteCount() + response1, restyResp1, err := client.Sda.GetFabricSiteCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricSiteCount", err, - "Failure at GetFabricSiteCount, unexpected response", "")) + "Failure when executing 2 GetFabricSiteCountV1", err, + "Failure at GetFabricSiteCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetFabricSiteCountItem(response1.Response) + vItem1 := flattenSdaGetFabricSiteCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricSiteCount response", + "Failure when setting GetFabricSiteCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceSdaFabricSitesCountRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSdaGetFabricSiteCountItem(item *catalystcentersdkgo.ResponseSdaGetFabricSiteCountResponse) []map[string]interface{} { +func flattenSdaGetFabricSiteCountV1Item(item *catalystcentersdkgo.ResponseSdaGetFabricSiteCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_zones.go b/catalystcenter/data_source_sda_fabric_zones.go index 9db56be..8ae8ff3 100644 --- a/catalystcenter/data_source_sda_fabric_zones.go +++ b/catalystcenter/data_source_sda_fabric_zones.go @@ -89,8 +89,8 @@ func dataSourceSdaFabricZonesRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricZones") - queryParams1 := catalystcentersdkgo.GetFabricZonesQueryParams{} + log.Printf("[DEBUG] Selected method: GetFabricZonesV1") + queryParams1 := catalystcentersdkgo.GetFabricZonesV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -105,24 +105,24 @@ func dataSourceSdaFabricZonesRead(ctx context.Context, d *schema.ResourceData, m queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetFabricZones(&queryParams1) + response1, restyResp1, err := client.Sda.GetFabricZonesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricZones", err, - "Failure at GetFabricZones, unexpected response", "")) + "Failure when executing 2 GetFabricZonesV1", err, + "Failure at GetFabricZonesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetFabricZonesItems(response1.Response) + vItems1 := flattenSdaGetFabricZonesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricZones response", + "Failure when setting GetFabricZonesV1 response", err)) return diags } @@ -134,7 +134,7 @@ func dataSourceSdaFabricZonesRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSdaGetFabricZonesItems(items *[]catalystcentersdkgo.ResponseSdaGetFabricZonesResponse) []map[string]interface{} { +func flattenSdaGetFabricZonesV1Items(items *[]catalystcentersdkgo.ResponseSdaGetFabricZonesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabric_zones_count.go b/catalystcenter/data_source_sda_fabric_zones_count.go index 373e58a..ff875b2 100644 --- a/catalystcenter/data_source_sda_fabric_zones_count.go +++ b/catalystcenter/data_source_sda_fabric_zones_count.go @@ -47,26 +47,26 @@ func dataSourceSdaFabricZonesCountRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetFabricZoneCount") + log.Printf("[DEBUG] Selected method: GetFabricZoneCountV1") - response1, restyResp1, err := client.Sda.GetFabricZoneCount() + response1, restyResp1, err := client.Sda.GetFabricZoneCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetFabricZoneCount", err, - "Failure at GetFabricZoneCount, unexpected response", "")) + "Failure when executing 2 GetFabricZoneCountV1", err, + "Failure at GetFabricZoneCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetFabricZoneCountItem(response1.Response) + vItem1 := flattenSdaGetFabricZoneCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetFabricZoneCount response", + "Failure when setting GetFabricZoneCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceSdaFabricZonesCountRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSdaGetFabricZoneCountItem(item *catalystcentersdkgo.ResponseSdaGetFabricZoneCountResponse) []map[string]interface{} { +func flattenSdaGetFabricZoneCountV1Item(item *catalystcentersdkgo.ResponseSdaGetFabricZoneCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids.go b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids.go index c68c7a6..116cea0 100644 --- a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids.go +++ b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids.go @@ -98,8 +98,8 @@ func dataSourceSdaFabricsVLANToSSIDsRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsAllTheFabricSitesThatHaveVLANToSSIDMapping") - queryParams1 := catalystcentersdkgo.ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1") + queryParams1 := catalystcentersdkgo.ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -108,24 +108,24 @@ func dataSourceSdaFabricsVLANToSSIDsRead(ctx context.Context, d *schema.Resource queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.FabricWireless.ReturnsAllTheFabricSitesThatHaveVLANToSSIDMapping(&queryParams1) + response1, restyResp1, err := client.FabricWireless.ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsAllTheFabricSitesThatHaveVLANToSSIDMapping", err, - "Failure at ReturnsAllTheFabricSitesThatHaveVLANToSSIDMapping, unexpected response", "")) + "Failure when executing 2 ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1", err, + "Failure at ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItems(response1.Response) + vItems1 := flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsAllTheFabricSitesThatHaveVLANToSSIDMapping response", + "Failure when setting ReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1 response", err)) return diags } @@ -137,7 +137,7 @@ func dataSourceSdaFabricsVLANToSSIDsRead(ctx context.Context, d *schema.Resource return diags } -func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItems(items *[]catalystcentersdkgo.ResponseFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingResponse) []map[string]interface{} { +func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1Items(items *[]catalystcentersdkgo.ResponseFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1Response) []map[string]interface{} { if items == nil { return nil } @@ -145,13 +145,13 @@ func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItems for _, item := range *items { respItem := make(map[string]interface{}) respItem["fabric_id"] = item.FabricID - respItem["vlan_details"] = flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItemsVLANDetails(item.VLANDetails) + respItem["vlan_details"] = flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1ItemsVLANDetails(item.VLANDetails) respItems = append(respItems, respItem) } return respItems } -func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItemsVLANDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingResponseVLANDetails) []map[string]interface{} { +func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1ItemsVLANDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1ResponseVLANDetails) []map[string]interface{} { if items == nil { return nil } @@ -159,13 +159,13 @@ func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItems for _, item := range *items { respItem := make(map[string]interface{}) respItem["vlan_name"] = item.VLANName - respItem["ssid_details"] = flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItemsVLANDetailsSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1ItemsVLANDetailsSSIDDetails(item.SSIDDetails) respItems = append(respItems, respItem) } return respItems } -func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingItemsVLANDetailsSSIDDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingResponseVLANDetailsSSIDDetails) []map[string]interface{} { +func flattenFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1ItemsVLANDetailsSSIDDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessReturnsAllTheFabricSitesThatHaveVLANToSSIDMappingV1ResponseVLANDetailsSSIDDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_count.go b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_count.go index 7b945d9..dfef5ef 100644 --- a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_count.go +++ b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_count.go @@ -47,26 +47,26 @@ func dataSourceSdaFabricsVLANToSSIDsCountRead(ctx context.Context, d *schema.Res selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMapping") + log.Printf("[DEBUG] Selected method: ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1") - response1, restyResp1, err := client.FabricWireless.ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMapping() + response1, restyResp1, err := client.FabricWireless.ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMapping", err, - "Failure at ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMapping, unexpected response", "")) + "Failure when executing 2 ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1", err, + "Failure at ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenFabricWirelessReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingItem(response1.Response) + vItem1 := flattenFabricWirelessReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMapping response", + "Failure when setting ReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceSdaFabricsVLANToSSIDsCountRead(ctx context.Context, d *schema.Res return diags } -func flattenFabricWirelessReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingItem(item *catalystcentersdkgo.ResponseFabricWirelessReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingResponse) []map[string]interface{} { +func flattenFabricWirelessReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1Item(item *catalystcentersdkgo.ResponseFabricWirelessReturnTheCountOfAllTheFabricSiteWhichHasSSIDToIPPoolMappingV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id.go b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id.go index a7f6edd..f612c5d 100644 --- a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id.go +++ b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id.go @@ -91,9 +91,9 @@ func dataSourceSdaFabricsVLANToSSIDsFabricIDRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite") + log.Printf("[DEBUG] Selected method: RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1") vvFabricID := vFabricID.(string) - queryParams1 := catalystcentersdkgo.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -102,24 +102,24 @@ func dataSourceSdaFabricsVLANToSSIDsFabricIDRead(ctx context.Context, d *schema. queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.FabricWireless.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite(vvFabricID, &queryParams1) + response1, restyResp1, err := client.FabricWireless.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1(vvFabricID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite", err, - "Failure at RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite, unexpected response", "")) + "Failure when executing 2 RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1", err, + "Failure at RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteItems(response1.Response) + vItems1 := flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite response", + "Failure when setting RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1 response", err)) return diags } @@ -131,7 +131,7 @@ func dataSourceSdaFabricsVLANToSSIDsFabricIDRead(ctx context.Context, d *schema. return diags } -func flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteItems(items *[]catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteResponse) []map[string]interface{} { +func flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Items(items *[]catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Response) []map[string]interface{} { if items == nil { return nil } @@ -139,13 +139,13 @@ func flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSi for _, item := range *items { respItem := make(map[string]interface{}) respItem["vlan_name"] = item.VLANName - respItem["ssid_details"] = flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteItemsSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1ItemsSSIDDetails(item.SSIDDetails) respItems = append(respItems, respItem) } return respItems } -func flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteItemsSSIDDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteResponseSSIDDetails) []map[string]interface{} { +func flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1ItemsSSIDDetails(items *[]catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1ResponseSSIDDetails) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id_count.go b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id_count.go index 17e3cfd..505dac3 100644 --- a/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id_count.go +++ b/catalystcenter/data_source_sda_fabrics_vlan_to_ssids_fabric_id_count.go @@ -55,27 +55,27 @@ func dataSourceSdaFabricsVLANToSSIDsFabricIDCountRead(ctx context.Context, d *sc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSite") + log.Printf("[DEBUG] Selected method: ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1") vvFabricID := vFabricID.(string) - response1, restyResp1, err := client.FabricWireless.ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSite(vvFabricID) + response1, restyResp1, err := client.FabricWireless.ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1(vvFabricID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSite", err, - "Failure at ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSite, unexpected response", "")) + "Failure when executing 2 ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1", err, + "Failure at ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenFabricWirelessReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteItem(response1.Response) + vItem1 := flattenFabricWirelessReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSite response", + "Failure when setting ReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1 response", err)) return diags } @@ -87,7 +87,7 @@ func dataSourceSdaFabricsVLANToSSIDsFabricIDCountRead(ctx context.Context, d *sc return diags } -func flattenFabricWirelessReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteItem(item *catalystcentersdkgo.ResponseFabricWirelessReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteResponse) []map[string]interface{} { +func flattenFabricWirelessReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1Item(item *catalystcentersdkgo.ResponseFabricWirelessReturnsTheCountOfVLANsMappedToSSIDsInAFabricSiteV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_layer2_virtual_networks.go b/catalystcenter/data_source_sda_layer2_virtual_networks.go index eb8e151..146b0a6 100644 --- a/catalystcenter/data_source_sda_layer2_virtual_networks.go +++ b/catalystcenter/data_source_sda_layer2_virtual_networks.go @@ -146,8 +146,8 @@ func dataSourceSdaLayer2VirtualNetworksRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetLayer2VirtualNetworks") - queryParams1 := catalystcentersdkgo.GetLayer2VirtualNetworksQueryParams{} + log.Printf("[DEBUG] Selected method: GetLayer2VirtualNetworksV1") + queryParams1 := catalystcentersdkgo.GetLayer2VirtualNetworksV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -174,24 +174,24 @@ func dataSourceSdaLayer2VirtualNetworksRead(ctx context.Context, d *schema.Resou queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetLayer2VirtualNetworks(&queryParams1) + response1, restyResp1, err := client.Sda.GetLayer2VirtualNetworksV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetLayer2VirtualNetworks", err, - "Failure at GetLayer2VirtualNetworks, unexpected response", "")) + "Failure when executing 2 GetLayer2VirtualNetworksV1", err, + "Failure at GetLayer2VirtualNetworksV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetLayer2VirtualNetworksItems(response1.Response) + vItems1 := flattenSdaGetLayer2VirtualNetworksV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetLayer2VirtualNetworks response", + "Failure when setting GetLayer2VirtualNetworksV1 response", err)) return diags } @@ -203,7 +203,7 @@ func dataSourceSdaLayer2VirtualNetworksRead(ctx context.Context, d *schema.Resou return diags } -func flattenSdaGetLayer2VirtualNetworksItems(items *[]catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksResponse) []map[string]interface{} { +func flattenSdaGetLayer2VirtualNetworksV1Items(items *[]catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_layer2_virtual_networks_count.go b/catalystcenter/data_source_sda_layer2_virtual_networks_count.go index 0c323e3..8dca107 100644 --- a/catalystcenter/data_source_sda_layer2_virtual_networks_count.go +++ b/catalystcenter/data_source_sda_layer2_virtual_networks_count.go @@ -82,8 +82,8 @@ func dataSourceSdaLayer2VirtualNetworksCountRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetLayer2VirtualNetworkCount") - queryParams1 := catalystcentersdkgo.GetLayer2VirtualNetworkCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetLayer2VirtualNetworkCountV1") + queryParams1 := catalystcentersdkgo.GetLayer2VirtualNetworkCountV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -101,24 +101,24 @@ func dataSourceSdaLayer2VirtualNetworksCountRead(ctx context.Context, d *schema. queryParams1.AssociatedLayer3VirtualNetworkName = vAssociatedLayer3VirtualNetworkName.(string) } - response1, restyResp1, err := client.Sda.GetLayer2VirtualNetworkCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetLayer2VirtualNetworkCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetLayer2VirtualNetworkCount", err, - "Failure at GetLayer2VirtualNetworkCount, unexpected response", "")) + "Failure when executing 2 GetLayer2VirtualNetworkCountV1", err, + "Failure at GetLayer2VirtualNetworkCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetLayer2VirtualNetworkCountItem(response1.Response) + vItem1 := flattenSdaGetLayer2VirtualNetworkCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetLayer2VirtualNetworkCount response", + "Failure when setting GetLayer2VirtualNetworkCountV1 response", err)) return diags } @@ -130,7 +130,7 @@ func dataSourceSdaLayer2VirtualNetworksCountRead(ctx context.Context, d *schema. return diags } -func flattenSdaGetLayer2VirtualNetworkCountItem(item *catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworkCountResponse) []map[string]interface{} { +func flattenSdaGetLayer2VirtualNetworkCountV1Item(item *catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworkCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_layer3_virtual_networks.go b/catalystcenter/data_source_sda_layer3_virtual_networks.go index 284a799..0f61b86 100644 --- a/catalystcenter/data_source_sda_layer3_virtual_networks.go +++ b/catalystcenter/data_source_sda_layer3_virtual_networks.go @@ -106,8 +106,8 @@ func dataSourceSdaLayer3VirtualNetworksRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetLayer3VirtualNetworks") - queryParams1 := catalystcentersdkgo.GetLayer3VirtualNetworksQueryParams{} + log.Printf("[DEBUG] Selected method: GetLayer3VirtualNetworksV1") + queryParams1 := catalystcentersdkgo.GetLayer3VirtualNetworksV1QueryParams{} if okVirtualNetworkName { queryParams1.VirtualNetworkName = vVirtualNetworkName.(string) @@ -125,24 +125,24 @@ func dataSourceSdaLayer3VirtualNetworksRead(ctx context.Context, d *schema.Resou queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetLayer3VirtualNetworks(&queryParams1) + response1, restyResp1, err := client.Sda.GetLayer3VirtualNetworksV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetLayer3VirtualNetworks", err, - "Failure at GetLayer3VirtualNetworks, unexpected response", "")) + "Failure when executing 2 GetLayer3VirtualNetworksV1", err, + "Failure at GetLayer3VirtualNetworksV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetLayer3VirtualNetworksItems(response1.Response) + vItems1 := flattenSdaGetLayer3VirtualNetworksV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetLayer3VirtualNetworks response", + "Failure when setting GetLayer3VirtualNetworksV1 response", err)) return diags } @@ -154,7 +154,7 @@ func dataSourceSdaLayer3VirtualNetworksRead(ctx context.Context, d *schema.Resou return diags } -func flattenSdaGetLayer3VirtualNetworksItems(items *[]catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksResponse) []map[string]interface{} { +func flattenSdaGetLayer3VirtualNetworksV1Items(items *[]catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_layer3_virtual_networks_count.go b/catalystcenter/data_source_sda_layer3_virtual_networks_count.go index 705b475..f2ce43d 100644 --- a/catalystcenter/data_source_sda_layer3_virtual_networks_count.go +++ b/catalystcenter/data_source_sda_layer3_virtual_networks_count.go @@ -61,8 +61,8 @@ func dataSourceSdaLayer3VirtualNetworksCountRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetLayer3VirtualNetworksCount") - queryParams1 := catalystcentersdkgo.GetLayer3VirtualNetworksCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetLayer3VirtualNetworksCountV1") + queryParams1 := catalystcentersdkgo.GetLayer3VirtualNetworksCountV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -71,24 +71,24 @@ func dataSourceSdaLayer3VirtualNetworksCountRead(ctx context.Context, d *schema. queryParams1.AnchoredSiteID = vAnchoredSiteID.(string) } - response1, restyResp1, err := client.Sda.GetLayer3VirtualNetworksCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetLayer3VirtualNetworksCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetLayer3VirtualNetworksCount", err, - "Failure at GetLayer3VirtualNetworksCount, unexpected response", "")) + "Failure when executing 2 GetLayer3VirtualNetworksCountV1", err, + "Failure at GetLayer3VirtualNetworksCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetLayer3VirtualNetworksCountItem(response1.Response) + vItem1 := flattenSdaGetLayer3VirtualNetworksCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetLayer3VirtualNetworksCount response", + "Failure when setting GetLayer3VirtualNetworksCountV1 response", err)) return diags } @@ -100,7 +100,7 @@ func dataSourceSdaLayer3VirtualNetworksCountRead(ctx context.Context, d *schema. return diags } -func flattenSdaGetLayer3VirtualNetworksCountItem(item *catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksCountResponse) []map[string]interface{} { +func flattenSdaGetLayer3VirtualNetworksCountV1Item(item *catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_multicast.go b/catalystcenter/data_source_sda_multicast.go index bf37e64..9fa6212 100644 --- a/catalystcenter/data_source_sda_multicast.go +++ b/catalystcenter/data_source_sda_multicast.go @@ -138,29 +138,29 @@ func dataSourceSdaMulticastRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMulticastDetailsFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetMulticastDetailsFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) - response1, restyResp1, err := client.Sda.GetMulticastDetailsFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetMulticastDetailsFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetMulticastDetailsFromSdaFabric", err, - "Failure at GetMulticastDetailsFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetMulticastDetailsFromSdaFabricV1", err, + "Failure at GetMulticastDetailsFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetMulticastDetailsFromSdaFabricItem(response1) + vItem1 := flattenSdaGetMulticastDetailsFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMulticastDetailsFromSdaFabric response", + "Failure when setting GetMulticastDetailsFromSdaFabricV1 response", err)) return diags } @@ -172,14 +172,14 @@ func dataSourceSdaMulticastRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenSdaGetMulticastDetailsFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetMulticastDetailsFromSdaFabric) []map[string]interface{} { +func flattenSdaGetMulticastDetailsFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetMulticastDetailsFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["multicast_method"] = item.MulticastMethod respItem["multicast_type"] = item.MulticastType - respItem["multicast_vn_info"] = flattenSdaGetMulticastDetailsFromSdaFabricItemMulticastVnInfo(item.MulticastVnInfo) + respItem["multicast_vn_info"] = flattenSdaGetMulticastDetailsFromSdaFabricV1ItemMulticastVnInfo(item.MulticastVnInfo) respItem["status"] = item.Status respItem["description"] = item.Description return []map[string]interface{}{ @@ -187,7 +187,7 @@ func flattenSdaGetMulticastDetailsFromSdaFabricItem(item *catalystcentersdkgo.Re } } -func flattenSdaGetMulticastDetailsFromSdaFabricItemMulticastVnInfo(items *[]catalystcentersdkgo.ResponseSdaGetMulticastDetailsFromSdaFabricMulticastVnInfo) []map[string]interface{} { +func flattenSdaGetMulticastDetailsFromSdaFabricV1ItemMulticastVnInfo(items *[]catalystcentersdkgo.ResponseSdaGetMulticastDetailsFromSdaFabricV1MulticastVnInfo) []map[string]interface{} { if items == nil { return nil } @@ -198,13 +198,13 @@ func flattenSdaGetMulticastDetailsFromSdaFabricItemMulticastVnInfo(items *[]cata respItem["ip_pool_name"] = item.IPPoolName respItem["internal_rp_ip_address"] = item.InternalRpIPAddress respItem["external_rp_ip_address"] = item.ExternalRpIPAddress - respItem["ssm_info"] = flattenSdaGetMulticastDetailsFromSdaFabricItemMulticastVnInfoSsmInfo(item.SsmInfo) + respItem["ssm_info"] = flattenSdaGetMulticastDetailsFromSdaFabricV1ItemMulticastVnInfoSsmInfo(item.SsmInfo) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetMulticastDetailsFromSdaFabricItemMulticastVnInfoSsmInfo(items *[]catalystcentersdkgo.ResponseSdaGetMulticastDetailsFromSdaFabricMulticastVnInfoSsmInfo) []map[string]interface{} { +func flattenSdaGetMulticastDetailsFromSdaFabricV1ItemMulticastVnInfoSsmInfo(items *[]catalystcentersdkgo.ResponseSdaGetMulticastDetailsFromSdaFabricV1MulticastVnInfoSsmInfo) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_multicast_v1.go b/catalystcenter/data_source_sda_multicast_v1.go index ea93878..e53c9cf 100644 --- a/catalystcenter/data_source_sda_multicast_v1.go +++ b/catalystcenter/data_source_sda_multicast_v1.go @@ -75,8 +75,8 @@ func dataSourceSdaMulticastV1Read(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMulticast") - queryParams1 := catalystcentersdkgo.GetMulticastQueryParams{} + log.Printf("[DEBUG] Selected method: GetMulticastV1") + queryParams1 := catalystcentersdkgo.GetMulticastV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -88,24 +88,24 @@ func dataSourceSdaMulticastV1Read(ctx context.Context, d *schema.ResourceData, m queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetMulticast(&queryParams1) + response1, restyResp1, err := client.Sda.GetMulticastV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetMulticast", err, - "Failure at GetMulticast, unexpected response", "")) + "Failure when executing 2 GetMulticastV1", err, + "Failure at GetMulticastV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetMulticastItems(response1.Response) + vItems1 := flattenSdaGetMulticastV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMulticast response", + "Failure when setting GetMulticastV1 response", err)) return diags } @@ -117,7 +117,7 @@ func dataSourceSdaMulticastV1Read(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSdaGetMulticastItems(items *[]catalystcentersdkgo.ResponseSdaGetMulticastResponse) []map[string]interface{} { +func flattenSdaGetMulticastV1Items(items *[]catalystcentersdkgo.ResponseSdaGetMulticastV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_multicast_virtual_networks.go b/catalystcenter/data_source_sda_multicast_virtual_networks.go index 2061f6b..919494d 100644 --- a/catalystcenter/data_source_sda_multicast_virtual_networks.go +++ b/catalystcenter/data_source_sda_multicast_virtual_networks.go @@ -182,8 +182,8 @@ func dataSourceSdaMulticastVirtualNetworksRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMulticastVirtualNetworks") - queryParams1 := catalystcentersdkgo.GetMulticastVirtualNetworksQueryParams{} + log.Printf("[DEBUG] Selected method: GetMulticastVirtualNetworksV1") + queryParams1 := catalystcentersdkgo.GetMulticastVirtualNetworksV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -198,24 +198,24 @@ func dataSourceSdaMulticastVirtualNetworksRead(ctx context.Context, d *schema.Re queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetMulticastVirtualNetworks(&queryParams1) + response1, restyResp1, err := client.Sda.GetMulticastVirtualNetworksV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetMulticastVirtualNetworks", err, - "Failure at GetMulticastVirtualNetworks, unexpected response", "")) + "Failure when executing 2 GetMulticastVirtualNetworksV1", err, + "Failure at GetMulticastVirtualNetworksV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetMulticastVirtualNetworksItems(response1.Response) + vItems1 := flattenSdaGetMulticastVirtualNetworksV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMulticastVirtualNetworks response", + "Failure when setting GetMulticastVirtualNetworksV1 response", err)) return diags } @@ -227,7 +227,7 @@ func dataSourceSdaMulticastVirtualNetworksRead(ctx context.Context, d *schema.Re return diags } -func flattenSdaGetMulticastVirtualNetworksItems(items *[]catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksResponse) []map[string]interface{} { +func flattenSdaGetMulticastVirtualNetworksV1Items(items *[]catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksV1Response) []map[string]interface{} { if items == nil { return nil } @@ -239,13 +239,13 @@ func flattenSdaGetMulticastVirtualNetworksItems(items *[]catalystcentersdkgo.Res respItem["virtual_network_name"] = item.VirtualNetworkName respItem["ip_pool_name"] = item.IPPoolName respItem["ipv4_ssm_ranges"] = item.IPv4SsmRanges - respItem["multicast_r_ps"] = flattenSdaGetMulticastVirtualNetworksItemsMulticastRPs(item.MulticastRPs) + respItem["multicast_r_ps"] = flattenSdaGetMulticastVirtualNetworksV1ItemsMulticastRPs(item.MulticastRPs) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetMulticastVirtualNetworksItemsMulticastRPs(items *[]catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksResponseMulticastRPs) []map[string]interface{} { +func flattenSdaGetMulticastVirtualNetworksV1ItemsMulticastRPs(items *[]catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksV1ResponseMulticastRPs) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_multicast_virtual_networks_count.go b/catalystcenter/data_source_sda_multicast_virtual_networks_count.go index 4a5dda3..2275de6 100644 --- a/catalystcenter/data_source_sda_multicast_virtual_networks_count.go +++ b/catalystcenter/data_source_sda_multicast_virtual_networks_count.go @@ -54,31 +54,31 @@ func dataSourceSdaMulticastVirtualNetworksCountRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMulticastVirtualNetworkCount") - queryParams1 := catalystcentersdkgo.GetMulticastVirtualNetworkCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetMulticastVirtualNetworkCountV1") + queryParams1 := catalystcentersdkgo.GetMulticastVirtualNetworkCountV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) } - response1, restyResp1, err := client.Sda.GetMulticastVirtualNetworkCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetMulticastVirtualNetworkCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetMulticastVirtualNetworkCount", err, - "Failure at GetMulticastVirtualNetworkCount, unexpected response", "")) + "Failure when executing 2 GetMulticastVirtualNetworkCountV1", err, + "Failure at GetMulticastVirtualNetworkCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetMulticastVirtualNetworkCountItem(response1.Response) + vItem1 := flattenSdaGetMulticastVirtualNetworkCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMulticastVirtualNetworkCount response", + "Failure when setting GetMulticastVirtualNetworkCountV1 response", err)) return diags } @@ -90,7 +90,7 @@ func dataSourceSdaMulticastVirtualNetworksCountRead(ctx context.Context, d *sche return diags } -func flattenSdaGetMulticastVirtualNetworkCountItem(item *catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworkCountResponse) []map[string]interface{} { +func flattenSdaGetMulticastVirtualNetworkCountV1Item(item *catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworkCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_port_assignment_for_access_point.go b/catalystcenter/data_source_sda_port_assignment_for_access_point.go index 64b1c96..f7f4fd1 100644 --- a/catalystcenter/data_source_sda_port_assignment_for_access_point.go +++ b/catalystcenter/data_source_sda_port_assignment_for_access_point.go @@ -106,31 +106,31 @@ func dataSourceSdaPortAssignmentForAccessPointRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortAssignmentForAccessPointInSdaFabric") - queryParams1 := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortAssignmentForAccessPointInSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) queryParams1.InterfaceName = vInterfaceName.(string) - response1, restyResp1, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPortAssignmentForAccessPointInSdaFabric", err, - "Failure at GetPortAssignmentForAccessPointInSdaFabric, unexpected response", "")) + "Failure when executing 2 GetPortAssignmentForAccessPointInSdaFabricV1", err, + "Failure at GetPortAssignmentForAccessPointInSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetPortAssignmentForAccessPointInSdaFabricItem(response1) + vItem1 := flattenSdaGetPortAssignmentForAccessPointInSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortAssignmentForAccessPointInSdaFabric response", + "Failure when setting GetPortAssignmentForAccessPointInSdaFabricV1 response", err)) return diags } @@ -142,7 +142,7 @@ func dataSourceSdaPortAssignmentForAccessPointRead(ctx context.Context, d *schem return diags } -func flattenSdaGetPortAssignmentForAccessPointInSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetPortAssignmentForAccessPointInSdaFabric) []map[string]interface{} { +func flattenSdaGetPortAssignmentForAccessPointInSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetPortAssignmentForAccessPointInSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_port_assignment_for_user_device.go b/catalystcenter/data_source_sda_port_assignment_for_user_device.go index ed385c4..c5cca46 100644 --- a/catalystcenter/data_source_sda_port_assignment_for_user_device.go +++ b/catalystcenter/data_source_sda_port_assignment_for_user_device.go @@ -106,31 +106,31 @@ func dataSourceSdaPortAssignmentForUserDeviceRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortAssignmentForUserDeviceInSdaFabric") - queryParams1 := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortAssignmentForUserDeviceInSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) queryParams1.InterfaceName = vInterfaceName.(string) - response1, restyResp1, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPortAssignmentForUserDeviceInSdaFabric", err, - "Failure at GetPortAssignmentForUserDeviceInSdaFabric, unexpected response", "")) + "Failure when executing 2 GetPortAssignmentForUserDeviceInSdaFabricV1", err, + "Failure at GetPortAssignmentForUserDeviceInSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetPortAssignmentForUserDeviceInSdaFabricItem(response1) + vItem1 := flattenSdaGetPortAssignmentForUserDeviceInSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortAssignmentForUserDeviceInSdaFabric response", + "Failure when setting GetPortAssignmentForUserDeviceInSdaFabricV1 response", err)) return diags } @@ -142,7 +142,7 @@ func dataSourceSdaPortAssignmentForUserDeviceRead(ctx context.Context, d *schema return diags } -func flattenSdaGetPortAssignmentForUserDeviceInSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetPortAssignmentForUserDeviceInSdaFabric) []map[string]interface{} { +func flattenSdaGetPortAssignmentForUserDeviceInSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetPortAssignmentForUserDeviceInSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_port_assignments.go b/catalystcenter/data_source_sda_port_assignments.go index 2202896..48e2eb1 100644 --- a/catalystcenter/data_source_sda_port_assignments.go +++ b/catalystcenter/data_source_sda_port_assignments.go @@ -159,8 +159,8 @@ func dataSourceSdaPortAssignmentsRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortAssignments") - queryParams1 := catalystcentersdkgo.GetPortAssignmentsQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortAssignmentsV1") + queryParams1 := catalystcentersdkgo.GetPortAssignmentsV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -184,24 +184,24 @@ func dataSourceSdaPortAssignmentsRead(ctx context.Context, d *schema.ResourceDat queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetPortAssignments(&queryParams1) + response1, restyResp1, err := client.Sda.GetPortAssignmentsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPortAssignments", err, - "Failure at GetPortAssignments, unexpected response", "")) + "Failure when executing 2 GetPortAssignmentsV1", err, + "Failure at GetPortAssignmentsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetPortAssignmentsItems(response1.Response) + vItems1 := flattenSdaGetPortAssignmentsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortAssignments response", + "Failure when setting GetPortAssignmentsV1 response", err)) return diags } @@ -213,7 +213,7 @@ func dataSourceSdaPortAssignmentsRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenSdaGetPortAssignmentsItems(items *[]catalystcentersdkgo.ResponseSdaGetPortAssignmentsResponse) []map[string]interface{} { +func flattenSdaGetPortAssignmentsV1Items(items *[]catalystcentersdkgo.ResponseSdaGetPortAssignmentsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_port_assignments_count.go b/catalystcenter/data_source_sda_port_assignments_count.go index b25e9f7..9ea906b 100644 --- a/catalystcenter/data_source_sda_port_assignments_count.go +++ b/catalystcenter/data_source_sda_port_assignments_count.go @@ -82,8 +82,8 @@ func dataSourceSdaPortAssignmentsCountRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortAssignmentCount") - queryParams1 := catalystcentersdkgo.GetPortAssignmentCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortAssignmentCountV1") + queryParams1 := catalystcentersdkgo.GetPortAssignmentCountV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -101,24 +101,24 @@ func dataSourceSdaPortAssignmentsCountRead(ctx context.Context, d *schema.Resour queryParams1.VoiceVLANName = vVoiceVLANName.(string) } - response1, restyResp1, err := client.Sda.GetPortAssignmentCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetPortAssignmentCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPortAssignmentCount", err, - "Failure at GetPortAssignmentCount, unexpected response", "")) + "Failure when executing 2 GetPortAssignmentCountV1", err, + "Failure at GetPortAssignmentCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetPortAssignmentCountItem(response1.Response) + vItem1 := flattenSdaGetPortAssignmentCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortAssignmentCount response", + "Failure when setting GetPortAssignmentCountV1 response", err)) return diags } @@ -130,7 +130,7 @@ func dataSourceSdaPortAssignmentsCountRead(ctx context.Context, d *schema.Resour return diags } -func flattenSdaGetPortAssignmentCountItem(item *catalystcentersdkgo.ResponseSdaGetPortAssignmentCountResponse) []map[string]interface{} { +func flattenSdaGetPortAssignmentCountV1Item(item *catalystcentersdkgo.ResponseSdaGetPortAssignmentCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_port_channels.go b/catalystcenter/data_source_sda_port_channels.go index 97c1d7d..aeb3265 100644 --- a/catalystcenter/data_source_sda_port_channels.go +++ b/catalystcenter/data_source_sda_port_channels.go @@ -141,8 +141,8 @@ func dataSourceSdaPortChannelsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortChannels") - queryParams1 := catalystcentersdkgo.GetPortChannelsQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortChannelsV1") + queryParams1 := catalystcentersdkgo.GetPortChannelsV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -163,24 +163,24 @@ func dataSourceSdaPortChannelsRead(ctx context.Context, d *schema.ResourceData, queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetPortChannels(&queryParams1) + response1, restyResp1, err := client.Sda.GetPortChannelsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPortChannels", err, - "Failure at GetPortChannels, unexpected response", "")) + "Failure when executing 2 GetPortChannelsV1", err, + "Failure at GetPortChannelsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetPortChannelsItems(response1.Response) + vItems1 := flattenSdaGetPortChannelsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortChannels response", + "Failure when setting GetPortChannelsV1 response", err)) return diags } @@ -192,7 +192,7 @@ func dataSourceSdaPortChannelsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenSdaGetPortChannelsItems(items *[]catalystcentersdkgo.ResponseSdaGetPortChannelsResponse) []map[string]interface{} { +func flattenSdaGetPortChannelsV1Items(items *[]catalystcentersdkgo.ResponseSdaGetPortChannelsV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_port_channels_count.go b/catalystcenter/data_source_sda_port_channels_count.go index 01f238e..b37b9f9 100644 --- a/catalystcenter/data_source_sda_port_channels_count.go +++ b/catalystcenter/data_source_sda_port_channels_count.go @@ -75,8 +75,8 @@ func dataSourceSdaPortChannelsCountRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortChannelCount") - queryParams1 := catalystcentersdkgo.GetPortChannelCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortChannelCountV1") + queryParams1 := catalystcentersdkgo.GetPortChannelCountV1QueryParams{} if okFabricID { queryParams1.FabricID = vFabricID.(string) @@ -91,24 +91,24 @@ func dataSourceSdaPortChannelsCountRead(ctx context.Context, d *schema.ResourceD queryParams1.ConnectedDeviceType = vConnectedDeviceType.(string) } - response1, restyResp1, err := client.Sda.GetPortChannelCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetPortChannelCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPortChannelCount", err, - "Failure at GetPortChannelCount, unexpected response", "")) + "Failure when executing 2 GetPortChannelCountV1", err, + "Failure at GetPortChannelCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetPortChannelCountItem(response1.Response) + vItem1 := flattenSdaGetPortChannelCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortChannelCount response", + "Failure when setting GetPortChannelCountV1 response", err)) return diags } @@ -120,7 +120,7 @@ func dataSourceSdaPortChannelsCountRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenSdaGetPortChannelCountItem(item *catalystcentersdkgo.ResponseSdaGetPortChannelCountResponse) []map[string]interface{} { +func flattenSdaGetPortChannelCountV1Item(item *catalystcentersdkgo.ResponseSdaGetPortChannelCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_provision_device.go b/catalystcenter/data_source_sda_provision_device.go index 6bad62e..5a68fa4 100644 --- a/catalystcenter/data_source_sda_provision_device.go +++ b/catalystcenter/data_source_sda_provision_device.go @@ -74,29 +74,29 @@ func dataSourceSdaProvisionDeviceRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetProvisionedWiredDevice") - queryParams1 := catalystcentersdkgo.GetProvisionedWiredDeviceQueryParams{} + log.Printf("[DEBUG] Selected method: GetProvisionedWiredDeviceV1") + queryParams1 := catalystcentersdkgo.GetProvisionedWiredDeviceV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress.(string) - response1, restyResp1, err := client.Sda.GetProvisionedWiredDevice(&queryParams1) + response1, restyResp1, err := client.Sda.GetProvisionedWiredDeviceV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetProvisionedWiredDevice", err, - "Failure at GetProvisionedWiredDevice, unexpected response", "")) + "Failure when executing 2 GetProvisionedWiredDeviceV1", err, + "Failure at GetProvisionedWiredDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetProvisionedWiredDeviceItem(response1) + vItem1 := flattenSdaGetProvisionedWiredDeviceV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetProvisionedWiredDevice response", + "Failure when setting GetProvisionedWiredDeviceV1 response", err)) return diags } @@ -108,7 +108,7 @@ func dataSourceSdaProvisionDeviceRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenSdaGetProvisionedWiredDeviceItem(item *catalystcentersdkgo.ResponseSdaGetProvisionedWiredDevice) []map[string]interface{} { +func flattenSdaGetProvisionedWiredDeviceV1Item(item *catalystcentersdkgo.ResponseSdaGetProvisionedWiredDeviceV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_provision_devices.go b/catalystcenter/data_source_sda_provision_devices.go index 64025f8..165f21e 100644 --- a/catalystcenter/data_source_sda_provision_devices.go +++ b/catalystcenter/data_source_sda_provision_devices.go @@ -96,8 +96,8 @@ func dataSourceSdaProvisionDevicesRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetProvisionedDevices") - queryParams1 := catalystcentersdkgo.GetProvisionedDevicesQueryParams{} + log.Printf("[DEBUG] Selected method: GetProvisionedDevicesV1") + queryParams1 := catalystcentersdkgo.GetProvisionedDevicesV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -115,24 +115,24 @@ func dataSourceSdaProvisionDevicesRead(ctx context.Context, d *schema.ResourceDa queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetProvisionedDevices(&queryParams1) + response1, restyResp1, err := client.Sda.GetProvisionedDevicesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetProvisionedDevices", err, - "Failure at GetProvisionedDevices, unexpected response", "")) + "Failure when executing 2 GetProvisionedDevicesV1", err, + "Failure at GetProvisionedDevicesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetProvisionedDevicesItems(response1.Response) + vItems1 := flattenSdaGetProvisionedDevicesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetProvisionedDevices response", + "Failure when setting GetProvisionedDevicesV1 response", err)) return diags } @@ -144,7 +144,7 @@ func dataSourceSdaProvisionDevicesRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSdaGetProvisionedDevicesItems(items *[]catalystcentersdkgo.ResponseSdaGetProvisionedDevicesResponse) []map[string]interface{} { +func flattenSdaGetProvisionedDevicesV1Items(items *[]catalystcentersdkgo.ResponseSdaGetProvisionedDevicesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_provision_devices_count.go b/catalystcenter/data_source_sda_provision_devices_count.go index 44b0011..8ae0df9 100644 --- a/catalystcenter/data_source_sda_provision_devices_count.go +++ b/catalystcenter/data_source_sda_provision_devices_count.go @@ -54,31 +54,31 @@ func dataSourceSdaProvisionDevicesCountRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetProvisionedDevicesCount") - queryParams1 := catalystcentersdkgo.GetProvisionedDevicesCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetProvisionedDevicesCountV1") + queryParams1 := catalystcentersdkgo.GetProvisionedDevicesCountV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) } - response1, restyResp1, err := client.Sda.GetProvisionedDevicesCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetProvisionedDevicesCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetProvisionedDevicesCount", err, - "Failure at GetProvisionedDevicesCount, unexpected response", "")) + "Failure when executing 2 GetProvisionedDevicesCountV1", err, + "Failure at GetProvisionedDevicesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetProvisionedDevicesCountItem(response1.Response) + vItem1 := flattenSdaGetProvisionedDevicesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetProvisionedDevicesCount response", + "Failure when setting GetProvisionedDevicesCountV1 response", err)) return diags } @@ -90,7 +90,7 @@ func dataSourceSdaProvisionDevicesCountRead(ctx context.Context, d *schema.Resou return diags } -func flattenSdaGetProvisionedDevicesCountItem(item *catalystcentersdkgo.ResponseSdaGetProvisionedDevicesCountResponse) []map[string]interface{} { +func flattenSdaGetProvisionedDevicesCountV1Item(item *catalystcentersdkgo.ResponseSdaGetProvisionedDevicesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_site_member_member.go b/catalystcenter/data_source_sda_site_member_member.go index 63619e8..b4461ee 100644 --- a/catalystcenter/data_source_sda_site_member_member.go +++ b/catalystcenter/data_source_sda_site_member_member.go @@ -433,9 +433,9 @@ func dataSourceSdaSiteMemberMemberRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDevicesThatAreAssignedToASite") + log.Printf("[DEBUG] Selected method: GetDevicesThatAreAssignedToASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetDevicesThatAreAssignedToASiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetDevicesThatAreAssignedToASiteV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(string) @@ -449,24 +449,24 @@ func dataSourceSdaSiteMemberMemberRead(ctx context.Context, d *schema.ResourceDa queryParams1.Level = vLevel.(string) } - response1, restyResp1, err := client.Sites.GetDevicesThatAreAssignedToASite(vvID, &queryParams1) + response1, restyResp1, err := client.Sites.GetDevicesThatAreAssignedToASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDevicesThatAreAssignedToASite", err, - "Failure at GetDevicesThatAreAssignedToASite, unexpected response", "")) + "Failure when executing 2 GetDevicesThatAreAssignedToASiteV1", err, + "Failure at GetDevicesThatAreAssignedToASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSitesGetDevicesThatAreAssignedToASiteItems(response1.Response) + vItems1 := flattenSitesGetDevicesThatAreAssignedToASiteV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDevicesThatAreAssignedToASite response", + "Failure when setting GetDevicesThatAreAssignedToASiteV1 response", err)) return diags } @@ -478,7 +478,7 @@ func dataSourceSdaSiteMemberMemberRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSitesGetDevicesThatAreAssignedToASiteItems(items *[]catalystcentersdkgo.ResponseSitesGetDevicesThatAreAssignedToASiteResponse) []map[string]interface{} { +func flattenSitesGetDevicesThatAreAssignedToASiteV1Items(items *[]catalystcentersdkgo.ResponseSitesGetDevicesThatAreAssignedToASiteV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sda_transit_networks.go b/catalystcenter/data_source_sda_transit_networks.go index 18d265c..df6abf4 100644 --- a/catalystcenter/data_source_sda_transit_networks.go +++ b/catalystcenter/data_source_sda_transit_networks.go @@ -146,8 +146,8 @@ func dataSourceSdaTransitNetworksRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTransitNetworks") - queryParams1 := catalystcentersdkgo.GetTransitNetworksQueryParams{} + log.Printf("[DEBUG] Selected method: GetTransitNetworksV1") + queryParams1 := catalystcentersdkgo.GetTransitNetworksV1QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -165,24 +165,24 @@ func dataSourceSdaTransitNetworksRead(ctx context.Context, d *schema.ResourceDat queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.Sda.GetTransitNetworks(&queryParams1) + response1, restyResp1, err := client.Sda.GetTransitNetworksV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTransitNetworks", err, - "Failure at GetTransitNetworks, unexpected response", "")) + "Failure when executing 2 GetTransitNetworksV1", err, + "Failure at GetTransitNetworksV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSdaGetTransitNetworksItems(response1.Response) + vItems1 := flattenSdaGetTransitNetworksV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTransitNetworks response", + "Failure when setting GetTransitNetworksV1 response", err)) return diags } @@ -194,7 +194,7 @@ func dataSourceSdaTransitNetworksRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenSdaGetTransitNetworksItems(items *[]catalystcentersdkgo.ResponseSdaGetTransitNetworksResponse) []map[string]interface{} { +func flattenSdaGetTransitNetworksV1Items(items *[]catalystcentersdkgo.ResponseSdaGetTransitNetworksV1Response) []map[string]interface{} { if items == nil { return nil } @@ -204,14 +204,14 @@ func flattenSdaGetTransitNetworksItems(items *[]catalystcentersdkgo.ResponseSdaG respItem["id"] = item.ID respItem["name"] = item.Name respItem["type"] = item.Type - respItem["ip_transit_settings"] = flattenSdaGetTransitNetworksItemsIPTransitSettings(item.IPTransitSettings) - respItem["sda_transit_settings"] = flattenSdaGetTransitNetworksItemsSdaTransitSettings(item.SdaTransitSettings) + respItem["ip_transit_settings"] = flattenSdaGetTransitNetworksV1ItemsIPTransitSettings(item.IPTransitSettings) + respItem["sda_transit_settings"] = flattenSdaGetTransitNetworksV1ItemsSdaTransitSettings(item.SdaTransitSettings) respItems = append(respItems, respItem) } return respItems } -func flattenSdaGetTransitNetworksItemsIPTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitNetworksResponseIPTransitSettings) []map[string]interface{} { +func flattenSdaGetTransitNetworksV1ItemsIPTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitNetworksV1ResponseIPTransitSettings) []map[string]interface{} { if item == nil { return nil } @@ -225,7 +225,7 @@ func flattenSdaGetTransitNetworksItemsIPTransitSettings(item *catalystcentersdkg } -func flattenSdaGetTransitNetworksItemsSdaTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitNetworksResponseSdaTransitSettings) []map[string]interface{} { +func flattenSdaGetTransitNetworksV1ItemsSdaTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitNetworksV1ResponseSdaTransitSettings) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_transit_networks_count.go b/catalystcenter/data_source_sda_transit_networks_count.go index f1ab6c9..0e5dff8 100644 --- a/catalystcenter/data_source_sda_transit_networks_count.go +++ b/catalystcenter/data_source_sda_transit_networks_count.go @@ -54,31 +54,31 @@ func dataSourceSdaTransitNetworksCountRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTransitNetworksCount") - queryParams1 := catalystcentersdkgo.GetTransitNetworksCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetTransitNetworksCountV1") + queryParams1 := catalystcentersdkgo.GetTransitNetworksCountV1QueryParams{} if okType { queryParams1.Type = vType.(string) } - response1, restyResp1, err := client.Sda.GetTransitNetworksCount(&queryParams1) + response1, restyResp1, err := client.Sda.GetTransitNetworksCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTransitNetworksCount", err, - "Failure at GetTransitNetworksCount, unexpected response", "")) + "Failure when executing 2 GetTransitNetworksCountV1", err, + "Failure at GetTransitNetworksCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetTransitNetworksCountItem(response1.Response) + vItem1 := flattenSdaGetTransitNetworksCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTransitNetworksCount response", + "Failure when setting GetTransitNetworksCountV1 response", err)) return diags } @@ -90,7 +90,7 @@ func dataSourceSdaTransitNetworksCountRead(ctx context.Context, d *schema.Resour return diags } -func flattenSdaGetTransitNetworksCountItem(item *catalystcentersdkgo.ResponseSdaGetTransitNetworksCountResponse) []map[string]interface{} { +func flattenSdaGetTransitNetworksCountV1Item(item *catalystcentersdkgo.ResponseSdaGetTransitNetworksCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_virtual_network.go b/catalystcenter/data_source_sda_virtual_network.go index 17dbb5e..2cb6d68 100644 --- a/catalystcenter/data_source_sda_virtual_network.go +++ b/catalystcenter/data_source_sda_virtual_network.go @@ -124,31 +124,31 @@ func dataSourceSdaVirtualNetworkRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVnFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetVnFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetVnFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetVnFromSdaFabricV1QueryParams{} queryParams1.VirtualNetworkName = vVirtualNetworkName.(string) queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) - response1, restyResp1, err := client.Sda.GetVnFromSdaFabric(&queryParams1) + response1, restyResp1, err := client.Sda.GetVnFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetVnFromSdaFabric", err, - "Failure at GetVnFromSdaFabric, unexpected response", "")) + "Failure when executing 2 GetVnFromSdaFabricV1", err, + "Failure at GetVnFromSdaFabricV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetVnFromSdaFabricItem(response1) + vItem1 := flattenSdaGetVnFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVnFromSdaFabric response", + "Failure when setting GetVnFromSdaFabricV1 response", err)) return diags } @@ -160,7 +160,7 @@ func dataSourceSdaVirtualNetworkRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenSdaGetVnFromSdaFabricItem(item *catalystcentersdkgo.ResponseSdaGetVnFromSdaFabric) []map[string]interface{} { +func flattenSdaGetVnFromSdaFabricV1Item(item *catalystcentersdkgo.ResponseSdaGetVnFromSdaFabricV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_virtual_network_ip_pool.go b/catalystcenter/data_source_sda_virtual_network_ip_pool.go index 61c17b5..892f247 100644 --- a/catalystcenter/data_source_sda_virtual_network_ip_pool.go +++ b/catalystcenter/data_source_sda_virtual_network_ip_pool.go @@ -115,8 +115,8 @@ func dataSourceSdaVirtualNetworkIPPoolRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetIPPoolFromSdaVirtualNetwork") - queryParams1 := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkQueryParams{} + log.Printf("[DEBUG] Selected method: GetIPPoolFromSdaVirtualNetworkV1") + queryParams1 := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy.(string) @@ -124,24 +124,24 @@ func dataSourceSdaVirtualNetworkIPPoolRead(ctx context.Context, d *schema.Resour queryParams1.IPPoolName = vIPPoolName.(string) - response1, restyResp1, err := client.Sda.GetIPPoolFromSdaVirtualNetwork(&queryParams1) + response1, restyResp1, err := client.Sda.GetIPPoolFromSdaVirtualNetworkV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetIPPoolFromSdaVirtualNetwork", err, - "Failure at GetIPPoolFromSdaVirtualNetwork, unexpected response", "")) + "Failure when executing 2 GetIPPoolFromSdaVirtualNetworkV1", err, + "Failure at GetIPPoolFromSdaVirtualNetworkV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetIPPoolFromSdaVirtualNetworkItem(response1) + vItem1 := flattenSdaGetIPPoolFromSdaVirtualNetworkV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetIPPoolFromSdaVirtualNetwork response", + "Failure when setting GetIPPoolFromSdaVirtualNetworkV1 response", err)) return diags } @@ -153,7 +153,7 @@ func dataSourceSdaVirtualNetworkIPPoolRead(ctx context.Context, d *schema.Resour return diags } -func flattenSdaGetIPPoolFromSdaVirtualNetworkItem(item *catalystcentersdkgo.ResponseSdaGetIPPoolFromSdaVirtualNetwork) []map[string]interface{} { +func flattenSdaGetIPPoolFromSdaVirtualNetworkV1Item(item *catalystcentersdkgo.ResponseSdaGetIPPoolFromSdaVirtualNetworkV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sda_virtual_network_v2.go b/catalystcenter/data_source_sda_virtual_network_v2.go index ef10783..9e4a74a 100644 --- a/catalystcenter/data_source_sda_virtual_network_v2.go +++ b/catalystcenter/data_source_sda_virtual_network_v2.go @@ -106,29 +106,29 @@ func dataSourceSdaVirtualNetworkV2Read(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVirtualNetworkWithScalableGroups") - queryParams1 := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsQueryParams{} + log.Printf("[DEBUG] Selected method: GetVirtualNetworkWithScalableGroupsV1") + queryParams1 := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsV1QueryParams{} queryParams1.VirtualNetworkName = vVirtualNetworkName.(string) - response1, restyResp1, err := client.Sda.GetVirtualNetworkWithScalableGroups(&queryParams1) + response1, restyResp1, err := client.Sda.GetVirtualNetworkWithScalableGroupsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetVirtualNetworkWithScalableGroups", err, - "Failure at GetVirtualNetworkWithScalableGroups, unexpected response", "")) + "Failure when executing 2 GetVirtualNetworkWithScalableGroupsV1", err, + "Failure at GetVirtualNetworkWithScalableGroupsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetVirtualNetworkWithScalableGroupsItem(response1) + vItem1 := flattenSdaGetVirtualNetworkWithScalableGroupsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVirtualNetworkWithScalableGroups response", + "Failure when setting GetVirtualNetworkWithScalableGroupsV1 response", err)) return diags } @@ -140,7 +140,7 @@ func dataSourceSdaVirtualNetworkV2Read(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSdaGetVirtualNetworkWithScalableGroupsItem(item *catalystcentersdkgo.ResponseSdaGetVirtualNetworkWithScalableGroups) []map[string]interface{} { +func flattenSdaGetVirtualNetworkWithScalableGroupsV1Item(item *catalystcentersdkgo.ResponseSdaGetVirtualNetworkWithScalableGroupsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_security_advisories.go b/catalystcenter/data_source_security_advisories.go index 0b28dd9..3ef9545 100644 --- a/catalystcenter/data_source_security_advisories.go +++ b/catalystcenter/data_source_security_advisories.go @@ -113,26 +113,26 @@ func dataSourceSecurityAdvisoriesRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAdvisoriesList") + log.Printf("[DEBUG] Selected method: GetAdvisoriesListV1") - response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoriesList() + response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoriesListV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAdvisoriesList", err, - "Failure at GetAdvisoriesList, unexpected response", "")) + "Failure when executing 2 GetAdvisoriesListV1", err, + "Failure at GetAdvisoriesListV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSecurityAdvisoriesGetAdvisoriesListItem(response1.Response) + vItem1 := flattenSecurityAdvisoriesGetAdvisoriesListV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAdvisoriesList response", + "Failure when setting GetAdvisoriesListV1 response", err)) return diags } @@ -144,7 +144,7 @@ func dataSourceSecurityAdvisoriesRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenSecurityAdvisoriesGetAdvisoriesListItem(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesListResponse) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesListV1Item(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesListV1Response) []map[string]interface{} { if item == nil { return nil } @@ -158,13 +158,13 @@ func flattenSecurityAdvisoriesGetAdvisoriesListItem(item *catalystcentersdkgo.Re respItem["detection_type"] = item.DetectionType respItem["default_detection_type"] = item.DefaultDetectionType respItem["default_config_match_pattern"] = item.DefaultConfigMatchPattern - respItem["fixed_versions"] = flattenSecurityAdvisoriesGetAdvisoriesListItemFixedVersions(item.FixedVersions) + respItem["fixed_versions"] = flattenSecurityAdvisoriesGetAdvisoriesListV1ItemFixedVersions(item.FixedVersions) return []map[string]interface{}{ respItem, } } -func flattenSecurityAdvisoriesGetAdvisoriesListItemFixedVersions(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesListResponseFixedVersions) interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesListV1ItemFixedVersions(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesListV1ResponseFixedVersions) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_security_advisories_devices.go b/catalystcenter/data_source_security_advisories_devices.go index 061fb6e..393c9a8 100644 --- a/catalystcenter/data_source_security_advisories_devices.go +++ b/catalystcenter/data_source_security_advisories_devices.go @@ -64,27 +64,27 @@ func dataSourceSecurityAdvisoriesDevicesRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDevicesPerAdvisory") + log.Printf("[DEBUG] Selected method: GetDevicesPerAdvisoryV1") vvAdvisoryID := vAdvisoryID.(string) - response1, restyResp1, err := client.SecurityAdvisories.GetDevicesPerAdvisory(vvAdvisoryID) + response1, restyResp1, err := client.SecurityAdvisories.GetDevicesPerAdvisoryV1(vvAdvisoryID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDevicesPerAdvisory", err, - "Failure at GetDevicesPerAdvisory, unexpected response", "")) + "Failure when executing 2 GetDevicesPerAdvisoryV1", err, + "Failure at GetDevicesPerAdvisoryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSecurityAdvisoriesGetDevicesPerAdvisoryItems(response1) + vItems1 := flattenSecurityAdvisoriesGetDevicesPerAdvisoryV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDevicesPerAdvisory response", + "Failure when setting GetDevicesPerAdvisoryV1 response", err)) return diags } @@ -96,7 +96,7 @@ func dataSourceSecurityAdvisoriesDevicesRead(ctx context.Context, d *schema.Reso return diags } -func flattenSecurityAdvisoriesGetDevicesPerAdvisoryItems(items *catalystcentersdkgo.ResponseSecurityAdvisoriesGetDevicesPerAdvisory) []map[string]interface{} { +func flattenSecurityAdvisoriesGetDevicesPerAdvisoryV1Items(items *catalystcentersdkgo.ResponseSecurityAdvisoriesGetDevicesPerAdvisoryV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_security_advisories_ids_per_device.go b/catalystcenter/data_source_security_advisories_ids_per_device.go index bcd2943..f7ac640 100644 --- a/catalystcenter/data_source_security_advisories_ids_per_device.go +++ b/catalystcenter/data_source_security_advisories_ids_per_device.go @@ -99,27 +99,27 @@ func dataSourceSecurityAdvisoriesIDsPerDeviceRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAdvisoryDeviceDetail") + log.Printf("[DEBUG] Selected method: GetAdvisoryDeviceDetailV1") vvDeviceID := vDeviceID.(string) - response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoryDeviceDetail(vvDeviceID) + response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoryDeviceDetailV1(vvDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAdvisoryDeviceDetail", err, - "Failure at GetAdvisoryDeviceDetail, unexpected response", "")) + "Failure when executing 2 GetAdvisoryDeviceDetailV1", err, + "Failure at GetAdvisoryDeviceDetailV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSecurityAdvisoriesGetAdvisoryDeviceDetailItem(response1.Response) + vItem1 := flattenSecurityAdvisoriesGetAdvisoryDeviceDetailV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAdvisoryDeviceDetail response", + "Failure when setting GetAdvisoryDeviceDetailV1 response", err)) return diags } @@ -131,7 +131,7 @@ func dataSourceSecurityAdvisoriesIDsPerDeviceRead(ctx context.Context, d *schema return diags } -func flattenSecurityAdvisoriesGetAdvisoryDeviceDetailItem(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoryDeviceDetailResponse) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoryDeviceDetailV1Item(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoryDeviceDetailV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_security_advisories_per_device.go b/catalystcenter/data_source_security_advisories_per_device.go index a5f8af1..cb184c0 100644 --- a/catalystcenter/data_source_security_advisories_per_device.go +++ b/catalystcenter/data_source_security_advisories_per_device.go @@ -120,27 +120,27 @@ func dataSourceSecurityAdvisoriesPerDeviceRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAdvisoriesPerDevice") + log.Printf("[DEBUG] Selected method: GetAdvisoriesPerDeviceV1") vvDeviceID := vDeviceID.(string) - response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoriesPerDevice(vvDeviceID) + response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoriesPerDeviceV1(vvDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAdvisoriesPerDevice", err, - "Failure at GetAdvisoriesPerDevice, unexpected response", "")) + "Failure when executing 2 GetAdvisoriesPerDeviceV1", err, + "Failure at GetAdvisoriesPerDeviceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSecurityAdvisoriesGetAdvisoriesPerDeviceItem(response1.Response) + vItem1 := flattenSecurityAdvisoriesGetAdvisoriesPerDeviceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAdvisoriesPerDevice response", + "Failure when setting GetAdvisoriesPerDeviceV1 response", err)) return diags } @@ -152,7 +152,7 @@ func dataSourceSecurityAdvisoriesPerDeviceRead(ctx context.Context, d *schema.Re return diags } -func flattenSecurityAdvisoriesGetAdvisoriesPerDeviceItem(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesPerDeviceResponse) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesPerDeviceV1Item(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesPerDeviceV1Response) []map[string]interface{} { if item == nil { return nil } @@ -166,13 +166,13 @@ func flattenSecurityAdvisoriesGetAdvisoriesPerDeviceItem(item *catalystcentersdk respItem["detection_type"] = item.DetectionType respItem["default_detection_type"] = item.DefaultDetectionType respItem["default_config_match_pattern"] = item.DefaultConfigMatchPattern - respItem["fixed_versions"] = flattenSecurityAdvisoriesGetAdvisoriesPerDeviceItemFixedVersions(item.FixedVersions) + respItem["fixed_versions"] = flattenSecurityAdvisoriesGetAdvisoriesPerDeviceV1ItemFixedVersions(item.FixedVersions) return []map[string]interface{}{ respItem, } } -func flattenSecurityAdvisoriesGetAdvisoriesPerDeviceItemFixedVersions(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesPerDeviceResponseFixedVersions) interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesPerDeviceV1ItemFixedVersions(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesPerDeviceV1ResponseFixedVersions) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_security_advisories_summary.go b/catalystcenter/data_source_security_advisories_summary.go index bb97d0e..52356e1 100644 --- a/catalystcenter/data_source_security_advisories_summary.go +++ b/catalystcenter/data_source_security_advisories_summary.go @@ -262,26 +262,26 @@ func dataSourceSecurityAdvisoriesSummaryRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAdvisoriesSummary") + log.Printf("[DEBUG] Selected method: GetAdvisoriesSummaryV1") - response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoriesSummary() + response1, restyResp1, err := client.SecurityAdvisories.GetAdvisoriesSummaryV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAdvisoriesSummary", err, - "Failure at GetAdvisoriesSummary, unexpected response", "")) + "Failure when executing 2 GetAdvisoriesSummaryV1", err, + "Failure at GetAdvisoriesSummaryV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSecurityAdvisoriesGetAdvisoriesSummaryItem(response1.Response) + vItem1 := flattenSecurityAdvisoriesGetAdvisoriesSummaryV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAdvisoriesSummary response", + "Failure when setting GetAdvisoriesSummaryV1 response", err)) return diags } @@ -293,23 +293,23 @@ func dataSourceSecurityAdvisoriesSummaryRead(ctx context.Context, d *schema.Reso return diags } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItem(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponse) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1Item(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["inf_orm_ati_ona_l"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryItemINFORMATIONAL(item.INFORMATIONAL) - respItem["low"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryItemLOW(item.LOW) - respItem["med_ium"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryItemMEDIUM(item.MEDIUM) - respItem["hig_h"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryItemHIGH(item.HIGH) - respItem["cri_tic_al"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryItemCRITICaL(item.CRITICaL) - respItem["na"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryItemNA(item.NA) + respItem["inf_orm_ati_ona_l"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemINFORMATIONAL(item.INFORMATIONAL) + respItem["low"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemLOW(item.LOW) + respItem["med_ium"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemMEDIUM(item.MEDIUM) + respItem["hig_h"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemHIGH(item.HIGH) + respItem["cri_tic_al"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemCRITICaL(item.CRITICaL) + respItem["na"] = flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemNA(item.NA) return []map[string]interface{}{ respItem, } } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemINFORMATIONAL(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponseINFORMATIONAL) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemINFORMATIONAL(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1ResponseINFORMATIONAL) []map[string]interface{} { if item == nil { return nil } @@ -325,7 +325,7 @@ func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemINFORMATIONAL(item *cataly } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemLOW(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponseLOW) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemLOW(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1ResponseLOW) []map[string]interface{} { if item == nil { return nil } @@ -341,7 +341,7 @@ func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemLOW(item *catalystcentersd } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemMEDIUM(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponseMEDIUM) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemMEDIUM(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1ResponseMEDIUM) []map[string]interface{} { if item == nil { return nil } @@ -357,7 +357,7 @@ func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemMEDIUM(item *catalystcente } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemHIGH(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponseHIGH) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemHIGH(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1ResponseHIGH) []map[string]interface{} { if item == nil { return nil } @@ -373,7 +373,7 @@ func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemHIGH(item *catalystcenters } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemCRITICaL(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponseCRITICaL) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemCRITICaL(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1ResponseCRITICaL) []map[string]interface{} { if item == nil { return nil } @@ -389,7 +389,7 @@ func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemCRITICaL(item *catalystcen } -func flattenSecurityAdvisoriesGetAdvisoriesSummaryItemNA(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryResponseNA) []map[string]interface{} { +func flattenSecurityAdvisoriesGetAdvisoriesSummaryV1ItemNA(item *catalystcentersdkgo.ResponseSecurityAdvisoriesGetAdvisoriesSummaryV1ResponseNA) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_security_rogue_wireless_containment_status.go b/catalystcenter/data_source_security_rogue_wireless_containment_status.go new file mode 100644 index 0000000..922eeb0 --- /dev/null +++ b/catalystcenter/data_source_security_rogue_wireless_containment_status.go @@ -0,0 +1,278 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSecurityRogueWirelessContainmentStatus() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Devices. + +- Intent API to check the wireless rogue access point containment status. The response includes all the details like +containment status, contained by WLC, containment status of each BSSID etc. This data source also includes the +information of strongest detecting WLC for this rogue access point. +`, + + ReadContext: dataSourceSecurityRogueWirelessContainmentStatusRead, + Schema: map[string]*schema.Schema{ + "mac_address": &schema.Schema{ + Description: `macAddress path parameter. MAC Address of the Wireless Rogue AP +`, + Type: schema.TypeString, + Required: true, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "bssid_containment_status": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "bssid": &schema.Schema{ + Description: `Bssid`, + Type: schema.TypeString, + Computed: true, + }, + + "contained_by_wlc_ip": &schema.Schema{ + Description: `Contained By Wlc Ip`, + Type: schema.TypeString, + Computed: true, + }, + + "containment_status": &schema.Schema{ + Description: `Containment Status`, + Type: schema.TypeString, + Computed: true, + }, + + "is_adhoc": &schema.Schema{ + Description: `Is Adhoc`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "radio_type": &schema.Schema{ + Description: `Radio Type`, + Type: schema.TypeString, + Computed: true, + }, + + "ssid": &schema.Schema{ + Description: `Ssid`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "classification": &schema.Schema{ + Description: `Classification`, + Type: schema.TypeString, + Computed: true, + }, + + "contained_by_wlc_ip": &schema.Schema{ + Description: `Contained By Wlc Ip`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "containment_status": &schema.Schema{ + Description: `Containment Status`, + Type: schema.TypeString, + Computed: true, + }, + + "last_seen": &schema.Schema{ + Description: `Last Seen`, + Type: schema.TypeInt, + Computed: true, + }, + + "last_task_detail": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "initiated_on_bssid": &schema.Schema{ + Description: `Initiated On Bssid`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "initiated_on_wlc_ip": &schema.Schema{ + Description: `Initiated On Wlc Ip`, + Type: schema.TypeString, + Computed: true, + }, + + "task_id": &schema.Schema{ + Description: `Task Id`, + Type: schema.TypeString, + Computed: true, + }, + + "task_start_time": &schema.Schema{ + Description: `Task Start Time`, + Type: schema.TypeInt, + Computed: true, + }, + + "task_state": &schema.Schema{ + Description: `Task State`, + Type: schema.TypeString, + Computed: true, + }, + + "task_type": &schema.Schema{ + Description: `Task Type`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Computed: true, + }, + + "strongest_detecting_wlc_ip": &schema.Schema{ + Description: `Strongest Detecting Wlc Ip`, + Type: schema.TypeString, + Computed: true, + }, + + "type": &schema.Schema{ + Description: `Type`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSecurityRogueWirelessContainmentStatusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vMacAddress := d.Get("mac_address") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: WirelessRogueApContainmentStatusV1") + vvMacAddress := vMacAddress.(string) + + response1, restyResp1, err := client.Devices.WirelessRogueApContainmentStatusV1(vvMacAddress) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 WirelessRogueApContainmentStatusV1", err, + "Failure at WirelessRogueApContainmentStatusV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesWirelessRogueApContainmentStatusV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting WirelessRogueApContainmentStatusV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDevicesWirelessRogueApContainmentStatusV1Items(items *[]catalystcentersdkgo.ResponseDevicesWirelessRogueApContainmentStatusV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["mac_address"] = item.MacAddress + respItem["type"] = item.Type + respItem["classification"] = item.Classification + respItem["containment_status"] = item.ContainmentStatus + respItem["contained_by_wlc_ip"] = item.ContainedByWlcIP + respItem["last_seen"] = item.LastSeen + respItem["strongest_detecting_wlc_ip"] = item.StrongestDetectingWlcIP + respItem["last_task_detail"] = flattenDevicesWirelessRogueApContainmentStatusV1ItemsLastTaskDetail(item.LastTaskDetail) + respItem["bssid_containment_status"] = flattenDevicesWirelessRogueApContainmentStatusV1ItemsBssidContainmentStatus(item.BssidContainmentStatus) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDevicesWirelessRogueApContainmentStatusV1ItemsLastTaskDetail(item *catalystcentersdkgo.ResponseDevicesWirelessRogueApContainmentStatusV1ResponseLastTaskDetail) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["task_id"] = item.TaskID + respItem["task_type"] = item.TaskType + respItem["task_state"] = item.TaskState + respItem["task_start_time"] = item.TaskStartTime + respItem["initiated_on_wlc_ip"] = item.InitiatedOnWlcIP + respItem["initiated_on_bssid"] = item.InitiatedOnBssid + + return []map[string]interface{}{ + respItem, + } + +} + +func flattenDevicesWirelessRogueApContainmentStatusV1ItemsBssidContainmentStatus(items *[]catalystcentersdkgo.ResponseDevicesWirelessRogueApContainmentStatusV1ResponseBssidContainmentStatus) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["bssid"] = item.Bssid + respItem["ssid"] = item.SSID + respItem["radio_type"] = item.RadioType + respItem["containment_status"] = item.ContainmentStatus + respItem["contained_by_wlc_ip"] = item.ContainedByWlcIP + respItem["is_adhoc"] = boolPtrToString(item.IsAdhoc) + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_security_threats_level.go b/catalystcenter/data_source_security_threats_level.go new file mode 100644 index 0000000..086eddc --- /dev/null +++ b/catalystcenter/data_source_security_threats_level.go @@ -0,0 +1,98 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSecurityThreatsLevel() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Devices. + +- Intent API to fetch all threat levels defined. +`, + + ReadContext: dataSourceSecurityThreatsLevelRead, + Schema: map[string]*schema.Schema{ + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "name": &schema.Schema{ + Description: `Name`, + Type: schema.TypeString, + Computed: true, + }, + + "value": &schema.Schema{ + Description: `Value`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSecurityThreatsLevelRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetThreatLevelsV1") + + response1, restyResp1, err := client.Devices.GetThreatLevelsV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetThreatLevelsV1", err, + "Failure at GetThreatLevelsV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesGetThreatLevelsV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetThreatLevelsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDevicesGetThreatLevelsV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetThreatLevelsV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["name"] = item.Name + respItem["value"] = item.Value + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_security_threats_rogue_allowed_list.go b/catalystcenter/data_source_security_threats_rogue_allowed_list.go new file mode 100644 index 0000000..25041f1 --- /dev/null +++ b/catalystcenter/data_source_security_threats_rogue_allowed_list.go @@ -0,0 +1,127 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSecurityThreatsRogueAllowedList() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Devices. + +- Intent API to fetch all the allowed mac addresses in the system. +`, + + ReadContext: dataSourceSecurityThreatsRogueAllowedListRead, + Schema: map[string]*schema.Schema{ + "limit": &schema.Schema{ + Description: `limit query parameter. The maximum number of entries to return. If the value exceeds the total count, then the maximum entries will be returned. +`, + Type: schema.TypeFloat, + Optional: true, + }, + "offset": &schema.Schema{ + Description: `offset query parameter. The offset of the first item in the collection to return. +`, + Type: schema.TypeFloat, + Optional: true, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "category": &schema.Schema{ + Description: `Category`, + Type: schema.TypeInt, + Computed: true, + }, + + "last_modified": &schema.Schema{ + Description: `Last Modified`, + Type: schema.TypeInt, + Computed: true, + }, + + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSecurityThreatsRogueAllowedListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vOffset, okOffset := d.GetOk("offset") + vLimit, okLimit := d.GetOk("limit") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetAllowedMacAddressV1") + queryParams1 := catalystcentersdkgo.GetAllowedMacAddressV1QueryParams{} + + if okOffset { + queryParams1.Offset = vOffset.(float64) + } + if okLimit { + queryParams1.Limit = vLimit.(float64) + } + + response1, restyResp1, err := client.Devices.GetAllowedMacAddressV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetAllowedMacAddressV1", err, + "Failure at GetAllowedMacAddressV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesGetAllowedMacAddressV1Items(response1) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetAllowedMacAddressV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDevicesGetAllowedMacAddressV1Items(items *catalystcentersdkgo.ResponseDevicesGetAllowedMacAddressV1) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["mac_address"] = item.MacAddress + respItem["category"] = item.Category + respItem["last_modified"] = item.LastModified + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_security_threats_rogue_allowed_list_count.go b/catalystcenter/data_source_security_threats_rogue_allowed_list_count.go new file mode 100644 index 0000000..4f1fa74 --- /dev/null +++ b/catalystcenter/data_source_security_threats_rogue_allowed_list_count.go @@ -0,0 +1,96 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSecurityThreatsRogueAllowedListCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Devices. + +- Intent API to fetch the count of allowed mac addresses in the system. +`, + + ReadContext: dataSourceSecurityThreatsRogueAllowedListCountRead, + Schema: map[string]*schema.Schema{ + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "response": &schema.Schema{ + Description: `Response`, + Type: schema.TypeInt, + Computed: true, + }, + + "version": &schema.Schema{ + Description: `Version`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSecurityThreatsRogueAllowedListCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetAllowedMacAddressCountV1") + + response1, restyResp1, err := client.Devices.GetAllowedMacAddressCountV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetAllowedMacAddressCountV1", err, + "Failure at GetAllowedMacAddressCountV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenDevicesGetAllowedMacAddressCountV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetAllowedMacAddressCountV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDevicesGetAllowedMacAddressCountV1Item(item *catalystcentersdkgo.ResponseDevicesGetAllowedMacAddressCountV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["response"] = item.Response + respItem["version"] = item.Version + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/data_source_security_threats_type.go b/catalystcenter/data_source_security_threats_type.go new file mode 100644 index 0000000..e5ae6da --- /dev/null +++ b/catalystcenter/data_source_security_threats_type.go @@ -0,0 +1,121 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSecurityThreatsType() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Devices. + +- Intent API to fetch all threat types defined. +`, + + ReadContext: dataSourceSecurityThreatsTypeRead, + Schema: map[string]*schema.Schema{ + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "is_custom": &schema.Schema{ + Description: `Is Custom`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "is_deleted": &schema.Schema{ + Description: `Is Deleted`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + + "label": &schema.Schema{ + Description: `Label`, + Type: schema.TypeString, + Computed: true, + }, + + "name": &schema.Schema{ + Description: `Name`, + Type: schema.TypeString, + Computed: true, + }, + + "value": &schema.Schema{ + Description: `Value`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSecurityThreatsTypeRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetThreatTypesV1") + + response1, restyResp1, err := client.Devices.GetThreatTypesV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 GetThreatTypesV1", err, + "Failure at GetThreatTypesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesGetThreatTypesV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetThreatTypesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenDevicesGetThreatTypesV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetThreatTypesV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["value"] = item.Value + respItem["name"] = item.Name + respItem["label"] = item.Label + respItem["is_custom"] = boolPtrToString(item.IsCustom) + respItem["is_deleted"] = boolPtrToString(item.IsDeleted) + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_sensor.go b/catalystcenter/data_source_sensor.go index c7bc496..068e096 100644 --- a/catalystcenter/data_source_sensor.go +++ b/catalystcenter/data_source_sensor.go @@ -168,31 +168,31 @@ func dataSourceSensorRead(ctx context.Context, d *schema.ResourceData, m interfa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: Sensors") - queryParams1 := catalystcentersdkgo.SensorsQueryParams{} + log.Printf("[DEBUG] Selected method: SensorsV1") + queryParams1 := catalystcentersdkgo.SensorsV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) } - response1, restyResp1, err := client.Sensors.Sensors(&queryParams1) + response1, restyResp1, err := client.Sensors.SensorsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 Sensors", err, - "Failure at Sensors, unexpected response", "")) + "Failure when executing 2 SensorsV1", err, + "Failure at SensorsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSensorsSensorsItems(response1.Response) + vItems1 := flattenSensorsSensorsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting Sensors response", + "Failure when setting SensorsV1 response", err)) return diags } @@ -204,7 +204,7 @@ func dataSourceSensorRead(ctx context.Context, d *schema.ResourceData, m interfa return diags } -func flattenSensorsSensorsItems(items *[]catalystcentersdkgo.ResponseSensorsSensorsResponse) []map[string]interface{} { +func flattenSensorsSensorsV1Items(items *[]catalystcentersdkgo.ResponseSensorsSensorsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -222,14 +222,14 @@ func flattenSensorsSensorsItems(items *[]catalystcentersdkgo.ResponseSensorsSens respItem["version"] = item.Version respItem["last_seen"] = item.LastSeen respItem["type"] = item.Type - respItem["ssh"] = flattenSensorsSensorsItemsSSH(item.SSH) + respItem["ssh"] = flattenSensorsSensorsV1ItemsSSH(item.SSH) respItem["led"] = boolPtrToString(item.Led) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsSensorsItemsSSH(item *catalystcentersdkgo.ResponseSensorsSensorsResponseSSH) []map[string]interface{} { +func flattenSensorsSensorsV1ItemsSSH(item *catalystcentersdkgo.ResponseSensorsSensorsV1ResponseSSH) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_service_provider.go b/catalystcenter/data_source_service_provider.go index d65b429..ff1ae44 100644 --- a/catalystcenter/data_source_service_provider.go +++ b/catalystcenter/data_source_service_provider.go @@ -121,26 +121,26 @@ func dataSourceServiceProviderRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetServiceProviderDetails") + log.Printf("[DEBUG] Selected method: GetServiceProviderDetailsV1") - response1, restyResp1, err := client.NetworkSettings.GetServiceProviderDetails() + response1, restyResp1, err := client.NetworkSettings.GetServiceProviderDetailsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetServiceProviderDetails", err, - "Failure at GetServiceProviderDetails, unexpected response", "")) + "Failure when executing 2 GetServiceProviderDetailsV1", err, + "Failure at GetServiceProviderDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenNetworkSettingsGetServiceProviderDetailsItems(response1.Response) + vItems1 := flattenNetworkSettingsGetServiceProviderDetailsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetServiceProviderDetails response", + "Failure when setting GetServiceProviderDetailsV1 response", err)) return diags } @@ -152,7 +152,7 @@ func dataSourceServiceProviderRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenNetworkSettingsGetServiceProviderDetailsItems(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponse) []map[string]interface{} { +func flattenNetworkSettingsGetServiceProviderDetailsV1Items(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -165,7 +165,7 @@ func flattenNetworkSettingsGetServiceProviderDetailsItems(items *[]catalystcente respItem["type"] = item.Type respItem["key"] = item.Key respItem["version"] = item.Version - respItem["value"] = flattenNetworkSettingsGetServiceProviderDetailsItemsValue(item.Value) + respItem["value"] = flattenNetworkSettingsGetServiceProviderDetailsV1ItemsValue(item.Value) respItem["group_uuid"] = item.GroupUUID respItem["inherited_group_uuid"] = item.InheritedGroupUUID respItem["inherited_group_name"] = item.InheritedGroupName @@ -174,7 +174,7 @@ func flattenNetworkSettingsGetServiceProviderDetailsItems(items *[]catalystcente return respItems } -func flattenNetworkSettingsGetServiceProviderDetailsItemsValue(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponseValue) []map[string]interface{} { +func flattenNetworkSettingsGetServiceProviderDetailsV1ItemsValue(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1ResponseValue) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_site.go b/catalystcenter/data_source_site.go index b866a20..6164a79 100644 --- a/catalystcenter/data_source_site.go +++ b/catalystcenter/data_source_site.go @@ -59,93 +59,11 @@ func dataSourceSite() *schema.Resource { Schema: map[string]*schema.Schema{ "additional_info": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "attributes": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "country": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "address": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "latitude": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "addressinheritedfrom": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "longitude": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "offsetx": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "offsety": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "length": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "width": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "height": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "rfmodel": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "floorindex": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "parent_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "floor_number": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "rf_model": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - - "name_space": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, + Description: `Additional Info`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, }, }, @@ -203,8 +121,8 @@ func dataSourceSiteRead(ctx context.Context, d *schema.ResourceData, m interface selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSite") - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteV1") + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -222,24 +140,24 @@ func dataSourceSiteRead(ctx context.Context, d *schema.ResourceData, m interface queryParams1.Limit = vLimit.(int) } - response1, restyResp1, err := client.Sites.GetSite(&queryParams1) + response1, restyResp1, err := client.Sites.GetSiteV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSite", err, - "Failure at GetSite, unexpected response", "")) + "Failure when executing 2 GetSiteV1", err, + "Failure at GetSiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSitesGetSiteItems(response1.Response, nil) + vItems1 := flattenSitesGetSiteV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSite response", + "Failure when setting GetSiteV1 response", err)) return diags } @@ -251,27 +169,7 @@ func dataSourceSiteRead(ctx context.Context, d *schema.ResourceData, m interface return diags } -func flattenSitesGetSiteItems(items *[]catalystcentersdkgo.ResponseSitesGetSiteResponse, parameters []interface{}) []map[string]interface{} { - if items == nil { - return nil - } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["parent_id"] = item.ParentID - respItem["name"] = item.Name - respItem["additional_info"] = flattenSitesGetSiteItemsAdditionalInfo(item.AdditionalInfo, parameters) - respItem["site_hierarchy"] = item.SiteHierarchy - respItem["site_name_hierarchy"] = item.SiteNameHierarchy - respItem["instance_tenant_id"] = item.InstanceTenantID - respItem["id"] = item.ID - //respItem["latitude"] = item. - respItems = append(respItems, respItem) - } - return respItems -} - -func flattenSitesGetFloorItems(items *[]catalystcentersdkgo.ResponseSitesGetFloorResponse) []map[string]interface{} { +func flattenSitesGetSiteV1Items(items *[]catalystcentersdkgo.ResponseSitesGetSiteV1Response) []map[string]interface{} { if items == nil { return nil } @@ -280,38 +178,16 @@ func flattenSitesGetFloorItems(items *[]catalystcentersdkgo.ResponseSitesGetFloo respItem := make(map[string]interface{}) respItem["parent_id"] = item.ParentID respItem["name"] = item.Name - respItem["additional_info"] = flattenSitesGetFloorItemsAdditionalInfo(item.AdditionalInfo) + respItem["additional_info"] = item.AdditionalInfo respItem["site_hierarchy"] = item.SiteHierarchy respItem["site_name_hierarchy"] = item.SiteNameHierarchy respItem["instance_tenant_id"] = item.InstanceTenantID respItem["id"] = item.ID - //respItem["latitude"] = item. respItems = append(respItems, respItem) } return respItems } - -func flattenSitesGetAreaItems(items *[]catalystcentersdkgo.ResponseSitesGetAreaResponse, parameters []interface{}) []map[string]interface{} { - if items == nil { - return nil - } - var respItems []map[string]interface{} - for _, item := range *items { - respItem := make(map[string]interface{}) - respItem["parent_id"] = item.ParentID - respItem["name"] = item.Name - respItem["additional_info"] = flattenSitesGetAreaItemsAdditionalInfo(item.AdditionalInfo, parameters) - respItem["site_hierarchy"] = item.SiteHierarchy - respItem["site_name_hierarchy"] = item.SiteNameHierarchy - respItem["instance_tenant_id"] = item.InstanceTenantID - respItem["id"] = item.ID - //respItem["latitude"] = item. - respItems = append(respItems, respItem) - } - return respItems -} - -func flattenSitesGetSiteParams(items *[]catalystcentersdkgo.ResponseSitesGetSiteResponse, parameters []interface{}) map[string]interface{} { +func flattenSitesGetSiteParams(items *[]catalystcentersdkgo.ResponseSitesGetSiteV1Response, parameters []interface{}) map[string]interface{} { respParams := make(map[string]interface{}) buildings := make([]map[string]interface{}, 0) parentName := getParametersOfLastUpdatedBuilding(parameters, "parent_name", "building") @@ -360,7 +236,7 @@ func flattenSitesGetSiteParams(items *[]catalystcentersdkgo.ResponseSitesGetSite } -func flattenSitesGetFloorParams(items *[]catalystcentersdkgo.ResponseSitesGetFloorResponse, parameters []interface{}) map[string]interface{} { +func flattenSitesGetFloorParams(items *[]catalystcentersdkgo.ResponseSitesGetFloorV1Response, parameters []interface{}) map[string]interface{} { respParams := make(map[string]interface{}) parentName := getParametersOfLastUpdatedBuilding(parameters, "parent_name", "floor") rfModel := getParametersOfLastUpdatedBuilding(parameters, "rf_model", "floor") @@ -436,7 +312,7 @@ func flattenSitesGetFloorParams(items *[]catalystcentersdkgo.ResponseSitesGetFlo } -func flattenSitesGetAreaParams(items *[]catalystcentersdkgo.ResponseSitesGetAreaResponse, parameters []interface{}) map[string]interface{} { +func flattenSitesGetAreaParams(items *[]catalystcentersdkgo.ResponseSitesGetAreaV1Response, parameters []interface{}) map[string]interface{} { respParams := make(map[string]interface{}) areas := make([]map[string]interface{}, 0) parentName := getParametersOfLastUpdatedBuilding(parameters, "parent_name", "area") @@ -467,7 +343,7 @@ func flattenSitesGetAreaParams(items *[]catalystcentersdkgo.ResponseSitesGetArea } /* -func flattenSitesGetSiteItem(item *catalystcentersdkgo.ResponseSitesGetSiteResponse) []map[string]interface{} { +func flattenSitesGetSiteItem(item *catalystcentersdkgo.ResponseSitesGetSiteV1Response) []map[string]interface{} { if item == nil { return nil } @@ -483,7 +359,7 @@ func flattenSitesGetSiteItem(item *catalystcentersdkgo.ResponseSitesGetSiteRespo return respItems }*/ -func flattenSitesGetSiteItemsAdditionalInfo(items []catalystcentersdkgo.ResponseSitesGetSiteResponseAdditionalInfo, parameters []interface{}) []map[string]interface{} { +func flattenSitesGetSiteItemsAdditionalInfo(items []catalystcentersdkgo.ResponseSitesGetSiteV1ResponseAdditionalInfo, parameters []interface{}) []map[string]interface{} { var respItems []map[string]interface{} var parentName string if parameters != nil { @@ -517,7 +393,7 @@ func flattenSitesGetSiteItemsAdditionalInfo(items []catalystcentersdkgo.Response return respItems } -func flattenSitesGetFloorItemsAdditionalInfo(items []catalystcentersdkgo.ResponseSitesGetFloorResponseAdditionalInfo) []map[string]interface{} { +func flattenSitesGetFloorItemsAdditionalInfo(items []catalystcentersdkgo.ResponseSitesGetFloorV1ResponseAdditionalInfo) []map[string]interface{} { var respItems []map[string]interface{} for _, item := range items { respItem := make(map[string]interface{}) @@ -538,7 +414,7 @@ func flattenSitesGetFloorItemsAdditionalInfo(items []catalystcentersdkgo.Respons return respItems } -func flattenSitesGetAreaItemsAdditionalInfo(items []catalystcentersdkgo.ResponseSitesGetAreaResponseAdditionalInfo, parameters []interface{}) []map[string]interface{} { +func flattenSitesGetAreaItemsAdditionalInfo(items []catalystcentersdkgo.ResponseSitesGetAreaV1ResponseAdditionalInfo, parameters []interface{}) []map[string]interface{} { var respItems []map[string]interface{} var parentName string if parameters != nil { @@ -562,7 +438,7 @@ func flattenSitesGetAreaItemsAdditionalInfo(items []catalystcentersdkgo.Response return respItems } -func flattenSitesGetSiteItemsAdditionalInfoAtributes(item *catalystcentersdkgo.ResponseSitesGetSiteResponseAdditionalInfoAttributes) map[string]interface{} { +func flattenSitesGetSiteItemsAdditionalInfoAtributes(item *catalystcentersdkgo.ResponseSitesGetSiteV1ResponseAdditionalInfoAttributes) map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_count.go b/catalystcenter/data_source_site_count.go index 88cc50b..e6740b0 100644 --- a/catalystcenter/data_source_site_count.go +++ b/catalystcenter/data_source_site_count.go @@ -59,31 +59,31 @@ func dataSourceSiteCountRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteCount") - queryParams1 := catalystcentersdkgo.GetSiteCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteCountV1") + queryParams1 := catalystcentersdkgo.GetSiteCountV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) } - response1, restyResp1, err := client.Sites.GetSiteCount(&queryParams1) + response1, restyResp1, err := client.Sites.GetSiteCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteCount", err, - "Failure at GetSiteCount, unexpected response", "")) + "Failure when executing 2 GetSiteCountV1", err, + "Failure at GetSiteCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSitesGetSiteCountItem(response1) + vItem1 := flattenSitesGetSiteCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteCount response", + "Failure when setting GetSiteCountV1 response", err)) return diags } @@ -95,7 +95,7 @@ func dataSourceSiteCountRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenSitesGetSiteCountItem(item *catalystcentersdkgo.ResponseSitesGetSiteCount) []map[string]interface{} { +func flattenSitesGetSiteCountV1Item(item *catalystcentersdkgo.ResponseSitesGetSiteCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_health.go b/catalystcenter/data_source_site_health.go index 751e3bc..51d9443 100644 --- a/catalystcenter/data_source_site_health.go +++ b/catalystcenter/data_source_site_health.go @@ -591,8 +591,8 @@ func dataSourceSiteHealthRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteHealth") - queryParams1 := catalystcentersdkgo.GetSiteHealthQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteHealthV1") + queryParams1 := catalystcentersdkgo.GetSiteHealthV1QueryParams{} if okSiteType { queryParams1.SiteType = vSiteType.(string) @@ -607,24 +607,24 @@ func dataSourceSiteHealthRead(ctx context.Context, d *schema.ResourceData, m int queryParams1.Timestamp = vTimestamp.(float64) } - response1, restyResp1, err := client.Sites.GetSiteHealth(&queryParams1) + response1, restyResp1, err := client.Sites.GetSiteHealthV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteHealth", err, - "Failure at GetSiteHealth, unexpected response", "")) + "Failure when executing 2 GetSiteHealthV1", err, + "Failure at GetSiteHealthV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSitesGetSiteHealthItems(response1.Response) + vItems1 := flattenSitesGetSiteHealthV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteHealth response", + "Failure when setting GetSiteHealthV1 response", err)) return diags } @@ -636,7 +636,7 @@ func dataSourceSiteHealthRead(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenSitesGetSiteHealthItems(items *[]catalystcentersdkgo.ResponseSitesGetSiteHealthResponse) []map[string]interface{} { +func flattenSitesGetSiteHealthV1Items(items *[]catalystcentersdkgo.ResponseSitesGetSiteHealthV1Response) []map[string]interface{} { if items == nil { return nil } @@ -690,19 +690,19 @@ func flattenSitesGetSiteHealthItems(items *[]catalystcentersdkgo.ResponseSitesGe respItem["switch_device_good_count"] = item.SwitchDeviceGoodCount respItem["switch_device_total_count"] = item.SwitchDeviceTotalCount respItem["application_health"] = item.ApplicationHealth - respItem["application_health_info"] = flattenSitesGetSiteHealthItemsApplicationHealthInfo(item.ApplicationHealthInfo) + respItem["application_health_info"] = flattenSitesGetSiteHealthV1ItemsApplicationHealthInfo(item.ApplicationHealthInfo) respItem["application_good_count"] = item.ApplicationGoodCount respItem["application_total_count"] = item.ApplicationTotalCount respItem["application_bytes_total_count"] = item.ApplicationBytesTotalCount - respItem["dnac_info"] = flattenSitesGetSiteHealthItemsDnacInfo(item.DnacInfo) + respItem["dnac_info"] = flattenSitesGetSiteHealthV1ItemsDnacInfo(item.DnacInfo) respItem["usage"] = item.Usage - respItem["application_health_stats"] = flattenSitesGetSiteHealthItemsApplicationHealthStats(item.ApplicationHealthStats) + respItem["application_health_stats"] = flattenSitesGetSiteHealthV1ItemsApplicationHealthStats(item.ApplicationHealthStats) respItems = append(respItems, respItem) } return respItems } -func flattenSitesGetSiteHealthItemsApplicationHealthInfo(items *[]catalystcentersdkgo.ResponseSitesGetSiteHealthResponseApplicationHealthInfo) []map[string]interface{} { +func flattenSitesGetSiteHealthV1ItemsApplicationHealthInfo(items *[]catalystcentersdkgo.ResponseSitesGetSiteHealthV1ResponseApplicationHealthInfo) []map[string]interface{} { if items == nil { return nil } @@ -717,7 +717,7 @@ func flattenSitesGetSiteHealthItemsApplicationHealthInfo(items *[]catalystcenter return respItems } -func flattenSitesGetSiteHealthItemsDnacInfo(item *catalystcentersdkgo.ResponseSitesGetSiteHealthResponseDnacInfo) []map[string]interface{} { +func flattenSitesGetSiteHealthV1ItemsDnacInfo(item *catalystcentersdkgo.ResponseSitesGetSiteHealthV1ResponseDnacInfo) []map[string]interface{} { if item == nil { return nil } @@ -732,15 +732,15 @@ func flattenSitesGetSiteHealthItemsDnacInfo(item *catalystcentersdkgo.ResponseSi } -func flattenSitesGetSiteHealthItemsApplicationHealthStats(item *catalystcentersdkgo.ResponseSitesGetSiteHealthResponseApplicationHealthStats) []map[string]interface{} { +func flattenSitesGetSiteHealthV1ItemsApplicationHealthStats(item *catalystcentersdkgo.ResponseSitesGetSiteHealthV1ResponseApplicationHealthStats) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["app_total_count"] = item.AppTotalCount - respItem["business_relevant_app_count"] = flattenSitesGetSiteHealthItemsApplicationHealthStatsBusinessRelevantAppCount(item.BusinessRelevantAppCount) - respItem["business_irrelevant_app_count"] = flattenSitesGetSiteHealthItemsApplicationHealthStatsBusinessIrrelevantAppCount(item.BusinessIrrelevantAppCount) - respItem["default_health_app_count"] = flattenSitesGetSiteHealthItemsApplicationHealthStatsDefaultHealthAppCount(item.DefaultHealthAppCount) + respItem["business_relevant_app_count"] = flattenSitesGetSiteHealthV1ItemsApplicationHealthStatsBusinessRelevantAppCount(item.BusinessRelevantAppCount) + respItem["business_irrelevant_app_count"] = flattenSitesGetSiteHealthV1ItemsApplicationHealthStatsBusinessIrrelevantAppCount(item.BusinessIrrelevantAppCount) + respItem["default_health_app_count"] = flattenSitesGetSiteHealthV1ItemsApplicationHealthStatsDefaultHealthAppCount(item.DefaultHealthAppCount) return []map[string]interface{}{ respItem, @@ -748,7 +748,7 @@ func flattenSitesGetSiteHealthItemsApplicationHealthStats(item *catalystcentersd } -func flattenSitesGetSiteHealthItemsApplicationHealthStatsBusinessRelevantAppCount(item *catalystcentersdkgo.ResponseSitesGetSiteHealthResponseApplicationHealthStatsBusinessRelevantAppCount) []map[string]interface{} { +func flattenSitesGetSiteHealthV1ItemsApplicationHealthStatsBusinessRelevantAppCount(item *catalystcentersdkgo.ResponseSitesGetSiteHealthV1ResponseApplicationHealthStatsBusinessRelevantAppCount) []map[string]interface{} { if item == nil { return nil } @@ -763,7 +763,7 @@ func flattenSitesGetSiteHealthItemsApplicationHealthStatsBusinessRelevantAppCoun } -func flattenSitesGetSiteHealthItemsApplicationHealthStatsBusinessIrrelevantAppCount(item *catalystcentersdkgo.ResponseSitesGetSiteHealthResponseApplicationHealthStatsBusinessIrrelevantAppCount) []map[string]interface{} { +func flattenSitesGetSiteHealthV1ItemsApplicationHealthStatsBusinessIrrelevantAppCount(item *catalystcentersdkgo.ResponseSitesGetSiteHealthV1ResponseApplicationHealthStatsBusinessIrrelevantAppCount) []map[string]interface{} { if item == nil { return nil } @@ -778,7 +778,7 @@ func flattenSitesGetSiteHealthItemsApplicationHealthStatsBusinessIrrelevantAppCo } -func flattenSitesGetSiteHealthItemsApplicationHealthStatsDefaultHealthAppCount(item *catalystcentersdkgo.ResponseSitesGetSiteHealthResponseApplicationHealthStatsDefaultHealthAppCount) []map[string]interface{} { +func flattenSitesGetSiteHealthV1ItemsApplicationHealthStatsDefaultHealthAppCount(item *catalystcentersdkgo.ResponseSitesGetSiteHealthV1ResponseApplicationHealthStatsDefaultHealthAppCount) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_health_summaries.go b/catalystcenter/data_source_site_health_summaries.go index e5faa3c..101ff7f 100644 --- a/catalystcenter/data_source_site_health_summaries.go +++ b/catalystcenter/data_source_site_health_summaries.go @@ -16,24 +16,24 @@ func dataSourceSiteHealthSummaries() *schema.Resource { Description: `It performs read operation on Sites. - Get a paginated list of site health summaries. Use the available query parameters to identify a subset of sites you -want health summaries for. This data source provides the latest health data from a given 'endTime' If data is not ready +want health summaries for. This data source provides the latest health data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, since we are not a real time -system. When 'endTime' is not provided, the API returns the latest data. This data source also provides issue data. The -'startTime' query param can be used to specify the beginning point of time range to retrieve the active issue counts in. -When this param is not provided, the default 'startTime' will be 24 hours before endTime. Valid values for 'sortBy' -param in this API are limited to the attributes provided in the 'site' view. Default sortBy is 'siteHierarchy' in order +system. When *endTime* is not provided, the API returns the latest data. This data source also provides issue data. The +*startTime* query param can be used to specify the beginning point of time range to retrieve the active issue counts in. +When this param is not provided, the default *startTime* will be 24 hours before endTime. Valid values for *sortBy* +param in this API are limited to the attributes provided in the *site* view. Default sortBy is 'siteHierarchy' in order 'asc' (ascending). For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- siteHealthSummaries-1.0.3-resolved.yaml - Get a health summary for a specific site by providing the unique site id in the url path. This data source provides -the latest health data from a given 'endTime' If data is not ready for the provided endTime, the request will fail, and +the latest health data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur -if the provided endTime=currentTime, since we are not a real time system. When 'endTime' is not provided, the API -returns the latest data. This data source also provides issue data. The 'startTime' query param can be used to specify +if the provided endTime=currentTime, since we are not a real time system. When *endTime* is not provided, the API +returns the latest data. This data source also provides issue data. The *startTime* query param can be used to specify the beginning point of time range to retrieve the active issue counts in. When this param is not provided, the default -'startTime' will be 24 hours before endTime. For detailed information about the usage of the API, please refer to the +*startTime* will be 24 hours before endTime. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.yaml `, @@ -82,31 +82,31 @@ attribute=siteHierarchy&attribute=clientCount (multiple attributes requested) Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_type": &schema.Schema{ Description: `siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) `, Type: schema.TypeString, Optional: true, @@ -119,7 +119,7 @@ Examples: }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -769,10 +769,10 @@ func dataSourceSiteHealthSummariesRead(ctx context.Context, d *schema.ResourceDa selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReadListOfSiteHealthSummaries") + log.Printf("[DEBUG] Selected method: ReadListOfSiteHealthSummariesV1") - headerParams1 := catalystcentersdkgo.ReadListOfSiteHealthSummariesHeaderParams{} - queryParams1 := catalystcentersdkgo.ReadListOfSiteHealthSummariesQueryParams{} + headerParams1 := catalystcentersdkgo.ReadListOfSiteHealthSummariesV1HeaderParams{} + queryParams1 := catalystcentersdkgo.ReadListOfSiteHealthSummariesV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -814,24 +814,24 @@ func dataSourceSiteHealthSummariesRead(ctx context.Context, d *schema.ResourceDa headerParams1.XCaLLERID = vXCaLLERID.(string) } - response1, restyResp1, err := client.Sites.ReadListOfSiteHealthSummaries(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Sites.ReadListOfSiteHealthSummariesV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReadListOfSiteHealthSummaries", err, - "Failure at ReadListOfSiteHealthSummaries, unexpected response", "")) + "Failure when executing 2 ReadListOfSiteHealthSummariesV1", err, + "Failure at ReadListOfSiteHealthSummariesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSitesReadListOfSiteHealthSummariesItems(response1.Response) + vItems1 := flattenSitesReadListOfSiteHealthSummariesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ReadListOfSiteHealthSummaries response", + "Failure when setting ReadListOfSiteHealthSummariesV1 response", err)) return diags } @@ -841,11 +841,11 @@ func dataSourceSiteHealthSummariesRead(ctx context.Context, d *schema.ResourceDa } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: ReadSiteHealthSummaryDataBySiteID") + log.Printf("[DEBUG] Selected method: ReadSiteHealthSummaryDataBySiteIDV1") vvID := vID.(string) - headerParams2 := catalystcentersdkgo.ReadSiteHealthSummaryDataBySiteIDHeaderParams{} - queryParams2 := catalystcentersdkgo.ReadSiteHealthSummaryDataBySiteIDQueryParams{} + headerParams2 := catalystcentersdkgo.ReadSiteHealthSummaryDataBySiteIDV1HeaderParams{} + queryParams2 := catalystcentersdkgo.ReadSiteHealthSummaryDataBySiteIDV1QueryParams{} if okStartTime { queryParams2.StartTime = vStartTime.(float64) @@ -863,24 +863,24 @@ func dataSourceSiteHealthSummariesRead(ctx context.Context, d *schema.ResourceDa headerParams2.XCaLLERID = vXCaLLERID.(string) } - response2, restyResp2, err := client.Sites.ReadSiteHealthSummaryDataBySiteID(vvID, &headerParams2, &queryParams2) + response2, restyResp2, err := client.Sites.ReadSiteHealthSummaryDataBySiteIDV1(vvID, &headerParams2, &queryParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReadSiteHealthSummaryDataBySiteID", err, - "Failure at ReadSiteHealthSummaryDataBySiteID, unexpected response", "")) + "Failure when executing 2 ReadSiteHealthSummaryDataBySiteIDV1", err, + "Failure at ReadSiteHealthSummaryDataBySiteIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenSitesReadSiteHealthSummaryDataBySiteIDItem(response2.Response) + vItem2 := flattenSitesReadSiteHealthSummaryDataBySiteIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting ReadSiteHealthSummaryDataBySiteID response", + "Failure when setting ReadSiteHealthSummaryDataBySiteIDV1 response", err)) return diags } @@ -892,7 +892,7 @@ func dataSourceSiteHealthSummariesRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenSitesReadListOfSiteHealthSummariesItems(items *[]catalystcentersdkgo.ResponseSitesReadListOfSiteHealthSummariesResponse) []map[string]interface{} { +func flattenSitesReadListOfSiteHealthSummariesV1Items(items *[]catalystcentersdkgo.ResponseSitesReadListOfSiteHealthSummariesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -952,7 +952,7 @@ func flattenSitesReadListOfSiteHealthSummariesItems(items *[]catalystcentersdkgo return respItems } -func flattenSitesReadSiteHealthSummaryDataBySiteIDItem(item *catalystcentersdkgo.ResponseSitesReadSiteHealthSummaryDataBySiteIDResponse) []map[string]interface{} { +func flattenSitesReadSiteHealthSummaryDataBySiteIDV1Item(item *catalystcentersdkgo.ResponseSitesReadSiteHealthSummaryDataBySiteIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_health_summaries_count.go b/catalystcenter/data_source_site_health_summaries_count.go index f18e5b4..e45ac1f 100644 --- a/catalystcenter/data_source_site_health_summaries_count.go +++ b/catalystcenter/data_source_site_health_summaries_count.go @@ -16,9 +16,9 @@ func dataSourceSiteHealthSummariesCount() *schema.Resource { Description: `It performs read operation on Sites. - Get a count of sites. Use the available query parameters to get the count of a subset of sites. This data source -provides the latest data from a given 'endTime' If data is not ready for the provided endTime, the request will fail, +provides the latest data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may -occur if the provided endTime=currentTime, since we are not a real time system. When 'endTime' is not provided, the API +occur if the provided endTime=currentTime, since we are not a real time system. When *endTime* is not provided, the API returns the latest data. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- siteHealthSummaries-1.0.3-resolved.yaml @@ -39,31 +39,31 @@ siteHealthSummaries-1.0.3-resolved.yaml Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_type": &schema.Schema{ Description: `siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) `, Type: schema.TypeString, Optional: true, @@ -106,10 +106,10 @@ func dataSourceSiteHealthSummariesCountRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReadSiteCount") + log.Printf("[DEBUG] Selected method: ReadSiteCountV1") - headerParams1 := catalystcentersdkgo.ReadSiteCountHeaderParams{} - queryParams1 := catalystcentersdkgo.ReadSiteCountQueryParams{} + headerParams1 := catalystcentersdkgo.ReadSiteCountV1HeaderParams{} + queryParams1 := catalystcentersdkgo.ReadSiteCountV1QueryParams{} if okEndTime { queryParams1.EndTime = vEndTime.(float64) @@ -128,24 +128,24 @@ func dataSourceSiteHealthSummariesCountRead(ctx context.Context, d *schema.Resou } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Sites.ReadSiteCount(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Sites.ReadSiteCountV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReadSiteCount", err, - "Failure at ReadSiteCount, unexpected response", "")) + "Failure when executing 2 ReadSiteCountV1", err, + "Failure at ReadSiteCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSitesReadSiteCountItem(response1.Response) + vItem1 := flattenSitesReadSiteCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReadSiteCount response", + "Failure when setting ReadSiteCountV1 response", err)) return diags } @@ -157,7 +157,7 @@ func dataSourceSiteHealthSummariesCountRead(ctx context.Context, d *schema.Resou return diags } -func flattenSitesReadSiteCountItem(item *catalystcentersdkgo.ResponseSitesReadSiteCountResponse) []map[string]interface{} { +func flattenSitesReadSiteCountV1Item(item *catalystcentersdkgo.ResponseSitesReadSiteCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_health_summaries_summary_analytics.go b/catalystcenter/data_source_site_health_summaries_summary_analytics.go index 51a2e00..e1c94c5 100644 --- a/catalystcenter/data_source_site_health_summaries_summary_analytics.go +++ b/catalystcenter/data_source_site_health_summaries_summary_analytics.go @@ -16,14 +16,14 @@ func dataSourceSiteHealthSummariesSummaryAnalytics() *schema.Resource { Description: `It performs read operation on Sites. - Get an aggregated summary of all site health or use the query params to get an aggregated summary of health for a -subset of sites. This data source provides the latest health data from a given 'endTime' If data is not ready for the +subset of sites. This data source provides the latest health data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, since we are not a real time system. -When 'endTime' is not provided, the API returns the latest data. This data source also provides issue data. The -'startTime' query param can be used to specify the beginning point of time range to retrieve the active issue counts in. -When this param is not provided, the default 'startTime' will be 24 hours before endTime. Aggregated response data will -NOT have unique identifier data populated. List of unique identifier data: ['id', 'siteHierarchy', 'siteHierarchyId', -'siteType', 'latitude', 'longitude']. For detailed information about the usage of the API, please refer to the Open API +When *endTime* is not provided, the API returns the latest data. This data source also provides issue data. The +*startTime* query param can be used to specify the beginning point of time range to retrieve the active issue counts in. +When this param is not provided, the default *startTime* will be 24 hours before endTime. Aggregated response data will +NOT have unique identifier data populated. List of unique identifier data: [*id*, *siteHierarchy*, *siteHierarchyId*, +*siteType*, *latitude*, *longitude*]. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.yaml `, @@ -54,38 +54,38 @@ attribute=siteHierarchy&attribute=clientCount (multiple attributes requested) Optional: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, }, "site_type": &schema.Schema{ Description: `siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) `, Type: schema.TypeString, Optional: true, }, "start_time": &schema.Schema{ Description: `startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. `, Type: schema.TypeFloat, Optional: true, @@ -429,10 +429,10 @@ func dataSourceSiteHealthSummariesSummaryAnalyticsRead(ctx context.Context, d *s selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReadAnAggregatedSummaryOfSiteHealthData") + log.Printf("[DEBUG] Selected method: ReadAnAggregatedSummaryOfSiteHealthDataV1") - headerParams1 := catalystcentersdkgo.ReadAnAggregatedSummaryOfSiteHealthDataHeaderParams{} - queryParams1 := catalystcentersdkgo.ReadAnAggregatedSummaryOfSiteHealthDataQueryParams{} + headerParams1 := catalystcentersdkgo.ReadAnAggregatedSummaryOfSiteHealthDataV1HeaderParams{} + queryParams1 := catalystcentersdkgo.ReadAnAggregatedSummaryOfSiteHealthDataV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(float64) @@ -460,24 +460,24 @@ func dataSourceSiteHealthSummariesSummaryAnalyticsRead(ctx context.Context, d *s } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Sites.ReadAnAggregatedSummaryOfSiteHealthData(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Sites.ReadAnAggregatedSummaryOfSiteHealthDataV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReadAnAggregatedSummaryOfSiteHealthData", err, - "Failure at ReadAnAggregatedSummaryOfSiteHealthData, unexpected response", "")) + "Failure when executing 2 ReadAnAggregatedSummaryOfSiteHealthDataV1", err, + "Failure at ReadAnAggregatedSummaryOfSiteHealthDataV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSitesReadAnAggregatedSummaryOfSiteHealthDataItem(response1.Response) + vItem1 := flattenSitesReadAnAggregatedSummaryOfSiteHealthDataV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReadAnAggregatedSummaryOfSiteHealthData response", + "Failure when setting ReadAnAggregatedSummaryOfSiteHealthDataV1 response", err)) return diags } @@ -489,7 +489,7 @@ func dataSourceSiteHealthSummariesSummaryAnalyticsRead(ctx context.Context, d *s return diags } -func flattenSitesReadAnAggregatedSummaryOfSiteHealthDataItem(item *catalystcentersdkgo.ResponseSitesReadAnAggregatedSummaryOfSiteHealthDataResponse) []map[string]interface{} { +func flattenSitesReadAnAggregatedSummaryOfSiteHealthDataV1Item(item *catalystcentersdkgo.ResponseSitesReadAnAggregatedSummaryOfSiteHealthDataV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_membership.go b/catalystcenter/data_source_site_membership.go index 4b76b09..da57f07 100644 --- a/catalystcenter/data_source_site_membership.go +++ b/catalystcenter/data_source_site_membership.go @@ -129,9 +129,9 @@ func dataSourceSiteMembershipRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMembership") + log.Printf("[DEBUG] Selected method: GetMembershipV1") vvSiteID := vSiteID.(string) - queryParams1 := catalystcentersdkgo.GetMembershipQueryParams{} + queryParams1 := catalystcentersdkgo.GetMembershipV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -146,24 +146,24 @@ func dataSourceSiteMembershipRead(ctx context.Context, d *schema.ResourceData, m queryParams1.SerialNumber = vSerialNumber.(string) } - response1, restyResp1, err := client.Sites.GetMembership(vvSiteID, &queryParams1) + response1, restyResp1, err := client.Sites.GetMembershipV1(vvSiteID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetMembership", err, - "Failure at GetMembership, unexpected response", "")) + "Failure when executing 2 GetMembershipV1", err, + "Failure at GetMembershipV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSitesGetMembershipItem(response1) + vItem1 := flattenSitesGetMembershipV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMembership response", + "Failure when setting GetMembershipV1 response", err)) return diags } @@ -175,24 +175,24 @@ func dataSourceSiteMembershipRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSitesGetMembershipItem(item *catalystcentersdkgo.ResponseSitesGetMembership) []map[string]interface{} { +func flattenSitesGetMembershipV1Item(item *catalystcentersdkgo.ResponseSitesGetMembershipV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["site"] = flattenSitesGetMembershipItemSite(item.Site) - respItem["device"] = flattenSitesGetMembershipItemDevice(item.Device) + respItem["site"] = flattenSitesGetMembershipV1ItemSite(item.Site) + respItem["device"] = flattenSitesGetMembershipV1ItemDevice(item.Device) return []map[string]interface{}{ respItem, } } -func flattenSitesGetMembershipItemSite(item *catalystcentersdkgo.ResponseSitesGetMembershipSite) []map[string]interface{} { +func flattenSitesGetMembershipV1ItemSite(item *catalystcentersdkgo.ResponseSitesGetMembershipV1Site) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["response"] = flattenSitesGetMembershipItemSiteResponse(item.Response) + respItem["response"] = flattenSitesGetMembershipV1ItemSiteResponse(item.Response) respItem["version"] = item.Version return []map[string]interface{}{ @@ -201,7 +201,7 @@ func flattenSitesGetMembershipItemSite(item *catalystcentersdkgo.ResponseSitesGe } -func flattenSitesGetMembershipItemSiteResponse(items *[]catalystcentersdkgo.ResponseSitesGetMembershipSiteResponse) []interface{} { +func flattenSitesGetMembershipV1ItemSiteResponse(items *[]catalystcentersdkgo.ResponseSitesGetMembershipV1SiteResponse) []interface{} { if items == nil { return nil } @@ -213,14 +213,14 @@ func flattenSitesGetMembershipItemSiteResponse(items *[]catalystcentersdkgo.Resp return respItems } -func flattenSitesGetMembershipItemDevice(items *[]catalystcentersdkgo.ResponseSitesGetMembershipDevice) []map[string]interface{} { +func flattenSitesGetMembershipV1ItemDevice(items *[]catalystcentersdkgo.ResponseSitesGetMembershipV1Device) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["response"] = flattenSitesGetMembershipItemDeviceResponse(item.Response) + respItem["response"] = flattenSitesGetMembershipV1ItemDeviceResponse(item.Response) respItem["version"] = item.Version respItem["site_id"] = item.SiteID respItems = append(respItems, respItem) @@ -228,7 +228,7 @@ func flattenSitesGetMembershipItemDevice(items *[]catalystcentersdkgo.ResponseSi return respItems } -func flattenSitesGetMembershipItemDeviceResponse(items *[]catalystcentersdkgo.ResponseSitesGetMembershipDeviceResponse) []interface{} { +func flattenSitesGetMembershipV1ItemDeviceResponse(items *[]catalystcentersdkgo.ResponseSitesGetMembershipV1DeviceResponse) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_site_wise_product_names.go b/catalystcenter/data_source_site_wise_product_names.go index e79b8bf..d24912f 100644 --- a/catalystcenter/data_source_site_wise_product_names.go +++ b/catalystcenter/data_source_site_wise_product_names.go @@ -15,7 +15,7 @@ func dataSourceSiteWiseProductNames() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Software Image Management (SWIM). -- Provides network device product names for a site. The default value of 'siteId' is global. The response will include +- Provides network device product names for a site. The default value of *siteId* is global. The response will include the network device count and image summary. `, @@ -53,7 +53,7 @@ the network device count and image summary. Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `The unique identifier for the record is the 'id'. If there is no supervisor engine involved, the 'id' will be the same as the 'productNameOrdinal'. However, if the supervisor engine is applicable, the 'id' will be in the form of '-'. + Description: `The unique identifier for the record is the *id*. If there is no supervisor engine involved, the *id* will be the same as the *productNameOrdinal*. However, if the supervisor engine is applicable, the *id* will be in the form of *-*. `, Type: schema.TypeString, Computed: true, @@ -111,14 +111,14 @@ the network device count and image summary. }, "supervisor_product_name": &schema.Schema{ - Description: `Name of the Supervisor Engine Module, supported by the 'productName'. Example: The 'Cisco Catalyst 9404R Switch' chassis is capable of supporting different supervisor engine modules: the 'Cisco Catalyst 9400 Supervisor Engine-1', the 'Cisco Catalyst 9400 Supervisor Engine-1XL', the 'Cisco Catalyst 9400 Supervisor Engine-1XL-Y', etc. + Description: `Name of the Supervisor Engine Module, supported by the *productName*. Example: The *Cisco Catalyst 9404R Switch* chassis is capable of supporting different supervisor engine modules: the *Cisco Catalyst 9400 Supervisor Engine-1*, the *Cisco Catalyst 9400 Supervisor Engine-1XL*, the *Cisco Catalyst 9400 Supervisor Engine-1XL-Y*, etc. `, Type: schema.TypeString, Computed: true, }, "supervisor_product_name_ordinal": &schema.Schema{ - Description: `Supervisor Engine Module Ordinal, supported by the 'productNameOrdinal'. Example: The '286315691' chassis ordinal is capable of supporting different supervisor engine module ordinals: '286316172', '286316710', '286320394' etc. + Description: `Supervisor Engine Module Ordinal, supported by the *productNameOrdinal*. Example: The *286315691* chassis ordinal is capable of supporting different supervisor engine module ordinals: *286316172*, *286316710*, *286320394* etc. `, Type: schema.TypeFloat, Computed: true, @@ -141,8 +141,8 @@ func dataSourceSiteWiseProductNamesRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsNetworkDeviceProductNamesForASite") - queryParams1 := catalystcentersdkgo.ReturnsNetworkDeviceProductNamesForASiteQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnsNetworkDeviceProductNamesForASiteV1") + queryParams1 := catalystcentersdkgo.ReturnsNetworkDeviceProductNamesForASiteV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -157,24 +157,24 @@ func dataSourceSiteWiseProductNamesRead(ctx context.Context, d *schema.ResourceD queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsNetworkDeviceProductNamesForASite(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsNetworkDeviceProductNamesForASiteV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsNetworkDeviceProductNamesForASite", err, - "Failure at ReturnsNetworkDeviceProductNamesForASite, unexpected response", "")) + "Failure when executing 2 ReturnsNetworkDeviceProductNamesForASiteV1", err, + "Failure at ReturnsNetworkDeviceProductNamesForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsNetworkDeviceProductNamesForASite response", + "Failure when setting ReturnsNetworkDeviceProductNamesForASiteV1 response", err)) return diags } @@ -186,7 +186,7 @@ func dataSourceSiteWiseProductNamesRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteV1Response) []map[string]interface{} { if item == nil { return nil } @@ -197,13 +197,13 @@ func flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteI respItem["supervisor_product_name"] = item.SupervisorProductName respItem["supervisor_product_name_ordinal"] = item.SupervisorProductNameOrdinal respItem["network_device_count"] = item.NetworkDeviceCount - respItem["image_summary"] = flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteItemImageSummary(item.ImageSummary) + respItem["image_summary"] = flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteV1ItemImageSummary(item.ImageSummary) return []map[string]interface{}{ respItem, } } -func flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteItemImageSummary(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteResponseImageSummary) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteV1ItemImageSummary(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsNetworkDeviceProductNamesForASiteV1ResponseImageSummary) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_site_wise_product_names_count.go b/catalystcenter/data_source_site_wise_product_names_count.go index d2e0900..cda0d85 100644 --- a/catalystcenter/data_source_site_wise_product_names_count.go +++ b/catalystcenter/data_source_site_wise_product_names_count.go @@ -15,7 +15,7 @@ func dataSourceSiteWiseProductNamesCount() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Software Image Management (SWIM). -- Returns the count of network device product names for given filters. The default value of 'siteId' is global. +- Returns the count of network device product names for given filters. The default value of *siteId* is global. `, ReadContext: dataSourceSiteWiseProductNamesCountRead, @@ -61,8 +61,8 @@ func dataSourceSiteWiseProductNamesCountRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsTheCountOfNetworkDeviceProductNamesForASite") - queryParams1 := catalystcentersdkgo.ReturnsTheCountOfNetworkDeviceProductNamesForASiteQueryParams{} + log.Printf("[DEBUG] Selected method: ReturnsTheCountOfNetworkDeviceProductNamesForASiteV1") + queryParams1 := catalystcentersdkgo.ReturnsTheCountOfNetworkDeviceProductNamesForASiteV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -71,24 +71,24 @@ func dataSourceSiteWiseProductNamesCountRead(ctx context.Context, d *schema.Reso queryParams1.ProductName = vProductName.(string) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsTheCountOfNetworkDeviceProductNamesForASite(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.ReturnsTheCountOfNetworkDeviceProductNamesForASiteV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsTheCountOfNetworkDeviceProductNamesForASite", err, - "Failure at ReturnsTheCountOfNetworkDeviceProductNamesForASite, unexpected response", "")) + "Failure when executing 2 ReturnsTheCountOfNetworkDeviceProductNamesForASiteV1", err, + "Failure at ReturnsTheCountOfNetworkDeviceProductNamesForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimReturnsTheCountOfNetworkDeviceProductNamesForASiteItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimReturnsTheCountOfNetworkDeviceProductNamesForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsTheCountOfNetworkDeviceProductNamesForASite response", + "Failure when setting ReturnsTheCountOfNetworkDeviceProductNamesForASiteV1 response", err)) return diags } @@ -100,7 +100,7 @@ func dataSourceSiteWiseProductNamesCountRead(ctx context.Context, d *schema.Reso return diags } -func flattenSoftwareImageManagementSwimReturnsTheCountOfNetworkDeviceProductNamesForASiteItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsTheCountOfNetworkDeviceProductNamesForASiteResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimReturnsTheCountOfNetworkDeviceProductNamesForASiteV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimReturnsTheCountOfNetworkDeviceProductNamesForASiteV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites.go b/catalystcenter/data_source_sites.go index 40117dc..998e860 100644 --- a/catalystcenter/data_source_sites.go +++ b/catalystcenter/data_source_sites.go @@ -186,8 +186,8 @@ func dataSourceSitesRead(ctx context.Context, d *schema.ResourceData, m interfac selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSites") - queryParams1 := catalystcentersdkgo.GetSitesQueryParams{} + log.Printf("[DEBUG] Selected method: GetSitesV1") + queryParams1 := catalystcentersdkgo.GetSitesV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -208,24 +208,24 @@ func dataSourceSitesRead(ctx context.Context, d *schema.ResourceData, m interfac queryParams1.Limit = vLimit.(int) } - response1, restyResp1, err := client.SiteDesign.GetSites(&queryParams1) + response1, restyResp1, err := client.SiteDesign.GetSitesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSites", err, - "Failure at GetSites, unexpected response", "")) + "Failure when executing 2 GetSitesV1", err, + "Failure at GetSitesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSiteDesignGetSitesItems(response1.Response) + vItems1 := flattenSiteDesignGetSitesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSites response", + "Failure when setting GetSitesV1 response", err)) return diags } @@ -237,7 +237,7 @@ func dataSourceSitesRead(ctx context.Context, d *schema.ResourceData, m interfac return diags } -func flattenSiteDesignGetSitesItems(items *[]catalystcentersdkgo.ResponseSiteDesignGetSitesResponse) []map[string]interface{} { +func flattenSiteDesignGetSitesV1Items(items *[]catalystcentersdkgo.ResponseSiteDesignGetSitesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sites_aaa_settings.go b/catalystcenter/data_source_sites_aaa_settings.go index 6e62509..1e3dcde 100644 --- a/catalystcenter/data_source_sites_aaa_settings.go +++ b/catalystcenter/data_source_sites_aaa_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesAAASettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve AAA settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve AAA settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesAAASettingsRead, @@ -28,7 +28,7 @@ empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -179,32 +179,32 @@ func dataSourceSitesAAASettingsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveAAASettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveAAASettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveAAASettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveAAASettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveAAASettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveAAASettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveAAASettingsForASite", err, - "Failure at RetrieveAAASettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveAAASettingsForASiteV1", err, + "Failure at RetrieveAAASettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveAAASettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveAAASettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveAAASettingsForASite response", + "Failure when setting RetrieveAAASettingsForASiteV1 response", err)) return diags } @@ -216,19 +216,19 @@ func dataSourceSitesAAASettingsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenNetworkSettingsRetrieveAAASettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveAAASettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveAAASettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveAAASettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["aaa_network"] = flattenNetworkSettingsRetrieveAAASettingsForASiteItemAAANetwork(item.AAANetwork) - respItem["aaa_client"] = flattenNetworkSettingsRetrieveAAASettingsForASiteItemAAAClient(item.AAAClient) + respItem["aaa_network"] = flattenNetworkSettingsRetrieveAAASettingsForASiteV1ItemAAANetwork(item.AAANetwork) + respItem["aaa_client"] = flattenNetworkSettingsRetrieveAAASettingsForASiteV1ItemAAAClient(item.AAAClient) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveAAASettingsForASiteItemAAANetwork(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveAAASettingsForASiteResponseAAANetwork) []map[string]interface{} { +func flattenNetworkSettingsRetrieveAAASettingsForASiteV1ItemAAANetwork(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveAAASettingsForASiteV1ResponseAAANetwork) []map[string]interface{} { if item == nil { return nil } @@ -248,7 +248,7 @@ func flattenNetworkSettingsRetrieveAAASettingsForASiteItemAAANetwork(item *catal } -func flattenNetworkSettingsRetrieveAAASettingsForASiteItemAAAClient(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveAAASettingsForASiteResponseAAAClient) []map[string]interface{} { +func flattenNetworkSettingsRetrieveAAASettingsForASiteV1ItemAAAClient(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveAAASettingsForASiteV1ResponseAAAClient) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_banner_settings.go b/catalystcenter/data_source_sites_banner_settings.go index bac2054..3c9128b 100644 --- a/catalystcenter/data_source_sites_banner_settings.go +++ b/catalystcenter/data_source_sites_banner_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesBannerSettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve banner settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve banner settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesBannerSettingsRead, @@ -28,7 +28,7 @@ empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -91,32 +91,32 @@ func dataSourceSitesBannerSettingsRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveBannerSettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveBannerSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveBannerSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveBannerSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveBannerSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveBannerSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveBannerSettingsForASite", err, - "Failure at RetrieveBannerSettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveBannerSettingsForASiteV1", err, + "Failure at RetrieveBannerSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveBannerSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveBannerSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveBannerSettingsForASite response", + "Failure when setting RetrieveBannerSettingsForASiteV1 response", err)) return diags } @@ -128,18 +128,18 @@ func dataSourceSitesBannerSettingsRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenNetworkSettingsRetrieveBannerSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveBannerSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveBannerSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveBannerSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["banner"] = flattenNetworkSettingsRetrieveBannerSettingsForASiteItemBanner(item.Banner) + respItem["banner"] = flattenNetworkSettingsRetrieveBannerSettingsForASiteV1ItemBanner(item.Banner) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveBannerSettingsForASiteItemBanner(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveBannerSettingsForASiteResponseBanner) []map[string]interface{} { +func flattenNetworkSettingsRetrieveBannerSettingsForASiteV1ItemBanner(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveBannerSettingsForASiteV1ResponseBanner) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_count.go b/catalystcenter/data_source_sites_count.go index d4d978a..d0ef788 100644 --- a/catalystcenter/data_source_sites_count.go +++ b/catalystcenter/data_source_sites_count.go @@ -70,31 +70,31 @@ func dataSourceSitesCountRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSitesCount") - queryParams1 := catalystcentersdkgo.GetSitesCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetSitesCountV1") + queryParams1 := catalystcentersdkgo.GetSitesCountV1QueryParams{} if okName { queryParams1.Name = vName.(string) } - response1, restyResp1, err := client.SiteDesign.GetSitesCount(&queryParams1) + response1, restyResp1, err := client.SiteDesign.GetSitesCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSitesCount", err, - "Failure at GetSitesCount, unexpected response", "")) + "Failure when executing 2 GetSitesCountV1", err, + "Failure at GetSitesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSiteDesignGetSitesCountItems(response1) + vItems1 := flattenSiteDesignGetSitesCountV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSitesCount response", + "Failure when setting GetSitesCountV1 response", err)) return diags } @@ -106,21 +106,21 @@ func dataSourceSitesCountRead(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenSiteDesignGetSitesCountItems(items *catalystcentersdkgo.ResponseSiteDesignGetSitesCount) []map[string]interface{} { +func flattenSiteDesignGetSitesCountV1Items(items *catalystcentersdkgo.ResponseSiteDesignGetSitesCountV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["response"] = flattenSiteDesignGetSitesCountItemsResponse(item.Response) + respItem["response"] = flattenSiteDesignGetSitesCountV1ItemsResponse(item.Response) respItem["version"] = item.Version respItems = append(respItems, respItem) } return respItems } -func flattenSiteDesignGetSitesCountItemsResponse(item *catalystcentersdkgo.ResponseItemSiteDesignGetSitesCountResponse) []map[string]interface{} { +func flattenSiteDesignGetSitesCountV1ItemsResponse(item *catalystcentersdkgo.ResponseItemSiteDesignGetSitesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_device_credentials.go b/catalystcenter/data_source_sites_device_credentials.go index b4ca83b..c3aa4e9 100644 --- a/catalystcenter/data_source_sites_device_credentials.go +++ b/catalystcenter/data_source_sites_device_credentials.go @@ -15,21 +15,21 @@ func dataSourceSitesDeviceCredentials() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Gets device credential settings for a site; 'null' values indicate that the setting will be inherited from the parent -site; empty objects ('{}') indicate that the credential is unset, and that no credential of that type will be used for +- Gets device credential settings for a site; *null* values indicate that the setting will be inherited from the parent +site; empty objects (*{}*) indicate that the credential is unset, and that no credential of that type will be used for the site. `, ReadContext: dataSourceSitesDeviceCredentialsRead, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' + Description: `id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* `, Type: schema.TypeString, Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -48,7 +48,7 @@ the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -76,7 +76,7 @@ the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -104,7 +104,7 @@ the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -132,7 +132,7 @@ the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -160,7 +160,7 @@ the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -188,7 +188,7 @@ the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -224,32 +224,32 @@ func dataSourceSitesDeviceCredentialsRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDeviceCredentialSettingsForASite") + log.Printf("[DEBUG] Selected method: GetDeviceCredentialSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetDeviceCredentialSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceCredentialSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.GetDeviceCredentialSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.GetDeviceCredentialSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDeviceCredentialSettingsForASite", err, - "Failure at GetDeviceCredentialSettingsForASite, unexpected response", "")) + "Failure when executing 2 GetDeviceCredentialSettingsForASiteV1", err, + "Failure at GetDeviceCredentialSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceCredentialSettingsForASite response", + "Failure when setting GetDeviceCredentialSettingsForASiteV1 response", err)) return diags } @@ -261,23 +261,23 @@ func dataSourceSitesDeviceCredentialsRead(ctx context.Context, d *schema.Resourc return diags } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["cli_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemCliCredentialsID(item.CliCredentialsID) - respItem["snmpv2c_read_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv2CReadCredentialsID(item.SNMPv2CReadCredentialsID) - respItem["snmpv2c_write_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv2CWriteCredentialsID(item.SNMPv2CWriteCredentialsID) - respItem["snmpv3_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv3CredentialsID(item.SNMPv3CredentialsID) - respItem["http_read_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemHTTPReadCredentialsID(item.HTTPReadCredentialsID) - respItem["http_write_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemHTTPWriteCredentialsID(item.HTTPWriteCredentialsID) + respItem["cli_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemCliCredentialsID(item.CliCredentialsID) + respItem["snmpv2c_read_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemSNMPv2CReadCredentialsID(item.SNMPv2CReadCredentialsID) + respItem["snmpv2c_write_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemSNMPv2CWriteCredentialsID(item.SNMPv2CWriteCredentialsID) + respItem["snmpv3_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemSNMPv3CredentialsID(item.SNMPv3CredentialsID) + respItem["http_read_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemHTTPReadCredentialsID(item.HTTPReadCredentialsID) + respItem["http_write_credentials_id"] = flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemHTTPWriteCredentialsID(item.HTTPWriteCredentialsID) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemCliCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponseCliCredentialsID) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemCliCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1ResponseCliCredentialsID) []map[string]interface{} { if item == nil { return nil } @@ -292,7 +292,7 @@ func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemCliCredentials } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv2CReadCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponseSNMPv2CReadCredentialsID) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemSNMPv2CReadCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1ResponseSNMPv2CReadCredentialsID) []map[string]interface{} { if item == nil { return nil } @@ -307,7 +307,7 @@ func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv2CReadCre } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv2CWriteCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponseSNMPv2CWriteCredentialsID) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemSNMPv2CWriteCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1ResponseSNMPv2CWriteCredentialsID) []map[string]interface{} { if item == nil { return nil } @@ -322,7 +322,7 @@ func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv2CWriteCr } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv3CredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponseSNMPv3CredentialsID) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemSNMPv3CredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1ResponseSNMPv3CredentialsID) []map[string]interface{} { if item == nil { return nil } @@ -337,7 +337,7 @@ func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemSNMPv3Credenti } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemHTTPReadCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponseHTTPReadCredentialsID) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemHTTPReadCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1ResponseHTTPReadCredentialsID) []map[string]interface{} { if item == nil { return nil } @@ -352,7 +352,7 @@ func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemHTTPReadCreden } -func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItemHTTPWriteCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteResponseHTTPWriteCredentialsID) []map[string]interface{} { +func flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1ItemHTTPWriteCredentialsID(item *catalystcentersdkgo.ResponseNetworkSettingsGetDeviceCredentialSettingsForASiteV1ResponseHTTPWriteCredentialsID) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_device_credentials_status.go b/catalystcenter/data_source_sites_device_credentials_status.go index 5bb6d8f..1617724 100644 --- a/catalystcenter/data_source_sites_device_credentials_status.go +++ b/catalystcenter/data_source_sites_device_credentials_status.go @@ -139,27 +139,27 @@ func dataSourceSitesDeviceCredentialsStatusRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetNetworkDevicesCredentialsSyncStatus") + log.Printf("[DEBUG] Selected method: GetNetworkDevicesCredentialsSyncStatusV1") vvID := vID.(string) - response1, restyResp1, err := client.NetworkSettings.GetNetworkDevicesCredentialsSyncStatus(vvID) + response1, restyResp1, err := client.NetworkSettings.GetNetworkDevicesCredentialsSyncStatusV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetNetworkDevicesCredentialsSyncStatus", err, - "Failure at GetNetworkDevicesCredentialsSyncStatus, unexpected response", "")) + "Failure when executing 2 GetNetworkDevicesCredentialsSyncStatusV1", err, + "Failure at GetNetworkDevicesCredentialsSyncStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItem(response1.Response) + vItem1 := flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetNetworkDevicesCredentialsSyncStatus response", + "Failure when setting GetNetworkDevicesCredentialsSyncStatusV1 response", err)) return diags } @@ -171,21 +171,21 @@ func dataSourceSitesDeviceCredentialsStatusRead(ctx context.Context, d *schema.R return diags } -func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItem(item *catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusResponse) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["cli"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemCli(item.Cli) - respItem["snmp_v2_read"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV2Read(item.SNMPV2Read) - respItem["snmp_v2_write"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV2Write(item.SNMPV2Write) - respItem["snmp_v3"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV3(item.SNMPV3) + respItem["cli"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemCli(item.Cli) + respItem["snmp_v2_read"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemSNMPV2Read(item.SNMPV2Read) + respItem["snmp_v2_write"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemSNMPV2Write(item.SNMPV2Write) + respItem["snmp_v3"] = flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemSNMPV3(item.SNMPV3) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemCli(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusResponseCli) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemCli(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ResponseCli) []map[string]interface{} { if items == nil { return nil } @@ -199,7 +199,7 @@ func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemCli(items * return respItems } -func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV2Read(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusResponseSNMPV2Read) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemSNMPV2Read(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ResponseSNMPV2Read) []map[string]interface{} { if items == nil { return nil } @@ -213,7 +213,7 @@ func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV2Read( return respItems } -func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV2Write(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusResponseSNMPV2Write) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemSNMPV2Write(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ResponseSNMPV2Write) []map[string]interface{} { if items == nil { return nil } @@ -227,7 +227,7 @@ func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV2Write return respItems } -func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusItemSNMPV3(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusResponseSNMPV3) []map[string]interface{} { +func flattenNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ItemSNMPV3(items *[]catalystcentersdkgo.ResponseNetworkSettingsGetNetworkDevicesCredentialsSyncStatusV1ResponseSNMPV3) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sites_dhcp_settings.go b/catalystcenter/data_source_sites_dhcp_settings.go index a55a641..c3ecc33 100644 --- a/catalystcenter/data_source_sites_dhcp_settings.go +++ b/catalystcenter/data_source_sites_dhcp_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesDhcpSettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve DHCP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve DHCP settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesDhcpSettingsRead, @@ -28,7 +28,7 @@ empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -88,32 +88,32 @@ func dataSourceSitesDhcpSettingsRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveDHCPSettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveDHCPSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveDHCPSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveDHCPSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveDHCPSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveDHCPSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveDHCPSettingsForASite", err, - "Failure at RetrieveDHCPSettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveDHCPSettingsForASiteV1", err, + "Failure at RetrieveDHCPSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveDHCPSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveDHCPSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveDHCPSettingsForASite response", + "Failure when setting RetrieveDHCPSettingsForASiteV1 response", err)) return diags } @@ -125,18 +125,18 @@ func dataSourceSitesDhcpSettingsRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenNetworkSettingsRetrieveDHCPSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDHCPSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveDHCPSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDHCPSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["dhcp"] = flattenNetworkSettingsRetrieveDHCPSettingsForASiteItemDhcp(item.Dhcp) + respItem["dhcp"] = flattenNetworkSettingsRetrieveDHCPSettingsForASiteV1ItemDhcp(item.Dhcp) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveDHCPSettingsForASiteItemDhcp(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDHCPSettingsForASiteResponseDhcp) []map[string]interface{} { +func flattenNetworkSettingsRetrieveDHCPSettingsForASiteV1ItemDhcp(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDHCPSettingsForASiteV1ResponseDhcp) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_dns_settings.go b/catalystcenter/data_source_sites_dns_settings.go index 3c54196..ed00363 100644 --- a/catalystcenter/data_source_sites_dns_settings.go +++ b/catalystcenter/data_source_sites_dns_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesDNSSettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve DNS settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve DNS settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesDNSSettingsRead, @@ -28,7 +28,7 @@ empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -95,32 +95,32 @@ func dataSourceSitesDNSSettingsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveDNSSettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveDNSSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveDNSSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveDNSSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveDNSSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveDNSSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveDNSSettingsForASite", err, - "Failure at RetrieveDNSSettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveDNSSettingsForASiteV1", err, + "Failure at RetrieveDNSSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveDNSSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveDNSSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveDNSSettingsForASite response", + "Failure when setting RetrieveDNSSettingsForASiteV1 response", err)) return diags } @@ -132,18 +132,18 @@ func dataSourceSitesDNSSettingsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenNetworkSettingsRetrieveDNSSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDNSSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveDNSSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDNSSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["dns"] = flattenNetworkSettingsRetrieveDNSSettingsForASiteItemDNS(item.DNS) + respItem["dns"] = flattenNetworkSettingsRetrieveDNSSettingsForASiteV1ItemDNS(item.DNS) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveDNSSettingsForASiteItemDNS(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDNSSettingsForASiteResponseDNS) []map[string]interface{} { +func flattenNetworkSettingsRetrieveDNSSettingsForASiteV1ItemDNS(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveDNSSettingsForASiteV1ResponseDNS) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_image_distribution_settings.go b/catalystcenter/data_source_sites_image_distribution_settings.go index 73430a8..00a4c39 100644 --- a/catalystcenter/data_source_sites_image_distribution_settings.go +++ b/catalystcenter/data_source_sites_image_distribution_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesImageDistributionSettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve image distribution settings for a site; 'null' values indicate that the setting will be inherited from the -parent site; empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve image distribution settings for a site; *null* values indicate that the setting will be inherited from the +parent site; empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesImageDistributionSettingsRead, @@ -28,7 +28,7 @@ parent site; empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -88,32 +88,32 @@ func dataSourceSitesImageDistributionSettingsRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveImageDistributionSettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveImageDistributionSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveImageDistributionSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveImageDistributionSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveImageDistributionSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveImageDistributionSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveImageDistributionSettingsForASite", err, - "Failure at RetrieveImageDistributionSettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveImageDistributionSettingsForASiteV1", err, + "Failure at RetrieveImageDistributionSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveImageDistributionSettingsForASite response", + "Failure when setting RetrieveImageDistributionSettingsForASiteV1 response", err)) return diags } @@ -125,18 +125,18 @@ func dataSourceSitesImageDistributionSettingsRead(ctx context.Context, d *schema return diags } -func flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveImageDistributionSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveImageDistributionSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["image_distribution"] = flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteItemImageDistribution(item.ImageDistribution) + respItem["image_distribution"] = flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteV1ItemImageDistribution(item.ImageDistribution) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteItemImageDistribution(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveImageDistributionSettingsForASiteResponseImageDistribution) []map[string]interface{} { +func flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteV1ItemImageDistribution(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveImageDistributionSettingsForASiteV1ResponseImageDistribution) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_ntp_settings.go b/catalystcenter/data_source_sites_ntp_settings.go index f5a792e..c6bd360 100644 --- a/catalystcenter/data_source_sites_ntp_settings.go +++ b/catalystcenter/data_source_sites_ntp_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesNtpSettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve NTP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve NTP settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesNtpSettingsRead, @@ -28,7 +28,7 @@ empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -88,32 +88,32 @@ func dataSourceSitesNtpSettingsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveNTPSettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveNTPSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveNTPSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveNTPSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveNTPSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveNTPSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveNTPSettingsForASite", err, - "Failure at RetrieveNTPSettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveNTPSettingsForASiteV1", err, + "Failure at RetrieveNTPSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveNTPSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveNTPSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveNTPSettingsForASite response", + "Failure when setting RetrieveNTPSettingsForASiteV1 response", err)) return diags } @@ -125,18 +125,18 @@ func dataSourceSitesNtpSettingsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenNetworkSettingsRetrieveNTPSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveNTPSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveNTPSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveNTPSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ntp"] = flattenNetworkSettingsRetrieveNTPSettingsForASiteItemNtp(item.Ntp) + respItem["ntp"] = flattenNetworkSettingsRetrieveNTPSettingsForASiteV1ItemNtp(item.Ntp) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveNTPSettingsForASiteItemNtp(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveNTPSettingsForASiteResponseNtp) []map[string]interface{} { +func flattenNetworkSettingsRetrieveNTPSettingsForASiteV1ItemNtp(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveNTPSettingsForASiteV1ResponseNtp) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_profile_assignments.go b/catalystcenter/data_source_sites_profile_assignments.go index b39f4ac..8ec3e44 100644 --- a/catalystcenter/data_source_sites_profile_assignments.go +++ b/catalystcenter/data_source_sites_profile_assignments.go @@ -17,7 +17,7 @@ func dataSourceSitesProfileAssignments() *schema.Resource { - Retrieves the list of profiles that the given site has been assigned. These profiles may either be directly assigned to this site, or were assigned to a parent site and have been inherited. -These assigments can be modified via the '/dna/intent/api/v1/networkProfilesForSites/{profileId}/siteAssignments' +These assigments can be modified via the */dna/intent/api/v1/networkProfilesForSites/{profileId}/siteAssignments* resources. `, @@ -36,7 +36,7 @@ resources. Optional: true, }, "site_id": &schema.Schema{ - Description: `siteId path parameter. The 'id' of the site, retrievable from '/dna/intent/api/v1/sites' + Description: `siteId path parameter. The *id* of the site, retrievable from */dna/intent/api/v1/sites* `, Type: schema.TypeString, Required: true, @@ -70,9 +70,9 @@ func dataSourceSitesProfileAssignmentsRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssigned") + log.Printf("[DEBUG] Selected method: RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1") vvSiteID := vSiteID.(string) - queryParams1 := catalystcentersdkgo.RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedQueryParams{} + queryParams1 := catalystcentersdkgo.RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(float64) @@ -81,24 +81,24 @@ func dataSourceSitesProfileAssignmentsRead(ctx context.Context, d *schema.Resour queryParams1.Limit = vLimit.(float64) } - response1, restyResp1, err := client.SiteDesign.RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssigned(vvSiteID, &queryParams1) + response1, restyResp1, err := client.SiteDesign.RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1(vvSiteID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssigned", err, - "Failure at RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssigned, unexpected response", "")) + "Failure when executing 2 RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1", err, + "Failure at RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSiteDesignRetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedItems(response1.Response) + vItems1 := flattenSiteDesignRetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssigned response", + "Failure when setting RetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1 response", err)) return diags } @@ -110,7 +110,7 @@ func dataSourceSitesProfileAssignmentsRead(ctx context.Context, d *schema.Resour return diags } -func flattenSiteDesignRetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedItems(items *[]catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedResponse) []map[string]interface{} { +func flattenSiteDesignRetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1Items(items *[]catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfNetworkProfilesThatTheGivenSiteHasBeenAssignedV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sites_profile_assignments_count.go b/catalystcenter/data_source_sites_profile_assignments_count.go index cf9680b..23e344a 100644 --- a/catalystcenter/data_source_sites_profile_assignments_count.go +++ b/catalystcenter/data_source_sites_profile_assignments_count.go @@ -22,7 +22,7 @@ to this site, or were assigned to a parent site and have been inherited. ReadContext: dataSourceSitesProfileAssignmentsCountRead, Schema: map[string]*schema.Schema{ "site_id": &schema.Schema{ - Description: `siteId path parameter. The 'id' of the site, retrievable from '/dna/intent/api/v1/sites' + Description: `siteId path parameter. The *id* of the site, retrievable from */dna/intent/api/v1/sites* `, Type: schema.TypeString, Required: true, @@ -54,27 +54,27 @@ func dataSourceSitesProfileAssignmentsCountRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssigned") + log.Printf("[DEBUG] Selected method: RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1") vvSiteID := vSiteID.(string) - response1, restyResp1, err := client.SiteDesign.RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssigned(vvSiteID) + response1, restyResp1, err := client.SiteDesign.RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1(vvSiteID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssigned", err, - "Failure at RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssigned, unexpected response", "")) + "Failure when executing 2 RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1", err, + "Failure at RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignRetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedItem(response1.Response) + vItem1 := flattenSiteDesignRetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssigned response", + "Failure when setting RetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1 response", err)) return diags } @@ -86,7 +86,7 @@ func dataSourceSitesProfileAssignmentsCountRead(ctx context.Context, d *schema.R return diags } -func flattenSiteDesignRetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedItem(item *catalystcentersdkgo.ResponseSiteDesignRetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedResponse) []map[string]interface{} { +func flattenSiteDesignRetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1Item(item *catalystcentersdkgo.ResponseSiteDesignRetrievesTheCountOfProfilesThatTheGivenSiteHasBeenAssignedV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_telemetry_settings.go b/catalystcenter/data_source_sites_telemetry_settings.go index 0f01d39..3d3ddc0 100644 --- a/catalystcenter/data_source_sites_telemetry_settings.go +++ b/catalystcenter/data_source_sites_telemetry_settings.go @@ -15,20 +15,20 @@ func dataSourceSitesTelemetrySettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieves telemetry settings for the given site. 'null' values indicate that the setting will be inherited from the +- Retrieves telemetry settings for the given site. *null* values indicate that the setting will be inherited from the parent site. `, ReadContext: dataSourceSitesTelemetrySettingsRead, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' + Description: `id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* `, Type: schema.TypeString, Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -249,32 +249,32 @@ func dataSourceSitesTelemetrySettingsRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveTelemetrySettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveTelemetrySettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveTelemetrySettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTelemetrySettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveTelemetrySettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveTelemetrySettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveTelemetrySettingsForASite", err, - "Failure at RetrieveTelemetrySettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveTelemetrySettingsForASiteV1", err, + "Failure at RetrieveTelemetrySettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveTelemetrySettingsForASite response", + "Failure when setting RetrieveTelemetrySettingsForASiteV1 response", err)) return diags } @@ -286,22 +286,22 @@ func dataSourceSitesTelemetrySettingsRead(ctx context.Context, d *schema.Resourc return diags } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["wired_data_collection"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemWiredDataCollection(item.WiredDataCollection) - respItem["wireless_telemetry"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemWirelessTelemetry(item.WirelessTelemetry) - respItem["snmp_traps"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemSNMPTraps(item.SNMPTraps) - respItem["syslogs"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemSyslogs(item.Syslogs) - respItem["application_visibility"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemApplicationVisibility(item.ApplicationVisibility) + respItem["wired_data_collection"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemWiredDataCollection(item.WiredDataCollection) + respItem["wireless_telemetry"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemWirelessTelemetry(item.WirelessTelemetry) + respItem["snmp_traps"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemSNMPTraps(item.SNMPTraps) + respItem["syslogs"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemSyslogs(item.Syslogs) + respItem["application_visibility"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemApplicationVisibility(item.ApplicationVisibility) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemWiredDataCollection(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponseWiredDataCollection) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemWiredDataCollection(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1ResponseWiredDataCollection) []map[string]interface{} { if item == nil { return nil } @@ -316,7 +316,7 @@ func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemWiredDataCollect } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemWirelessTelemetry(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponseWirelessTelemetry) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemWirelessTelemetry(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1ResponseWirelessTelemetry) []map[string]interface{} { if item == nil { return nil } @@ -331,7 +331,7 @@ func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemWirelessTelemetr } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemSNMPTraps(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponseSNMPTraps) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemSNMPTraps(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1ResponseSNMPTraps) []map[string]interface{} { if item == nil { return nil } @@ -347,7 +347,7 @@ func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemSNMPTraps(item * } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemSyslogs(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponseSyslogs) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemSyslogs(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1ResponseSyslogs) []map[string]interface{} { if item == nil { return nil } @@ -363,12 +363,12 @@ func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemSyslogs(item *ca } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemApplicationVisibility(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponseApplicationVisibility) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemApplicationVisibility(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1ResponseApplicationVisibility) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["collector"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemApplicationVisibilityCollector(item.Collector) + respItem["collector"] = flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemApplicationVisibilityCollector(item.Collector) respItem["enable_on_wired_access_devices"] = boolPtrToString(item.EnableOnWiredAccessDevices) respItem["inherited_site_id"] = item.InheritedSiteID respItem["inherited_site_name"] = item.InheritedSiteName @@ -379,7 +379,7 @@ func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemApplicationVisib } -func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItemApplicationVisibilityCollector(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteResponseApplicationVisibilityCollector) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1ItemApplicationVisibilityCollector(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTelemetrySettingsForASiteV1ResponseApplicationVisibilityCollector) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_time_zone_settings.go b/catalystcenter/data_source_sites_time_zone_settings.go index 6c05613..bc9399c 100644 --- a/catalystcenter/data_source_sites_time_zone_settings.go +++ b/catalystcenter/data_source_sites_time_zone_settings.go @@ -15,8 +15,8 @@ func dataSourceSitesTimeZoneSettings() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Network Settings. -- Retrieve time zone settings for a site; 'null' values indicate that the setting will be inherited from the parent -site; empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve time zone settings for a site; *null* values indicate that the setting will be inherited from the parent +site; empty objects (*{}*) indicate that the setting is unset at a site. `, ReadContext: dataSourceSitesTimeZoneSettingsRead, @@ -28,7 +28,7 @@ site; empty objects ('{}') indicate that the setting is unset at a site. Required: true, }, "inherited": &schema.Schema{ - Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. + Description: `_inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. `, Type: schema.TypeBool, Optional: true, @@ -85,32 +85,32 @@ func dataSourceSitesTimeZoneSettingsRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveTimeZoneSettingsForASite") + log.Printf("[DEBUG] Selected method: RetrieveTimeZoneSettingsForASiteV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.RetrieveTimeZoneSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTimeZoneSettingsForASiteV1QueryParams{} if okInherited { queryParams1.Inherited = vInherited.(bool) } - response1, restyResp1, err := client.NetworkSettings.RetrieveTimeZoneSettingsForASite(vvID, &queryParams1) + response1, restyResp1, err := client.NetworkSettings.RetrieveTimeZoneSettingsForASiteV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveTimeZoneSettingsForASite", err, - "Failure at RetrieveTimeZoneSettingsForASite, unexpected response", "")) + "Failure when executing 2 RetrieveTimeZoneSettingsForASiteV1", err, + "Failure at RetrieveTimeZoneSettingsForASiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveTimeZoneSettingsForASite response", + "Failure when setting RetrieveTimeZoneSettingsForASiteV1 response", err)) return diags } @@ -122,18 +122,18 @@ func dataSourceSitesTimeZoneSettingsRead(ctx context.Context, d *schema.Resource return diags } -func flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTimeZoneSettingsForASiteResponse) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTimeZoneSettingsForASiteV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["time_zone"] = flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteItemTimeZone(item.TimeZone) + respItem["time_zone"] = flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteV1ItemTimeZone(item.TimeZone) return []map[string]interface{}{ respItem, } } -func flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteItemTimeZone(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTimeZoneSettingsForASiteResponseTimeZone) []map[string]interface{} { +func flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteV1ItemTimeZone(item *catalystcentersdkgo.ResponseNetworkSettingsRetrieveTimeZoneSettingsForASiteV1ResponseTimeZone) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_sites_wireless_settings_ssids.go b/catalystcenter/data_source_sites_wireless_settings_ssids.go index 9d832ab..1583b61 100644 --- a/catalystcenter/data_source_sites_wireless_settings_ssids.go +++ b/catalystcenter/data_source_sites_wireless_settings_ssids.go @@ -1236,9 +1236,9 @@ func dataSourceSitesWirelessSettingsSSIDsRead(ctx context.Context, d *schema.Res selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSSIDBySite") + log.Printf("[DEBUG] Selected method: GetSSIDBySiteV1") vvSiteID := vSiteID.(string) - queryParams1 := catalystcentersdkgo.GetSSIDBySiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSSIDBySiteV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -1247,24 +1247,24 @@ func dataSourceSitesWirelessSettingsSSIDsRead(ctx context.Context, d *schema.Res queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetSSIDBySite(vvSiteID, &queryParams1) + response1, restyResp1, err := client.Wireless.GetSSIDBySiteV1(vvSiteID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSSIDBySite", err, - "Failure at GetSSIDBySite, unexpected response", "")) + "Failure when executing 2 GetSSIDBySiteV1", err, + "Failure at GetSSIDBySiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetSSIDBySiteItems(response1.Response) + vItems1 := flattenWirelessGetSSIDBySiteV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDBySite response", + "Failure when setting GetSSIDBySiteV1 response", err)) return diags } @@ -1274,28 +1274,28 @@ func dataSourceSitesWirelessSettingsSSIDsRead(ctx context.Context, d *schema.Res } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetSSIDByID") + log.Printf("[DEBUG] Selected method: GetSSIDByIDV1") vvSiteID := vSiteID.(string) vvID := vID.(string) - response2, restyResp2, err := client.Wireless.GetSSIDByID(vvSiteID, vvID) + response2, restyResp2, err := client.Wireless.GetSSIDByIDV1(vvSiteID, vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSSIDByID", err, - "Failure at GetSSIDByID, unexpected response", "")) + "Failure when executing 2 GetSSIDByIDV1", err, + "Failure at GetSSIDByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenWirelessGetSSIDByIDItem(response2.Response) + vItem2 := flattenWirelessGetSSIDByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDByID response", + "Failure when setting GetSSIDByIDV1 response", err)) return diags } @@ -1307,7 +1307,7 @@ func dataSourceSitesWirelessSettingsSSIDsRead(ctx context.Context, d *schema.Res return diags } -func flattenWirelessGetSSIDBySiteItems(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDBySiteResponse) []map[string]interface{} { +func flattenWirelessGetSSIDBySiteV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDBySiteV1Response) []map[string]interface{} { if items == nil { return nil } @@ -1337,7 +1337,7 @@ func flattenWirelessGetSSIDBySiteItems(items *[]catalystcentersdkgo.ResponseWire respItem["aaa_override"] = boolPtrToString(item.AAAOverride) respItem["coverage_hole_detection_enable"] = boolPtrToString(item.CoverageHoleDetectionEnable) respItem["protected_management_frame"] = item.ProtectedManagementFrame - respItem["multi_psk_settings"] = flattenWirelessGetSSIDBySiteItemsMultipSKSettings(item.MultipSKSettings) + respItem["multi_psk_settings"] = flattenWirelessGetSSIDBySiteV1ItemsMultipSKSettings(item.MultipSKSettings) respItem["client_rate_limit"] = item.ClientRateLimit respItem["rsn_cipher_suite_gcmp256"] = boolPtrToString(item.RsnCipherSuiteGcmp256) respItem["rsn_cipher_suite_ccmp256"] = boolPtrToString(item.RsnCipherSuiteCcmp256) @@ -1391,7 +1391,7 @@ func flattenWirelessGetSSIDBySiteItems(items *[]catalystcentersdkgo.ResponseWire return respItems } -func flattenWirelessGetSSIDBySiteItemsMultipSKSettings(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDBySiteResponseMultipSKSettings) []map[string]interface{} { +func flattenWirelessGetSSIDBySiteV1ItemsMultipSKSettings(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDBySiteV1ResponseMultipSKSettings) []map[string]interface{} { if items == nil { return nil } @@ -1406,7 +1406,7 @@ func flattenWirelessGetSSIDBySiteItemsMultipSKSettings(items *[]catalystcentersd return respItems } -func flattenWirelessGetSSIDByIDItem(item *catalystcentersdkgo.ResponseWirelessGetSSIDByIDResponse) []map[string]interface{} { +func flattenWirelessGetSSIDByIDV1Item(item *catalystcentersdkgo.ResponseWirelessGetSSIDByIDV1Response) []map[string]interface{} { if item == nil { return nil } @@ -1434,7 +1434,7 @@ func flattenWirelessGetSSIDByIDItem(item *catalystcentersdkgo.ResponseWirelessGe respItem["aaa_override"] = boolPtrToString(item.AAAOverride) respItem["coverage_hole_detection_enable"] = boolPtrToString(item.CoverageHoleDetectionEnable) respItem["protected_management_frame"] = item.ProtectedManagementFrame - respItem["multi_psk_settings"] = flattenWirelessGetSSIDByIDItemMultipSKSettings(item.MultipSKSettings) + respItem["multi_psk_settings"] = flattenWirelessGetSSIDByIDV1ItemMultipSKSettings(item.MultipSKSettings) respItem["client_rate_limit"] = item.ClientRateLimit respItem["rsn_cipher_suite_gcmp256"] = boolPtrToString(item.RsnCipherSuiteGcmp256) respItem["rsn_cipher_suite_ccmp256"] = boolPtrToString(item.RsnCipherSuiteCcmp256) @@ -1488,7 +1488,7 @@ func flattenWirelessGetSSIDByIDItem(item *catalystcentersdkgo.ResponseWirelessGe } } -func flattenWirelessGetSSIDByIDItemMultipSKSettings(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDByIDResponseMultipSKSettings) []map[string]interface{} { +func flattenWirelessGetSSIDByIDV1ItemMultipSKSettings(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDByIDV1ResponseMultipSKSettings) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_sites_wireless_settings_ssids_count.go b/catalystcenter/data_source_sites_wireless_settings_ssids_count.go index fb52c1b..572f716 100644 --- a/catalystcenter/data_source_sites_wireless_settings_ssids_count.go +++ b/catalystcenter/data_source_sites_wireless_settings_ssids_count.go @@ -54,27 +54,27 @@ func dataSourceSitesWirelessSettingsSSIDsCountRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSSIDCountBySite") + log.Printf("[DEBUG] Selected method: GetSSIDCountBySiteV1") vvSiteID := vSiteID.(string) - response1, restyResp1, err := client.Wireless.GetSSIDCountBySite(vvSiteID) + response1, restyResp1, err := client.Wireless.GetSSIDCountBySiteV1(vvSiteID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSSIDCountBySite", err, - "Failure at GetSSIDCountBySite, unexpected response", "")) + "Failure when executing 2 GetSSIDCountBySiteV1", err, + "Failure at GetSSIDCountBySiteV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetSSIDCountBySiteItem(response1.Response) + vItem1 := flattenWirelessGetSSIDCountBySiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDCountBySite response", + "Failure when setting GetSSIDCountBySiteV1 response", err)) return diags } @@ -86,7 +86,7 @@ func dataSourceSitesWirelessSettingsSSIDsCountRead(ctx context.Context, d *schem return diags } -func flattenWirelessGetSSIDCountBySiteItem(item *catalystcentersdkgo.ResponseWirelessGetSSIDCountBySiteResponse) []map[string]interface{} { +func flattenWirelessGetSSIDCountBySiteV1Item(item *catalystcentersdkgo.ResponseWirelessGetSSIDCountBySiteV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_snmp_properties.go b/catalystcenter/data_source_snmp_properties.go index 0f2acfc..523e5a4 100644 --- a/catalystcenter/data_source_snmp_properties.go +++ b/catalystcenter/data_source_snmp_properties.go @@ -75,26 +75,26 @@ func dataSourceSNMPPropertiesRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSNMPProperties") + log.Printf("[DEBUG] Selected method: GetSNMPPropertiesV1") - response1, restyResp1, err := client.Discovery.GetSNMPProperties() + response1, restyResp1, err := client.Discovery.GetSNMPPropertiesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSNMPProperties", err, - "Failure at GetSNMPProperties, unexpected response", "")) + "Failure when executing 2 GetSNMPPropertiesV1", err, + "Failure at GetSNMPPropertiesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenDiscoveryGetSNMPPropertiesItems(response1.Response) + vItems1 := flattenDiscoveryGetSNMPPropertiesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSNMPProperties response", + "Failure when setting GetSNMPPropertiesV1 response", err)) return diags } @@ -106,7 +106,7 @@ func dataSourceSNMPPropertiesRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenDiscoveryGetSNMPPropertiesItems(items *[]catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesResponse) []map[string]interface{} { +func flattenDiscoveryGetSNMPPropertiesV1Items(items *[]catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_swim_image_details.go b/catalystcenter/data_source_swim_image_details.go index b77e681..c4f8620 100644 --- a/catalystcenter/data_source_swim_image_details.go +++ b/catalystcenter/data_source_swim_image_details.go @@ -335,8 +335,8 @@ func dataSourceSwimImageDetailsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSoftwareImageDetails") - queryParams1 := catalystcentersdkgo.GetSoftwareImageDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetSoftwareImageDetailsV1") + queryParams1 := catalystcentersdkgo.GetSoftwareImageDetailsV1QueryParams{} if okImageUUID { queryParams1.ImageUUID = vImageUUID.(string) @@ -393,24 +393,24 @@ func dataSourceSwimImageDetailsRead(ctx context.Context, d *schema.ResourceData, queryParams1.Offset = vOffset.(int) } - response1, restyResp1, err := client.SoftwareImageManagementSwim.GetSoftwareImageDetails(&queryParams1) + response1, restyResp1, err := client.SoftwareImageManagementSwim.GetSoftwareImageDetailsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSoftwareImageDetails", err, - "Failure at GetSoftwareImageDetails, unexpected response", "")) + "Failure when executing 2 GetSoftwareImageDetailsV1", err, + "Failure at GetSoftwareImageDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItems(response1.Response) + vItems1 := flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSoftwareImageDetails response", + "Failure when setting GetSoftwareImageDetailsV1 response", err)) return diags } @@ -422,17 +422,17 @@ func dataSourceSwimImageDetailsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItems(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1Items(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["applicable_devices_for_image"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsApplicableDevicesForImage(item.ApplicableDevicesForImage) + respItem["applicable_devices_for_image"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsApplicableDevicesForImage(item.ApplicableDevicesForImage) respItem["application_type"] = item.ApplicationType respItem["created_time"] = item.CreatedTime - respItem["extended_attributes"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsExtendedAttributes(item.ExtendedAttributes) + respItem["extended_attributes"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsExtendedAttributes(item.ExtendedAttributes) respItem["family"] = item.Family respItem["feature"] = item.Feature respItem["file_service_id"] = item.FileServiceID @@ -447,7 +447,7 @@ func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItems(items *[]cat respItem["is_tagged_golden"] = boolPtrToString(item.IsTaggedGolden) respItem["md5_checksum"] = item.Md5Checksum respItem["name"] = item.Name - respItem["profile_info"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsProfileInfo(item.ProfileInfo) + respItem["profile_info"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsProfileInfo(item.ProfileInfo) respItem["sha_check_sum"] = item.ShaCheckSum respItem["vendor"] = item.Vendor respItem["version"] = item.Version @@ -456,7 +456,7 @@ func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItems(items *[]cat return respItems } -func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsApplicableDevicesForImage(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponseApplicableDevicesForImage) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsApplicableDevicesForImage(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1ResponseApplicableDevicesForImage) []map[string]interface{} { if items == nil { return nil } @@ -471,7 +471,7 @@ func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsApplicableDev return respItems } -func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsExtendedAttributes(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponseExtendedAttributes) interface{} { +func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsExtendedAttributes(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1ResponseExtendedAttributes) interface{} { if item == nil { return nil } @@ -481,7 +481,7 @@ func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsExtendedAttri } -func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsProfileInfo(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponseProfileInfo) []map[string]interface{} { +func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsProfileInfo(items *[]catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1ResponseProfileInfo) []map[string]interface{} { if items == nil { return nil } @@ -489,7 +489,7 @@ func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsProfileInfo(i for _, item := range *items { respItem := make(map[string]interface{}) respItem["description"] = item.Description - respItem["extended_attributes"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsProfileInfoExtendedAttributes(item.ExtendedAttributes) + respItem["extended_attributes"] = flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsProfileInfoExtendedAttributes(item.ExtendedAttributes) respItem["memory"] = item.Memory respItem["product_type"] = item.ProductType respItem["profile_name"] = item.ProfileName @@ -500,7 +500,7 @@ func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsProfileInfo(i return respItems } -func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItemsProfileInfoExtendedAttributes(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponseProfileInfoExtendedAttributes) interface{} { +func flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1ItemsProfileInfoExtendedAttributes(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1ResponseProfileInfoExtendedAttributes) interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_system_health.go b/catalystcenter/data_source_system_health.go index d2de5d3..abe217a 100644 --- a/catalystcenter/data_source_system_health.go +++ b/catalystcenter/data_source_system_health.go @@ -169,8 +169,8 @@ func dataSourceSystemHealthRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SystemHealthAPI") - queryParams1 := catalystcentersdkgo.SystemHealthAPIQueryParams{} + log.Printf("[DEBUG] Selected method: SystemHealthAPIV1") + queryParams1 := catalystcentersdkgo.SystemHealthAPIV1QueryParams{} if okSummary { queryParams1.Summary = vSummary.(bool) @@ -188,24 +188,24 @@ func dataSourceSystemHealthRead(ctx context.Context, d *schema.ResourceData, m i queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.HealthAndPerformance.SystemHealthAPI(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.SystemHealthAPIV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SystemHealthAPI", err, - "Failure at SystemHealthAPI, unexpected response", "")) + "Failure when executing 2 SystemHealthAPIV1", err, + "Failure at SystemHealthAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenHealthAndPerformanceSystemHealthAPIItem(response1) + vItem1 := flattenHealthAndPerformanceSystemHealthAPIV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SystemHealthAPI response", + "Failure when setting SystemHealthAPIV1 response", err)) return diags } @@ -217,12 +217,12 @@ func dataSourceSystemHealthRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenHealthAndPerformanceSystemHealthAPIItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemHealthAPI) []map[string]interface{} { +func flattenHealthAndPerformanceSystemHealthAPIV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemHealthAPIV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["health_events"] = flattenHealthAndPerformanceSystemHealthAPIItemHealthEvents(item.HealthEvents) + respItem["health_events"] = flattenHealthAndPerformanceSystemHealthAPIV1ItemHealthEvents(item.HealthEvents) respItem["version"] = item.Version respItem["host_name"] = item.HostName respItem["cimcaddress"] = item.Cimcaddress @@ -231,7 +231,7 @@ func flattenHealthAndPerformanceSystemHealthAPIItem(item *catalystcentersdkgo.Re } } -func flattenHealthAndPerformanceSystemHealthAPIItemHealthEvents(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceSystemHealthAPIHealthEvents) []map[string]interface{} { +func flattenHealthAndPerformanceSystemHealthAPIV1ItemHealthEvents(items *[]catalystcentersdkgo.ResponseHealthAndPerformanceSystemHealthAPIV1HealthEvents) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_system_health_count.go b/catalystcenter/data_source_system_health_count.go index ff5ee15..8cc540e 100644 --- a/catalystcenter/data_source_system_health_count.go +++ b/catalystcenter/data_source_system_health_count.go @@ -61,8 +61,8 @@ func dataSourceSystemHealthCountRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SystemHealthCountAPI") - queryParams1 := catalystcentersdkgo.SystemHealthCountAPIQueryParams{} + log.Printf("[DEBUG] Selected method: SystemHealthCountAPIV1") + queryParams1 := catalystcentersdkgo.SystemHealthCountAPIV1QueryParams{} if okDomain { queryParams1.Domain = vDomain.(string) @@ -71,24 +71,24 @@ func dataSourceSystemHealthCountRead(ctx context.Context, d *schema.ResourceData queryParams1.Subdomain = vSubdomain.(string) } - response1, restyResp1, err := client.HealthAndPerformance.SystemHealthCountAPI(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.SystemHealthCountAPIV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SystemHealthCountAPI", err, - "Failure at SystemHealthCountAPI, unexpected response", "")) + "Failure when executing 2 SystemHealthCountAPIV1", err, + "Failure at SystemHealthCountAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenHealthAndPerformanceSystemHealthCountAPIItem(response1) + vItem1 := flattenHealthAndPerformanceSystemHealthCountAPIV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SystemHealthCountAPI response", + "Failure when setting SystemHealthCountAPIV1 response", err)) return diags } @@ -100,7 +100,7 @@ func dataSourceSystemHealthCountRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenHealthAndPerformanceSystemHealthCountAPIItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemHealthCountAPI) []map[string]interface{} { +func flattenHealthAndPerformanceSystemHealthCountAPIV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemHealthCountAPIV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_system_issue_definitions.go b/catalystcenter/data_source_system_issue_definitions.go index f7546a6..72b2206 100644 --- a/catalystcenter/data_source_system_issue_definitions.go +++ b/catalystcenter/data_source_system_issue_definitions.go @@ -16,7 +16,7 @@ func dataSourceSystemIssueDefinitions() *schema.Resource { Description: `It performs read operation on Issues. - Get all system issue defintions. The supported filters are id, name, profileId and definition enable status. An issue -trigger definition can be different across the profile and device type. So, 'profileId' and 'deviceType' in the query +trigger definition can be different across the profile and device type. So, *profileId* and *deviceType* in the query param is important and default is global profile and all device type. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- api-specs/blob/main/Assurance/CE_Cat_Center_Org-issueAndHealthDefinitions-1.0.0-resolved.yaml @@ -82,16 +82,16 @@ name=BGP_Down&name=BGP_Flap (multiple issue names separated by & operator) }, "priority": &schema.Schema{ Description: `priority query parameter. Issue priority, possible values are P1, P2, P3, P4. -'P1': A critical issue that needs immediate attention and can have a wide impact on network operations. -'P2': A major issue that can potentially impact multiple devices or clients. -'P3': A minor issue that has a localized or minimal impact. -'P4': A warning issue that may not be an immediate problem but addressing it can optimize the network performance. +*P1*: A critical issue that needs immediate attention and can have a wide impact on network operations. +*P2*: A major issue that can potentially impact multiple devices or clients. +*P3*: A minor issue that has a localized or minimal impact. +*P4*: A warning issue that may not be an immediate problem but addressing it can optimize the network performance. `, Type: schema.TypeString, Optional: true, }, "profile_id": &schema.Schema{ - Description: `profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is 'global'. Please refer Network design profiles documentation for more details. + Description: `profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is *global*. Please refer Network design profiles documentation for more details. `, Type: schema.TypeString, Optional: true, @@ -326,10 +326,10 @@ func dataSourceSystemIssueDefinitionsRead(ctx context.Context, d *schema.Resourc selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: ReturnsAllIssueTriggerDefinitionsForGivenFilters") + log.Printf("[DEBUG] Selected method: ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1") - headerParams1 := catalystcentersdkgo.ReturnsAllIssueTriggerDefinitionsForGivenFiltersHeaderParams{} - queryParams1 := catalystcentersdkgo.ReturnsAllIssueTriggerDefinitionsForGivenFiltersQueryParams{} + headerParams1 := catalystcentersdkgo.ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1HeaderParams{} + queryParams1 := catalystcentersdkgo.ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1QueryParams{} if okDeviceType { queryParams1.DeviceType = vDeviceType.(string) @@ -368,24 +368,24 @@ func dataSourceSystemIssueDefinitionsRead(ctx context.Context, d *schema.Resourc headerParams1.XCaLLERID = vXCaLLERID.(string) } - response1, restyResp1, err := client.Issues.ReturnsAllIssueTriggerDefinitionsForGivenFilters(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Issues.ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 ReturnsAllIssueTriggerDefinitionsForGivenFilters", err, - "Failure at ReturnsAllIssueTriggerDefinitionsForGivenFilters, unexpected response", "")) + "Failure when executing 2 ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1", err, + "Failure at ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersItems(response1.Response) + vItems1 := flattenIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ReturnsAllIssueTriggerDefinitionsForGivenFilters response", + "Failure when setting ReturnsAllIssueTriggerDefinitionsForGivenFiltersV1 response", err)) return diags } @@ -395,33 +395,33 @@ func dataSourceSystemIssueDefinitionsRead(ctx context.Context, d *schema.Resourc } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetIssueTriggerDefinitionForGivenID") + log.Printf("[DEBUG] Selected method: GetIssueTriggerDefinitionForGivenIDV1") vvID := vID.(string) - headerParams2 := catalystcentersdkgo.GetIssueTriggerDefinitionForGivenIDHeaderParams{} + headerParams2 := catalystcentersdkgo.GetIssueTriggerDefinitionForGivenIDV1HeaderParams{} if okXCaLLERID { headerParams2.XCaLLERID = vXCaLLERID.(string) } - response2, restyResp2, err := client.Issues.GetIssueTriggerDefinitionForGivenID(vvID, &headerParams2) + response2, restyResp2, err := client.Issues.GetIssueTriggerDefinitionForGivenIDV1(vvID, &headerParams2) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetIssueTriggerDefinitionForGivenID", err, - "Failure at GetIssueTriggerDefinitionForGivenID, unexpected response", "")) + "Failure when executing 2 GetIssueTriggerDefinitionForGivenIDV1", err, + "Failure at GetIssueTriggerDefinitionForGivenIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenIssuesGetIssueTriggerDefinitionForGivenIDItem(response2.Response) + vItem2 := flattenIssuesGetIssueTriggerDefinitionForGivenIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetIssueTriggerDefinitionForGivenID response", + "Failure when setting GetIssueTriggerDefinitionForGivenIDV1 response", err)) return diags } @@ -433,7 +433,7 @@ func dataSourceSystemIssueDefinitionsRead(ctx context.Context, d *schema.Resourc return diags } -func flattenIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersItems(items *[]catalystcentersdkgo.ResponseIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersResponse) []map[string]interface{} { +func flattenIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersV1Items(items *[]catalystcentersdkgo.ResponseIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersV1Response) []map[string]interface{} { if items == nil { return nil } @@ -459,7 +459,7 @@ func flattenIssuesReturnsAllIssueTriggerDefinitionsForGivenFiltersItems(items *[ return respItems } -func flattenIssuesGetIssueTriggerDefinitionForGivenIDItem(item *catalystcentersdkgo.ResponseIssuesGetIssueTriggerDefinitionForGivenIDResponse) []map[string]interface{} { +func flattenIssuesGetIssueTriggerDefinitionForGivenIDV1Item(item *catalystcentersdkgo.ResponseIssuesGetIssueTriggerDefinitionForGivenIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_system_issue_definitions_count.go b/catalystcenter/data_source_system_issue_definitions_count.go index f802189..9b3b2fa 100644 --- a/catalystcenter/data_source_system_issue_definitions_count.go +++ b/catalystcenter/data_source_system_issue_definitions_count.go @@ -55,16 +55,16 @@ name=BGP_Down&name=BGP_Flap (multiple issue names separated by & operator) }, "priority": &schema.Schema{ Description: `priority query parameter. Issue priority, possible values are P1, P2, P3, P4. -'P1': A critical issue that needs immediate attention and can have a wide impact on network operations. -'P2': A major issue that can potentially impact multiple devices or clients. -'P3': A minor issue that has a localized or minimal impact. -'P4': A warning issue that may not be an immediate problem but addressing it can optimize the network performance. +*P1*: A critical issue that needs immediate attention and can have a wide impact on network operations. +*P2*: A major issue that can potentially impact multiple devices or clients. +*P3*: A minor issue that has a localized or minimal impact. +*P4*: A warning issue that may not be an immediate problem but addressing it can optimize the network performance. `, Type: schema.TypeString, Optional: true, }, "profile_id": &schema.Schema{ - Description: `profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is 'global'. Please refer Network design profiles documentation for more details. + Description: `profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is *global*. Please refer Network design profiles documentation for more details. `, Type: schema.TypeString, Optional: true, @@ -108,10 +108,10 @@ func dataSourceSystemIssueDefinitionsCountRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFilters") + log.Printf("[DEBUG] Selected method: GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1") - headerParams1 := catalystcentersdkgo.GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersHeaderParams{} - queryParams1 := catalystcentersdkgo.GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersQueryParams{} + headerParams1 := catalystcentersdkgo.GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1HeaderParams{} + queryParams1 := catalystcentersdkgo.GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1QueryParams{} if okDeviceType { queryParams1.DeviceType = vDeviceType.(string) @@ -133,24 +133,24 @@ func dataSourceSystemIssueDefinitionsCountRead(ctx context.Context, d *schema.Re } headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFilters(&headerParams1, &queryParams1) + response1, restyResp1, err := client.Issues.GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFilters", err, - "Failure at GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFilters, unexpected response", "")) + "Failure when executing 2 GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1", err, + "Failure at GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenIssuesGetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersItem(response1.Response) + vItem1 := flattenIssuesGetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFilters response", + "Failure when setting GetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1 response", err)) return diags } @@ -162,7 +162,7 @@ func dataSourceSystemIssueDefinitionsCountRead(ctx context.Context, d *schema.Re return diags } -func flattenIssuesGetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersItem(item *catalystcentersdkgo.ResponseIssuesGetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersResponse) []map[string]interface{} { +func flattenIssuesGetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1Item(item *catalystcentersdkgo.ResponseIssuesGetTheCountOfSystemDefinedIssueDefinitionsBasedOnProvidedFiltersV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_system_performance.go b/catalystcenter/data_source_system_performance.go index 68af560..70047d0 100644 --- a/catalystcenter/data_source_system_performance.go +++ b/catalystcenter/data_source_system_performance.go @@ -184,8 +184,8 @@ func dataSourceSystemPerformanceRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SystemPerformanceAPI") - queryParams1 := catalystcentersdkgo.SystemPerformanceAPIQueryParams{} + log.Printf("[DEBUG] Selected method: SystemPerformanceAPIV1") + queryParams1 := catalystcentersdkgo.SystemPerformanceAPIV1QueryParams{} if okKpi { queryParams1.Kpi = vKpi.(string) @@ -200,24 +200,24 @@ func dataSourceSystemPerformanceRead(ctx context.Context, d *schema.ResourceData queryParams1.EndTime = vEndTime.(float64) } - response1, restyResp1, err := client.HealthAndPerformance.SystemPerformanceAPI(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.SystemPerformanceAPIV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SystemPerformanceAPI", err, - "Failure at SystemPerformanceAPI, unexpected response", "")) + "Failure when executing 2 SystemPerformanceAPIV1", err, + "Failure at SystemPerformanceAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenHealthAndPerformanceSystemPerformanceAPIItem(response1) + vItem1 := flattenHealthAndPerformanceSystemPerformanceAPIV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SystemPerformanceAPI response", + "Failure when setting SystemPerformanceAPIV1 response", err)) return diags } @@ -229,28 +229,28 @@ func dataSourceSystemPerformanceRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenHealthAndPerformanceSystemPerformanceAPIItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPI) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceAPIV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["host_name"] = item.HostName respItem["version"] = item.Version - respItem["kpis"] = flattenHealthAndPerformanceSystemPerformanceAPIItemKpis(item.Kpis) + respItem["kpis"] = flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpis(item.Kpis) return []map[string]interface{}{ respItem, } } -func flattenHealthAndPerformanceSystemPerformanceAPIItemKpis(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIKpis) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpis(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIV1Kpis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["cpu"] = flattenHealthAndPerformanceSystemPerformanceAPIItemKpisCPU(item.CPU) - respItem["memory"] = flattenHealthAndPerformanceSystemPerformanceAPIItemKpisMemory(item.Memory) - respItem["network_tx_rate"] = flattenHealthAndPerformanceSystemPerformanceAPIItemKpisNetworktxRate(item.NetworktxRate) - respItem["network_rx_rate"] = flattenHealthAndPerformanceSystemPerformanceAPIItemKpisNetworkrxRate(item.NetworkrxRate) + respItem["cpu"] = flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisCPU(item.CPU) + respItem["memory"] = flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisMemory(item.Memory) + respItem["network_tx_rate"] = flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisNetworktxRate(item.NetworktxRate) + respItem["network_rx_rate"] = flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisNetworkrxRate(item.NetworkrxRate) return []map[string]interface{}{ respItem, @@ -258,7 +258,7 @@ func flattenHealthAndPerformanceSystemPerformanceAPIItemKpis(item *catalystcente } -func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisCPU(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIKpisCPU) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisCPU(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIV1KpisCPU) []map[string]interface{} { if item == nil { return nil } @@ -272,7 +272,7 @@ func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisCPU(item *catalystce } -func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisMemory(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIKpisMemory) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisMemory(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIV1KpisMemory) []map[string]interface{} { if item == nil { return nil } @@ -286,7 +286,7 @@ func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisMemory(item *catalys } -func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisNetworktxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIKpisNetworktxRate) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisNetworktxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIV1KpisNetworktxRate) []map[string]interface{} { if item == nil { return nil } @@ -300,7 +300,7 @@ func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisNetworktxRate(item * } -func flattenHealthAndPerformanceSystemPerformanceAPIItemKpisNetworkrxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIKpisNetworkrxRate) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceAPIV1ItemKpisNetworkrxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceAPIV1KpisNetworkrxRate) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_system_performance_historical.go b/catalystcenter/data_source_system_performance_historical.go index 328aaba..5594df3 100644 --- a/catalystcenter/data_source_system_performance_historical.go +++ b/catalystcenter/data_source_system_performance_historical.go @@ -191,8 +191,8 @@ func dataSourceSystemPerformanceHistoricalRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SystemPerformanceHistoricalAPI") - queryParams1 := catalystcentersdkgo.SystemPerformanceHistoricalAPIQueryParams{} + log.Printf("[DEBUG] Selected method: SystemPerformanceHistoricalAPIV1") + queryParams1 := catalystcentersdkgo.SystemPerformanceHistoricalAPIV1QueryParams{} if okKpi { queryParams1.Kpi = vKpi.(string) @@ -204,24 +204,24 @@ func dataSourceSystemPerformanceHistoricalRead(ctx context.Context, d *schema.Re queryParams1.EndTime = vEndTime.(float64) } - response1, restyResp1, err := client.HealthAndPerformance.SystemPerformanceHistoricalAPI(&queryParams1) + response1, restyResp1, err := client.HealthAndPerformance.SystemPerformanceHistoricalAPIV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SystemPerformanceHistoricalAPI", err, - "Failure at SystemPerformanceHistoricalAPI, unexpected response", "")) + "Failure when executing 2 SystemPerformanceHistoricalAPIV1", err, + "Failure at SystemPerformanceHistoricalAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItem(response1) + vItem1 := flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SystemPerformanceHistoricalAPI response", + "Failure when setting SystemPerformanceHistoricalAPIV1 response", err)) return diags } @@ -233,26 +233,26 @@ func dataSourceSystemPerformanceHistoricalRead(ctx context.Context, d *schema.Re return diags } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItem(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPI) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1Item(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["host_name"] = item.HostName respItem["version"] = item.Version - respItem["kpis"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpis(item.Kpis) + respItem["kpis"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpis(item.Kpis) return []map[string]interface{}{ respItem, } } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpis(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpis) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpis(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1Kpis) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["legends"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegends(item.Legends) - respItem["data"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisData(item.Data) + respItem["legends"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegends(item.Legends) + respItem["data"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisData(item.Data) respItem["cpu_avg"] = item.CPUAvg respItem["memory_avg"] = item.MemoryAvg @@ -262,15 +262,15 @@ func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpis(item *cat } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegends(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpisLegends) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegends(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1KpisLegends) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["cpu"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsCPU(item.CPU) - respItem["memory"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsMemory(item.Memory) - respItem["network_tx_rate"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsNetworktxRate(item.NetworktxRate) - respItem["network_rx_rate"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsNetworkrxRate(item.NetworkrxRate) + respItem["cpu"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsCPU(item.CPU) + respItem["memory"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsMemory(item.Memory) + respItem["network_tx_rate"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsNetworktxRate(item.NetworktxRate) + respItem["network_rx_rate"] = flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsNetworkrxRate(item.NetworkrxRate) return []map[string]interface{}{ respItem, @@ -278,7 +278,7 @@ func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegends(it } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsCPU(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpisLegendsCPU) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsCPU(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1KpisLegendsCPU) []map[string]interface{} { if item == nil { return nil } @@ -291,7 +291,7 @@ func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsCPU } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsMemory(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpisLegendsMemory) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsMemory(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1KpisLegendsMemory) []map[string]interface{} { if item == nil { return nil } @@ -304,7 +304,7 @@ func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsMem } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsNetworktxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpisLegendsNetworktxRate) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsNetworktxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1KpisLegendsNetworktxRate) []map[string]interface{} { if item == nil { return nil } @@ -317,7 +317,7 @@ func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsNet } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsNetworkrxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpisLegendsNetworkrxRate) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisLegendsNetworkrxRate(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1KpisLegendsNetworkrxRate) []map[string]interface{} { if item == nil { return nil } @@ -330,7 +330,7 @@ func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisLegendsNet } -func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIItemKpisData(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIKpisData) []map[string]interface{} { +func flattenHealthAndPerformanceSystemPerformanceHistoricalAPIV1ItemKpisData(item *catalystcentersdkgo.ResponseHealthAndPerformanceSystemPerformanceHistoricalAPIV1KpisData) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_tag.go b/catalystcenter/data_source_tag.go index 6aa80d1..24730fb 100644 --- a/catalystcenter/data_source_tag.go +++ b/catalystcenter/data_source_tag.go @@ -294,8 +294,8 @@ func dataSourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{ selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTag") - queryParams1 := catalystcentersdkgo.GetTagQueryParams{} + log.Printf("[DEBUG] Selected method: GetTagV1") + queryParams1 := catalystcentersdkgo.GetTagV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -331,24 +331,24 @@ func dataSourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{ queryParams1.SystemTag = vSystemTag.(string) } - response1, restyResp1, err := client.Tag.GetTag(&queryParams1) + response1, restyResp1, err := client.Tag.GetTagV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTag", err, - "Failure at GetTag, unexpected response", "")) + "Failure when executing 2 GetTagV1", err, + "Failure at GetTagV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTagGetTagItems(response1.Response) + vItems1 := flattenTagGetTagV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTag response", + "Failure when setting GetTagV1 response", err)) return diags } @@ -358,27 +358,27 @@ func dataSourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{ } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetTagByID") + log.Printf("[DEBUG] Selected method: GetTagByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Tag.GetTagByID(vvID) + response2, restyResp2, err := client.Tag.GetTagByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTagByID", err, - "Failure at GetTagByID, unexpected response", "")) + "Failure when executing 2 GetTagByIDV1", err, + "Failure at GetTagByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenTagGetTagByIDItem(response2.Response) + vItem2 := flattenTagGetTagByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetTagByID response", + "Failure when setting GetTagByIDV1 response", err)) return diags } @@ -390,7 +390,7 @@ func dataSourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{ return diags } -func flattenTagGetTagItems(items *[]catalystcentersdkgo.ResponseTagGetTagResponse) []map[string]interface{} { +func flattenTagGetTagV1Items(items *[]catalystcentersdkgo.ResponseTagGetTagV1Response) []map[string]interface{} { if items == nil { return nil } @@ -399,7 +399,7 @@ func flattenTagGetTagItems(items *[]catalystcentersdkgo.ResponseTagGetTagRespons respItem := make(map[string]interface{}) respItem["system_tag"] = boolPtrToString(item.SystemTag) respItem["description"] = item.Description - respItem["dynamic_rules"] = flattenTagGetTagItemsDynamicRules(item.DynamicRules) + respItem["dynamic_rules"] = flattenTagGetTagV1ItemsDynamicRules(item.DynamicRules) respItem["name"] = item.Name respItem["id"] = item.ID respItem["instance_tenant_id"] = item.InstanceTenantID @@ -408,7 +408,7 @@ func flattenTagGetTagItems(items *[]catalystcentersdkgo.ResponseTagGetTagRespons return respItems } -func flattenTagGetTagItemsDynamicRules(items *[]catalystcentersdkgo.ResponseTagGetTagResponseDynamicRules) []map[string]interface{} { +func flattenTagGetTagV1ItemsDynamicRules(items *[]catalystcentersdkgo.ResponseTagGetTagV1ResponseDynamicRules) []map[string]interface{} { if items == nil { return nil } @@ -416,19 +416,19 @@ func flattenTagGetTagItemsDynamicRules(items *[]catalystcentersdkgo.ResponseTagG for _, item := range *items { respItem := make(map[string]interface{}) respItem["member_type"] = item.MemberType - respItem["rules"] = flattenTagGetTagItemsDynamicRulesRules(item.Rules) + respItem["rules"] = flattenTagGetTagV1ItemsDynamicRulesRules(item.Rules) respItems = append(respItems, respItem) } return respItems } -func flattenTagGetTagItemsDynamicRulesRules(item *catalystcentersdkgo.ResponseTagGetTagResponseDynamicRulesRules) []map[string]interface{} { +func flattenTagGetTagV1ItemsDynamicRulesRules(item *catalystcentersdkgo.ResponseTagGetTagV1ResponseDynamicRulesRules) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["values"] = item.Values - respItem["items"] = flattenTagGetTagItemsDynamicRulesRulesItems(item.Items) + respItem["items"] = item.Items respItem["operation"] = item.Operation respItem["name"] = item.Name respItem["value"] = item.Value @@ -439,26 +439,14 @@ func flattenTagGetTagItemsDynamicRulesRules(item *catalystcentersdkgo.ResponseTa } -func flattenTagGetTagItemsDynamicRulesRulesItems(items *[]catalystcentersdkgo.ResponseTagGetTagResponseDynamicRulesRulesItems) []interface{} { - if items == nil { - return nil - } - var respItems []interface{} - for _, item := range *items { - respItem := item - respItems = append(respItems, responseInterfaceToString(respItem)) - } - return respItems -} - -func flattenTagGetTagByIDItem(item *catalystcentersdkgo.ResponseTagGetTagByIDResponse) []map[string]interface{} { +func flattenTagGetTagByIDV1Item(item *catalystcentersdkgo.ResponseTagGetTagByIDV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["system_tag"] = boolPtrToString(item.SystemTag) respItem["description"] = item.Description - respItem["dynamic_rules"] = flattenTagGetTagByIDItemDynamicRules(item.DynamicRules) + respItem["dynamic_rules"] = flattenTagGetTagByIDV1ItemDynamicRules(item.DynamicRules) respItem["name"] = item.Name respItem["id"] = item.ID respItem["instance_tenant_id"] = item.InstanceTenantID @@ -467,7 +455,7 @@ func flattenTagGetTagByIDItem(item *catalystcentersdkgo.ResponseTagGetTagByIDRes } } -func flattenTagGetTagByIDItemDynamicRules(items *[]catalystcentersdkgo.ResponseTagGetTagByIDResponseDynamicRules) []map[string]interface{} { +func flattenTagGetTagByIDV1ItemDynamicRules(items *[]catalystcentersdkgo.ResponseTagGetTagByIDV1ResponseDynamicRules) []map[string]interface{} { if items == nil { return nil } @@ -475,19 +463,19 @@ func flattenTagGetTagByIDItemDynamicRules(items *[]catalystcentersdkgo.ResponseT for _, item := range *items { respItem := make(map[string]interface{}) respItem["member_type"] = item.MemberType - respItem["rules"] = flattenTagGetTagByIDItemDynamicRulesRules(item.Rules) + respItem["rules"] = flattenTagGetTagByIDV1ItemDynamicRulesRules(item.Rules) respItems = append(respItems, respItem) } return respItems } -func flattenTagGetTagByIDItemDynamicRulesRules(item *catalystcentersdkgo.ResponseTagGetTagByIDResponseDynamicRulesRules) []map[string]interface{} { +func flattenTagGetTagByIDV1ItemDynamicRulesRules(item *catalystcentersdkgo.ResponseTagGetTagByIDV1ResponseDynamicRulesRules) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["values"] = item.Values - respItem["items"] = flattenTagGetTagByIDItemDynamicRulesRulesItems(item.Items) + respItem["items"] = item.Items respItem["operation"] = item.Operation respItem["name"] = item.Name respItem["value"] = item.Value @@ -497,15 +485,3 @@ func flattenTagGetTagByIDItemDynamicRulesRules(item *catalystcentersdkgo.Respons } } - -func flattenTagGetTagByIDItemDynamicRulesRulesItems(items *[]catalystcentersdkgo.ResponseTagGetTagByIDResponseDynamicRulesRulesItems) []interface{} { - if items == nil { - return nil - } - var respItems []interface{} - for _, item := range *items { - respItem := item - respItems = append(respItems, responseInterfaceToString(respItem)) - } - return respItems -} diff --git a/catalystcenter/data_source_tag_count.go b/catalystcenter/data_source_tag_count.go index 5879995..417f8fe 100644 --- a/catalystcenter/data_source_tag_count.go +++ b/catalystcenter/data_source_tag_count.go @@ -81,8 +81,8 @@ func dataSourceTagCountRead(ctx context.Context, d *schema.ResourceData, m inter selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTagCount") - queryParams1 := catalystcentersdkgo.GetTagCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetTagCountV1") + queryParams1 := catalystcentersdkgo.GetTagCountV1QueryParams{} if okName { queryParams1.Name = vName.(string) @@ -100,24 +100,24 @@ func dataSourceTagCountRead(ctx context.Context, d *schema.ResourceData, m inter queryParams1.SystemTag = vSystemTag.(string) } - response1, restyResp1, err := client.Tag.GetTagCount(&queryParams1) + response1, restyResp1, err := client.Tag.GetTagCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTagCount", err, - "Failure at GetTagCount, unexpected response", "")) + "Failure when executing 2 GetTagCountV1", err, + "Failure at GetTagCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTagGetTagCountItem(response1) + vItem1 := flattenTagGetTagCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTagCount response", + "Failure when setting GetTagCountV1 response", err)) return diags } @@ -129,7 +129,7 @@ func dataSourceTagCountRead(ctx context.Context, d *schema.ResourceData, m inter return diags } -func flattenTagGetTagCountItem(item *catalystcentersdkgo.ResponseTagGetTagCount) []map[string]interface{} { +func flattenTagGetTagCountV1Item(item *catalystcentersdkgo.ResponseTagGetTagCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_tag_member.go b/catalystcenter/data_source_tag_member.go index bf9dfb1..ba14a08 100644 --- a/catalystcenter/data_source_tag_member.go +++ b/catalystcenter/data_source_tag_member.go @@ -86,9 +86,9 @@ func dataSourceTagMemberRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTagMembersByID") + log.Printf("[DEBUG] Selected method: GetTagMembersByIDV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetTagMembersByIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagMembersByIDV1QueryParams{} queryParams1.MemberType = vMemberType.(string) @@ -105,24 +105,24 @@ func dataSourceTagMemberRead(ctx context.Context, d *schema.ResourceData, m inte queryParams1.Level = vLevel.(string) } - response1, restyResp1, err := client.Tag.GetTagMembersByID(vvID, &queryParams1) + response1, restyResp1, err := client.Tag.GetTagMembersByIDV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTagMembersByID", err, - "Failure at GetTagMembersByID, unexpected response", "")) + "Failure when executing 2 GetTagMembersByIDV1", err, + "Failure at GetTagMembersByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTagGetTagMembersByIDItems(response1.Response) + vItems1 := flattenTagGetTagMembersByIDV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTagMembersByID response", + "Failure when setting GetTagMembersByIDV1 response", err)) return diags } @@ -134,7 +134,7 @@ func dataSourceTagMemberRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenTagGetTagMembersByIDItems(items *[]catalystcentersdkgo.ResponseTagGetTagMembersByIDResponse) []map[string]interface{} { +func flattenTagGetTagMembersByIDV1Items(items *[]catalystcentersdkgo.ResponseTagGetTagMembersByIDV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_tag_member_count.go b/catalystcenter/data_source_tag_member_count.go index f5fc236..5fce7c3 100644 --- a/catalystcenter/data_source_tag_member_count.go +++ b/catalystcenter/data_source_tag_member_count.go @@ -69,9 +69,9 @@ func dataSourceTagMemberCountRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTagMemberCount") + log.Printf("[DEBUG] Selected method: GetTagMemberCountV1") vvID := vID.(string) - queryParams1 := catalystcentersdkgo.GetTagMemberCountQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagMemberCountV1QueryParams{} queryParams1.MemberType = vMemberType.(string) @@ -79,24 +79,24 @@ func dataSourceTagMemberCountRead(ctx context.Context, d *schema.ResourceData, m queryParams1.MemberAssociationType = vMemberAssociationType.(string) } - response1, restyResp1, err := client.Tag.GetTagMemberCount(vvID, &queryParams1) + response1, restyResp1, err := client.Tag.GetTagMemberCountV1(vvID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTagMemberCount", err, - "Failure at GetTagMemberCount, unexpected response", "")) + "Failure when executing 2 GetTagMemberCountV1", err, + "Failure at GetTagMemberCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTagGetTagMemberCountItem(response1) + vItem1 := flattenTagGetTagMemberCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTagMemberCount response", + "Failure when setting GetTagMemberCountV1 response", err)) return diags } @@ -108,7 +108,7 @@ func dataSourceTagMemberCountRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenTagGetTagMemberCountItem(item *catalystcentersdkgo.ResponseTagGetTagMemberCount) []map[string]interface{} { +func flattenTagGetTagMemberCountV1Item(item *catalystcentersdkgo.ResponseTagGetTagMemberCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_tag_member_type.go b/catalystcenter/data_source_tag_member_type.go index 4ed50d7..a547a4d 100644 --- a/catalystcenter/data_source_tag_member_type.go +++ b/catalystcenter/data_source_tag_member_type.go @@ -53,26 +53,26 @@ func dataSourceTagMemberTypeRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTagResourceTypes") + log.Printf("[DEBUG] Selected method: GetTagResourceTypesV1") - response1, restyResp1, err := client.Tag.GetTagResourceTypes() + response1, restyResp1, err := client.Tag.GetTagResourceTypesV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTagResourceTypes", err, - "Failure at GetTagResourceTypes, unexpected response", "")) + "Failure when executing 2 GetTagResourceTypesV1", err, + "Failure at GetTagResourceTypesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTagGetTagResourceTypesItems(response1) + vItems1 := flattenTagGetTagResourceTypesV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTagResourceTypes response", + "Failure when setting GetTagResourceTypesV1 response", err)) return diags } @@ -84,7 +84,7 @@ func dataSourceTagMemberTypeRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenTagGetTagResourceTypesItems(items *catalystcentersdkgo.ResponseTagGetTagResourceTypes) []map[string]interface{} { +func flattenTagGetTagResourceTypesV1Items(items *catalystcentersdkgo.ResponseTagGetTagResourceTypesV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_tags_interfaces_members_associations.go b/catalystcenter/data_source_tags_interfaces_members_associations.go new file mode 100644 index 0000000..1c34131 --- /dev/null +++ b/catalystcenter/data_source_tags_interfaces_members_associations.go @@ -0,0 +1,154 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceTagsInterfacesMembersAssociations() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Tag. + +- Fetches the tags associated with the interfaces. Interfaces that don't have any tags associated will not be included +in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is tagged, it +is called a member of the tag. +`, + + ReadContext: dataSourceTagsInterfacesMembersAssociationsRead, + Schema: map[string]*schema.Schema{ + "limit": &schema.Schema{ + Description: `limit query parameter. The number of records to show for this page. minimum: 1, maximum: 500 +`, + Type: schema.TypeFloat, + Optional: true, + }, + "offset": &schema.Schema{ + Description: `offset query parameter. The first record to show for this page; the first record is numbered 1. minimum: 1 +`, + Type: schema.TypeFloat, + Optional: true, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Id of the member (network device or interface) +`, + Type: schema.TypeString, + Computed: true, + }, + + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Tag id +`, + Type: schema.TypeString, + Computed: true, + }, + + "name": &schema.Schema{ + Description: `Tag name +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceTagsInterfacesMembersAssociationsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vOffset, okOffset := d.GetOk("offset") + vLimit, okLimit := d.GetOk("limit") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: RetrieveTagsAssociatedWithTheInterfacesV1") + queryParams1 := catalystcentersdkgo.RetrieveTagsAssociatedWithTheInterfacesV1QueryParams{} + + if okOffset { + queryParams1.Offset = vOffset.(float64) + } + if okLimit { + queryParams1.Limit = vLimit.(float64) + } + + response1, restyResp1, err := client.Tag.RetrieveTagsAssociatedWithTheInterfacesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 RetrieveTagsAssociatedWithTheInterfacesV1", err, + "Failure at RetrieveTagsAssociatedWithTheInterfacesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenTagRetrieveTagsAssociatedWithTheInterfacesV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting RetrieveTagsAssociatedWithTheInterfacesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenTagRetrieveTagsAssociatedWithTheInterfacesV1Items(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithTheInterfacesV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["tags"] = flattenTagRetrieveTagsAssociatedWithTheInterfacesV1ItemsTags(item.Tags) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenTagRetrieveTagsAssociatedWithTheInterfacesV1ItemsTags(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithTheInterfacesV1ResponseTags) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["name"] = item.Name + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_tags_interfaces_members_associations_count.go b/catalystcenter/data_source_tags_interfaces_members_associations_count.go new file mode 100644 index 0000000..e97e417 --- /dev/null +++ b/catalystcenter/data_source_tags_interfaces_members_associations_count.go @@ -0,0 +1,91 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceTagsInterfacesMembersAssociationsCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Tag. + +- Fetches the count of interfaces that are associated with at least one tag. A tag is a user-defined or system-defined +construct to group resources. When an interface is tagged, it is called a member of the tag. +`, + + ReadContext: dataSourceTagsInterfacesMembersAssociationsCountRead, + Schema: map[string]*schema.Schema{ + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "count": &schema.Schema{ + Description: `The reported count. +`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceTagsInterfacesMembersAssociationsCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: RetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1") + + response1, restyResp1, err := client.Tag.RetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 RetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1", err, + "Failure at RetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1Item(response1.Response) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting RetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1Item(item *catalystcentersdkgo.ResponseTagRetrieveTheCountOfInterfacesThatAreAssociatedWithAtLeastOneTagV1Response) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["count"] = item.Count + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/data_source_tags_network_devices_members_associations.go b/catalystcenter/data_source_tags_network_devices_members_associations.go new file mode 100644 index 0000000..63fa41f --- /dev/null +++ b/catalystcenter/data_source_tags_network_devices_members_associations.go @@ -0,0 +1,154 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceTagsNetworkDevicesMembersAssociations() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Tag. + +- Fetches the tags associated with network devices. Devices that don't have any tags associated will not be included in +the response. A tag is a user-defined or system-defined construct to group resources. When a device is tagged, it is +called a member of the tag. +`, + + ReadContext: dataSourceTagsNetworkDevicesMembersAssociationsRead, + Schema: map[string]*schema.Schema{ + "limit": &schema.Schema{ + Description: `limit query parameter. The number of records to show for this page. minimum: 1, maximum: 500 +`, + Type: schema.TypeFloat, + Optional: true, + }, + "offset": &schema.Schema{ + Description: `offset query parameter. The first record to show for this page; the first record is numbered 1. minimum: 1 +`, + Type: schema.TypeFloat, + Optional: true, + }, + + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Id of the member (network device or interface) +`, + Type: schema.TypeString, + Computed: true, + }, + + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Tag id +`, + Type: schema.TypeString, + Computed: true, + }, + + "name": &schema.Schema{ + Description: `Tag name +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceTagsNetworkDevicesMembersAssociationsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + vOffset, okOffset := d.GetOk("offset") + vLimit, okLimit := d.GetOk("limit") + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: RetrieveTagsAssociatedWithNetworkDevicesV1") + queryParams1 := catalystcentersdkgo.RetrieveTagsAssociatedWithNetworkDevicesV1QueryParams{} + + if okOffset { + queryParams1.Offset = vOffset.(float64) + } + if okLimit { + queryParams1.Limit = vLimit.(float64) + } + + response1, restyResp1, err := client.Tag.RetrieveTagsAssociatedWithNetworkDevicesV1(&queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 RetrieveTagsAssociatedWithNetworkDevicesV1", err, + "Failure at RetrieveTagsAssociatedWithNetworkDevicesV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenTagRetrieveTagsAssociatedWithNetworkDevicesV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting RetrieveTagsAssociatedWithNetworkDevicesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenTagRetrieveTagsAssociatedWithNetworkDevicesV1Items(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithNetworkDevicesV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["tags"] = flattenTagRetrieveTagsAssociatedWithNetworkDevicesV1ItemsTags(item.Tags) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenTagRetrieveTagsAssociatedWithNetworkDevicesV1ItemsTags(items *[]catalystcentersdkgo.ResponseTagRetrieveTagsAssociatedWithNetworkDevicesV1ResponseTags) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["name"] = item.Name + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/data_source_tags_network_devices_members_associations_count.go b/catalystcenter/data_source_tags_network_devices_members_associations_count.go new file mode 100644 index 0000000..443ad7c --- /dev/null +++ b/catalystcenter/data_source_tags_network_devices_members_associations_count.go @@ -0,0 +1,91 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceTagsNetworkDevicesMembersAssociationsCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs read operation on Tag. + +- Fetches the count of network devices that are associated with at least one tag. A tag is a user-defined or system- +defined construct to group resources. When a device is tagged, it is called a member of the tag. +`, + + ReadContext: dataSourceTagsNetworkDevicesMembersAssociationsCountRead, + Schema: map[string]*schema.Schema{ + + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "count": &schema.Schema{ + Description: `The reported count. +`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceTagsNetworkDevicesMembersAssociationsCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: RetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1") + + response1, restyResp1, err := client.Tag.RetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1() + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 RetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1", err, + "Failure at RetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1Item(response1.Response) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting RetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + } + return diags +} + +func flattenTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1Item(item *catalystcentersdkgo.ResponseTagRetrieveTheCountOfNetworkDevicesThatAreAssociatedWithAtLeastOneTagV1Response) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["count"] = item.Count + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/data_source_task.go b/catalystcenter/data_source_task.go index c4623bf..892c484 100644 --- a/catalystcenter/data_source_task.go +++ b/catalystcenter/data_source_task.go @@ -347,8 +347,8 @@ func dataSourceTaskRead(ctx context.Context, d *schema.ResourceData, m interface selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTasks2") - queryParams1 := catalystcentersdkgo.GetTasks2QueryParams{} + log.Printf("[DEBUG] Selected method: GetTasksOperationalTasksV1") + queryParams1 := catalystcentersdkgo.GetTasksOperationalTasksV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(string) @@ -393,24 +393,24 @@ func dataSourceTaskRead(ctx context.Context, d *schema.ResourceData, m interface queryParams1.Order = vOrder.(string) } - response1, restyResp1, err := client.Task.GetTasks2(&queryParams1) + response1, restyResp1, err := client.Task.GetTasksOperationalTasksV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTasks2", err, - "Failure at GetTasks2, unexpected response", "")) + "Failure when executing 2 GetTasksOperationalTasksV1", err, + "Failure at GetTasksOperationalTasksV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTaskGetTasks2Items(response1.Response) + vItems1 := flattenTaskGetTasksOperationalTasksV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTasks2 response", + "Failure when setting GetTasksOperationalTasksV1 response", err)) return diags } @@ -420,27 +420,27 @@ func dataSourceTaskRead(ctx context.Context, d *schema.ResourceData, m interface } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetTaskByID") + log.Printf("[DEBUG] Selected method: GetTaskByIDV1") vvTaskID := vTaskID.(string) - response2, restyResp2, err := client.Task.GetTaskByID(vvTaskID) + response2, restyResp2, err := client.Task.GetTaskByIDV1(vvTaskID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTaskByID", err, - "Failure at GetTaskByID, unexpected response", "")) + "Failure when executing 2 GetTaskByIDV1", err, + "Failure at GetTaskByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenTaskGetTaskByIDItem(response2.Response) + vItem2 := flattenTaskGetTaskByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetTaskByID response", + "Failure when setting GetTaskByIDV1 response", err)) return diags } @@ -452,7 +452,7 @@ func dataSourceTaskRead(ctx context.Context, d *schema.ResourceData, m interface return diags } -func flattenTaskGetTasks2Items(items *[]catalystcentersdkgo.ResponseTaskGetTasks2Response) []map[string]interface{} { +func flattenTaskGetTasksOperationalTasksV1Items(items *[]catalystcentersdkgo.ResponseTaskGetTasksOperationalTasksV1Response) []map[string]interface{} { if items == nil { return nil } @@ -482,7 +482,7 @@ func flattenTaskGetTasks2Items(items *[]catalystcentersdkgo.ResponseTaskGetTasks return respItems } -func flattenTaskGetTaskByIDItem(item *catalystcentersdkgo.ResponseTaskGetTaskByIDResponse) []map[string]interface{} { +func flattenTaskGetTaskByIDV1Item(item *catalystcentersdkgo.ResponseTaskGetTaskByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_task_count.go b/catalystcenter/data_source_task_count.go index d7559f9..ea6f772 100644 --- a/catalystcenter/data_source_task_count.go +++ b/catalystcenter/data_source_task_count.go @@ -120,8 +120,8 @@ func dataSourceTaskCountRead(ctx context.Context, d *schema.ResourceData, m inte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTaskCount") - queryParams1 := catalystcentersdkgo.GetTaskCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetTaskCountV1") + queryParams1 := catalystcentersdkgo.GetTaskCountV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(string) @@ -154,24 +154,24 @@ func dataSourceTaskCountRead(ctx context.Context, d *schema.ResourceData, m inte queryParams1.ParentID = vParentID.(string) } - response1, restyResp1, err := client.Task.GetTaskCount(&queryParams1) + response1, restyResp1, err := client.Task.GetTaskCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTaskCount", err, - "Failure at GetTaskCount, unexpected response", "")) + "Failure when executing 2 GetTaskCountV1", err, + "Failure at GetTaskCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTaskGetTaskCountItem(response1) + vItem1 := flattenTaskGetTaskCountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTaskCount response", + "Failure when setting GetTaskCountV1 response", err)) return diags } @@ -183,7 +183,7 @@ func dataSourceTaskCountRead(ctx context.Context, d *schema.ResourceData, m inte return diags } -func flattenTaskGetTaskCountItem(item *catalystcentersdkgo.ResponseTaskGetTaskCount) []map[string]interface{} { +func flattenTaskGetTaskCountV1Item(item *catalystcentersdkgo.ResponseTaskGetTaskCountV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_task_operation.go b/catalystcenter/data_source_task_operation.go index e90762a..206f973 100644 --- a/catalystcenter/data_source_task_operation.go +++ b/catalystcenter/data_source_task_operation.go @@ -155,29 +155,29 @@ func dataSourceTaskOperationRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTaskByOperationID") + log.Printf("[DEBUG] Selected method: GetTaskByOperationIDV1") vvOperationID := vOperationID.(string) vvOffset := vOffset.(int) vvLimit := vLimit.(int) - response1, restyResp1, err := client.Task.GetTaskByOperationID(vvOperationID, vvOffset, vvLimit) + response1, restyResp1, err := client.Task.GetTaskByOperationIDV1(vvOperationID, vvOffset, vvLimit) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTaskByOperationID", err, - "Failure at GetTaskByOperationID, unexpected response", "")) + "Failure when executing 2 GetTaskByOperationIDV1", err, + "Failure at GetTaskByOperationIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTaskGetTaskByOperationIDItems(response1.Response) + vItems1 := flattenTaskGetTaskByOperationIDV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTaskByOperationID response", + "Failure when setting GetTaskByOperationIDV1 response", err)) return diags } @@ -189,7 +189,7 @@ func dataSourceTaskOperationRead(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenTaskGetTaskByOperationIDItems(items *[]catalystcentersdkgo.ResponseTaskGetTaskByOperationIDResponse) []map[string]interface{} { +func flattenTaskGetTaskByOperationIDV1Items(items *[]catalystcentersdkgo.ResponseTaskGetTaskByOperationIDV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_task_tree.go b/catalystcenter/data_source_task_tree.go index 291274a..3e4a80b 100644 --- a/catalystcenter/data_source_task_tree.go +++ b/catalystcenter/data_source_task_tree.go @@ -141,27 +141,27 @@ func dataSourceTaskTreeRead(ctx context.Context, d *schema.ResourceData, m inter selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTaskTree") + log.Printf("[DEBUG] Selected method: GetTaskTreeV1") vvTaskID := vTaskID.(string) - response1, restyResp1, err := client.Task.GetTaskTree(vvTaskID) + response1, restyResp1, err := client.Task.GetTaskTreeV1(vvTaskID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTaskTree", err, - "Failure at GetTaskTree, unexpected response", "")) + "Failure when executing 2 GetTaskTreeV1", err, + "Failure at GetTaskTreeV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTaskGetTaskTreeItems(response1.Response) + vItems1 := flattenTaskGetTaskTreeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTaskTree response", + "Failure when setting GetTaskTreeV1 response", err)) return diags } @@ -173,7 +173,7 @@ func dataSourceTaskTreeRead(ctx context.Context, d *schema.ResourceData, m inter return diags } -func flattenTaskGetTaskTreeItems(items *[]catalystcentersdkgo.ResponseTaskGetTaskTreeResponse) []map[string]interface{} { +func flattenTaskGetTaskTreeV1Items(items *[]catalystcentersdkgo.ResponseTaskGetTaskTreeV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_tasks.go b/catalystcenter/data_source_tasks.go index 1e9478a..b7a3476 100644 --- a/catalystcenter/data_source_tasks.go +++ b/catalystcenter/data_source_tasks.go @@ -29,7 +29,7 @@ func dataSourceTasks() *schema.Resource { Optional: true, }, "id": &schema.Schema{ - Description: `id path parameter. the 'id' of the task to retrieve + Description: `id path parameter. the *id* of the task to retrieve `, Type: schema.TypeString, Optional: true, @@ -234,8 +234,8 @@ func dataSourceTasksRead(ctx context.Context, d *schema.ResourceData, m interfac selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTasks") - queryParams1 := catalystcentersdkgo.GetTasksQueryParams{} + log.Printf("[DEBUG] Selected method: GetTasksV1") + queryParams1 := catalystcentersdkgo.GetTasksV1QueryParams{} if okOffset { queryParams1.Offset = vOffset.(int) @@ -265,24 +265,24 @@ func dataSourceTasksRead(ctx context.Context, d *schema.ResourceData, m interfac queryParams1.Status = vStatus.(string) } - response1, restyResp1, err := client.Task.GetTasks(&queryParams1) + response1, restyResp1, err := client.Task.GetTasksV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTasks", err, - "Failure at GetTasks, unexpected response", "")) + "Failure when executing 2 GetTasksV1", err, + "Failure at GetTasksV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTaskGetTasksItems(response1.Response) + vItems1 := flattenTaskGetTasksV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTasks response", + "Failure when setting GetTasksV1 response", err)) return diags } @@ -292,27 +292,27 @@ func dataSourceTasksRead(ctx context.Context, d *schema.ResourceData, m interfac } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetTasksByID") + log.Printf("[DEBUG] Selected method: GetTasksByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Task.GetTasksByID(vvID) + response2, restyResp2, err := client.Task.GetTasksByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTasksByID", err, - "Failure at GetTasksByID, unexpected response", "")) + "Failure when executing 2 GetTasksByIDV1", err, + "Failure at GetTasksByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenTaskGetTasksByIDItem(response2.Response) + vItem2 := flattenTaskGetTasksByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetTasksByID response", + "Failure when setting GetTasksByIDV1 response", err)) return diags } @@ -324,7 +324,7 @@ func dataSourceTasksRead(ctx context.Context, d *schema.ResourceData, m interfac return diags } -func flattenTaskGetTasksItems(items *[]catalystcentersdkgo.ResponseTaskGetTasksResponse) []map[string]interface{} { +func flattenTaskGetTasksV1Items(items *[]catalystcentersdkgo.ResponseTaskGetTasksV1Response) []map[string]interface{} { if items == nil { return nil } @@ -344,7 +344,7 @@ func flattenTaskGetTasksItems(items *[]catalystcentersdkgo.ResponseTaskGetTasksR return respItems } -func flattenTaskGetTasksByIDItem(item *catalystcentersdkgo.ResponseTaskGetTasksByIDResponse) []map[string]interface{} { +func flattenTaskGetTasksByIDV1Item(item *catalystcentersdkgo.ResponseTaskGetTasksByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_tasks_count.go b/catalystcenter/data_source_tasks_count.go index a6c507d..703764a 100644 --- a/catalystcenter/data_source_tasks_count.go +++ b/catalystcenter/data_source_tasks_count.go @@ -82,8 +82,8 @@ func dataSourceTasksCountRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTasksCount") - queryParams1 := catalystcentersdkgo.GetTasksCountQueryParams{} + log.Printf("[DEBUG] Selected method: GetTasksCountV1") + queryParams1 := catalystcentersdkgo.GetTasksCountV1QueryParams{} if okStartTime { queryParams1.StartTime = vStartTime.(int) @@ -101,24 +101,24 @@ func dataSourceTasksCountRead(ctx context.Context, d *schema.ResourceData, m int queryParams1.Status = vStatus.(string) } - response1, restyResp1, err := client.Task.GetTasksCount(&queryParams1) + response1, restyResp1, err := client.Task.GetTasksCountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTasksCount", err, - "Failure at GetTasksCount, unexpected response", "")) + "Failure when executing 2 GetTasksCountV1", err, + "Failure at GetTasksCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTaskGetTasksCountItem(response1.Response) + vItem1 := flattenTaskGetTasksCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTasksCount response", + "Failure when setting GetTasksCountV1 response", err)) return diags } @@ -130,7 +130,7 @@ func dataSourceTasksCountRead(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenTaskGetTasksCountItem(item *catalystcentersdkgo.ResponseTaskGetTasksCountResponse) []map[string]interface{} { +func flattenTaskGetTasksCountV1Item(item *catalystcentersdkgo.ResponseTaskGetTasksCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_tasks_detail.go b/catalystcenter/data_source_tasks_detail.go index 04dd933..588a59a 100644 --- a/catalystcenter/data_source_tasks_detail.go +++ b/catalystcenter/data_source_tasks_detail.go @@ -21,7 +21,7 @@ func dataSourceTasksDetail() *schema.Resource { ReadContext: dataSourceTasksDetailRead, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. the 'id' of the task to retrieve details for + Description: `id path parameter. the *id* of the task to retrieve details for `, Type: schema.TypeString, Required: true, @@ -75,27 +75,27 @@ func dataSourceTasksDetailRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTaskDetailsByID") + log.Printf("[DEBUG] Selected method: GetTaskDetailsByIDV1") vvID := vID.(string) - response1, restyResp1, err := client.Task.GetTaskDetailsByID(vvID) + response1, restyResp1, err := client.Task.GetTaskDetailsByIDV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTaskDetailsByID", err, - "Failure at GetTaskDetailsByID, unexpected response", "")) + "Failure when executing 2 GetTaskDetailsByIDV1", err, + "Failure at GetTaskDetailsByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTaskGetTaskDetailsByIDItem(response1.Response) + vItem1 := flattenTaskGetTaskDetailsByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTaskDetailsByID response", + "Failure when setting GetTaskDetailsByIDV1 response", err)) return diags } @@ -107,7 +107,7 @@ func dataSourceTasksDetailRead(ctx context.Context, d *schema.ResourceData, m in return diags } -func flattenTaskGetTaskDetailsByIDItem(item *catalystcentersdkgo.ResponseTaskGetTaskDetailsByIDResponse) []map[string]interface{} { +func flattenTaskGetTaskDetailsByIDV1Item(item *catalystcentersdkgo.ResponseTaskGetTaskDetailsByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_templates_details.go b/catalystcenter/data_source_templates_details_v2.go similarity index 82% rename from catalystcenter/data_source_templates_details.go rename to catalystcenter/data_source_templates_details_v2.go index 0c83ab0..53825a0 100644 --- a/catalystcenter/data_source_templates_details.go +++ b/catalystcenter/data_source_templates_details_v2.go @@ -11,14 +11,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceTemplatesDetails() *schema.Resource { +func dataSourceTemplatesDetailsV2() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on Configuration Templates. - Get template(s) details `, - ReadContext: dataSourceTemplatesDetailsRead, + ReadContext: dataSourceTemplatesDetailsV2Read, Schema: map[string]*schema.Schema{ "all_template_attributes": &schema.Schema{ Description: `allTemplateAttributes query parameter. Return all template attributes @@ -1310,7 +1310,7 @@ func dataSourceTemplatesDetails() *schema.Resource { } } -func dataSourceTemplatesDetailsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func dataSourceTemplatesDetailsV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -1334,8 +1334,8 @@ func dataSourceTemplatesDetailsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTemplatesDetails") - queryParams1 := catalystcentersdkgo.GetTemplatesDetailsQueryParams{} + log.Printf("[DEBUG] Selected method: GetTemplatesDetailsV2") + queryParams1 := catalystcentersdkgo.GetTemplatesDetailsV2QueryParams{} if okID { queryParams1.ID = vID.(string) @@ -1389,24 +1389,24 @@ func dataSourceTemplatesDetailsRead(ctx context.Context, d *schema.ResourceData, queryParams1.Limit = vLimit.(int) } - response1, restyResp1, err := client.ConfigurationTemplates.GetTemplatesDetails(&queryParams1) + response1, restyResp1, err := client.ConfigurationTemplates.GetTemplatesDetailsV2(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTemplatesDetails", err, - "Failure at GetTemplatesDetails, unexpected response", "")) + "Failure when executing 2 GetTemplatesDetailsV2", err, + "Failure at GetTemplatesDetailsV2, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenConfigurationTemplatesGetTemplatesDetailsItem(&response1.Response) + vItem1 := flattenConfigurationTemplatesGetTemplatesDetailsV2Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTemplatesDetails response", + "Failure when setting GetTemplatesDetailsV2 response", err)) return diags } @@ -1418,47 +1418,45 @@ func dataSourceTemplatesDetailsRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenConfigurationTemplatesGetTemplatesDetailsItem(item *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsResponse) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2) []map[string]interface{} { if item == nil { return nil } - var respItems []map[string]interface{} - for _, item := range *item { - respItem := make(map[string]interface{}) - respItem["author"] = item.Author - respItem["composite"] = boolPtrToString(item.Composite) - respItem["containing_templates"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplates(item.ContainingTemplates) - respItem["create_time"] = item.CreateTime - respItem["custom_params_order"] = boolPtrToString(item.CustomParamsOrder) - respItem["description"] = item.Description - respItem["device_types"] = flattenConfigurationTemplatesGetTemplatesDetailsItemDeviceTypes(item.DeviceTypes) - respItem["failure_policy"] = item.FailurePolicy - respItem["id"] = item.ID - respItem["language"] = item.Language - respItem["last_update_time"] = item.LastUpdateTime - respItem["latest_version_time"] = item.LatestVersionTime - respItem["name"] = item.Name - respItem["parent_template_id"] = item.ParentTemplateID - respItem["project_associated"] = boolPtrToString(item.ProjectAssociated) - respItem["project_id"] = item.ProjectID - respItem["project_name"] = item.ProjectName - respItem["rollback_template_content"] = item.RollbackTemplateContent - respItem["rollback_template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParams(item.RollbackTemplateParams) - respItem["software_type"] = item.SoftwareType - respItem["software_variant"] = item.SoftwareVariant - respItem["software_version"] = item.SoftwareVersion - respItem["tags"] = flattenConfigurationTemplatesGetTemplatesDetailsItemTags(item.Tags) - respItem["template_content"] = item.TemplateContent - respItem["template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParams(item.TemplateParams) - respItem["validation_errors"] = flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrors(item.ValidationErrors) - respItem["version"] = item.Version - respItem["versions_info"] = flattenConfigurationTemplatesGetTemplatesDetailsItemVersionsInfo(item.VersionsInfo) - respItems = append(respItems, respItem) + respItem := make(map[string]interface{}) + respItem["author"] = item.Author + respItem["composite"] = boolPtrToString(item.Composite) + respItem["containing_templates"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplates(item.ContainingTemplates) + respItem["create_time"] = item.CreateTime + respItem["custom_params_order"] = boolPtrToString(item.CustomParamsOrder) + respItem["description"] = item.Description + respItem["device_types"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemDeviceTypes(item.DeviceTypes) + respItem["failure_policy"] = item.FailurePolicy + respItem["id"] = item.ID + respItem["language"] = item.Language + respItem["last_update_time"] = item.LastUpdateTime + respItem["latest_version_time"] = item.LatestVersionTime + respItem["name"] = item.Name + respItem["parent_template_id"] = item.ParentTemplateID + respItem["project_associated"] = boolPtrToString(item.ProjectAssociated) + respItem["project_id"] = item.ProjectID + respItem["project_name"] = item.ProjectName + respItem["rollback_template_content"] = item.RollbackTemplateContent + respItem["rollback_template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParams(item.RollbackTemplateParams) + respItem["software_type"] = item.SoftwareType + respItem["software_variant"] = item.SoftwareVariant + respItem["software_version"] = item.SoftwareVersion + respItem["tags"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTags(item.Tags) + respItem["template_content"] = item.TemplateContent + respItem["template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParams(item.TemplateParams) + respItem["validation_errors"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemValidationErrors(item.ValidationErrors) + respItem["version"] = item.Version + respItem["versions_info"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemVersionsInfo(item.VersionsInfo) + return []map[string]interface{}{ + respItem, } - return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplates(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplates) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplates(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplates) []map[string]interface{} { if items == nil { return nil } @@ -1467,22 +1465,22 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplates(ite respItem := make(map[string]interface{}) respItem["composite"] = boolPtrToString(item.Composite) respItem["description"] = item.Description - respItem["device_types"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesDeviceTypes(item.DeviceTypes) + respItem["device_types"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesDeviceTypes(item.DeviceTypes) respItem["id"] = item.ID respItem["language"] = item.Language respItem["name"] = item.Name respItem["project_name"] = item.ProjectName - respItem["rollback_template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParams(item.RollbackTemplateParams) - respItem["tags"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTags(item.Tags) + respItem["rollback_template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParams(item.RollbackTemplateParams) + respItem["tags"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTags(item.Tags) respItem["template_content"] = item.TemplateContent - respItem["template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParams(item.TemplateParams) + respItem["template_params"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParams(item.TemplateParams) respItem["version"] = item.Version respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesDeviceTypes) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesDeviceTypes) []map[string]interface{} { if items == nil { return nil } @@ -1497,7 +1495,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesDevi return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesRollbackTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesRollbackTemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1519,15 +1517,15 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRoll respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesRollbackTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesRollbackTemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1542,7 +1540,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRoll return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesRollbackTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesRollbackTemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1550,7 +1548,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRoll respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1558,7 +1556,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRoll } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesRollbackTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1568,7 +1566,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesRoll } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesTags) []map[string]interface{} { if items == nil { return nil } @@ -1582,7 +1580,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTags return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesTemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1604,15 +1602,15 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemp respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesTemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1627,7 +1625,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemp return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesTemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1635,7 +1633,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemp respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1643,7 +1641,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemp } -func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsContainingTemplatesTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemContainingTemplatesTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ContainingTemplatesTemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1653,7 +1651,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemContainingTemplatesTemp } -func flattenConfigurationTemplatesGetTemplatesDetailsItemDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsDeviceTypes) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemDeviceTypes(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2DeviceTypes) []map[string]interface{} { if items == nil { return nil } @@ -1668,7 +1666,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemDeviceTypes(items *[]ca return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsRollbackTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2RollbackTemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1690,15 +1688,15 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParams( respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsRollbackTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2RollbackTemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1713,7 +1711,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsR return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsRollbackTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2RollbackTemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1721,7 +1719,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsS respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1729,7 +1727,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsS } -func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsRollbackTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemRollbackTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2RollbackTemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1739,7 +1737,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemRollbackTemplateParamsS } -func flattenConfigurationTemplatesGetTemplatesDetailsItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsTags) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTags(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2Tags) []map[string]interface{} { if items == nil { return nil } @@ -1753,7 +1751,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemTags(items *[]catalystc return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsTemplateParams) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParams(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2TemplateParams) []map[string]interface{} { if items == nil { return nil } @@ -1775,15 +1773,15 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParams(items *[ respItem["param_array"] = boolPtrToString(item.ParamArray) respItem["parameter_name"] = item.ParameterName respItem["provider"] = item.Provider - respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsRange(item.Range) + respItem["range"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParamsRange(item.Range) respItem["required"] = boolPtrToString(item.Required) - respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelection(item.Selection) + respItem["selection"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParamsSelection(item.Selection) respItems = append(respItems, respItem) } return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsTemplateParamsRange) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParamsRange(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2TemplateParamsRange) []map[string]interface{} { if items == nil { return nil } @@ -1798,7 +1796,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsRange(ite return respItems } -func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsTemplateParamsSelection) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParamsSelection(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2TemplateParamsSelection) []map[string]interface{} { if item == nil { return nil } @@ -1806,7 +1804,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelection respItem["default_selected_values"] = item.DefaultSelectedValues respItem["id"] = item.ID respItem["selection_type"] = item.SelectionType - respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelectionSelectionValues(item.SelectionValues) + respItem["selection_values"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParamsSelectionSelectionValues(item.SelectionValues) return []map[string]interface{}{ respItem, @@ -1814,7 +1812,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelection } -func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsTemplateParamsSelectionSelectionValues) interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemTemplateParamsSelectionSelectionValues(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2TemplateParamsSelectionSelectionValues) interface{} { if item == nil { return nil } @@ -1824,13 +1822,13 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemTemplateParamsSelection } -func flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsValidationErrors) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemValidationErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ValidationErrors) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["rollback_template_errors"] = flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrorsRollbackTemplateErrors(item.RollbackTemplateErrors) - respItem["template_errors"] = flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrorsTemplateErrors(item.TemplateErrors) + respItem["rollback_template_errors"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemValidationErrorsRollbackTemplateErrors(item.RollbackTemplateErrors) + respItem["template_errors"] = flattenConfigurationTemplatesGetTemplatesDetailsV2ItemValidationErrorsTemplateErrors(item.TemplateErrors) respItem["template_id"] = item.TemplateID respItem["template_version"] = item.TemplateVersion @@ -1840,7 +1838,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrors(item * } -func flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrorsRollbackTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsValidationErrorsRollbackTemplateErrors) interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemValidationErrorsRollbackTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ValidationErrorsRollbackTemplateErrors) interface{} { if item == nil { return nil } @@ -1850,7 +1848,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrorsRollbac } -func flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrorsTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsValidationErrorsTemplateErrors) interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemValidationErrorsTemplateErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2ValidationErrorsTemplateErrors) interface{} { if item == nil { return nil } @@ -1860,7 +1858,7 @@ func flattenConfigurationTemplatesGetTemplatesDetailsItemValidationErrorsTemplat } -func flattenConfigurationTemplatesGetTemplatesDetailsItemVersionsInfo(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsVersionsInfo) []map[string]interface{} { +func flattenConfigurationTemplatesGetTemplatesDetailsV2ItemVersionsInfo(items *[]catalystcentersdkgo.ResponseConfigurationTemplatesGetTemplatesDetailsV2VersionsInfo) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_threat_detail.go b/catalystcenter/data_source_threat_detail.go new file mode 100644 index 0000000..88c2f8f --- /dev/null +++ b/catalystcenter/data_source_threat_detail.go @@ -0,0 +1,229 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// dataSourceAction +func dataSourceThreatDetail() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- The details for the Rogue and aWIPS threats +`, + + ReadContext: dataSourceThreatDetailRead, + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `End Time`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "is_new_threat": &schema.Schema{ + Description: `Is New Threat`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ap_name": &schema.Schema{ + Description: `Ap Name`, + Type: schema.TypeString, + Computed: true, + }, + "containment": &schema.Schema{ + Description: `Containment`, + Type: schema.TypeString, + Computed: true, + }, + "detecting_apmac": &schema.Schema{ + Description: `Detecting A P Mac`, + Type: schema.TypeString, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Computed: true, + }, + "rssi": &schema.Schema{ + Description: `Rssi`, + Type: schema.TypeString, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeString, + Computed: true, + }, + "site_name_hierarchy": &schema.Schema{ + Description: `Site Name Hierarchy`, + Type: schema.TypeString, + Computed: true, + }, + "ssid": &schema.Schema{ + Description: `Ssid`, + Type: schema.TypeString, + Computed: true, + }, + "state": &schema.Schema{ + Description: `State`, + Type: schema.TypeString, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeString, + Computed: true, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeString, + Computed: true, + }, + "updated_time": &schema.Schema{ + Description: `Updated Time`, + Type: schema.TypeInt, + Computed: true, + }, + "vendor": &schema.Schema{ + Description: `Vendor`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "limit": &schema.Schema{ + Description: `Limit`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "offset": &schema.Schema{ + Description: `Offset`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `Start Time`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceThreatDetailRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + request1 := expandRequestThreatDetailThreatDetailsV1(ctx, "", d) + + response1, restyResp1, err := client.Devices.ThreatDetailsV1(request1) + + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 ThreatDetailsV1", err, + "Failure at ThreatDetailsV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesThreatDetailsV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting ThreatDetailsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + return diags +} + +func expandRequestThreatDetailThreatDetailsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesThreatDetailsV1 { + request := catalystcentersdkgo.RequestDevicesThreatDetailsV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".offset")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".offset")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".offset")))) { + request.Offset = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { + request.Limit = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_new_threat")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_new_threat")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_new_threat")))) { + request.IsNewThreat = interfaceToBoolPtr(v) + } + return &request +} diff --git a/catalystcenter/data_source_threat_detail_count.go b/catalystcenter/data_source_threat_detail_count.go new file mode 100644 index 0000000..72bf9fc --- /dev/null +++ b/catalystcenter/data_source_threat_detail_count.go @@ -0,0 +1,174 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// dataSourceAction +func dataSourceThreatDetailCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- The details count for the Rogue and aWIPS threats +`, + + ReadContext: dataSourceThreatDetailCountRead, + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `End Time`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "is_new_threat": &schema.Schema{ + Description: `Is New Threat`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "response": &schema.Schema{ + Description: `Response`, + Type: schema.TypeInt, + Computed: true, + }, + "version": &schema.Schema{ + Description: `Version`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "limit": &schema.Schema{ + Description: `Limit`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "offset": &schema.Schema{ + Description: `Offset`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `Start Time`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceThreatDetailCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + request1 := expandRequestThreatDetailCountThreatDetailCountV1(ctx, "", d) + + response1, restyResp1, err := client.Devices.ThreatDetailCountV1(request1) + + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 ThreatDetailCountV1", err, + "Failure at ThreatDetailCountV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenDevicesThreatDetailCountV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting ThreatDetailCountV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + return diags +} + +func expandRequestThreatDetailCountThreatDetailCountV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesThreatDetailCountV1 { + request := catalystcentersdkgo.RequestDevicesThreatDetailCountV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".offset")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".offset")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".offset")))) { + request.Offset = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { + request.Limit = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_new_threat")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_new_threat")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_new_threat")))) { + request.IsNewThreat = interfaceToBoolPtr(v) + } + return &request +} diff --git a/catalystcenter/data_source_threat_summary.go b/catalystcenter/data_source_threat_summary.go new file mode 100644 index 0000000..65acb15 --- /dev/null +++ b/catalystcenter/data_source_threat_summary.go @@ -0,0 +1,164 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// dataSourceAction +func dataSourceThreatSummary() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- The Threat Summary for the Rogues and aWIPS +`, + + ReadContext: dataSourceThreatSummaryRead, + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `End Time`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "threat_data": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "threat_count": &schema.Schema{ + Description: `Threat Count`, + Type: schema.TypeInt, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeString, + Computed: true, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "timestamp": &schema.Schema{ + Description: `Timestamp`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `Start Time`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceThreatSummaryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + request1 := expandRequestThreatSummaryThreatSummaryV1(ctx, "", d) + + response1, restyResp1, err := client.Devices.ThreatSummaryV1(request1) + + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing 2 ThreatSummaryV1", err, + "Failure at ThreatSummaryV1, unexpected response", "")) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesThreatSummaryV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting ThreatSummaryV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + + return diags +} + +func expandRequestThreatSummaryThreatSummaryV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesThreatSummaryV1 { + request := catalystcentersdkgo.RequestDevicesThreatSummaryV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + return &request +} diff --git a/catalystcenter/data_source_topology_layer_2.go b/catalystcenter/data_source_topology_layer_2.go index c4973db..6f4780f 100644 --- a/catalystcenter/data_source_topology_layer_2.go +++ b/catalystcenter/data_source_topology_layer_2.go @@ -424,27 +424,27 @@ func dataSourceTopologyLayer2Read(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTopologyDetails") + log.Printf("[DEBUG] Selected method: GetTopologyDetailsV1") vvVLANID := vVLANID.(string) - response1, restyResp1, err := client.Topology.GetTopologyDetails(vvVLANID) + response1, restyResp1, err := client.Topology.GetTopologyDetailsV1(vvVLANID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTopologyDetails", err, - "Failure at GetTopologyDetails, unexpected response", "")) + "Failure when executing 2 GetTopologyDetailsV1", err, + "Failure at GetTopologyDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTopologyGetTopologyDetailsItem(response1.Response) + vItem1 := flattenTopologyGetTopologyDetailsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTopologyDetails response", + "Failure when setting GetTopologyDetailsV1 response", err)) return diags } @@ -456,27 +456,27 @@ func dataSourceTopologyLayer2Read(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenTopologyGetTopologyDetailsItem(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsResponse) []map[string]interface{} { +func flattenTopologyGetTopologyDetailsV1Item(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["links"] = flattenTopologyGetTopologyDetailsItemLinks(item.Links) - respItem["nodes"] = flattenTopologyGetTopologyDetailsItemNodes(item.Nodes) + respItem["links"] = flattenTopologyGetTopologyDetailsV1ItemLinks(item.Links) + respItem["nodes"] = flattenTopologyGetTopologyDetailsV1ItemNodes(item.Nodes) return []map[string]interface{}{ respItem, } } -func flattenTopologyGetTopologyDetailsItemLinks(items *[]catalystcentersdkgo.ResponseTopologyGetTopologyDetailsResponseLinks) []map[string]interface{} { +func flattenTopologyGetTopologyDetailsV1ItemLinks(items *[]catalystcentersdkgo.ResponseTopologyGetTopologyDetailsV1ResponseLinks) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["additional_info"] = flattenTopologyGetTopologyDetailsItemLinksAdditionalInfo(item.AdditionalInfo) + respItem["additional_info"] = flattenTopologyGetTopologyDetailsV1ItemLinksAdditionalInfo(item.AdditionalInfo) respItem["end_port_id"] = item.EndPortID respItem["end_port_ipv4_address"] = item.EndPortIPv4Address respItem["end_port_ipv4_mask"] = item.EndPortIPv4Mask @@ -498,7 +498,7 @@ func flattenTopologyGetTopologyDetailsItemLinks(items *[]catalystcentersdkgo.Res return respItems } -func flattenTopologyGetTopologyDetailsItemLinksAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsResponseLinksAdditionalInfo) interface{} { +func flattenTopologyGetTopologyDetailsV1ItemLinksAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsV1ResponseLinksAdditionalInfo) interface{} { if item == nil { return nil } @@ -508,7 +508,7 @@ func flattenTopologyGetTopologyDetailsItemLinksAdditionalInfo(item *catalystcent } -func flattenTopologyGetTopologyDetailsItemNodes(items *[]catalystcentersdkgo.ResponseTopologyGetTopologyDetailsResponseNodes) []map[string]interface{} { +func flattenTopologyGetTopologyDetailsV1ItemNodes(items *[]catalystcentersdkgo.ResponseTopologyGetTopologyDetailsV1ResponseNodes) []map[string]interface{} { if items == nil { return nil } @@ -516,8 +516,8 @@ func flattenTopologyGetTopologyDetailsItemNodes(items *[]catalystcentersdkgo.Res for _, item := range *items { respItem := make(map[string]interface{}) respItem["acl_applied"] = boolPtrToString(item.ACLApplied) - respItem["additional_info"] = flattenTopologyGetTopologyDetailsItemNodesAdditionalInfo(item.AdditionalInfo) - respItem["custom_param"] = flattenTopologyGetTopologyDetailsItemNodesCustomParam(item.CustomParam) + respItem["additional_info"] = flattenTopologyGetTopologyDetailsV1ItemNodesAdditionalInfo(item.AdditionalInfo) + respItem["custom_param"] = flattenTopologyGetTopologyDetailsV1ItemNodesCustomParam(item.CustomParam) respItem["connected_device_id"] = item.ConnectedDeviceID respItem["data_path_id"] = item.DataPathID respItem["device_type"] = item.DeviceType @@ -547,7 +547,7 @@ func flattenTopologyGetTopologyDetailsItemNodes(items *[]catalystcentersdkgo.Res return respItems } -func flattenTopologyGetTopologyDetailsItemNodesAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsResponseNodesAdditionalInfo) interface{} { +func flattenTopologyGetTopologyDetailsV1ItemNodesAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsV1ResponseNodesAdditionalInfo) interface{} { if item == nil { return nil } @@ -557,7 +557,7 @@ func flattenTopologyGetTopologyDetailsItemNodesAdditionalInfo(item *catalystcent } -func flattenTopologyGetTopologyDetailsItemNodesCustomParam(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsResponseNodesCustomParam) []map[string]interface{} { +func flattenTopologyGetTopologyDetailsV1ItemNodesCustomParam(item *catalystcentersdkgo.ResponseTopologyGetTopologyDetailsV1ResponseNodesCustomParam) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_topology_layer_3.go b/catalystcenter/data_source_topology_layer_3.go index 2779710..ef9a6d6 100644 --- a/catalystcenter/data_source_topology_layer_3.go +++ b/catalystcenter/data_source_topology_layer_3.go @@ -424,27 +424,27 @@ func dataSourceTopologyLayer3Read(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetL3TopologyDetails") + log.Printf("[DEBUG] Selected method: GetL3TopologyDetailsV1") vvTopologyType := vTopologyType.(string) - response1, restyResp1, err := client.Topology.GetL3TopologyDetails(vvTopologyType) + response1, restyResp1, err := client.Topology.GetL3TopologyDetailsV1(vvTopologyType) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetL3TopologyDetails", err, - "Failure at GetL3TopologyDetails, unexpected response", "")) + "Failure when executing 2 GetL3TopologyDetailsV1", err, + "Failure at GetL3TopologyDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTopologyGetL3TopologyDetailsItem(response1.Response) + vItem1 := flattenTopologyGetL3TopologyDetailsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetL3TopologyDetails response", + "Failure when setting GetL3TopologyDetailsV1 response", err)) return diags } @@ -456,27 +456,27 @@ func dataSourceTopologyLayer3Read(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenTopologyGetL3TopologyDetailsItem(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsResponse) []map[string]interface{} { +func flattenTopologyGetL3TopologyDetailsV1Item(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["links"] = flattenTopologyGetL3TopologyDetailsItemLinks(item.Links) - respItem["nodes"] = flattenTopologyGetL3TopologyDetailsItemNodes(item.Nodes) + respItem["links"] = flattenTopologyGetL3TopologyDetailsV1ItemLinks(item.Links) + respItem["nodes"] = flattenTopologyGetL3TopologyDetailsV1ItemNodes(item.Nodes) return []map[string]interface{}{ respItem, } } -func flattenTopologyGetL3TopologyDetailsItemLinks(items *[]catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsResponseLinks) []map[string]interface{} { +func flattenTopologyGetL3TopologyDetailsV1ItemLinks(items *[]catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsV1ResponseLinks) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["additional_info"] = flattenTopologyGetL3TopologyDetailsItemLinksAdditionalInfo(item.AdditionalInfo) + respItem["additional_info"] = flattenTopologyGetL3TopologyDetailsV1ItemLinksAdditionalInfo(item.AdditionalInfo) respItem["end_port_id"] = item.EndPortID respItem["end_port_ipv4_address"] = item.EndPortIPv4Address respItem["end_port_ipv4_mask"] = item.EndPortIPv4Mask @@ -498,7 +498,7 @@ func flattenTopologyGetL3TopologyDetailsItemLinks(items *[]catalystcentersdkgo.R return respItems } -func flattenTopologyGetL3TopologyDetailsItemLinksAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsResponseLinksAdditionalInfo) interface{} { +func flattenTopologyGetL3TopologyDetailsV1ItemLinksAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsV1ResponseLinksAdditionalInfo) interface{} { if item == nil { return nil } @@ -508,7 +508,7 @@ func flattenTopologyGetL3TopologyDetailsItemLinksAdditionalInfo(item *catalystce } -func flattenTopologyGetL3TopologyDetailsItemNodes(items *[]catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsResponseNodes) []map[string]interface{} { +func flattenTopologyGetL3TopologyDetailsV1ItemNodes(items *[]catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsV1ResponseNodes) []map[string]interface{} { if items == nil { return nil } @@ -516,8 +516,8 @@ func flattenTopologyGetL3TopologyDetailsItemNodes(items *[]catalystcentersdkgo.R for _, item := range *items { respItem := make(map[string]interface{}) respItem["acl_applied"] = boolPtrToString(item.ACLApplied) - respItem["additional_info"] = flattenTopologyGetL3TopologyDetailsItemNodesAdditionalInfo(item.AdditionalInfo) - respItem["custom_param"] = flattenTopologyGetL3TopologyDetailsItemNodesCustomParam(item.CustomParam) + respItem["additional_info"] = flattenTopologyGetL3TopologyDetailsV1ItemNodesAdditionalInfo(item.AdditionalInfo) + respItem["custom_param"] = flattenTopologyGetL3TopologyDetailsV1ItemNodesCustomParam(item.CustomParam) respItem["connected_device_id"] = item.ConnectedDeviceID respItem["data_path_id"] = item.DataPathID respItem["device_type"] = item.DeviceType @@ -547,7 +547,7 @@ func flattenTopologyGetL3TopologyDetailsItemNodes(items *[]catalystcentersdkgo.R return respItems } -func flattenTopologyGetL3TopologyDetailsItemNodesAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsResponseNodesAdditionalInfo) interface{} { +func flattenTopologyGetL3TopologyDetailsV1ItemNodesAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsV1ResponseNodesAdditionalInfo) interface{} { if item == nil { return nil } @@ -557,7 +557,7 @@ func flattenTopologyGetL3TopologyDetailsItemNodesAdditionalInfo(item *catalystce } -func flattenTopologyGetL3TopologyDetailsItemNodesCustomParam(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsResponseNodesCustomParam) []map[string]interface{} { +func flattenTopologyGetL3TopologyDetailsV1ItemNodesCustomParam(item *catalystcentersdkgo.ResponseTopologyGetL3TopologyDetailsV1ResponseNodesCustomParam) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_topology_network_health.go b/catalystcenter/data_source_topology_network_health.go index d27c3e3..6cd6db6 100644 --- a/catalystcenter/data_source_topology_network_health.go +++ b/catalystcenter/data_source_topology_network_health.go @@ -125,31 +125,31 @@ func dataSourceTopologyNetworkHealthRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetOverallNetworkHealth") - queryParams1 := catalystcentersdkgo.GetOverallNetworkHealthQueryParams{} + log.Printf("[DEBUG] Selected method: GetOverallNetworkHealthV1") + queryParams1 := catalystcentersdkgo.GetOverallNetworkHealthV1QueryParams{} if okTimestamp { queryParams1.Timestamp = vTimestamp.(float64) } - response1, restyResp1, err := client.Topology.GetOverallNetworkHealth(&queryParams1) + response1, restyResp1, err := client.Topology.GetOverallNetworkHealthV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetOverallNetworkHealth", err, - "Failure at GetOverallNetworkHealth, unexpected response", "")) + "Failure when executing 2 GetOverallNetworkHealthV1", err, + "Failure at GetOverallNetworkHealthV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTopologyGetOverallNetworkHealthItems(response1.Response) + vItems1 := flattenTopologyGetOverallNetworkHealthV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetOverallNetworkHealth response", + "Failure when setting GetOverallNetworkHealthV1 response", err)) return diags } @@ -161,7 +161,7 @@ func dataSourceTopologyNetworkHealthRead(ctx context.Context, d *schema.Resource return diags } -func flattenTopologyGetOverallNetworkHealthItems(items *[]catalystcentersdkgo.ResponseTopologyGetOverallNetworkHealthResponse) []map[string]interface{} { +func flattenTopologyGetOverallNetworkHealthV1Items(items *[]catalystcentersdkgo.ResponseTopologyGetOverallNetworkHealthV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_topology_physical.go b/catalystcenter/data_source_topology_physical.go index 4bf6f11..023776d 100644 --- a/catalystcenter/data_source_topology_physical.go +++ b/catalystcenter/data_source_topology_physical.go @@ -423,31 +423,31 @@ func dataSourceTopologyPhysicalRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPhysicalTopology") - queryParams1 := catalystcentersdkgo.GetPhysicalTopologyQueryParams{} + log.Printf("[DEBUG] Selected method: GetPhysicalTopologyV1") + queryParams1 := catalystcentersdkgo.GetPhysicalTopologyV1QueryParams{} if okNodeType { queryParams1.NodeType = vNodeType.(string) } - response1, restyResp1, err := client.Topology.GetPhysicalTopology(&queryParams1) + response1, restyResp1, err := client.Topology.GetPhysicalTopologyV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPhysicalTopology", err, - "Failure at GetPhysicalTopology, unexpected response", "")) + "Failure when executing 2 GetPhysicalTopologyV1", err, + "Failure at GetPhysicalTopologyV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTopologyGetPhysicalTopologyItem(response1.Response) + vItem1 := flattenTopologyGetPhysicalTopologyV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPhysicalTopology response", + "Failure when setting GetPhysicalTopologyV1 response", err)) return diags } @@ -459,27 +459,27 @@ func dataSourceTopologyPhysicalRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenTopologyGetPhysicalTopologyItem(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyResponse) []map[string]interface{} { +func flattenTopologyGetPhysicalTopologyV1Item(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["links"] = flattenTopologyGetPhysicalTopologyItemLinks(item.Links) - respItem["nodes"] = flattenTopologyGetPhysicalTopologyItemNodes(item.Nodes) + respItem["links"] = flattenTopologyGetPhysicalTopologyV1ItemLinks(item.Links) + respItem["nodes"] = flattenTopologyGetPhysicalTopologyV1ItemNodes(item.Nodes) return []map[string]interface{}{ respItem, } } -func flattenTopologyGetPhysicalTopologyItemLinks(items *[]catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyResponseLinks) []map[string]interface{} { +func flattenTopologyGetPhysicalTopologyV1ItemLinks(items *[]catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyV1ResponseLinks) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["additional_info"] = flattenTopologyGetPhysicalTopologyItemLinksAdditionalInfo(item.AdditionalInfo) + respItem["additional_info"] = flattenTopologyGetPhysicalTopologyV1ItemLinksAdditionalInfo(item.AdditionalInfo) respItem["end_port_id"] = item.EndPortID respItem["end_port_ipv4_address"] = item.EndPortIPv4Address respItem["end_port_ipv4_mask"] = item.EndPortIPv4Mask @@ -501,7 +501,7 @@ func flattenTopologyGetPhysicalTopologyItemLinks(items *[]catalystcentersdkgo.Re return respItems } -func flattenTopologyGetPhysicalTopologyItemLinksAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyResponseLinksAdditionalInfo) interface{} { +func flattenTopologyGetPhysicalTopologyV1ItemLinksAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyV1ResponseLinksAdditionalInfo) interface{} { if item == nil { return nil } @@ -511,7 +511,7 @@ func flattenTopologyGetPhysicalTopologyItemLinksAdditionalInfo(item *catalystcen } -func flattenTopologyGetPhysicalTopologyItemNodes(items *[]catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyResponseNodes) []map[string]interface{} { +func flattenTopologyGetPhysicalTopologyV1ItemNodes(items *[]catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyV1ResponseNodes) []map[string]interface{} { if items == nil { return nil } @@ -519,8 +519,8 @@ func flattenTopologyGetPhysicalTopologyItemNodes(items *[]catalystcentersdkgo.Re for _, item := range *items { respItem := make(map[string]interface{}) respItem["acl_applied"] = boolPtrToString(item.ACLApplied) - respItem["additional_info"] = flattenTopologyGetPhysicalTopologyItemNodesAdditionalInfo(item.AdditionalInfo) - respItem["custom_param"] = flattenTopologyGetPhysicalTopologyItemNodesCustomParam(item.CustomParam) + respItem["additional_info"] = flattenTopologyGetPhysicalTopologyV1ItemNodesAdditionalInfo(item.AdditionalInfo) + respItem["custom_param"] = flattenTopologyGetPhysicalTopologyV1ItemNodesCustomParam(item.CustomParam) respItem["connected_device_id"] = item.ConnectedDeviceID respItem["data_path_id"] = item.DataPathID respItem["device_type"] = item.DeviceType @@ -550,7 +550,7 @@ func flattenTopologyGetPhysicalTopologyItemNodes(items *[]catalystcentersdkgo.Re return respItems } -func flattenTopologyGetPhysicalTopologyItemNodesAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyResponseNodesAdditionalInfo) interface{} { +func flattenTopologyGetPhysicalTopologyV1ItemNodesAdditionalInfo(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyV1ResponseNodesAdditionalInfo) interface{} { if item == nil { return nil } @@ -560,7 +560,7 @@ func flattenTopologyGetPhysicalTopologyItemNodesAdditionalInfo(item *catalystcen } -func flattenTopologyGetPhysicalTopologyItemNodesCustomParam(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyResponseNodesCustomParam) []map[string]interface{} { +func flattenTopologyGetPhysicalTopologyV1ItemNodesCustomParam(item *catalystcentersdkgo.ResponseTopologyGetPhysicalTopologyV1ResponseNodesCustomParam) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_topology_site.go b/catalystcenter/data_source_topology_site.go index b1fc14e..a67ed2b 100644 --- a/catalystcenter/data_source_topology_site.go +++ b/catalystcenter/data_source_topology_site.go @@ -119,26 +119,26 @@ func dataSourceTopologySiteRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteTopology") + log.Printf("[DEBUG] Selected method: GetSiteTopologyV1") - response1, restyResp1, err := client.Topology.GetSiteTopology() + response1, restyResp1, err := client.Topology.GetSiteTopologyV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSiteTopology", err, - "Failure at GetSiteTopology, unexpected response", "")) + "Failure when executing 2 GetSiteTopologyV1", err, + "Failure at GetSiteTopologyV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenTopologyGetSiteTopologyItem(response1.Response) + vItem1 := flattenTopologyGetSiteTopologyV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteTopology response", + "Failure when setting GetSiteTopologyV1 response", err)) return diags } @@ -150,18 +150,18 @@ func dataSourceTopologySiteRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func flattenTopologyGetSiteTopologyItem(item *catalystcentersdkgo.ResponseTopologyGetSiteTopologyResponse) []map[string]interface{} { +func flattenTopologyGetSiteTopologyV1Item(item *catalystcentersdkgo.ResponseTopologyGetSiteTopologyV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["sites"] = flattenTopologyGetSiteTopologyItemSites(item.Sites) + respItem["sites"] = flattenTopologyGetSiteTopologyV1ItemSites(item.Sites) return []map[string]interface{}{ respItem, } } -func flattenTopologyGetSiteTopologyItemSites(items *[]catalystcentersdkgo.ResponseTopologyGetSiteTopologyResponseSites) []map[string]interface{} { +func flattenTopologyGetSiteTopologyV1ItemSites(items *[]catalystcentersdkgo.ResponseTopologyGetSiteTopologyV1ResponseSites) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_topology_vlan_details.go b/catalystcenter/data_source_topology_vlan_details.go index 9df03fa..b89cd02 100644 --- a/catalystcenter/data_source_topology_vlan_details.go +++ b/catalystcenter/data_source_topology_vlan_details.go @@ -55,26 +55,26 @@ func dataSourceTopologyVLANDetailsRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVLANDetails") + log.Printf("[DEBUG] Selected method: GetVLANDetailsV1") - response1, restyResp1, err := client.Topology.GetVLANDetails() + response1, restyResp1, err := client.Topology.GetVLANDetailsV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetVLANDetails", err, - "Failure at GetVLANDetails, unexpected response", "")) + "Failure when executing 2 GetVLANDetailsV1", err, + "Failure at GetVLANDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTopologyGetVLANDetailsItems(response1) + vItems1 := flattenTopologyGetVLANDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVLANDetails response", + "Failure when setting GetVLANDetailsV1 response", err)) return diags } @@ -86,7 +86,7 @@ func dataSourceTopologyVLANDetailsRead(ctx context.Context, d *schema.ResourceDa return diags } -func flattenTopologyGetVLANDetailsItems(items *catalystcentersdkgo.ResponseTopologyGetVLANDetails) []map[string]interface{} { +func flattenTopologyGetVLANDetailsV1Items(items *catalystcentersdkgo.ResponseTopologyGetVLANDetailsV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_transit_peer_network.go b/catalystcenter/data_source_transit_peer_network.go index 1d6fe11..bb253ab 100644 --- a/catalystcenter/data_source_transit_peer_network.go +++ b/catalystcenter/data_source_transit_peer_network.go @@ -137,29 +137,29 @@ func dataSourceTransitPeerNetworkRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTransitPeerNetworkInfo") - queryParams1 := catalystcentersdkgo.GetTransitPeerNetworkInfoQueryParams{} + log.Printf("[DEBUG] Selected method: GetTransitPeerNetworkInfoV1") + queryParams1 := catalystcentersdkgo.GetTransitPeerNetworkInfoV1QueryParams{} queryParams1.TransitPeerNetworkName = vTransitPeerNetworkName.(string) - response1, restyResp1, err := client.Sda.GetTransitPeerNetworkInfo(&queryParams1) + response1, restyResp1, err := client.Sda.GetTransitPeerNetworkInfoV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetTransitPeerNetworkInfo", err, - "Failure at GetTransitPeerNetworkInfo, unexpected response", "")) + "Failure when executing 2 GetTransitPeerNetworkInfoV1", err, + "Failure at GetTransitPeerNetworkInfoV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetTransitPeerNetworkInfoItem(response1) + vItem1 := flattenSdaGetTransitPeerNetworkInfoV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTransitPeerNetworkInfo response", + "Failure when setting GetTransitPeerNetworkInfoV1 response", err)) return diags } @@ -171,15 +171,15 @@ func dataSourceTransitPeerNetworkRead(ctx context.Context, d *schema.ResourceDat return diags } -func flattenSdaGetTransitPeerNetworkInfoItem(item *catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfo) []map[string]interface{} { +func flattenSdaGetTransitPeerNetworkInfoV1Item(item *catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["transit_peer_network_name"] = item.TransitPeerNetworkName respItem["transit_peer_network_type"] = item.TransitPeerNetworkType - respItem["ip_transit_settings"] = flattenSdaGetTransitPeerNetworkInfoItemIPTransitSettings(item.IPTransitSettings) - respItem["sda_transit_settings"] = flattenSdaGetTransitPeerNetworkInfoItemSdaTransitSettings(item.SdaTransitSettings) + respItem["ip_transit_settings"] = flattenSdaGetTransitPeerNetworkInfoV1ItemIPTransitSettings(item.IPTransitSettings) + respItem["sda_transit_settings"] = flattenSdaGetTransitPeerNetworkInfoV1ItemSdaTransitSettings(item.SdaTransitSettings) respItem["status"] = item.Status respItem["description"] = item.Description respItem["transit_peer_network_id"] = item.TransitPeerNetworkID @@ -188,7 +188,7 @@ func flattenSdaGetTransitPeerNetworkInfoItem(item *catalystcentersdkgo.ResponseS } } -func flattenSdaGetTransitPeerNetworkInfoItemIPTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoIPTransitSettings) []map[string]interface{} { +func flattenSdaGetTransitPeerNetworkInfoV1ItemIPTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoV1IPTransitSettings) []map[string]interface{} { if item == nil { return nil } @@ -202,12 +202,12 @@ func flattenSdaGetTransitPeerNetworkInfoItemIPTransitSettings(item *catalystcent } -func flattenSdaGetTransitPeerNetworkInfoItemSdaTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoSdaTransitSettings) []map[string]interface{} { +func flattenSdaGetTransitPeerNetworkInfoV1ItemSdaTransitSettings(item *catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoV1SdaTransitSettings) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["transit_control_plane_settings"] = flattenSdaGetTransitPeerNetworkInfoItemSdaTransitSettingsTransitControlPlaneSettings(item.TransitControlPlaneSettings) + respItem["transit_control_plane_settings"] = flattenSdaGetTransitPeerNetworkInfoV1ItemSdaTransitSettingsTransitControlPlaneSettings(item.TransitControlPlaneSettings) return []map[string]interface{}{ respItem, @@ -215,7 +215,7 @@ func flattenSdaGetTransitPeerNetworkInfoItemSdaTransitSettings(item *catalystcen } -func flattenSdaGetTransitPeerNetworkInfoItemSdaTransitSettingsTransitControlPlaneSettings(items *[]catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoSdaTransitSettingsTransitControlPlaneSettings) []map[string]interface{} { +func flattenSdaGetTransitPeerNetworkInfoV1ItemSdaTransitSettingsTransitControlPlaneSettings(items *[]catalystcentersdkgo.ResponseSdaGetTransitPeerNetworkInfoV1SdaTransitSettingsTransitControlPlaneSettings) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_user.go b/catalystcenter/data_source_user.go index 4fa6e98..bfc7bf9 100644 --- a/catalystcenter/data_source_user.go +++ b/catalystcenter/data_source_user.go @@ -15,7 +15,7 @@ func dataSourceUser() *schema.Resource { return &schema.Resource{ Description: `It performs read operation on User and Roles. -- Get all users for the Cisco Catalyst Center System. +- Get all users for the Cisco DNA Center System. `, ReadContext: dataSourceUserRead, @@ -116,8 +116,8 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, m interface selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetUsersAPI") - queryParams1 := catalystcentersdkgo.GetUsersAPIQueryParams{} + log.Printf("[DEBUG] Selected method: GetUsersAPIV1") + queryParams1 := catalystcentersdkgo.GetUsersAPIV1QueryParams{} queryParams1.InvokeSource = vInvokeSource.(string) @@ -125,24 +125,24 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, m interface queryParams1.AuthSource = vAuthSource.(string) } - response1, restyResp1, err := client.UserandRoles.GetUsersAPI(&queryParams1) + response1, restyResp1, err := client.UserandRoles.GetUsersAPIV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetUsersAPI", err, - "Failure at GetUsersAPI, unexpected response", "")) + "Failure when executing 2 GetUsersAPIV1", err, + "Failure at GetUsersAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetUsersAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetUsersAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetUsersAPI response", + "Failure when setting GetUsersAPIV1 response", err)) return diags } @@ -154,18 +154,18 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, m interface return diags } -func flattenUserandRolesGetUsersAPIItem(item *catalystcentersdkgo.ResponseUserandRolesGetUsersAPIResponse) []map[string]interface{} { +func flattenUserandRolesGetUsersAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesGetUsersAPIV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["users"] = flattenUserandRolesGetUsersAPIItemUsers(item.Users) + respItem["users"] = flattenUserandRolesGetUsersAPIV1ItemUsers(item.Users) return []map[string]interface{}{ respItem, } } -func flattenUserandRolesGetUsersAPIItemUsers(items *[]catalystcentersdkgo.ResponseUserandRolesGetUsersAPIResponseUsers) []map[string]interface{} { +func flattenUserandRolesGetUsersAPIV1ItemUsers(items *[]catalystcentersdkgo.ResponseUserandRolesGetUsersAPIV1ResponseUsers) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_user_enrichment_details.go b/catalystcenter/data_source_user_enrichment_details.go index c250af6..15123d6 100644 --- a/catalystcenter/data_source_user_enrichment_details.go +++ b/catalystcenter/data_source_user_enrichment_details.go @@ -632,9 +632,9 @@ func dataSourceUserEnrichmentDetailsRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetUserEnrichmentDetails") + log.Printf("[DEBUG] Selected method: GetUserEnrichmentDetailsV1") - headerParams1 := catalystcentersdkgo.GetUserEnrichmentDetailsHeaderParams{} + headerParams1 := catalystcentersdkgo.GetUserEnrichmentDetailsV1HeaderParams{} headerParams1.EntityType = vEntityType.(string) @@ -642,24 +642,24 @@ func dataSourceUserEnrichmentDetailsRead(ctx context.Context, d *schema.Resource headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Users.GetUserEnrichmentDetails(&headerParams1) + response1, restyResp1, err := client.Users.GetUserEnrichmentDetailsV1(&headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetUserEnrichmentDetails", err, - "Failure at GetUserEnrichmentDetails, unexpected response", "")) + "Failure when executing 2 GetUserEnrichmentDetailsV1", err, + "Failure at GetUserEnrichmentDetailsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenUsersGetUserEnrichmentDetailsItems(response1) + vItems1 := flattenUsersGetUserEnrichmentDetailsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetUserEnrichmentDetails response", + "Failure when setting GetUserEnrichmentDetailsV1 response", err)) return diags } @@ -671,21 +671,21 @@ func dataSourceUserEnrichmentDetailsRead(ctx context.Context, d *schema.Resource return diags } -func flattenUsersGetUserEnrichmentDetailsItems(items *catalystcentersdkgo.ResponseUsersGetUserEnrichmentDetails) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1Items(items *catalystcentersdkgo.ResponseUsersGetUserEnrichmentDetailsV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["user_details"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetails(item.UserDetails) - respItem["connected_device"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDevice(item.ConnectedDevice) + respItem["user_details"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetails(item.UserDetails) + respItem["connected_device"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDevice(item.ConnectedDevice) respItems = append(respItems, respItem) } return respItems } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetails(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetails) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetails(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetails) []map[string]interface{} { if item == nil { return nil } @@ -693,38 +693,38 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetails(item *catalystcentersd respItem["id"] = item.ID respItem["connection_status"] = item.ConnectionStatus respItem["host_type"] = item.HostType - respItem["user_id"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsUserID(item.UserID) - respItem["host_name"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostName(item.HostName) - respItem["host_os"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostOs(item.HostOs) - respItem["host_version"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostVersion(item.HostVersion) + respItem["user_id"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsUserID(item.UserID) + respItem["host_name"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostName(item.HostName) + respItem["host_os"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostOs(item.HostOs) + respItem["host_version"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostVersion(item.HostVersion) respItem["sub_type"] = item.SubType respItem["last_updated"] = item.LastUpdated - respItem["health_score"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHealthScore(item.HealthScore) + respItem["health_score"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHealthScore(item.HealthScore) respItem["host_mac"] = item.HostMac respItem["host_ip_v4"] = item.HostIPV4 - respItem["host_ip_v6"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostIPV6(item.HostIPV6) - respItem["auth_type"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAuthType(item.AuthType) + respItem["host_ip_v6"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostIPV6(item.HostIPV6) + respItem["auth_type"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsAuthType(item.AuthType) respItem["vlan_id"] = item.VLANID - respItem["ssid"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsSSID(item.SSID) - respItem["frequency"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsFrequency(item.Frequency) - respItem["channel"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsChannel(item.Channel) - respItem["ap_group"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsApGroup(item.ApGroup) - respItem["location"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsLocation(item.Location) + respItem["ssid"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsSSID(item.SSID) + respItem["frequency"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsFrequency(item.Frequency) + respItem["channel"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsChannel(item.Channel) + respItem["ap_group"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsApGroup(item.ApGroup) + respItem["location"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsLocation(item.Location) respItem["client_connection"] = item.ClientConnection - respItem["connected_device"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsConnectedDevice(item.ConnectedDevice) + respItem["connected_device"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsConnectedDevice(item.ConnectedDevice) respItem["issue_count"] = item.IssueCount - respItem["rssi"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsRssi(item.Rssi) - respItem["avg_rssi"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAvgRssi(item.AvgRssi) - respItem["snr"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsSnr(item.Snr) - respItem["avg_snr"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAvgSnr(item.AvgSnr) - respItem["data_rate"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDataRate(item.DataRate) - respItem["tx_bytes"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsTxBytes(item.TxBytes) - respItem["rx_bytes"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsRxBytes(item.RxBytes) - respItem["dns_success"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDNSSuccess(item.DNSSuccess) - respItem["dns_failure"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDNSFailure(item.DNSFailure) - respItem["onboarding"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboarding(item.Onboarding) - respItem["onboarding_time"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingTime(item.OnboardingTime) - respItem["port"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsPort(item.Port) + respItem["rssi"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsRssi(item.Rssi) + respItem["avg_rssi"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsAvgRssi(item.AvgRssi) + respItem["snr"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsSnr(item.Snr) + respItem["avg_snr"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsAvgSnr(item.AvgSnr) + respItem["data_rate"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsDataRate(item.DataRate) + respItem["tx_bytes"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsTxBytes(item.TxBytes) + respItem["rx_bytes"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsRxBytes(item.RxBytes) + respItem["dns_success"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsDNSSuccess(item.DNSSuccess) + respItem["dns_failure"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsDNSFailure(item.DNSFailure) + respItem["onboarding"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboarding(item.Onboarding) + respItem["onboarding_time"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingTime(item.OnboardingTime) + respItem["port"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsPort(item.Port) return []map[string]interface{}{ respItem, @@ -732,7 +732,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetails(item *catalystcentersd } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsUserID(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsUserID) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsUserID(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsUserID) interface{} { if item == nil { return nil } @@ -742,7 +742,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsUserID(item *catalystce } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostName(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsHostName) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostName(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsHostName) interface{} { if item == nil { return nil } @@ -752,7 +752,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostName(item *catalyst } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostOs(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsHostOs) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostOs(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsHostOs) interface{} { if item == nil { return nil } @@ -762,7 +762,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostOs(item *catalystce } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostVersion(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsHostVersion) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostVersion(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsHostVersion) interface{} { if item == nil { return nil } @@ -772,7 +772,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostVersion(item *catal } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHealthScore(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsHealthScore) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHealthScore(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsHealthScore) []map[string]interface{} { if items == nil { return nil } @@ -787,7 +787,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHealthScore(items *[]ca return respItems } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostIPV6(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsHostIPV6) []interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsHostIPV6(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsHostIPV6) []interface{} { if items == nil { return nil } @@ -799,7 +799,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsHostIPV6(items *[]catal return respItems } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAuthType(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsAuthType) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsAuthType(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsAuthType) interface{} { if item == nil { return nil } @@ -809,7 +809,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAuthType(item *catalyst } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsSSID(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsSSID) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsSSID(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsSSID) interface{} { if item == nil { return nil } @@ -819,7 +819,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsSSID(item *catalystcent } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsFrequency(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsFrequency) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsFrequency(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsFrequency) interface{} { if item == nil { return nil } @@ -829,7 +829,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsFrequency(item *catalys } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsChannel(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsChannel) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsChannel(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsChannel) interface{} { if item == nil { return nil } @@ -839,7 +839,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsChannel(item *catalystc } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsApGroup(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsApGroup) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsApGroup(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsApGroup) interface{} { if item == nil { return nil } @@ -849,7 +849,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsApGroup(item *catalystc } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsLocation(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsLocation) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsLocation(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsLocation) interface{} { if item == nil { return nil } @@ -859,7 +859,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsLocation(item *catalyst } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsConnectedDevice) []interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsConnectedDevice) []interface{} { if items == nil { return nil } @@ -871,7 +871,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsConnectedDevice(items * return respItems } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsRssi(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsRssi) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsRssi(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsRssi) interface{} { if item == nil { return nil } @@ -881,7 +881,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsRssi(item *catalystcent } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAvgRssi(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsAvgRssi) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsAvgRssi(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsAvgRssi) interface{} { if item == nil { return nil } @@ -891,7 +891,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAvgRssi(item *catalystc } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsSnr(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsSnr) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsSnr(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsSnr) interface{} { if item == nil { return nil } @@ -901,7 +901,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsSnr(item *catalystcente } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAvgSnr(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsAvgSnr) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsAvgSnr(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsAvgSnr) interface{} { if item == nil { return nil } @@ -911,7 +911,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsAvgSnr(item *catalystce } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDataRate(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsDataRate) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsDataRate(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsDataRate) interface{} { if item == nil { return nil } @@ -921,7 +921,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDataRate(item *catalyst } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsTxBytes(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsTxBytes) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsTxBytes(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsTxBytes) interface{} { if item == nil { return nil } @@ -931,7 +931,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsTxBytes(item *catalystc } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsRxBytes(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsRxBytes) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsRxBytes(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsRxBytes) interface{} { if item == nil { return nil } @@ -941,7 +941,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsRxBytes(item *catalystc } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDNSSuccess(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsDNSSuccess) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsDNSSuccess(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsDNSSuccess) interface{} { if item == nil { return nil } @@ -951,7 +951,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDNSSuccess(item *cataly } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDNSFailure(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsDNSFailure) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsDNSFailure(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsDNSFailure) interface{} { if item == nil { return nil } @@ -961,21 +961,21 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsDNSFailure(item *cataly } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboarding(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboarding) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboarding(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboarding) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["average_run_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageRunDuration(item.AverageRunDuration) - respItem["max_run_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxRunDuration(item.MaxRunDuration) - respItem["average_assoc_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageAssocDuration(item.AverageAssocDuration) - respItem["max_assoc_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxAssocDuration(item.MaxAssocDuration) - respItem["average_auth_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageAuthDuration(item.AverageAuthDuration) - respItem["max_auth_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxAuthDuration(item.MaxAuthDuration) - respItem["average_dhcp_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageDhcpDuration(item.AverageDhcpDuration) - respItem["max_dhcp_duration"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxDhcpDuration(item.MaxDhcpDuration) - respItem["aaa_server_ip"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAAAServerIP(item.AAAServerIP) - respItem["dhcp_server_ip"] = flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingDhcpServerIP(item.DhcpServerIP) + respItem["average_run_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageRunDuration(item.AverageRunDuration) + respItem["max_run_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxRunDuration(item.MaxRunDuration) + respItem["average_assoc_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageAssocDuration(item.AverageAssocDuration) + respItem["max_assoc_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxAssocDuration(item.MaxAssocDuration) + respItem["average_auth_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageAuthDuration(item.AverageAuthDuration) + respItem["max_auth_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxAuthDuration(item.MaxAuthDuration) + respItem["average_dhcp_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageDhcpDuration(item.AverageDhcpDuration) + respItem["max_dhcp_duration"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxDhcpDuration(item.MaxDhcpDuration) + respItem["aaa_server_ip"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAAAServerIP(item.AAAServerIP) + respItem["dhcp_server_ip"] = flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingDhcpServerIP(item.DhcpServerIP) return []map[string]interface{}{ respItem, @@ -983,7 +983,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboarding(item *cataly } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageRunDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingAverageRunDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageRunDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingAverageRunDuration) interface{} { if item == nil { return nil } @@ -993,7 +993,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageRunDur } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxRunDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingMaxRunDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxRunDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingMaxRunDuration) interface{} { if item == nil { return nil } @@ -1003,7 +1003,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxRunDuratio } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageAssocDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingAverageAssocDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageAssocDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingAverageAssocDuration) interface{} { if item == nil { return nil } @@ -1013,7 +1013,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageAssocD } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxAssocDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingMaxAssocDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxAssocDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingMaxAssocDuration) interface{} { if item == nil { return nil } @@ -1023,7 +1023,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxAssocDurat } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageAuthDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingAverageAuthDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageAuthDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingAverageAuthDuration) interface{} { if item == nil { return nil } @@ -1033,7 +1033,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageAuthDu } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxAuthDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingMaxAuthDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxAuthDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingMaxAuthDuration) interface{} { if item == nil { return nil } @@ -1043,7 +1043,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxAuthDurati } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageDhcpDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingAverageDhcpDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAverageDhcpDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingAverageDhcpDuration) interface{} { if item == nil { return nil } @@ -1053,7 +1053,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAverageDhcpDu } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxDhcpDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingMaxDhcpDuration) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingMaxDhcpDuration(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingMaxDhcpDuration) interface{} { if item == nil { return nil } @@ -1063,7 +1063,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingMaxDhcpDurati } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAAAServerIP(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingAAAServerIP) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingAAAServerIP(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingAAAServerIP) interface{} { if item == nil { return nil } @@ -1073,7 +1073,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingAAAServerIP(i } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingDhcpServerIP(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingDhcpServerIP) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingDhcpServerIP(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingDhcpServerIP) interface{} { if item == nil { return nil } @@ -1083,7 +1083,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingDhcpServerIP( } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingTime(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsOnboardingTime) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsOnboardingTime(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsOnboardingTime) interface{} { if item == nil { return nil } @@ -1093,7 +1093,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsOnboardingTime(item *ca } -func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsPort(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsUserDetailsPort) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsUserDetailsPort(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1UserDetailsPort) interface{} { if item == nil { return nil } @@ -1103,28 +1103,28 @@ func flattenUsersGetUserEnrichmentDetailsItemsUserDetailsPort(item *catalystcent } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDevice) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDevice(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDevice) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["device_details"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item.DeviceDetails) + respItem["device_details"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetails(item.DeviceDetails) respItems = append(respItems, respItem) } return respItems } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetails) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetails(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["family"] = item.Family respItem["type"] = item.Type - respItem["location"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocation(item.Location) - respItem["error_code"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorCode(item.ErrorCode) + respItem["location"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocation(item.Location) + respItem["error_code"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsErrorCode(item.ErrorCode) respItem["mac_address"] = item.MacAddress respItem["role"] = item.Role respItem["ap_manager_interface_ip"] = item.ApManagerInterfaceIP @@ -1141,8 +1141,8 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item respItem["reachability_status"] = item.ReachabilityStatus respItem["snmp_contact"] = item.SNMPContact respItem["snmp_location"] = item.SNMPLocation - respItem["tunnel_udp_port"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsTunnelUDPPort(item.TunnelUDPPort) - respItem["waas_device_mode"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item.WaasDeviceMode) + respItem["tunnel_udp_port"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsTunnelUDPPort(item.TunnelUDPPort) + respItem["waas_device_mode"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item.WaasDeviceMode) respItem["series"] = item.Series respItem["inventory_status_detail"] = item.InventoryStatusDetail respItem["collection_interval"] = item.CollectionInterval @@ -1152,13 +1152,13 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item respItem["hostname"] = item.Hostname respItem["up_time"] = item.UpTime respItem["last_update_time"] = item.LastUpdateTime - respItem["error_description"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorDescription(item.ErrorDescription) - respItem["location_name"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocationName(item.LocationName) + respItem["error_description"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsErrorDescription(item.ErrorDescription) + respItem["location_name"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocationName(item.LocationName) respItem["tag_count"] = item.TagCount respItem["last_updated"] = item.LastUpdated respItem["instance_uuid"] = item.InstanceUUID respItem["id"] = item.ID - respItem["neighbor_topology"] = flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopology(item.NeighborTopology) + respItem["neighbor_topology"] = flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopology(item.NeighborTopology) return []map[string]interface{}{ respItem, @@ -1166,7 +1166,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetails(item } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocation(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsLocation) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocation(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsLocation) interface{} { if item == nil { return nil } @@ -1176,7 +1176,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocati } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorCode(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsErrorCode) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsErrorCode(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsErrorCode) interface{} { if item == nil { return nil } @@ -1186,7 +1186,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorC } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsTunnelUDPPort(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsTunnelUDPPort) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsTunnelUDPPort(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsTunnelUDPPort) interface{} { if item == nil { return nil } @@ -1196,7 +1196,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsTunnel } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsWaasDeviceMode) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsWaasDeviceMode(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsWaasDeviceMode) interface{} { if item == nil { return nil } @@ -1206,7 +1206,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsWaasDe } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorDescription(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsErrorDescription) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsErrorDescription(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsErrorDescription) interface{} { if item == nil { return nil } @@ -1216,7 +1216,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsErrorD } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocationName(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsLocationName) interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsLocationName(item *catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsLocationName) interface{} { if item == nil { return nil } @@ -1226,7 +1226,7 @@ func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsLocati } -func flattenUsersGetUserEnrichmentDetailsItemsConnectedDeviceDeviceDetailsNeighborTopology(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsConnectedDeviceDeviceDetailsNeighborTopology) []map[string]interface{} { +func flattenUsersGetUserEnrichmentDetailsV1ItemsConnectedDeviceDeviceDetailsNeighborTopology(items *[]catalystcentersdkgo.ResponseItemUsersGetUserEnrichmentDetailsV1ConnectedDeviceDeviceDetailsNeighborTopology) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_users_external_authentication.go b/catalystcenter/data_source_users_external_authentication.go index e1c351a..80a1642 100644 --- a/catalystcenter/data_source_users_external_authentication.go +++ b/catalystcenter/data_source_users_external_authentication.go @@ -57,26 +57,26 @@ func dataSourceUsersExternalAuthenticationRead(ctx context.Context, d *schema.Re selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetExternalAuthenticationSettingAPI") + log.Printf("[DEBUG] Selected method: GetExternalAuthenticationSettingAPIV1") - response1, restyResp1, err := client.UserandRoles.GetExternalAuthenticationSettingAPI() + response1, restyResp1, err := client.UserandRoles.GetExternalAuthenticationSettingAPIV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetExternalAuthenticationSettingAPI", err, - "Failure at GetExternalAuthenticationSettingAPI, unexpected response", "")) + "Failure when executing 2 GetExternalAuthenticationSettingAPIV1", err, + "Failure at GetExternalAuthenticationSettingAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetExternalAuthenticationSettingAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetExternalAuthenticationSettingAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetExternalAuthenticationSettingAPI response", + "Failure when setting GetExternalAuthenticationSettingAPIV1 response", err)) return diags } @@ -88,18 +88,18 @@ func dataSourceUsersExternalAuthenticationRead(ctx context.Context, d *schema.Re return diags } -func flattenUserandRolesGetExternalAuthenticationSettingAPIItem(item *catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationSettingAPIResponse) []map[string]interface{} { +func flattenUserandRolesGetExternalAuthenticationSettingAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationSettingAPIV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["external_authentication_flag"] = flattenUserandRolesGetExternalAuthenticationSettingAPIItemExternalAuthenticationFlag(item.ExternalAuthenticationFlag) + respItem["external_authentication_flag"] = flattenUserandRolesGetExternalAuthenticationSettingAPIV1ItemExternalAuthenticationFlag(item.ExternalAuthenticationFlag) return []map[string]interface{}{ respItem, } } -func flattenUserandRolesGetExternalAuthenticationSettingAPIItemExternalAuthenticationFlag(items *[]catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationSettingAPIResponseExternalAuthenticationFlag) []map[string]interface{} { +func flattenUserandRolesGetExternalAuthenticationSettingAPIV1ItemExternalAuthenticationFlag(items *[]catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationSettingAPIV1ResponseExternalAuthenticationFlag) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_users_external_servers.go b/catalystcenter/data_source_users_external_servers.go index 44b12c2..196c23f 100644 --- a/catalystcenter/data_source_users_external_servers.go +++ b/catalystcenter/data_source_users_external_servers.go @@ -120,29 +120,29 @@ func dataSourceUsersExternalServersRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetExternalAuthenticationServersAPI") - queryParams1 := catalystcentersdkgo.GetExternalAuthenticationServersAPIQueryParams{} + log.Printf("[DEBUG] Selected method: GetExternalAuthenticationServersAPIV1") + queryParams1 := catalystcentersdkgo.GetExternalAuthenticationServersAPIV1QueryParams{} queryParams1.InvokeSource = vInvokeSource.(string) - response1, restyResp1, err := client.UserandRoles.GetExternalAuthenticationServersAPI(&queryParams1) + response1, restyResp1, err := client.UserandRoles.GetExternalAuthenticationServersAPIV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetExternalAuthenticationServersAPI", err, - "Failure at GetExternalAuthenticationServersAPI, unexpected response", "")) + "Failure when executing 2 GetExternalAuthenticationServersAPIV1", err, + "Failure at GetExternalAuthenticationServersAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetExternalAuthenticationServersAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetExternalAuthenticationServersAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetExternalAuthenticationServersAPI response", + "Failure when setting GetExternalAuthenticationServersAPIV1 response", err)) return diags } @@ -154,18 +154,18 @@ func dataSourceUsersExternalServersRead(ctx context.Context, d *schema.ResourceD return diags } -func flattenUserandRolesGetExternalAuthenticationServersAPIItem(item *catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationServersAPIResponse) []map[string]interface{} { +func flattenUserandRolesGetExternalAuthenticationServersAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationServersAPIV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["aaa_servers"] = flattenUserandRolesGetExternalAuthenticationServersAPIItemAAAServers(item.AAAServers) + respItem["aaa_servers"] = flattenUserandRolesGetExternalAuthenticationServersAPIV1ItemAAAServers(item.AAAServers) return []map[string]interface{}{ respItem, } } -func flattenUserandRolesGetExternalAuthenticationServersAPIItemAAAServers(items *[]catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationServersAPIResponseAAAServers) []map[string]interface{} { +func flattenUserandRolesGetExternalAuthenticationServersAPIV1ItemAAAServers(items *[]catalystcentersdkgo.ResponseUserandRolesGetExternalAuthenticationServersAPIV1ResponseAAAServers) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_users_external_servers_aaa_attribute.go b/catalystcenter/data_source_users_external_servers_aaa_attribute.go index 7eb2c34..d8a6e94 100644 --- a/catalystcenter/data_source_users_external_servers_aaa_attribute.go +++ b/catalystcenter/data_source_users_external_servers_aaa_attribute.go @@ -56,26 +56,26 @@ func dataSourceUsersExternalServersAAAAttributeRead(ctx context.Context, d *sche selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAAAAttributeAPI") + log.Printf("[DEBUG] Selected method: GetAAAAttributeAPIV1") - response1, restyResp1, err := client.UserandRoles.GetAAAAttributeAPI() + response1, restyResp1, err := client.UserandRoles.GetAAAAttributeAPIV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAAAAttributeAPI", err, - "Failure at GetAAAAttributeAPI, unexpected response", "")) + "Failure when executing 2 GetAAAAttributeAPIV1", err, + "Failure at GetAAAAttributeAPIV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetAAAAttributeAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetAAAAttributeAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAAAAttributeAPI response", + "Failure when setting GetAAAAttributeAPIV1 response", err)) return diags } @@ -87,18 +87,18 @@ func dataSourceUsersExternalServersAAAAttributeRead(ctx context.Context, d *sche return diags } -func flattenUserandRolesGetAAAAttributeAPIItem(item *catalystcentersdkgo.ResponseUserandRolesGetAAAAttributeAPIResponse) []map[string]interface{} { +func flattenUserandRolesGetAAAAttributeAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesGetAAAAttributeAPIV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["aaa_attributes"] = flattenUserandRolesGetAAAAttributeAPIItemAAAAttributes(item.AAAAttributes) + respItem["aaa_attributes"] = flattenUserandRolesGetAAAAttributeAPIV1ItemAAAAttributes(item.AAAAttributes) return []map[string]interface{}{ respItem, } } -func flattenUserandRolesGetAAAAttributeAPIItemAAAAttributes(items *[]catalystcentersdkgo.ResponseUserandRolesGetAAAAttributeAPIResponseAAAAttributes) []map[string]interface{} { +func flattenUserandRolesGetAAAAttributeAPIV1ItemAAAAttributes(items *[]catalystcentersdkgo.ResponseUserandRolesGetAAAAttributeAPIV1ResponseAAAAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_access_points_factory_reset_request_status.go b/catalystcenter/data_source_wireless_access_points_factory_reset_request_status.go index e664569..ade6698 100644 --- a/catalystcenter/data_source_wireless_access_points_factory_reset_request_status.go +++ b/catalystcenter/data_source_wireless_access_points_factory_reset_request_status.go @@ -105,29 +105,29 @@ func dataSourceWirelessAccessPointsFactoryResetRequestStatusRead(ctx context.Con selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAccessPointsFactoryResetStatus") - queryParams1 := catalystcentersdkgo.GetAccessPointsFactoryResetStatusQueryParams{} + log.Printf("[DEBUG] Selected method: GetAccessPointsFactoryResetStatusV1") + queryParams1 := catalystcentersdkgo.GetAccessPointsFactoryResetStatusV1QueryParams{} queryParams1.TaskID = vTaskID.(string) - response1, restyResp1, err := client.Wireless.GetAccessPointsFactoryResetStatus(&queryParams1) + response1, restyResp1, err := client.Wireless.GetAccessPointsFactoryResetStatusV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAccessPointsFactoryResetStatus", err, - "Failure at GetAccessPointsFactoryResetStatus, unexpected response", "")) + "Failure when executing 2 GetAccessPointsFactoryResetStatusV1", err, + "Failure at GetAccessPointsFactoryResetStatusV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetAccessPointsFactoryResetStatusItems(response1.Response) + vItems1 := flattenWirelessGetAccessPointsFactoryResetStatusV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAccessPointsFactoryResetStatus response", + "Failure when setting GetAccessPointsFactoryResetStatusV1 response", err)) return diags } @@ -139,7 +139,7 @@ func dataSourceWirelessAccessPointsFactoryResetRequestStatusRead(ctx context.Con return diags } -func flattenWirelessGetAccessPointsFactoryResetStatusItems(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointsFactoryResetStatusResponse) []map[string]interface{} { +func flattenWirelessGetAccessPointsFactoryResetStatusV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointsFactoryResetStatusV1Response) []map[string]interface{} { if items == nil { return nil } @@ -148,13 +148,13 @@ func flattenWirelessGetAccessPointsFactoryResetStatusItems(items *[]catalystcent respItem := make(map[string]interface{}) respItem["wlc_ip"] = item.WlcIP respItem["wlc_name"] = item.WlcName - respItem["ap_response_info_list"] = flattenWirelessGetAccessPointsFactoryResetStatusItemsApResponseInfoList(item.ApResponseInfoList) + respItem["ap_response_info_list"] = flattenWirelessGetAccessPointsFactoryResetStatusV1ItemsApResponseInfoList(item.ApResponseInfoList) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAccessPointsFactoryResetStatusItemsApResponseInfoList(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointsFactoryResetStatusResponseApResponseInfoList) []map[string]interface{} { +func flattenWirelessGetAccessPointsFactoryResetStatusV1ItemsApResponseInfoList(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointsFactoryResetStatusV1ResponseApResponseInfoList) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_accesspoint_configuration_summary.go b/catalystcenter/data_source_wireless_accesspoint_configuration_summary.go index 5599c19..ad59d8a 100644 --- a/catalystcenter/data_source_wireless_accesspoint_configuration_summary.go +++ b/catalystcenter/data_source_wireless_accesspoint_configuration_summary.go @@ -459,29 +459,29 @@ func dataSourceWirelessAccesspointConfigurationSummaryRead(ctx context.Context, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAccessPointConfiguration") - queryParams1 := catalystcentersdkgo.GetAccessPointConfigurationQueryParams{} + log.Printf("[DEBUG] Selected method: GetAccessPointConfigurationV1") + queryParams1 := catalystcentersdkgo.GetAccessPointConfigurationV1QueryParams{} queryParams1.Key = vKey.(string) - response1, restyResp1, err := client.Wireless.GetAccessPointConfiguration(&queryParams1) + response1, restyResp1, err := client.Wireless.GetAccessPointConfigurationV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAccessPointConfiguration", err, - "Failure at GetAccessPointConfiguration, unexpected response", "")) + "Failure when executing 2 GetAccessPointConfigurationV1", err, + "Failure at GetAccessPointConfigurationV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetAccessPointConfigurationItem(response1) + vItem1 := flattenWirelessGetAccessPointConfigurationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAccessPointConfiguration response", + "Failure when setting GetAccessPointConfigurationV1 response", err)) return diags } @@ -493,27 +493,27 @@ func dataSourceWirelessAccesspointConfigurationSummaryRead(ctx context.Context, return diags } -func flattenWirelessGetAccessPointConfigurationItem(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfiguration) []map[string]interface{} { +func flattenWirelessGetAccessPointConfigurationV1Item(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["instance_uuid"] = flattenWirelessGetAccessPointConfigurationItemInstanceUUID(item.InstanceUUID) + respItem["instance_uuid"] = flattenWirelessGetAccessPointConfigurationV1ItemInstanceUUID(item.InstanceUUID) respItem["instance_id"] = item.InstanceID - respItem["auth_entity_id"] = flattenWirelessGetAccessPointConfigurationItemAuthEntityID(item.AuthEntityID) + respItem["auth_entity_id"] = flattenWirelessGetAccessPointConfigurationV1ItemAuthEntityID(item.AuthEntityID) respItem["display_name"] = item.DisplayName - respItem["auth_entity_class"] = flattenWirelessGetAccessPointConfigurationItemAuthEntityClass(item.AuthEntityClass) + respItem["auth_entity_class"] = flattenWirelessGetAccessPointConfigurationV1ItemAuthEntityClass(item.AuthEntityClass) respItem["instance_tenant_id"] = item.InstanceTenantID respItem["ordered_list_oeindex"] = item.OrderedListOEIndex - respItem["ordered_list_oeassoc_name"] = flattenWirelessGetAccessPointConfigurationItemOrderedListOEAssocName(item.OrderedListOEAssocName) + respItem["ordered_list_oeassoc_name"] = flattenWirelessGetAccessPointConfigurationV1ItemOrderedListOEAssocName(item.OrderedListOEAssocName) respItem["creation_order_index"] = item.CreationOrderIndex respItem["is_being_changed"] = boolPtrToString(item.IsBeingChanged) respItem["deploy_pending"] = item.DeployPending - respItem["instance_created_on"] = flattenWirelessGetAccessPointConfigurationItemInstanceCreatedOn(item.InstanceCreatedOn) - respItem["instance_updated_on"] = flattenWirelessGetAccessPointConfigurationItemInstanceUpdatedOn(item.InstanceUpdatedOn) - respItem["change_log_list"] = flattenWirelessGetAccessPointConfigurationItemChangeLogList(item.ChangeLogList) - respItem["instance_origin"] = flattenWirelessGetAccessPointConfigurationItemInstanceOrigin(item.InstanceOrigin) - respItem["lazy_loaded_entities"] = flattenWirelessGetAccessPointConfigurationItemLazyLoadedEntities(item.LazyLoadedEntities) + respItem["instance_created_on"] = flattenWirelessGetAccessPointConfigurationV1ItemInstanceCreatedOn(item.InstanceCreatedOn) + respItem["instance_updated_on"] = flattenWirelessGetAccessPointConfigurationV1ItemInstanceUpdatedOn(item.InstanceUpdatedOn) + respItem["change_log_list"] = flattenWirelessGetAccessPointConfigurationV1ItemChangeLogList(item.ChangeLogList) + respItem["instance_origin"] = flattenWirelessGetAccessPointConfigurationV1ItemInstanceOrigin(item.InstanceOrigin) + respItem["lazy_loaded_entities"] = flattenWirelessGetAccessPointConfigurationV1ItemLazyLoadedEntities(item.LazyLoadedEntities) respItem["instance_version"] = item.InstanceVersion respItem["admin_status"] = item.AdminStatus respItem["ap_height"] = item.ApHeight @@ -531,15 +531,15 @@ func flattenWirelessGetAccessPointConfigurationItem(item *catalystcentersdkgo.Re respItem["secondary_ip_address"] = item.SecondaryIPAddress respItem["tertiary_controller_name"] = item.TertiaryControllerName respItem["tertiary_ip_address"] = item.TertiaryIPAddress - respItem["mesh_dtos"] = flattenWirelessGetAccessPointConfigurationItemMeshDTOs(item.MeshDTOs) - respItem["radio_dtos"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOs(item.RadioDTOs) - respItem["internal_key"] = flattenWirelessGetAccessPointConfigurationItemInternalKey(item.InternalKey) + respItem["mesh_dtos"] = flattenWirelessGetAccessPointConfigurationV1ItemMeshDTOs(item.MeshDTOs) + respItem["radio_dtos"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOs(item.RadioDTOs) + respItem["internal_key"] = flattenWirelessGetAccessPointConfigurationV1ItemInternalKey(item.InternalKey) return []map[string]interface{}{ respItem, } } -func flattenWirelessGetAccessPointConfigurationItemInstanceUUID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationInstanceUUID) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemInstanceUUID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1InstanceUUID) interface{} { if item == nil { return nil } @@ -549,7 +549,7 @@ func flattenWirelessGetAccessPointConfigurationItemInstanceUUID(item *catalystce } -func flattenWirelessGetAccessPointConfigurationItemAuthEntityID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationAuthEntityID) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemAuthEntityID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1AuthEntityID) interface{} { if item == nil { return nil } @@ -559,7 +559,7 @@ func flattenWirelessGetAccessPointConfigurationItemAuthEntityID(item *catalystce } -func flattenWirelessGetAccessPointConfigurationItemAuthEntityClass(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationAuthEntityClass) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemAuthEntityClass(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1AuthEntityClass) interface{} { if item == nil { return nil } @@ -569,7 +569,7 @@ func flattenWirelessGetAccessPointConfigurationItemAuthEntityClass(item *catalys } -func flattenWirelessGetAccessPointConfigurationItemOrderedListOEAssocName(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationOrderedListOEAssocName) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemOrderedListOEAssocName(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1OrderedListOEAssocName) interface{} { if item == nil { return nil } @@ -579,7 +579,7 @@ func flattenWirelessGetAccessPointConfigurationItemOrderedListOEAssocName(item * } -func flattenWirelessGetAccessPointConfigurationItemInstanceCreatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationInstanceCreatedOn) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemInstanceCreatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1InstanceCreatedOn) interface{} { if item == nil { return nil } @@ -589,7 +589,7 @@ func flattenWirelessGetAccessPointConfigurationItemInstanceCreatedOn(item *catal } -func flattenWirelessGetAccessPointConfigurationItemInstanceUpdatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationInstanceUpdatedOn) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemInstanceUpdatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1InstanceUpdatedOn) interface{} { if item == nil { return nil } @@ -599,7 +599,7 @@ func flattenWirelessGetAccessPointConfigurationItemInstanceUpdatedOn(item *catal } -func flattenWirelessGetAccessPointConfigurationItemChangeLogList(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationChangeLogList) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemChangeLogList(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1ChangeLogList) interface{} { if item == nil { return nil } @@ -609,7 +609,7 @@ func flattenWirelessGetAccessPointConfigurationItemChangeLogList(item *catalystc } -func flattenWirelessGetAccessPointConfigurationItemInstanceOrigin(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationInstanceOrigin) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemInstanceOrigin(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1InstanceOrigin) interface{} { if item == nil { return nil } @@ -619,7 +619,7 @@ func flattenWirelessGetAccessPointConfigurationItemInstanceOrigin(item *catalyst } -func flattenWirelessGetAccessPointConfigurationItemLazyLoadedEntities(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationLazyLoadedEntities) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemLazyLoadedEntities(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1LazyLoadedEntities) interface{} { if item == nil { return nil } @@ -629,7 +629,7 @@ func flattenWirelessGetAccessPointConfigurationItemLazyLoadedEntities(item *cata } -func flattenWirelessGetAccessPointConfigurationItemMeshDTOs(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationMeshDTOs) []interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemMeshDTOs(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1MeshDTOs) []interface{} { if items == nil { return nil } @@ -641,29 +641,29 @@ func flattenWirelessGetAccessPointConfigurationItemMeshDTOs(items *[]catalystcen return respItems } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOs(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOs) []map[string]interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOs(items *[]catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOs) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["instance_uuid"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceUUID(item.InstanceUUID) + respItem["instance_uuid"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceUUID(item.InstanceUUID) respItem["instance_id"] = item.InstanceID - respItem["auth_entity_id"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsAuthEntityID(item.AuthEntityID) + respItem["auth_entity_id"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsAuthEntityID(item.AuthEntityID) respItem["display_name"] = item.DisplayName - respItem["auth_entity_class"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsAuthEntityClass(item.AuthEntityClass) + respItem["auth_entity_class"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsAuthEntityClass(item.AuthEntityClass) respItem["instance_tenant_id"] = item.InstanceTenantID respItem["ordered_list_oeindex"] = item.OrderedListOEIndex - respItem["ordered_list_oeassoc_name"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsOrderedListOEAssocName(item.OrderedListOEAssocName) + respItem["ordered_list_oeassoc_name"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsOrderedListOEAssocName(item.OrderedListOEAssocName) respItem["creation_order_index"] = item.CreationOrderIndex respItem["is_being_changed"] = boolPtrToString(item.IsBeingChanged) respItem["deploy_pending"] = item.DeployPending - respItem["instance_created_on"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceCreatedOn(item.InstanceCreatedOn) - respItem["instance_updated_on"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceUpdatedOn(item.InstanceUpdatedOn) - respItem["change_log_list"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsChangeLogList(item.ChangeLogList) - respItem["instance_origin"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceOrigin(item.InstanceOrigin) - respItem["lazy_loaded_entities"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsLazyLoadedEntities(item.LazyLoadedEntities) + respItem["instance_created_on"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceCreatedOn(item.InstanceCreatedOn) + respItem["instance_updated_on"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceUpdatedOn(item.InstanceUpdatedOn) + respItem["change_log_list"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsChangeLogList(item.ChangeLogList) + respItem["instance_origin"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceOrigin(item.InstanceOrigin) + respItem["lazy_loaded_entities"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsLazyLoadedEntities(item.LazyLoadedEntities) respItem["instance_version"] = item.InstanceVersion respItem["admin_status"] = item.AdminStatus respItem["antenna_angle"] = item.AntennaAngle @@ -679,16 +679,16 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOs(items *[]catalystce respItem["mac_address"] = item.MacAddress respItem["power_assignment_mode"] = item.PowerAssignmentMode respItem["powerlevel"] = item.Powerlevel - respItem["radio_band"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsRadioBand(item.RadioBand) - respItem["radio_role_assignment"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsRadioRoleAssignment(item.RadioRoleAssignment) + respItem["radio_band"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsRadioBand(item.RadioBand) + respItem["radio_role_assignment"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsRadioRoleAssignment(item.RadioRoleAssignment) respItem["slot_id"] = item.SlotID - respItem["internal_key"] = flattenWirelessGetAccessPointConfigurationItemRadioDTOsInternalKey(item.InternalKey) + respItem["internal_key"] = flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInternalKey(item.InternalKey) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceUUID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsInstanceUUID) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceUUID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsInstanceUUID) interface{} { if item == nil { return nil } @@ -698,7 +698,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceUUID(item *c } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsAuthEntityID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsAuthEntityID) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsAuthEntityID(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsAuthEntityID) interface{} { if item == nil { return nil } @@ -708,7 +708,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsAuthEntityID(item *c } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsAuthEntityClass(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsAuthEntityClass) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsAuthEntityClass(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsAuthEntityClass) interface{} { if item == nil { return nil } @@ -718,7 +718,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsAuthEntityClass(item } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsOrderedListOEAssocName(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsOrderedListOEAssocName) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsOrderedListOEAssocName(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsOrderedListOEAssocName) interface{} { if item == nil { return nil } @@ -728,7 +728,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsOrderedListOEAssocNa } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceCreatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsInstanceCreatedOn) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceCreatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsInstanceCreatedOn) interface{} { if item == nil { return nil } @@ -738,7 +738,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceCreatedOn(it } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceUpdatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsInstanceUpdatedOn) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceUpdatedOn(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsInstanceUpdatedOn) interface{} { if item == nil { return nil } @@ -748,7 +748,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceUpdatedOn(it } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsChangeLogList(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsChangeLogList) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsChangeLogList(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsChangeLogList) interface{} { if item == nil { return nil } @@ -758,7 +758,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsChangeLogList(item * } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceOrigin(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsInstanceOrigin) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInstanceOrigin(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsInstanceOrigin) interface{} { if item == nil { return nil } @@ -768,7 +768,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInstanceOrigin(item } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsLazyLoadedEntities(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsLazyLoadedEntities) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsLazyLoadedEntities(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsLazyLoadedEntities) interface{} { if item == nil { return nil } @@ -778,7 +778,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsLazyLoadedEntities(i } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsRadioBand(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsRadioBand) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsRadioBand(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsRadioBand) interface{} { if item == nil { return nil } @@ -788,7 +788,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsRadioBand(item *cata } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsRadioRoleAssignment(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsRadioRoleAssignment) interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsRadioRoleAssignment(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsRadioRoleAssignment) interface{} { if item == nil { return nil } @@ -798,7 +798,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsRadioRoleAssignment( } -func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInternalKey(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationRadioDTOsInternalKey) []map[string]interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemRadioDTOsInternalKey(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1RadioDTOsInternalKey) []map[string]interface{} { if item == nil { return nil } @@ -814,7 +814,7 @@ func flattenWirelessGetAccessPointConfigurationItemRadioDTOsInternalKey(item *ca } -func flattenWirelessGetAccessPointConfigurationItemInternalKey(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationInternalKey) []map[string]interface{} { +func flattenWirelessGetAccessPointConfigurationV1ItemInternalKey(item *catalystcentersdkgo.ResponseWirelessGetAccessPointConfigurationV1InternalKey) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_anchor_managed_ap_locations.go b/catalystcenter/data_source_wireless_controllers_anchor_managed_ap_locations.go index 9e2e7b7..e04d35e 100644 --- a/catalystcenter/data_source_wireless_controllers_anchor_managed_ap_locations.go +++ b/catalystcenter/data_source_wireless_controllers_anchor_managed_ap_locations.go @@ -84,9 +84,9 @@ func dataSourceWirelessControllersAnchorManagedApLocationsRead(ctx context.Conte selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAnchorManagedApLocationsForSpecificWirelessController") + log.Printf("[DEBUG] Selected method: GetAnchorManagedApLocationsForSpecificWirelessControllerV1") vvNetworkDeviceID := vNetworkDeviceID.(string) - queryParams1 := catalystcentersdkgo.GetAnchorManagedApLocationsForSpecificWirelessControllerQueryParams{} + queryParams1 := catalystcentersdkgo.GetAnchorManagedApLocationsForSpecificWirelessControllerV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -95,24 +95,24 @@ func dataSourceWirelessControllersAnchorManagedApLocationsRead(ctx context.Conte queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetAnchorManagedApLocationsForSpecificWirelessController(vvNetworkDeviceID, &queryParams1) + response1, restyResp1, err := client.Wireless.GetAnchorManagedApLocationsForSpecificWirelessControllerV1(vvNetworkDeviceID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAnchorManagedApLocationsForSpecificWirelessController", err, - "Failure at GetAnchorManagedApLocationsForSpecificWirelessController, unexpected response", "")) + "Failure when executing 2 GetAnchorManagedApLocationsForSpecificWirelessControllerV1", err, + "Failure at GetAnchorManagedApLocationsForSpecificWirelessControllerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerItems(response1.Response) + vItems1 := flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAnchorManagedApLocationsForSpecificWirelessController response", + "Failure when setting GetAnchorManagedApLocationsForSpecificWirelessControllerV1 response", err)) return diags } @@ -124,20 +124,20 @@ func dataSourceWirelessControllersAnchorManagedApLocationsRead(ctx context.Conte return diags } -func flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerItems(items *[]catalystcentersdkgo.ResponseWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerResponse) []map[string]interface{} { +func flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["managed_ap_locations"] = flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerItemsManagedApLocations(item.ManagedApLocations) + respItem["managed_ap_locations"] = flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerV1ItemsManagedApLocations(item.ManagedApLocations) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerItemsManagedApLocations(items *[]catalystcentersdkgo.ResponseWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerResponseManagedApLocations) []map[string]interface{} { +func flattenWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerV1ItemsManagedApLocations(items *[]catalystcentersdkgo.ResponseWirelessGetAnchorManagedApLocationsForSpecificWirelessControllerV1ResponseManagedApLocations) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_managed_ap_locations_count.go b/catalystcenter/data_source_wireless_controllers_managed_ap_locations_count.go index 00f5508..41da2a4 100644 --- a/catalystcenter/data_source_wireless_controllers_managed_ap_locations_count.go +++ b/catalystcenter/data_source_wireless_controllers_managed_ap_locations_count.go @@ -69,27 +69,27 @@ func dataSourceWirelessControllersManagedApLocationsCountRead(ctx context.Contex selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetManagedApLocationsCountForSpecificWirelessController") + log.Printf("[DEBUG] Selected method: GetManagedApLocationsCountForSpecificWirelessControllerV1") vvNetworkDeviceID := vNetworkDeviceID.(string) - response1, restyResp1, err := client.Wireless.GetManagedApLocationsCountForSpecificWirelessController(vvNetworkDeviceID) + response1, restyResp1, err := client.Wireless.GetManagedApLocationsCountForSpecificWirelessControllerV1(vvNetworkDeviceID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetManagedApLocationsCountForSpecificWirelessController", err, - "Failure at GetManagedApLocationsCountForSpecificWirelessController, unexpected response", "")) + "Failure when executing 2 GetManagedApLocationsCountForSpecificWirelessControllerV1", err, + "Failure at GetManagedApLocationsCountForSpecificWirelessControllerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetManagedApLocationsCountForSpecificWirelessControllerItem(response1.Response) + vItem1 := flattenWirelessGetManagedApLocationsCountForSpecificWirelessControllerV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetManagedApLocationsCountForSpecificWirelessController response", + "Failure when setting GetManagedApLocationsCountForSpecificWirelessControllerV1 response", err)) return diags } @@ -101,7 +101,7 @@ func dataSourceWirelessControllersManagedApLocationsCountRead(ctx context.Contex return diags } -func flattenWirelessGetManagedApLocationsCountForSpecificWirelessControllerItem(item *catalystcentersdkgo.ResponseWirelessGetManagedApLocationsCountForSpecificWirelessControllerResponse) []map[string]interface{} { +func flattenWirelessGetManagedApLocationsCountForSpecificWirelessControllerV1Item(item *catalystcentersdkgo.ResponseWirelessGetManagedApLocationsCountForSpecificWirelessControllerV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_primary_managed_ap_locations.go b/catalystcenter/data_source_wireless_controllers_primary_managed_ap_locations.go index 6d39007..9087418 100644 --- a/catalystcenter/data_source_wireless_controllers_primary_managed_ap_locations.go +++ b/catalystcenter/data_source_wireless_controllers_primary_managed_ap_locations.go @@ -84,9 +84,9 @@ func dataSourceWirelessControllersPrimaryManagedApLocationsRead(ctx context.Cont selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPrimaryManagedApLocationsForSpecificWirelessController") + log.Printf("[DEBUG] Selected method: GetPrimaryManagedApLocationsForSpecificWirelessControllerV1") vvNetworkDeviceID := vNetworkDeviceID.(string) - queryParams1 := catalystcentersdkgo.GetPrimaryManagedApLocationsForSpecificWirelessControllerQueryParams{} + queryParams1 := catalystcentersdkgo.GetPrimaryManagedApLocationsForSpecificWirelessControllerV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -95,24 +95,24 @@ func dataSourceWirelessControllersPrimaryManagedApLocationsRead(ctx context.Cont queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetPrimaryManagedApLocationsForSpecificWirelessController(vvNetworkDeviceID, &queryParams1) + response1, restyResp1, err := client.Wireless.GetPrimaryManagedApLocationsForSpecificWirelessControllerV1(vvNetworkDeviceID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetPrimaryManagedApLocationsForSpecificWirelessController", err, - "Failure at GetPrimaryManagedApLocationsForSpecificWirelessController, unexpected response", "")) + "Failure when executing 2 GetPrimaryManagedApLocationsForSpecificWirelessControllerV1", err, + "Failure at GetPrimaryManagedApLocationsForSpecificWirelessControllerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerItems(response1.Response) + vItems1 := flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPrimaryManagedApLocationsForSpecificWirelessController response", + "Failure when setting GetPrimaryManagedApLocationsForSpecificWirelessControllerV1 response", err)) return diags } @@ -124,20 +124,20 @@ func dataSourceWirelessControllersPrimaryManagedApLocationsRead(ctx context.Cont return diags } -func flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerItems(items *[]catalystcentersdkgo.ResponseWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerResponse) []map[string]interface{} { +func flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["managed_ap_locations"] = flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerItemsManagedApLocations(item.ManagedApLocations) + respItem["managed_ap_locations"] = flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerV1ItemsManagedApLocations(item.ManagedApLocations) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerItemsManagedApLocations(items *[]catalystcentersdkgo.ResponseWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerResponseManagedApLocations) []map[string]interface{} { +func flattenWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerV1ItemsManagedApLocations(items *[]catalystcentersdkgo.ResponseWirelessGetPrimaryManagedApLocationsForSpecificWirelessControllerV1ResponseManagedApLocations) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_secondary_managed_ap_locations.go b/catalystcenter/data_source_wireless_controllers_secondary_managed_ap_locations.go index 5bfa0dd..d4955d4 100644 --- a/catalystcenter/data_source_wireless_controllers_secondary_managed_ap_locations.go +++ b/catalystcenter/data_source_wireless_controllers_secondary_managed_ap_locations.go @@ -84,9 +84,9 @@ func dataSourceWirelessControllersSecondaryManagedApLocationsRead(ctx context.Co selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSecondaryManagedApLocationsForSpecificWirelessController") + log.Printf("[DEBUG] Selected method: GetSecondaryManagedApLocationsForSpecificWirelessControllerV1") vvNetworkDeviceID := vNetworkDeviceID.(string) - queryParams1 := catalystcentersdkgo.GetSecondaryManagedApLocationsForSpecificWirelessControllerQueryParams{} + queryParams1 := catalystcentersdkgo.GetSecondaryManagedApLocationsForSpecificWirelessControllerV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -95,24 +95,24 @@ func dataSourceWirelessControllersSecondaryManagedApLocationsRead(ctx context.Co queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetSecondaryManagedApLocationsForSpecificWirelessController(vvNetworkDeviceID, &queryParams1) + response1, restyResp1, err := client.Wireless.GetSecondaryManagedApLocationsForSpecificWirelessControllerV1(vvNetworkDeviceID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSecondaryManagedApLocationsForSpecificWirelessController", err, - "Failure at GetSecondaryManagedApLocationsForSpecificWirelessController, unexpected response", "")) + "Failure when executing 2 GetSecondaryManagedApLocationsForSpecificWirelessControllerV1", err, + "Failure at GetSecondaryManagedApLocationsForSpecificWirelessControllerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerItems(response1.Response) + vItems1 := flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSecondaryManagedApLocationsForSpecificWirelessController response", + "Failure when setting GetSecondaryManagedApLocationsForSpecificWirelessControllerV1 response", err)) return diags } @@ -124,20 +124,20 @@ func dataSourceWirelessControllersSecondaryManagedApLocationsRead(ctx context.Co return diags } -func flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerItems(items *[]catalystcentersdkgo.ResponseWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerResponse) []map[string]interface{} { +func flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerV1Response) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["managed_ap_locations"] = flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerItemsManagedApLocations(item.ManagedApLocations) + respItem["managed_ap_locations"] = flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerV1ItemsManagedApLocations(item.ManagedApLocations) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerItemsManagedApLocations(items *[]catalystcentersdkgo.ResponseWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerResponseManagedApLocations) []map[string]interface{} { +func flattenWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerV1ItemsManagedApLocations(items *[]catalystcentersdkgo.ResponseWirelessGetSecondaryManagedApLocationsForSpecificWirelessControllerV1ResponseManagedApLocations) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_ssid_details.go b/catalystcenter/data_source_wireless_controllers_ssid_details.go index 45f311f..f624c44 100644 --- a/catalystcenter/data_source_wireless_controllers_ssid_details.go +++ b/catalystcenter/data_source_wireless_controllers_ssid_details.go @@ -140,9 +140,9 @@ func dataSourceWirelessControllersSSIDDetailsRead(ctx context.Context, d *schema selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSSIDDetailsForSpecificWirelessController") + log.Printf("[DEBUG] Selected method: GetSSIDDetailsForSpecificWirelessControllerV1") vvNetworkDeviceID := vNetworkDeviceID.(string) - queryParams1 := catalystcentersdkgo.GetSSIDDetailsForSpecificWirelessControllerQueryParams{} + queryParams1 := catalystcentersdkgo.GetSSIDDetailsForSpecificWirelessControllerV1QueryParams{} if okSSIDName { queryParams1.SSIDName = vSSIDName.(string) @@ -160,24 +160,24 @@ func dataSourceWirelessControllersSSIDDetailsRead(ctx context.Context, d *schema queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetSSIDDetailsForSpecificWirelessController(vvNetworkDeviceID, &queryParams1) + response1, restyResp1, err := client.Wireless.GetSSIDDetailsForSpecificWirelessControllerV1(vvNetworkDeviceID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSSIDDetailsForSpecificWirelessController", err, - "Failure at GetSSIDDetailsForSpecificWirelessController, unexpected response", "")) + "Failure when executing 2 GetSSIDDetailsForSpecificWirelessControllerV1", err, + "Failure at GetSSIDDetailsForSpecificWirelessControllerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetSSIDDetailsForSpecificWirelessControllerItems(response1.Response) + vItems1 := flattenWirelessGetSSIDDetailsForSpecificWirelessControllerV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDDetailsForSpecificWirelessController response", + "Failure when setting GetSSIDDetailsForSpecificWirelessControllerV1 response", err)) return diags } @@ -189,7 +189,7 @@ func dataSourceWirelessControllersSSIDDetailsRead(ctx context.Context, d *schema return diags } -func flattenWirelessGetSSIDDetailsForSpecificWirelessControllerItems(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDDetailsForSpecificWirelessControllerResponse) []map[string]interface{} { +func flattenWirelessGetSSIDDetailsForSpecificWirelessControllerV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetSSIDDetailsForSpecificWirelessControllerV1Response) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_ssid_details_count.go b/catalystcenter/data_source_wireless_controllers_ssid_details_count.go index 09e004e..abcfb07 100644 --- a/catalystcenter/data_source_wireless_controllers_ssid_details_count.go +++ b/catalystcenter/data_source_wireless_controllers_ssid_details_count.go @@ -68,9 +68,9 @@ func dataSourceWirelessControllersSSIDDetailsCountRead(ctx context.Context, d *s selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSSIDCountForSpecificWirelessController") + log.Printf("[DEBUG] Selected method: GetSSIDCountForSpecificWirelessControllerV1") vvNetworkDeviceID := vNetworkDeviceID.(string) - queryParams1 := catalystcentersdkgo.GetSSIDCountForSpecificWirelessControllerQueryParams{} + queryParams1 := catalystcentersdkgo.GetSSIDCountForSpecificWirelessControllerV1QueryParams{} if okAdminStatus { queryParams1.AdminStatus = vAdminStatus.(bool) @@ -79,24 +79,24 @@ func dataSourceWirelessControllersSSIDDetailsCountRead(ctx context.Context, d *s queryParams1.Managed = vManaged.(bool) } - response1, restyResp1, err := client.Wireless.GetSSIDCountForSpecificWirelessController(vvNetworkDeviceID, &queryParams1) + response1, restyResp1, err := client.Wireless.GetSSIDCountForSpecificWirelessControllerV1(vvNetworkDeviceID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetSSIDCountForSpecificWirelessController", err, - "Failure at GetSSIDCountForSpecificWirelessController, unexpected response", "")) + "Failure when executing 2 GetSSIDCountForSpecificWirelessControllerV1", err, + "Failure at GetSSIDCountForSpecificWirelessControllerV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetSSIDCountForSpecificWirelessControllerItem(response1.Response) + vItem1 := flattenWirelessGetSSIDCountForSpecificWirelessControllerV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDCountForSpecificWirelessController response", + "Failure when setting GetSSIDCountForSpecificWirelessControllerV1 response", err)) return diags } @@ -108,7 +108,7 @@ func dataSourceWirelessControllersSSIDDetailsCountRead(ctx context.Context, d *s return diags } -func flattenWirelessGetSSIDCountForSpecificWirelessControllerItem(item *catalystcentersdkgo.ResponseWirelessGetSSIDCountForSpecificWirelessControllerResponse) []map[string]interface{} { +func flattenWirelessGetSSIDCountForSpecificWirelessControllerV1Item(item *catalystcentersdkgo.ResponseWirelessGetSSIDCountForSpecificWirelessControllerV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups.go b/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups.go index 6867780..8a1a564 100644 --- a/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups.go +++ b/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups.go @@ -166,31 +166,31 @@ func dataSourceWirelessControllersWirelessMobilityGroupsRead(ctx context.Context selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllMobilityGroups") - queryParams1 := catalystcentersdkgo.GetAllMobilityGroupsQueryParams{} + log.Printf("[DEBUG] Selected method: GetAllMobilityGroupsV1") + queryParams1 := catalystcentersdkgo.GetAllMobilityGroupsV1QueryParams{} if okNetworkDeviceID { queryParams1.NetworkDeviceID = vNetworkDeviceID.(string) } - response1, restyResp1, err := client.Wireless.GetAllMobilityGroups(&queryParams1) + response1, restyResp1, err := client.Wireless.GetAllMobilityGroupsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAllMobilityGroups", err, - "Failure at GetAllMobilityGroups, unexpected response", "")) + "Failure when executing 2 GetAllMobilityGroupsV1", err, + "Failure at GetAllMobilityGroupsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetAllMobilityGroupsItems(response1.Response) + vItems1 := flattenWirelessGetAllMobilityGroupsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAllMobilityGroups response", + "Failure when setting GetAllMobilityGroupsV1 response", err)) return diags } @@ -202,7 +202,7 @@ func dataSourceWirelessControllersWirelessMobilityGroupsRead(ctx context.Context return diags } -func flattenWirelessGetAllMobilityGroupsItems(items *[]catalystcentersdkgo.ResponseWirelessGetAllMobilityGroupsResponse) []map[string]interface{} { +func flattenWirelessGetAllMobilityGroupsV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetAllMobilityGroupsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -215,13 +215,13 @@ func flattenWirelessGetAllMobilityGroupsItems(items *[]catalystcentersdkgo.Respo respItem["network_device_id"] = item.NetworkDeviceID respItem["dtls_high_cipher"] = boolPtrToString(item.DtlsHighCipher) respItem["data_link_encryption"] = boolPtrToString(item.DataLinkEncryption) - respItem["mobility_peers"] = flattenWirelessGetAllMobilityGroupsItemsMobilityPeers(item.MobilityPeers) + respItem["mobility_peers"] = flattenWirelessGetAllMobilityGroupsV1ItemsMobilityPeers(item.MobilityPeers) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetAllMobilityGroupsItemsMobilityPeers(items *[]catalystcentersdkgo.ResponseWirelessGetAllMobilityGroupsResponseMobilityPeers) []map[string]interface{} { +func flattenWirelessGetAllMobilityGroupsV1ItemsMobilityPeers(items *[]catalystcentersdkgo.ResponseWirelessGetAllMobilityGroupsV1ResponseMobilityPeers) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups_count.go b/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups_count.go index 42ea802..8e9c4f0 100644 --- a/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups_count.go +++ b/catalystcenter/data_source_wireless_controllers_wireless_mobility_groups_count.go @@ -47,26 +47,26 @@ func dataSourceWirelessControllersWirelessMobilityGroupsCountRead(ctx context.Co selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMobilityGroupsCount") + log.Printf("[DEBUG] Selected method: GetMobilityGroupsCountV1") - response1, restyResp1, err := client.Wireless.GetMobilityGroupsCount() + response1, restyResp1, err := client.Wireless.GetMobilityGroupsCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetMobilityGroupsCount", err, - "Failure at GetMobilityGroupsCount, unexpected response", "")) + "Failure when executing 2 GetMobilityGroupsCountV1", err, + "Failure at GetMobilityGroupsCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetMobilityGroupsCountItem(response1.Response) + vItem1 := flattenWirelessGetMobilityGroupsCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMobilityGroupsCount response", + "Failure when setting GetMobilityGroupsCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceWirelessControllersWirelessMobilityGroupsCountRead(ctx context.Co return diags } -func flattenWirelessGetMobilityGroupsCountItem(item *catalystcentersdkgo.ResponseWirelessGetMobilityGroupsCountResponse) []map[string]interface{} { +func flattenWirelessGetMobilityGroupsCountV1Item(item *catalystcentersdkgo.ResponseWirelessGetMobilityGroupsCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_dynamic_interface.go b/catalystcenter/data_source_wireless_dynamic_interface.go index e402c9e..6275b45 100644 --- a/catalystcenter/data_source_wireless_dynamic_interface.go +++ b/catalystcenter/data_source_wireless_dynamic_interface.go @@ -61,31 +61,31 @@ func dataSourceWirelessDynamicInterfaceRead(ctx context.Context, d *schema.Resou selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDynamicInterface") - queryParams1 := catalystcentersdkgo.GetDynamicInterfaceQueryParams{} + log.Printf("[DEBUG] Selected method: GetDynamicInterfaceV1") + queryParams1 := catalystcentersdkgo.GetDynamicInterfaceV1QueryParams{} if okInterfaceName { queryParams1.InterfaceName = vInterfaceName.(string) } - response1, restyResp1, err := client.Wireless.GetDynamicInterface(&queryParams1) + response1, restyResp1, err := client.Wireless.GetDynamicInterfaceV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetDynamicInterface", err, - "Failure at GetDynamicInterface, unexpected response", "")) + "Failure when executing 2 GetDynamicInterfaceV1", err, + "Failure at GetDynamicInterfaceV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetDynamicInterfaceItems(response1) + vItems1 := flattenWirelessGetDynamicInterfaceV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDynamicInterface response", + "Failure when setting GetDynamicInterfaceV1 response", err)) return diags } @@ -97,7 +97,7 @@ func dataSourceWirelessDynamicInterfaceRead(ctx context.Context, d *schema.Resou return diags } -func flattenWirelessGetDynamicInterfaceItems(items *catalystcentersdkgo.ResponseWirelessGetDynamicInterface) []map[string]interface{} { +func flattenWirelessGetDynamicInterfaceV1Items(items *catalystcentersdkgo.ResponseWirelessGetDynamicInterfaceV1) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_enterprise_ssid.go b/catalystcenter/data_source_wireless_enterprise_ssid.go index 92fb196..7fc12d6 100644 --- a/catalystcenter/data_source_wireless_enterprise_ssid.go +++ b/catalystcenter/data_source_wireless_enterprise_ssid.go @@ -322,31 +322,31 @@ func dataSourceWirelessEnterpriseSSIDRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEnterpriseSSID") - queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDQueryParams{} + log.Printf("[DEBUG] Selected method: GetEnterpriseSSIDV1") + queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDV1QueryParams{} if okSSIDName { queryParams1.SSIDName = vSSIDName.(string) } - response1, restyResp1, err := client.Wireless.GetEnterpriseSSID(&queryParams1) + response1, restyResp1, err := client.Wireless.GetEnterpriseSSIDV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetEnterpriseSSID", err, - "Failure at GetEnterpriseSSID, unexpected response", "")) + "Failure when executing 2 GetEnterpriseSSIDV1", err, + "Failure at GetEnterpriseSSIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetEnterpriseSSIDItems(response1) + vItems1 := flattenWirelessGetEnterpriseSSIDV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEnterpriseSSID response", + "Failure when setting GetEnterpriseSSIDV1 response", err)) return diags } @@ -358,7 +358,7 @@ func dataSourceWirelessEnterpriseSSIDRead(ctx context.Context, d *schema.Resourc return diags } -func flattenWirelessGetEnterpriseSSIDItems(items *catalystcentersdkgo.ResponseWirelessGetEnterpriseSSID) []map[string]interface{} { +func flattenWirelessGetEnterpriseSSIDV1Items(items *catalystcentersdkgo.ResponseWirelessGetEnterpriseSSIDV1) []map[string]interface{} { if items == nil { return nil } @@ -367,7 +367,7 @@ func flattenWirelessGetEnterpriseSSIDItems(items *catalystcentersdkgo.ResponseWi respItem := make(map[string]interface{}) respItem["instance_uuid"] = item.InstanceUUID respItem["version"] = item.Version - respItem["ssid_details"] = flattenWirelessGetEnterpriseSSIDItemsSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenWirelessGetEnterpriseSSIDV1ItemsSSIDDetails(item.SSIDDetails) respItem["group_uuid"] = item.GroupUUID respItem["inherited_group_uuid"] = item.InheritedGroupUUID respItem["inherited_group_name"] = item.InheritedGroupName @@ -376,7 +376,7 @@ func flattenWirelessGetEnterpriseSSIDItems(items *catalystcentersdkgo.ResponseWi return respItems } -func flattenWirelessGetEnterpriseSSIDItemsSSIDDetails(items *[]catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDSSIDDetails) []map[string]interface{} { +func flattenWirelessGetEnterpriseSSIDV1ItemsSSIDDetails(items *[]catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDV1SSIDDetails) []map[string]interface{} { if items == nil { return nil } @@ -400,7 +400,7 @@ func flattenWirelessGetEnterpriseSSIDItemsSSIDDetails(items *[]catalystcentersdk respItem["aaa_override"] = boolPtrToString(item.AAAOverride) respItem["coverage_hole_detection_enable"] = boolPtrToString(item.CoverageHoleDetectionEnable) respItem["protected_management_frame"] = item.ProtectedManagementFrame - respItem["multi_psk_settings"] = flattenWirelessGetEnterpriseSSIDItemsSSIDDetailsMultipSKSettings(item.MultipSKSettings) + respItem["multi_psk_settings"] = flattenWirelessGetEnterpriseSSIDV1ItemsSSIDDetailsMultipSKSettings(item.MultipSKSettings) respItem["client_rate_limit"] = item.ClientRateLimit respItem["enable_session_time_out"] = boolPtrToString(item.EnableSessionTimeOut) respItem["session_time_out"] = item.SessionTimeOut @@ -416,7 +416,7 @@ func flattenWirelessGetEnterpriseSSIDItemsSSIDDetails(items *[]catalystcentersdk return respItems } -func flattenWirelessGetEnterpriseSSIDItemsSSIDDetailsMultipSKSettings(items *[]catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDSSIDDetailsMultipSKSettings) []map[string]interface{} { +func flattenWirelessGetEnterpriseSSIDV1ItemsSSIDDetailsMultipSKSettings(items *[]catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDV1SSIDDetailsMultipSKSettings) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_profile.go b/catalystcenter/data_source_wireless_profile.go index 726ed8f..54dc158 100644 --- a/catalystcenter/data_source_wireless_profile.go +++ b/catalystcenter/data_source_wireless_profile.go @@ -135,31 +135,31 @@ func dataSourceWirelessProfileRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetWirelessProfile") - queryParams1 := catalystcentersdkgo.GetWirelessProfileQueryParams{} + log.Printf("[DEBUG] Selected method: GetWirelessProfileV1") + queryParams1 := catalystcentersdkgo.GetWirelessProfileV1QueryParams{} if okProfileName { queryParams1.ProfileName = vProfileName.(string) } - response1, restyResp1, err := client.Wireless.GetWirelessProfile(&queryParams1) + response1, restyResp1, err := client.Wireless.GetWirelessProfileV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWirelessProfile", err, - "Failure at GetWirelessProfile, unexpected response", "")) + "Failure when executing 2 GetWirelessProfileV1", err, + "Failure at GetWirelessProfileV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetWirelessProfileItems(response1) + vItems1 := flattenWirelessGetWirelessProfileV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetWirelessProfile response", + "Failure when setting GetWirelessProfileV1 response", err)) return diags } @@ -171,27 +171,27 @@ func dataSourceWirelessProfileRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenWirelessGetWirelessProfileItems(items *catalystcentersdkgo.ResponseWirelessGetWirelessProfile) []map[string]interface{} { +func flattenWirelessGetWirelessProfileV1Items(items *catalystcentersdkgo.ResponseWirelessGetWirelessProfileV1) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["profile_details"] = flattenWirelessGetWirelessProfileItemsProfileDetails(item.ProfileDetails) + respItem["profile_details"] = flattenWirelessGetWirelessProfileV1ItemsProfileDetails(item.ProfileDetails) respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetWirelessProfileItemsProfileDetails(item *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetails) []map[string]interface{} { +func flattenWirelessGetWirelessProfileV1ItemsProfileDetails(item *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetails) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["name"] = item.Name respItem["sites"] = item.Sites - respItem["ssid_details"] = flattenWirelessGetWirelessProfileItemsProfileDetailsSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenWirelessGetWirelessProfileV1ItemsProfileDetailsSSIDDetails(item.SSIDDetails) return []map[string]interface{}{ respItem, @@ -199,7 +199,7 @@ func flattenWirelessGetWirelessProfileItemsProfileDetails(item *catalystcentersd } -func flattenWirelessGetWirelessProfileItemsProfileDetailsSSIDDetails(items *[]catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetails) []map[string]interface{} { +func flattenWirelessGetWirelessProfileV1ItemsProfileDetailsSSIDDetails(items *[]catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetails) []map[string]interface{} { if items == nil { return nil } @@ -209,14 +209,14 @@ func flattenWirelessGetWirelessProfileItemsProfileDetailsSSIDDetails(items *[]ca respItem["name"] = item.Name respItem["type"] = item.Type respItem["enable_fabric"] = boolPtrToString(item.EnableFabric) - respItem["flex_connect"] = flattenWirelessGetWirelessProfileItemsProfileDetailsSSIDDetailsFlexConnect(item.FlexConnect) + respItem["flex_connect"] = flattenWirelessGetWirelessProfileV1ItemsProfileDetailsSSIDDetailsFlexConnect(item.FlexConnect) respItem["interface_name"] = item.InterfaceName respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetWirelessProfileItemsProfileDetailsSSIDDetailsFlexConnect(item *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetailsFlexConnect) []map[string]interface{} { +func flattenWirelessGetWirelessProfileV1ItemsProfileDetailsSSIDDetailsFlexConnect(item *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_profiles.go b/catalystcenter/data_source_wireless_profiles.go index 2f49959..0893f93 100644 --- a/catalystcenter/data_source_wireless_profiles.go +++ b/catalystcenter/data_source_wireless_profiles.go @@ -255,8 +255,8 @@ func dataSourceWirelessProfilesRead(ctx context.Context, d *schema.ResourceData, selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetWirelessProfiles") - queryParams1 := catalystcentersdkgo.GetWirelessProfilesQueryParams{} + log.Printf("[DEBUG] Selected method: GetWirelessProfilesV1") + queryParams1 := catalystcentersdkgo.GetWirelessProfilesV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -265,24 +265,24 @@ func dataSourceWirelessProfilesRead(ctx context.Context, d *schema.ResourceData, queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetWirelessProfiles(&queryParams1) + response1, restyResp1, err := client.Wireless.GetWirelessProfilesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWirelessProfiles", err, - "Failure at GetWirelessProfiles, unexpected response", "")) + "Failure when executing 2 GetWirelessProfilesV1", err, + "Failure at GetWirelessProfilesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetWirelessProfilesItems(response1.Response) + vItems1 := flattenWirelessGetWirelessProfilesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetWirelessProfiles response", + "Failure when setting GetWirelessProfilesV1 response", err)) return diags } @@ -292,27 +292,27 @@ func dataSourceWirelessProfilesRead(ctx context.Context, d *schema.ResourceData, } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetWirelessProfileByID") + log.Printf("[DEBUG] Selected method: GetWirelessProfileByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Wireless.GetWirelessProfileByID(vvID) + response2, restyResp2, err := client.Wireless.GetWirelessProfileByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWirelessProfileByID", err, - "Failure at GetWirelessProfileByID, unexpected response", "")) + "Failure when executing 2 GetWirelessProfileByIDV1", err, + "Failure at GetWirelessProfileByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenWirelessGetWirelessProfileByIDItem(response2.Response) + vItem2 := flattenWirelessGetWirelessProfileByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetWirelessProfileByID response", + "Failure when setting GetWirelessProfileByIDV1 response", err)) return diags } @@ -324,7 +324,7 @@ func dataSourceWirelessProfilesRead(ctx context.Context, d *schema.ResourceData, return diags } -func flattenWirelessGetWirelessProfilesItems(items *[]catalystcentersdkgo.ResponseWirelessGetWirelessProfilesResponse) []map[string]interface{} { +func flattenWirelessGetWirelessProfilesV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetWirelessProfilesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -332,14 +332,14 @@ func flattenWirelessGetWirelessProfilesItems(items *[]catalystcentersdkgo.Respon for _, item := range *items { respItem := make(map[string]interface{}) respItem["wireless_profile_name"] = item.WirelessProfileName - respItem["ssid_details"] = flattenWirelessGetWirelessProfilesItemsSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenWirelessGetWirelessProfilesV1ItemsSSIDDetails(item.SSIDDetails) respItem["id"] = item.ID respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetWirelessProfilesItemsSSIDDetails(items *[]catalystcentersdkgo.ResponseWirelessGetWirelessProfilesResponseSSIDDetails) []map[string]interface{} { +func flattenWirelessGetWirelessProfilesV1ItemsSSIDDetails(items *[]catalystcentersdkgo.ResponseWirelessGetWirelessProfilesV1ResponseSSIDDetails) []map[string]interface{} { if items == nil { return nil } @@ -347,7 +347,7 @@ func flattenWirelessGetWirelessProfilesItemsSSIDDetails(items *[]catalystcenters for _, item := range *items { respItem := make(map[string]interface{}) respItem["ssid_name"] = item.SSIDName - respItem["flex_connect"] = flattenWirelessGetWirelessProfilesItemsSSIDDetailsFlexConnect(item.FlexConnect) + respItem["flex_connect"] = flattenWirelessGetWirelessProfilesV1ItemsSSIDDetailsFlexConnect(item.FlexConnect) respItem["enable_fabric"] = boolPtrToString(item.EnableFabric) respItem["wlan_profile_name"] = item.WLANProfileName respItem["interface_name"] = item.InterfaceName @@ -358,7 +358,7 @@ func flattenWirelessGetWirelessProfilesItemsSSIDDetails(items *[]catalystcenters return respItems } -func flattenWirelessGetWirelessProfilesItemsSSIDDetailsFlexConnect(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfilesResponseSSIDDetailsFlexConnect) []map[string]interface{} { +func flattenWirelessGetWirelessProfilesV1ItemsSSIDDetailsFlexConnect(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfilesV1ResponseSSIDDetailsFlexConnect) []map[string]interface{} { if item == nil { return nil } @@ -372,20 +372,20 @@ func flattenWirelessGetWirelessProfilesItemsSSIDDetailsFlexConnect(item *catalys } -func flattenWirelessGetWirelessProfileByIDItem(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfileByIDResponse) []map[string]interface{} { +func flattenWirelessGetWirelessProfileByIDV1Item(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfileByIDV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["wireless_profile_name"] = item.WirelessProfileName - respItem["ssid_details"] = flattenWirelessGetWirelessProfileByIDItemSSIDDetails(item.SSIDDetails) + respItem["ssid_details"] = flattenWirelessGetWirelessProfileByIDV1ItemSSIDDetails(item.SSIDDetails) respItem["id"] = item.ID return []map[string]interface{}{ respItem, } } -func flattenWirelessGetWirelessProfileByIDItemSSIDDetails(items *[]catalystcentersdkgo.ResponseWirelessGetWirelessProfileByIDResponseSSIDDetails) []map[string]interface{} { +func flattenWirelessGetWirelessProfileByIDV1ItemSSIDDetails(items *[]catalystcentersdkgo.ResponseWirelessGetWirelessProfileByIDV1ResponseSSIDDetails) []map[string]interface{} { if items == nil { return nil } @@ -393,7 +393,7 @@ func flattenWirelessGetWirelessProfileByIDItemSSIDDetails(items *[]catalystcente for _, item := range *items { respItem := make(map[string]interface{}) respItem["ssid_name"] = item.SSIDName - respItem["flex_connect"] = flattenWirelessGetWirelessProfileByIDItemSSIDDetailsFlexConnect(item.FlexConnect) + respItem["flex_connect"] = flattenWirelessGetWirelessProfileByIDV1ItemSSIDDetailsFlexConnect(item.FlexConnect) respItem["enable_fabric"] = boolPtrToString(item.EnableFabric) respItem["wlan_profile_name"] = item.WLANProfileName respItem["interface_name"] = item.InterfaceName @@ -404,7 +404,7 @@ func flattenWirelessGetWirelessProfileByIDItemSSIDDetails(items *[]catalystcente return respItems } -func flattenWirelessGetWirelessProfileByIDItemSSIDDetailsFlexConnect(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfileByIDResponseSSIDDetailsFlexConnect) []map[string]interface{} { +func flattenWirelessGetWirelessProfileByIDV1ItemSSIDDetailsFlexConnect(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfileByIDV1ResponseSSIDDetailsFlexConnect) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_profiles_count.go b/catalystcenter/data_source_wireless_profiles_count.go index 248fd56..3c24b47 100644 --- a/catalystcenter/data_source_wireless_profiles_count.go +++ b/catalystcenter/data_source_wireless_profiles_count.go @@ -47,26 +47,26 @@ func dataSourceWirelessProfilesCountRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetWirelessProfilesCount") + log.Printf("[DEBUG] Selected method: GetWirelessProfilesCountV1") - response1, restyResp1, err := client.Wireless.GetWirelessProfilesCount() + response1, restyResp1, err := client.Wireless.GetWirelessProfilesCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetWirelessProfilesCount", err, - "Failure at GetWirelessProfilesCount, unexpected response", "")) + "Failure when executing 2 GetWirelessProfilesCountV1", err, + "Failure at GetWirelessProfilesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetWirelessProfilesCountItem(response1.Response) + vItem1 := flattenWirelessGetWirelessProfilesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetWirelessProfilesCount response", + "Failure when setting GetWirelessProfilesCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceWirelessProfilesCountRead(ctx context.Context, d *schema.Resource return diags } -func flattenWirelessGetWirelessProfilesCountItem(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfilesCountResponse) []map[string]interface{} { +func flattenWirelessGetWirelessProfilesCountV1Item(item *catalystcentersdkgo.ResponseWirelessGetWirelessProfilesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_rf_profile.go b/catalystcenter/data_source_wireless_rf_profile.go index d2bb9c4..dc12df5 100644 --- a/catalystcenter/data_source_wireless_rf_profile.go +++ b/catalystcenter/data_source_wireless_rf_profile.go @@ -304,31 +304,31 @@ func dataSourceWirelessRfProfileRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: RetrieveRfProfiles") - queryParams1 := catalystcentersdkgo.RetrieveRfProfilesQueryParams{} + log.Printf("[DEBUG] Selected method: RetrieveRfProfilesV1") + queryParams1 := catalystcentersdkgo.RetrieveRfProfilesV1QueryParams{} if okRfProfileName { queryParams1.RfProfileName = vRfProfileName.(string) } - response1, restyResp1, err := client.Wireless.RetrieveRfProfiles(&queryParams1) + response1, restyResp1, err := client.Wireless.RetrieveRfProfilesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 RetrieveRfProfiles", err, - "Failure at RetrieveRfProfiles, unexpected response", "")) + "Failure when executing 2 RetrieveRfProfilesV1", err, + "Failure at RetrieveRfProfilesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessRetrieveRfProfilesItem(response1) + vItem1 := flattenWirelessRetrieveRfProfilesV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrieveRfProfiles response", + "Failure when setting RetrieveRfProfilesV1 response", err)) return diags } @@ -340,7 +340,7 @@ func dataSourceWirelessRfProfileRead(ctx context.Context, d *schema.ResourceData return diags } -func flattenWirelessRetrieveRfProfilesItem(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfiles) []map[string]interface{} { +func flattenWirelessRetrieveRfProfilesV1Item(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1) []map[string]interface{} { if item == nil { return nil } @@ -352,16 +352,16 @@ func flattenWirelessRetrieveRfProfilesItem(item *catalystcentersdkgo.ResponseWir respItem["channel_width"] = item.ChannelWidth respItem["enable_custom"] = boolPtrToString(item.EnableCustom) respItem["enable_brown_field"] = boolPtrToString(item.EnableBrownField) - respItem["radio_type_a_properties"] = flattenWirelessRetrieveRfProfilesItemRadioTypeAProperties(item.RadioTypeAProperties) - respItem["radio_type_b_properties"] = flattenWirelessRetrieveRfProfilesItemRadioTypeBProperties(item.RadioTypeBProperties) - respItem["radio_type_c_properties"] = flattenWirelessRetrieveRfProfilesItemRadioTypeCProperties(item.RadioTypeCProperties) + respItem["radio_type_a_properties"] = flattenWirelessRetrieveRfProfilesV1ItemRadioTypeAProperties(item.RadioTypeAProperties) + respItem["radio_type_b_properties"] = flattenWirelessRetrieveRfProfilesV1ItemRadioTypeBProperties(item.RadioTypeBProperties) + respItem["radio_type_c_properties"] = flattenWirelessRetrieveRfProfilesV1ItemRadioTypeCProperties(item.RadioTypeCProperties) respItem["enable_radio_type_c"] = boolPtrToString(item.EnableRadioTypeC) return []map[string]interface{}{ respItem, } } -func flattenWirelessRetrieveRfProfilesItemRadioTypeAProperties(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesRadioTypeAProperties) []map[string]interface{} { +func flattenWirelessRetrieveRfProfilesV1ItemRadioTypeAProperties(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1RadioTypeAProperties) []map[string]interface{} { if item == nil { return nil } @@ -381,7 +381,7 @@ func flattenWirelessRetrieveRfProfilesItemRadioTypeAProperties(item *catalystcen } -func flattenWirelessRetrieveRfProfilesItemRadioTypeBProperties(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesRadioTypeBProperties) []map[string]interface{} { +func flattenWirelessRetrieveRfProfilesV1ItemRadioTypeBProperties(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1RadioTypeBProperties) []map[string]interface{} { if item == nil { return nil } @@ -401,7 +401,7 @@ func flattenWirelessRetrieveRfProfilesItemRadioTypeBProperties(item *catalystcen } -func flattenWirelessRetrieveRfProfilesItemRadioTypeCProperties(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesRadioTypeCProperties) []map[string]interface{} { +func flattenWirelessRetrieveRfProfilesV1ItemRadioTypeCProperties(item *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1RadioTypeCProperties) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_sensor_test_results.go b/catalystcenter/data_source_wireless_sensor_test_results.go index ed53f1d..e8cae83 100644 --- a/catalystcenter/data_source_wireless_sensor_test_results.go +++ b/catalystcenter/data_source_wireless_sensor_test_results.go @@ -428,8 +428,8 @@ func dataSourceWirelessSensorTestResultsRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: SensorTestResults") - queryParams1 := catalystcentersdkgo.SensorTestResultsQueryParams{} + log.Printf("[DEBUG] Selected method: SensorTestResultsV1") + queryParams1 := catalystcentersdkgo.SensorTestResultsV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID.(string) @@ -444,24 +444,24 @@ func dataSourceWirelessSensorTestResultsRead(ctx context.Context, d *schema.Reso queryParams1.TestFailureBy = vTestFailureBy.(string) } - response1, restyResp1, err := client.Wireless.SensorTestResults(&queryParams1) + response1, restyResp1, err := client.Wireless.SensorTestResultsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 SensorTestResults", err, - "Failure at SensorTestResults, unexpected response", "")) + "Failure when executing 2 SensorTestResultsV1", err, + "Failure at SensorTestResultsV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessSensorTestResultsItem(response1.Response) + vItem1 := flattenWirelessSensorTestResultsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SensorTestResults response", + "Failure when setting SensorTestResultsV1 response", err)) return diags } @@ -473,30 +473,30 @@ func dataSourceWirelessSensorTestResultsRead(ctx context.Context, d *schema.Reso return diags } -func flattenWirelessSensorTestResultsItem(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponse) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1Item(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["summary"] = flattenWirelessSensorTestResultsItemSummary(item.Summary) - respItem["failure_stats"] = flattenWirelessSensorTestResultsItemFailureStats(item.FailureStats) + respItem["summary"] = flattenWirelessSensorTestResultsV1ItemSummary(item.Summary) + respItem["failure_stats"] = flattenWirelessSensorTestResultsV1ItemFailureStats(item.FailureStats) return []map[string]interface{}{ respItem, } } -func flattenWirelessSensorTestResultsItemSummary(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummary) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummary(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummary) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["total_test_count"] = item.TotalTestCount - respItem["onb_oar_din_g"] = flattenWirelessSensorTestResultsItemSummaryOnBoarding(item.OnBoarding) - respItem["per_for_man_ce"] = flattenWirelessSensorTestResultsItemSummaryPERfORMAncE(item.PERfORMAncE) - respItem["net_wor_kse_rvi_ces"] = flattenWirelessSensorTestResultsItemSummaryNETWORKSERVICES(item.NETWORKSERVICES) - respItem["app_con_nec_tiv_ity"] = flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITY(item.ApPCONNECTIVITY) - respItem["rfa_sse_ssm_ent"] = flattenWirelessSensorTestResultsItemSummaryRfASSESSMENT(item.RfASSESSMENT) - respItem["ema_il"] = flattenWirelessSensorTestResultsItemSummaryEmail(item.Email) + respItem["onb_oar_din_g"] = flattenWirelessSensorTestResultsV1ItemSummaryOnBoarding(item.OnBoarding) + respItem["per_for_man_ce"] = flattenWirelessSensorTestResultsV1ItemSummaryPERfORMAncE(item.PERfORMAncE) + respItem["net_wor_kse_rvi_ces"] = flattenWirelessSensorTestResultsV1ItemSummaryNETWORKSERVICES(item.NETWORKSERVICES) + respItem["app_con_nec_tiv_ity"] = flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITY(item.ApPCONNECTIVITY) + respItem["rfa_sse_ssm_ent"] = flattenWirelessSensorTestResultsV1ItemSummaryRfASSESSMENT(item.RfASSESSMENT) + respItem["ema_il"] = flattenWirelessSensorTestResultsV1ItemSummaryEmail(item.Email) return []map[string]interface{}{ respItem, @@ -504,14 +504,14 @@ func flattenWirelessSensorTestResultsItemSummary(item *catalystcentersdkgo.Respo } -func flattenWirelessSensorTestResultsItemSummaryOnBoarding(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryOnBoarding) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryOnBoarding(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryOnBoarding) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["aut_h"] = flattenWirelessSensorTestResultsItemSummaryOnBoardingAuth(item.Auth) - respItem["dhc_p"] = flattenWirelessSensorTestResultsItemSummaryOnBoardingDHCP(item.DHCP) - respItem["ass_oc"] = flattenWirelessSensorTestResultsItemSummaryOnBoardingAssoc(item.Assoc) + respItem["aut_h"] = flattenWirelessSensorTestResultsV1ItemSummaryOnBoardingAuth(item.Auth) + respItem["dhc_p"] = flattenWirelessSensorTestResultsV1ItemSummaryOnBoardingDHCP(item.DHCP) + respItem["ass_oc"] = flattenWirelessSensorTestResultsV1ItemSummaryOnBoardingAssoc(item.Assoc) return []map[string]interface{}{ respItem, @@ -519,7 +519,7 @@ func flattenWirelessSensorTestResultsItemSummaryOnBoarding(item *catalystcenters } -func flattenWirelessSensorTestResultsItemSummaryOnBoardingAuth(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryOnBoardingAuth) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryOnBoardingAuth(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryOnBoardingAuth) []map[string]interface{} { if item == nil { return nil } @@ -533,7 +533,7 @@ func flattenWirelessSensorTestResultsItemSummaryOnBoardingAuth(item *catalystcen } -func flattenWirelessSensorTestResultsItemSummaryOnBoardingDHCP(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryOnBoardingDHCP) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryOnBoardingDHCP(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryOnBoardingDHCP) []map[string]interface{} { if item == nil { return nil } @@ -547,7 +547,7 @@ func flattenWirelessSensorTestResultsItemSummaryOnBoardingDHCP(item *catalystcen } -func flattenWirelessSensorTestResultsItemSummaryOnBoardingAssoc(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryOnBoardingAssoc) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryOnBoardingAssoc(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryOnBoardingAssoc) []map[string]interface{} { if item == nil { return nil } @@ -561,12 +561,12 @@ func flattenWirelessSensorTestResultsItemSummaryOnBoardingAssoc(item *catalystce } -func flattenWirelessSensorTestResultsItemSummaryPERfORMAncE(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryPERfORMAncE) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryPERfORMAncE(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryPERfORMAncE) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["ips_las_end_er"] = flattenWirelessSensorTestResultsItemSummaryPERfORMAncEIPSLASENDER(item.IPSLASENDER) + respItem["ips_las_end_er"] = flattenWirelessSensorTestResultsV1ItemSummaryPERfORMAncEIPSLASENDER(item.IPSLASENDER) return []map[string]interface{}{ respItem, @@ -574,7 +574,7 @@ func flattenWirelessSensorTestResultsItemSummaryPERfORMAncE(item *catalystcenter } -func flattenWirelessSensorTestResultsItemSummaryPERfORMAncEIPSLASENDER(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryPERfORMAncEIPSLASENDER) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryPERfORMAncEIPSLASENDER(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryPERfORMAncEIPSLASENDER) []map[string]interface{} { if item == nil { return nil } @@ -588,12 +588,12 @@ func flattenWirelessSensorTestResultsItemSummaryPERfORMAncEIPSLASENDER(item *cat } -func flattenWirelessSensorTestResultsItemSummaryNETWORKSERVICES(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryNETWORKSERVICES) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryNETWORKSERVICES(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryNETWORKSERVICES) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["dns"] = flattenWirelessSensorTestResultsItemSummaryNETWORKSERVICESDNS(item.DNS) + respItem["dns"] = flattenWirelessSensorTestResultsV1ItemSummaryNETWORKSERVICESDNS(item.DNS) return []map[string]interface{}{ respItem, @@ -601,7 +601,7 @@ func flattenWirelessSensorTestResultsItemSummaryNETWORKSERVICES(item *catalystce } -func flattenWirelessSensorTestResultsItemSummaryNETWORKSERVICESDNS(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryNETWORKSERVICESDNS) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryNETWORKSERVICESDNS(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryNETWORKSERVICESDNS) []map[string]interface{} { if item == nil { return nil } @@ -615,14 +615,14 @@ func flattenWirelessSensorTestResultsItemSummaryNETWORKSERVICESDNS(item *catalys } -func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITY(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryApPCONNECTIVITY) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITY(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryApPCONNECTIVITY) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["hos_tre_ach_abi_lit_y"] = flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYHOSTREACHABILITY(item.HOSTREACHABILITY) - respItem["web_ser_ver"] = flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYWebServer(item.WebServer) - respItem["fil_etr_ans_fer"] = flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYFileTransfer(item.FileTransfer) + respItem["hos_tre_ach_abi_lit_y"] = flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITYHOSTREACHABILITY(item.HOSTREACHABILITY) + respItem["web_ser_ver"] = flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITYWebServer(item.WebServer) + respItem["fil_etr_ans_fer"] = flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITYFileTransfer(item.FileTransfer) return []map[string]interface{}{ respItem, @@ -630,7 +630,7 @@ func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITY(item *catalystce } -func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYHOSTREACHABILITY(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryApPCONNECTIVITYHOSTREACHABILITY) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITYHOSTREACHABILITY(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryApPCONNECTIVITYHOSTREACHABILITY) []map[string]interface{} { if item == nil { return nil } @@ -644,7 +644,7 @@ func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYHOSTREACHABILITY( } -func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYWebServer(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryApPCONNECTIVITYWebServer) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITYWebServer(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryApPCONNECTIVITYWebServer) []map[string]interface{} { if item == nil { return nil } @@ -658,7 +658,7 @@ func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYWebServer(item *c } -func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYFileTransfer(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryApPCONNECTIVITYFileTransfer) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryApPCONNECTIVITYFileTransfer(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryApPCONNECTIVITYFileTransfer) []map[string]interface{} { if item == nil { return nil } @@ -672,13 +672,13 @@ func flattenWirelessSensorTestResultsItemSummaryApPCONNECTIVITYFileTransfer(item } -func flattenWirelessSensorTestResultsItemSummaryRfASSESSMENT(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryRfASSESSMENT) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryRfASSESSMENT(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryRfASSESSMENT) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["dat_ara_te"] = flattenWirelessSensorTestResultsItemSummaryRfASSESSMENTDATARATE(item.DATARATE) - respItem["snr"] = flattenWirelessSensorTestResultsItemSummaryRfASSESSMENTSNR(item.SNR) + respItem["dat_ara_te"] = flattenWirelessSensorTestResultsV1ItemSummaryRfASSESSMENTDATARATE(item.DATARATE) + respItem["snr"] = flattenWirelessSensorTestResultsV1ItemSummaryRfASSESSMENTSNR(item.SNR) return []map[string]interface{}{ respItem, @@ -686,7 +686,7 @@ func flattenWirelessSensorTestResultsItemSummaryRfASSESSMENT(item *catalystcente } -func flattenWirelessSensorTestResultsItemSummaryRfASSESSMENTDATARATE(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryRfASSESSMENTDATARATE) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryRfASSESSMENTDATARATE(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryRfASSESSMENTDATARATE) []map[string]interface{} { if item == nil { return nil } @@ -700,7 +700,7 @@ func flattenWirelessSensorTestResultsItemSummaryRfASSESSMENTDATARATE(item *catal } -func flattenWirelessSensorTestResultsItemSummaryRfASSESSMENTSNR(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryRfASSESSMENTSNR) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryRfASSESSMENTSNR(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryRfASSESSMENTSNR) []map[string]interface{} { if item == nil { return nil } @@ -714,12 +714,12 @@ func flattenWirelessSensorTestResultsItemSummaryRfASSESSMENTSNR(item *catalystce } -func flattenWirelessSensorTestResultsItemSummaryEmail(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryEmail) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryEmail(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryEmail) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["mai_lse_rve_r"] = flattenWirelessSensorTestResultsItemSummaryEmailMailServer(item.MailServer) + respItem["mai_lse_rve_r"] = flattenWirelessSensorTestResultsV1ItemSummaryEmailMailServer(item.MailServer) return []map[string]interface{}{ respItem, @@ -727,7 +727,7 @@ func flattenWirelessSensorTestResultsItemSummaryEmail(item *catalystcentersdkgo. } -func flattenWirelessSensorTestResultsItemSummaryEmailMailServer(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseSummaryEmailMailServer) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemSummaryEmailMailServer(item *catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseSummaryEmailMailServer) []map[string]interface{} { if item == nil { return nil } @@ -741,7 +741,7 @@ func flattenWirelessSensorTestResultsItemSummaryEmailMailServer(item *catalystce } -func flattenWirelessSensorTestResultsItemFailureStats(items *[]catalystcentersdkgo.ResponseWirelessSensorTestResultsResponseFailureStats) []map[string]interface{} { +func flattenWirelessSensorTestResultsV1ItemFailureStats(items *[]catalystcentersdkgo.ResponseWirelessSensorTestResultsV1ResponseFailureStats) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/data_source_wireless_settings_dot11be_profiles.go b/catalystcenter/data_source_wireless_settings_dot11be_profiles.go index 043aa30..daa4d53 100644 --- a/catalystcenter/data_source_wireless_settings_dot11be_profiles.go +++ b/catalystcenter/data_source_wireless_settings_dot11be_profiles.go @@ -199,8 +199,8 @@ func dataSourceWirelessSettingsDot11BeProfilesRead(ctx context.Context, d *schem selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAll80211BeProfiles") - queryParams1 := catalystcentersdkgo.GetAll80211BeProfilesQueryParams{} + log.Printf("[DEBUG] Selected method: GetAll80211BeProfilesV1") + queryParams1 := catalystcentersdkgo.GetAll80211BeProfilesV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -209,24 +209,24 @@ func dataSourceWirelessSettingsDot11BeProfilesRead(ctx context.Context, d *schem queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetAll80211BeProfiles(&queryParams1) + response1, restyResp1, err := client.Wireless.GetAll80211BeProfilesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetAll80211BeProfiles", err, - "Failure at GetAll80211BeProfiles, unexpected response", "")) + "Failure when executing 2 GetAll80211BeProfilesV1", err, + "Failure at GetAll80211BeProfilesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetAll80211BeProfilesItems(response1.Response) + vItems1 := flattenWirelessGetAll80211BeProfilesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetAll80211BeProfiles response", + "Failure when setting GetAll80211BeProfilesV1 response", err)) return diags } @@ -236,27 +236,27 @@ func dataSourceWirelessSettingsDot11BeProfilesRead(ctx context.Context, d *schem } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: Get80211BeProfileByID") + log.Printf("[DEBUG] Selected method: Get80211BeProfileByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Wireless.Get80211BeProfileByID(vvID) + response2, restyResp2, err := client.Wireless.Get80211BeProfileByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 Get80211BeProfileByID", err, - "Failure at Get80211BeProfileByID, unexpected response", "")) + "Failure when executing 2 Get80211BeProfileByIDV1", err, + "Failure at Get80211BeProfileByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenWirelessGet80211BeProfileByIDItem(response2.Response) + vItem2 := flattenWirelessGet80211BeProfileByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting Get80211BeProfileByID response", + "Failure when setting Get80211BeProfileByIDV1 response", err)) return diags } @@ -268,7 +268,7 @@ func dataSourceWirelessSettingsDot11BeProfilesRead(ctx context.Context, d *schem return diags } -func flattenWirelessGetAll80211BeProfilesItems(items *[]catalystcentersdkgo.ResponseWirelessGetAll80211BeProfilesResponse) []map[string]interface{} { +func flattenWirelessGetAll80211BeProfilesV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetAll80211BeProfilesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -288,7 +288,7 @@ func flattenWirelessGetAll80211BeProfilesItems(items *[]catalystcentersdkgo.Resp return respItems } -func flattenWirelessGet80211BeProfileByIDItem(item *catalystcentersdkgo.ResponseWirelessGet80211BeProfileByIDResponse) []map[string]interface{} { +func flattenWirelessGet80211BeProfileByIDV1Item(item *catalystcentersdkgo.ResponseWirelessGet80211BeProfileByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_settings_dot11be_profiles_count.go b/catalystcenter/data_source_wireless_settings_dot11be_profiles_count.go index d87736e..6609cc2 100644 --- a/catalystcenter/data_source_wireless_settings_dot11be_profiles_count.go +++ b/catalystcenter/data_source_wireless_settings_dot11be_profiles_count.go @@ -47,26 +47,26 @@ func dataSourceWirelessSettingsDot11BeProfilesCountRead(ctx context.Context, d * selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: Get80211BeProfilesCount") + log.Printf("[DEBUG] Selected method: Get80211BeProfilesCountV1") - response1, restyResp1, err := client.Wireless.Get80211BeProfilesCount() + response1, restyResp1, err := client.Wireless.Get80211BeProfilesCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 Get80211BeProfilesCount", err, - "Failure at Get80211BeProfilesCount, unexpected response", "")) + "Failure when executing 2 Get80211BeProfilesCountV1", err, + "Failure at Get80211BeProfilesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGet80211BeProfilesCountItem(response1.Response) + vItem1 := flattenWirelessGet80211BeProfilesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting Get80211BeProfilesCount response", + "Failure when setting Get80211BeProfilesCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceWirelessSettingsDot11BeProfilesCountRead(ctx context.Context, d * return diags } -func flattenWirelessGet80211BeProfilesCountItem(item *catalystcentersdkgo.ResponseWirelessGet80211BeProfilesCountResponse) []map[string]interface{} { +func flattenWirelessGet80211BeProfilesCountV1Item(item *catalystcentersdkgo.ResponseWirelessGet80211BeProfilesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_settings_interfaces.go b/catalystcenter/data_source_wireless_settings_interfaces.go index 29a1c2e..eefb5ce 100644 --- a/catalystcenter/data_source_wireless_settings_interfaces.go +++ b/catalystcenter/data_source_wireless_settings_interfaces.go @@ -117,8 +117,8 @@ func dataSourceWirelessSettingsInterfacesRead(ctx context.Context, d *schema.Res selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetInterfaces") - queryParams1 := catalystcentersdkgo.GetInterfacesQueryParams{} + log.Printf("[DEBUG] Selected method: GetInterfacesV1") + queryParams1 := catalystcentersdkgo.GetInterfacesV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -127,24 +127,24 @@ func dataSourceWirelessSettingsInterfacesRead(ctx context.Context, d *schema.Res queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetInterfaces(&queryParams1) + response1, restyResp1, err := client.Wireless.GetInterfacesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfaces", err, - "Failure at GetInterfaces, unexpected response", "")) + "Failure when executing 2 GetInterfacesV1", err, + "Failure at GetInterfacesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetInterfacesItems(response1.Response) + vItems1 := flattenWirelessGetInterfacesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfaces response", + "Failure when setting GetInterfacesV1 response", err)) return diags } @@ -154,27 +154,27 @@ func dataSourceWirelessSettingsInterfacesRead(ctx context.Context, d *schema.Res } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetInterfaceByID") + log.Printf("[DEBUG] Selected method: GetInterfaceByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Wireless.GetInterfaceByID(vvID) + response2, restyResp2, err := client.Wireless.GetInterfaceByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfaceByID", err, - "Failure at GetInterfaceByID, unexpected response", "")) + "Failure when executing 2 GetInterfaceByIDV1", err, + "Failure at GetInterfaceByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenWirelessGetInterfaceByIDItem(response2.Response) + vItem2 := flattenWirelessGetInterfaceByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfaceByID response", + "Failure when setting GetInterfaceByIDV1 response", err)) return diags } @@ -186,7 +186,7 @@ func dataSourceWirelessSettingsInterfacesRead(ctx context.Context, d *schema.Res return diags } -func flattenWirelessGetInterfacesItems(items *[]catalystcentersdkgo.ResponseWirelessGetInterfacesResponse) []map[string]interface{} { +func flattenWirelessGetInterfacesV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetInterfacesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -201,7 +201,7 @@ func flattenWirelessGetInterfacesItems(items *[]catalystcentersdkgo.ResponseWire return respItems } -func flattenWirelessGetInterfaceByIDItem(item *catalystcentersdkgo.ResponseWirelessGetInterfaceByIDResponse) []map[string]interface{} { +func flattenWirelessGetInterfaceByIDV1Item(item *catalystcentersdkgo.ResponseWirelessGetInterfaceByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_settings_interfaces_count.go b/catalystcenter/data_source_wireless_settings_interfaces_count.go index 12bd69e..f522f24 100644 --- a/catalystcenter/data_source_wireless_settings_interfaces_count.go +++ b/catalystcenter/data_source_wireless_settings_interfaces_count.go @@ -47,26 +47,26 @@ func dataSourceWirelessSettingsInterfacesCountRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetInterfacesCount") + log.Printf("[DEBUG] Selected method: GetInterfacesCountV1") - response1, restyResp1, err := client.Wireless.GetInterfacesCount() + response1, restyResp1, err := client.Wireless.GetInterfacesCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetInterfacesCount", err, - "Failure at GetInterfacesCount, unexpected response", "")) + "Failure when executing 2 GetInterfacesCountV1", err, + "Failure at GetInterfacesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetInterfacesCountItem(response1.Response) + vItem1 := flattenWirelessGetInterfacesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetInterfacesCount response", + "Failure when setting GetInterfacesCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceWirelessSettingsInterfacesCountRead(ctx context.Context, d *schem return diags } -func flattenWirelessGetInterfacesCountItem(item *catalystcentersdkgo.ResponseWirelessGetInterfacesCountResponse) []map[string]interface{} { +func flattenWirelessGetInterfacesCountV1Item(item *catalystcentersdkgo.ResponseWirelessGetInterfacesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_settings_rf_profiles.go b/catalystcenter/data_source_wireless_settings_rf_profiles.go index bbefbd5..12d9ed4 100644 --- a/catalystcenter/data_source_wireless_settings_rf_profiles.go +++ b/catalystcenter/data_source_wireless_settings_rf_profiles.go @@ -893,8 +893,8 @@ func dataSourceWirelessSettingsRfProfilesRead(ctx context.Context, d *schema.Res selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetRfProfiles") - queryParams1 := catalystcentersdkgo.GetRfProfilesQueryParams{} + log.Printf("[DEBUG] Selected method: GetRfProfilesV1") + queryParams1 := catalystcentersdkgo.GetRfProfilesV1QueryParams{} if okLimit { queryParams1.Limit = vLimit.(float64) @@ -903,24 +903,24 @@ func dataSourceWirelessSettingsRfProfilesRead(ctx context.Context, d *schema.Res queryParams1.Offset = vOffset.(float64) } - response1, restyResp1, err := client.Wireless.GetRfProfiles(&queryParams1) + response1, restyResp1, err := client.Wireless.GetRfProfilesV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetRfProfiles", err, - "Failure at GetRfProfiles, unexpected response", "")) + "Failure when executing 2 GetRfProfilesV1", err, + "Failure at GetRfProfilesV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenWirelessGetRfProfilesItems(response1.Response) + vItems1 := flattenWirelessGetRfProfilesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetRfProfiles response", + "Failure when setting GetRfProfilesV1 response", err)) return diags } @@ -930,27 +930,27 @@ func dataSourceWirelessSettingsRfProfilesRead(ctx context.Context, d *schema.Res } if selectedMethod == 2 { - log.Printf("[DEBUG] Selected method: GetRfProfileByID") + log.Printf("[DEBUG] Selected method: GetRfProfileByIDV1") vvID := vID.(string) - response2, restyResp2, err := client.Wireless.GetRfProfileByID(vvID) + response2, restyResp2, err := client.Wireless.GetRfProfileByIDV1(vvID) if err != nil || response2 == nil { if restyResp2 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetRfProfileByID", err, - "Failure at GetRfProfileByID, unexpected response", "")) + "Failure when executing 2 GetRfProfileByIDV1", err, + "Failure at GetRfProfileByIDV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenWirelessGetRfProfileByIDItem(response2.Response) + vItem2 := flattenWirelessGetRfProfileByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( - "Failure when setting GetRfProfileByID response", + "Failure when setting GetRfProfileByIDV1 response", err)) return diags } @@ -962,7 +962,7 @@ func dataSourceWirelessSettingsRfProfilesRead(ctx context.Context, d *schema.Res return diags } -func flattenWirelessGetRfProfilesItems(items *[]catalystcentersdkgo.ResponseWirelessGetRfProfilesResponse) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1Items(items *[]catalystcentersdkgo.ResponseWirelessGetRfProfilesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -975,16 +975,16 @@ func flattenWirelessGetRfProfilesItems(items *[]catalystcentersdkgo.ResponseWire respItem["enable_radio_type_b"] = boolPtrToString(item.EnableRadioTypeB) respItem["enable_radio_type6_g_hz"] = boolPtrToString(item.EnableRadioType6GHz) respItem["enable_custom"] = boolPtrToString(item.EnableCustom) - respItem["radio_type_a_properties"] = flattenWirelessGetRfProfilesItemsRadioTypeAProperties(item.RadioTypeAProperties) - respItem["radio_type_b_properties"] = flattenWirelessGetRfProfilesItemsRadioTypeBProperties(item.RadioTypeBProperties) - respItem["radio_type6_g_hz_properties"] = flattenWirelessGetRfProfilesItemsRadioType6GHzProperties(item.RadioType6GHzProperties) + respItem["radio_type_a_properties"] = flattenWirelessGetRfProfilesV1ItemsRadioTypeAProperties(item.RadioTypeAProperties) + respItem["radio_type_b_properties"] = flattenWirelessGetRfProfilesV1ItemsRadioTypeBProperties(item.RadioTypeBProperties) + respItem["radio_type6_g_hz_properties"] = flattenWirelessGetRfProfilesV1ItemsRadioType6GHzProperties(item.RadioType6GHzProperties) respItem["id"] = item.ID respItems = append(respItems, respItem) } return respItems } -func flattenWirelessGetRfProfilesItemsRadioTypeAProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponseRadioTypeAProperties) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1ItemsRadioTypeAProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1ResponseRadioTypeAProperties) []map[string]interface{} { if item == nil { return nil } @@ -1006,7 +1006,7 @@ func flattenWirelessGetRfProfilesItemsRadioTypeAProperties(item *catalystcenters } -func flattenWirelessGetRfProfilesItemsRadioTypeBProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponseRadioTypeBProperties) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1ItemsRadioTypeBProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1ResponseRadioTypeBProperties) []map[string]interface{} { if item == nil { return nil } @@ -1026,7 +1026,7 @@ func flattenWirelessGetRfProfilesItemsRadioTypeBProperties(item *catalystcenters } -func flattenWirelessGetRfProfilesItemsRadioType6GHzProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponseRadioType6GHzProperties) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1ItemsRadioType6GHzProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1ResponseRadioType6GHzProperties) []map[string]interface{} { if item == nil { return nil } @@ -1040,7 +1040,7 @@ func flattenWirelessGetRfProfilesItemsRadioType6GHzProperties(item *catalystcent respItem["min_power_level"] = item.MinPowerLevel respItem["max_power_level"] = item.MaxPowerLevel respItem["enable_standard_power_service"] = boolPtrToString(item.EnableStandardPowerService) - respItem["multi_bssid_properties"] = flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidProperties(item.MultiBssidProperties) + respItem["multi_bssid_properties"] = flattenWirelessGetRfProfilesV1ItemsRadioType6GHzPropertiesMultiBssidProperties(item.MultiBssidProperties) respItem["preamble_puncture"] = boolPtrToString(item.PreamblePuncture) respItem["min_dbs_width"] = item.MinDbsWidth respItem["max_dbs_width"] = item.MaxDbsWidth @@ -1051,13 +1051,13 @@ func flattenWirelessGetRfProfilesItemsRadioType6GHzProperties(item *catalystcent } -func flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponseRadioType6GHzPropertiesMultiBssidProperties) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1ItemsRadioType6GHzPropertiesMultiBssidProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1ResponseRadioType6GHzPropertiesMultiBssidProperties) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["dot11ax_parameters"] = flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item.Dot11AxParameters) - respItem["dot11be_parameters"] = flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item.Dot11BeParameters) + respItem["dot11ax_parameters"] = flattenWirelessGetRfProfilesV1ItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item.Dot11AxParameters) + respItem["dot11be_parameters"] = flattenWirelessGetRfProfilesV1ItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item.Dot11BeParameters) respItem["target_wake_time"] = boolPtrToString(item.TargetWakeTime) respItem["twt_broadcast_support"] = boolPtrToString(item.TwtBroadcastSupport) @@ -1067,7 +1067,7 @@ func flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertie } -func flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1ItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1ResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters) []map[string]interface{} { if item == nil { return nil } @@ -1083,7 +1083,7 @@ func flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertie } -func flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters) []map[string]interface{} { +func flattenWirelessGetRfProfilesV1ItemsRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1ResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters) []map[string]interface{} { if item == nil { return nil } @@ -1100,7 +1100,7 @@ func flattenWirelessGetRfProfilesItemsRadioType6GHzPropertiesMultiBssidPropertie } -func flattenWirelessGetRfProfileByIDItem(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponse) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1Item(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1Response) []map[string]interface{} { if item == nil { return nil } @@ -1111,16 +1111,16 @@ func flattenWirelessGetRfProfileByIDItem(item *catalystcentersdkgo.ResponseWirel respItem["enable_radio_type_b"] = boolPtrToString(item.EnableRadioTypeB) respItem["enable_radio_type6_g_hz"] = boolPtrToString(item.EnableRadioType6GHz) respItem["enable_custom"] = boolPtrToString(item.EnableCustom) - respItem["radio_type_a_properties"] = flattenWirelessGetRfProfileByIDItemRadioTypeAProperties(item.RadioTypeAProperties) - respItem["radio_type_b_properties"] = flattenWirelessGetRfProfileByIDItemRadioTypeBProperties(item.RadioTypeBProperties) - respItem["radio_type6_g_hz_properties"] = flattenWirelessGetRfProfileByIDItemRadioType6GHzProperties(item.RadioType6GHzProperties) + respItem["radio_type_a_properties"] = flattenWirelessGetRfProfileByIDV1ItemRadioTypeAProperties(item.RadioTypeAProperties) + respItem["radio_type_b_properties"] = flattenWirelessGetRfProfileByIDV1ItemRadioTypeBProperties(item.RadioTypeBProperties) + respItem["radio_type6_g_hz_properties"] = flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzProperties(item.RadioType6GHzProperties) respItem["id"] = item.ID return []map[string]interface{}{ respItem, } } -func flattenWirelessGetRfProfileByIDItemRadioTypeAProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponseRadioTypeAProperties) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1ItemRadioTypeAProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1ResponseRadioTypeAProperties) []map[string]interface{} { if item == nil { return nil } @@ -1142,7 +1142,7 @@ func flattenWirelessGetRfProfileByIDItemRadioTypeAProperties(item *catalystcente } -func flattenWirelessGetRfProfileByIDItemRadioTypeBProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponseRadioTypeBProperties) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1ItemRadioTypeBProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1ResponseRadioTypeBProperties) []map[string]interface{} { if item == nil { return nil } @@ -1162,7 +1162,7 @@ func flattenWirelessGetRfProfileByIDItemRadioTypeBProperties(item *catalystcente } -func flattenWirelessGetRfProfileByIDItemRadioType6GHzProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponseRadioType6GHzProperties) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1ResponseRadioType6GHzProperties) []map[string]interface{} { if item == nil { return nil } @@ -1176,7 +1176,7 @@ func flattenWirelessGetRfProfileByIDItemRadioType6GHzProperties(item *catalystce respItem["min_power_level"] = item.MinPowerLevel respItem["max_power_level"] = item.MaxPowerLevel respItem["enable_standard_power_service"] = boolPtrToString(item.EnableStandardPowerService) - respItem["multi_bssid_properties"] = flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidProperties(item.MultiBssidProperties) + respItem["multi_bssid_properties"] = flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzPropertiesMultiBssidProperties(item.MultiBssidProperties) respItem["preamble_puncture"] = boolPtrToString(item.PreamblePuncture) respItem["min_dbs_width"] = item.MinDbsWidth respItem["max_dbs_width"] = item.MaxDbsWidth @@ -1187,13 +1187,13 @@ func flattenWirelessGetRfProfileByIDItemRadioType6GHzProperties(item *catalystce } -func flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponseRadioType6GHzPropertiesMultiBssidProperties) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzPropertiesMultiBssidProperties(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1ResponseRadioType6GHzPropertiesMultiBssidProperties) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["dot11ax_parameters"] = flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item.Dot11AxParameters) - respItem["dot11be_parameters"] = flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item.Dot11BeParameters) + respItem["dot11ax_parameters"] = flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item.Dot11AxParameters) + respItem["dot11be_parameters"] = flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item.Dot11BeParameters) respItem["target_wake_time"] = boolPtrToString(item.TargetWakeTime) respItem["twt_broadcast_support"] = boolPtrToString(item.TwtBroadcastSupport) @@ -1203,7 +1203,7 @@ func flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidPropert } -func flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1ResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters) []map[string]interface{} { if item == nil { return nil } @@ -1219,7 +1219,7 @@ func flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidPropert } -func flattenWirelessGetRfProfileByIDItemRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters) []map[string]interface{} { +func flattenWirelessGetRfProfileByIDV1ItemRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(item *catalystcentersdkgo.ResponseWirelessGetRfProfileByIDV1ResponseRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/data_source_wireless_settings_rf_profiles_count.go b/catalystcenter/data_source_wireless_settings_rf_profiles_count.go index 9038163..1b775c2 100644 --- a/catalystcenter/data_source_wireless_settings_rf_profiles_count.go +++ b/catalystcenter/data_source_wireless_settings_rf_profiles_count.go @@ -47,26 +47,26 @@ func dataSourceWirelessSettingsRfProfilesCountRead(ctx context.Context, d *schem selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetRfProfilesCount") + log.Printf("[DEBUG] Selected method: GetRfProfilesCountV1") - response1, restyResp1, err := client.Wireless.GetRfProfilesCount() + response1, restyResp1, err := client.Wireless.GetRfProfilesCountV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagErrorWithAlt( - "Failure when executing 2 GetRfProfilesCount", err, - "Failure at GetRfProfilesCount, unexpected response", "")) + "Failure when executing 2 GetRfProfilesCountV1", err, + "Failure at GetRfProfilesCountV1, unexpected response", "")) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetRfProfilesCountItem(response1.Response) + vItem1 := flattenWirelessGetRfProfilesCountV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetRfProfilesCount response", + "Failure when setting GetRfProfilesCountV1 response", err)) return diags } @@ -78,7 +78,7 @@ func dataSourceWirelessSettingsRfProfilesCountRead(ctx context.Context, d *schem return diags } -func flattenWirelessGetRfProfilesCountItem(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesCountResponse) []map[string]interface{} { +func flattenWirelessGetRfProfilesCountV1Item(item *catalystcentersdkgo.ResponseWirelessGetRfProfilesCountV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/provider.go b/catalystcenter/provider.go index 990ed90..9ac9a39 100644 --- a/catalystcenter/provider.go +++ b/catalystcenter/provider.go @@ -51,623 +51,1294 @@ func Provider() *schema.Provider { }, }, ResourcesMap: map[string]*schema.Resource{ - "catalystcenter_reserve_ip_subpool": resourceReserveIPSubpool(), - "catalystcenter_wireless_rf_profile": resourceWirelessRfProfile(), - "catalystcenter_wireless_profile": resourceWirelessProfile(), - "catalystcenter_configuration_template_project": resourceConfigurationTemplateProject(), - "catalystcenter_tag": resourceTag(), - "catalystcenter_snmp_properties": resourceSNMPProperties(), - "catalystcenter_pnp_global_settings": resourcePnpGlobalSettings(), - "catalystcenter_network_device_list": resourceNetworkDeviceList(), - "catalystcenter_network_device": resourceNetworkDevice(), - "catalystcenter_global_pool": resourceGlobalPool(), - "catalystcenter_path_trace": resourcePathTrace(), - "catalystcenter_transit_peer_network": resourceTransitPeerNetwork(), - "catalystcenter_event_subscription_syslog": resourceEventSubscriptionSyslog(), - "catalystcenter_event_subscription_rest": resourceEventSubscriptionRest(), - "catalystcenter_event_subscription_email": resourceEventSubscriptionEmail(), - "catalystcenter_event_subscription": resourceEventSubscription(), - "catalystcenter_wireless_dynamic_interface": resourceWirelessDynamicInterface(), - "catalystcenter_wireless_enterprise_ssid": resourceWirelessEnterpriseSSID(), - "catalystcenter_discovery": resourceDiscovery(), - "catalystcenter_device_replacement": resourceDeviceReplacement(), - "catalystcenter_reports": resourceReports(), - "catalystcenter_sda_virtual_network_v2": resourceSdaVirtualNetworkV2(), - "catalystcenter_sda_provision_device": resourceSdaProvisionDevice(), - "catalystcenter_sda_virtual_network_ip_pool": resourceSdaVirtualNetworkIPPool(), - "catalystcenter_sda_virtual_network": resourceSdaVirtualNetwork(), - "catalystcenter_sda_port_assignment_for_user_device": resourceSdaPortAssignmentForUserDevice(), - "catalystcenter_sda_port_assignment_for_access_point": resourceSdaPortAssignmentForAccessPoint(), - "catalystcenter_sda_fabric_site": resourceSdaFabricSite(), - "catalystcenter_sda_fabric_edge_device": resourceSdaFabricEdgeDevice(), - "catalystcenter_sda_fabric_control_plane_device": resourceSdaFabricControlPlaneDevice(), - "catalystcenter_sda_fabric_border_device": resourceSdaFabricBorderDevice(), - "catalystcenter_sda_fabric_authentication_profile": resourceSdaFabricAuthenticationProfile(), - "catalystcenter_applications": resourceApplications(), - "catalystcenter_application_sets": resourceApplicationSets(), - "catalystcenter_pnp_workflow": resourcePnpWorkflow(), - "catalystcenter_pnp_device": resourcePnpDevice(), - "catalystcenter_configuration_template": resourceConfigurationTemplate(), - "catalystcenter_app_policy_queuing_profile": resourceAppPolicyQueuingProfile(), - "catalystcenter_business_sda_hostonboarding_ssid_ippool": resourceBusinessSdaHostonboardingSSIDIPpool(), - "catalystcenter_qos_device_interface": resourceQosDeviceInterface(), - "catalystcenter_network_device_custom_prompt": resourceNetworkDeviceCustomPrompt(), - "catalystcenter_service_provider": resourceServiceProvider(), - "catalystcenter_sensor": resourceSensor(), - "catalystcenter_area": resourceArea(), - "catalystcenter_building": resourceBuilding(), - "catalystcenter_floor": resourceFloor(), - "catalystcenter_license_device": resourceLicenseDevice(), - "catalystcenter_golden_tag_image": resourceGoldenTagImage(), - "catalystcenter_device_reboot_apreboot": resourceDeviceRebootApreboot(), - "catalystcenter_event_syslog_config": resourceEventSyslogConfig(), - "catalystcenter_integration_settings_instances_itsm": resourceIntegrationSettingsInstancesItsm(), - "catalystcenter_network_device_user_defined_field": resourceNetworkDeviceUserDefinedField(), - "catalystcenter_global_credential_v2": resourceGlobalCredentialV2(), - "catalystcenter_network_v2": resourceNetworkV2(), - "catalystcenter_service_provider_v2": resourceServiceProviderV2(), - "catalystcenter_user": resourceUser(), - "catalystcenter_flexible_report_schedule": resourceFlexibleReportSchedule(), - "catalystcenter_sda_authentication_profiles": resourceSdaAuthenticationProfiles(), - "catalystcenter_sda_extranet_policies": resourceSdaExtranetPolicies(), - "catalystcenter_sda_fabric_devices": resourceSdaFabricDevices(), - "catalystcenter_sda_fabric_devices_layer2_handoffs": resourceSdaFabricDevicesLayer2Handoffs(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits": resourceSdaFabricDevicesLayer2HandoffsIPTransits(), - "catalystcenter_sda_fabric_sites": resourceSdaFabricSites(), - "catalystcenter_sda_fabric_zones": resourceSdaFabricZones(), - "catalystcenter_sda_port_assignments": resourceSdaPortAssignments(), - "catalystcenter_sda_provision_devices": resourceSdaProvisionDevices(), - "catalystcenter_application_policy_application_set": resourceApplicationPolicyApplicationSet(), - "catalystcenter_applications_v2": resourceApplicationsV2(), - "catalystcenter_users_external_servers_aaa_attribute": resourceUsersExternalServersAAAAttribute(), - "catalystcenter_custom_issue_definitions": resourceCustomIssueDefinitions(), - "catalystcenter_diagnostic_validation_workflows": resourceDiagnosticValidationWorkflows(), - "catalystcenter_health_score_definitions": resourceHealthScoreDefinitions(), - "catalystcenter_images_distribution_server_settings": resourceImagesDistributionServerSettings(), - "catalystcenter_images_site_wise_product_names": resourceImagesSiteWiseProductNames(), - "catalystcenter_license_setting": resourceLicenseSetting(), - "catalystcenter_network_devices_device_controllability_settings": resourceNetworkDevicesDeviceControllabilitySettings(), - "catalystcenter_network_devices_resync_interval_settings_id": resourceNetworkDevicesResyncIntervalSettingsID(), - "catalystcenter_network_devices_network_profiles_for_sites": resourceNetworkDevicesNetworkProfilesForSites(), - "catalystcenter_network_profiles_for_sites_site_assignments": resourceNetworkProfilesForSitesSiteAssignments(), - "catalystcenter_provisioning_settings": resourceProvisioningSettings(), - "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id": resourceSdaFabricsVLANToSSIDsFabricID(), - "catalystcenter_sda_layer2_virtual_networks": resourceSdaLayer2VirtualNetworks(), - "catalystcenter_sda_layer3_virtual_networks": resourceSdaLayer3VirtualNetworks(), - "catalystcenter_sda_multicast_virtual_networks": resourceSdaMulticastVirtualNetworks(), - "catalystcenter_sda_port_channels": resourceSdaPortChannels(), - "catalystcenter_sda_transit_networks": resourceSdaTransitNetworks(), - "catalystcenter_sites_aaa_settings": resourceSitesAAASettings(), - "catalystcenter_sites_banner_settings": resourceSitesBannerSettings(), - "catalystcenter_sites_device_credentials": resourceSitesDeviceCredentials(), - "catalystcenter_sites_dhcp_settings": resourceSitesDhcpSettings(), - "catalystcenter_sites_dns_settings": resourceSitesDNSSettings(), - "catalystcenter_sites_image_distribution_settings": resourceSitesImageDistributionSettings(), - "catalystcenter_sites_ntp_settings": resourceSitesNtpSettings(), - "catalystcenter_sites_telemetry_settings": resourceSitesTelemetrySettings(), - "catalystcenter_sites_time_zone_settings": resourceSitesTimeZoneSettings(), - "catalystcenter_sites_wireless_settings_ssids": resourceSitesWirelessSettingsSSIDs(), - "catalystcenter_system_issue_definitions": resourceSystemIssueDefinitions(), - "catalystcenter_wireless_profiles": resourceWirelessProfiles(), - "catalystcenter_wireless_settings_dot11be_profiles": resourceWirelessSettingsDot11BeProfiles(), - "catalystcenter_wireless_settings_interfaces": resourceWirelessSettingsInterfaces(), - "catalystcenter_wireless_settings_rf_profiles": resourceWirelessSettingsRfProfiles(), - "catalystcenter_floors_settings": resourceFloorsSettings(), - "catalystcenter_ipam_server_setting": resourceIPamServerSetting(), - "catalystcenter_sda_multicast": resourceSdaMulticast(), - "catalystcenter_site_assign_credential": resourceSiteAssignCredential(), - "catalystcenter_wireless_provision_device_create": resourceWirelessProvisionDeviceCreate(), - "catalystcenter_wireless_provision_device_update": resourceWirelessProvisionDeviceUpdate(), - "catalystcenter_wireless_provision_access_point": resourceWirelessProvisionAccessPoint(), - "catalystcenter_template_preview": resourceTemplatePreview(), - "catalystcenter_sensor_test_template_duplicate": resourceSensorTestTemplateDuplicate(), - "catalystcenter_sensor_test_run": resourceSensorTestRun(), - "catalystcenter_sensor_test_create": resourceSensorTestCreate(), - "catalystcenter_pnp_virtual_account_deregister": resourcePnpVirtualAccountDeregister(), - "catalystcenter_pnp_server_profile_update": resourcePnpServerProfileUpdate(), - "catalystcenter_pnp_virtual_account_add": resourcePnpVirtualAccountAdd(), - "catalystcenter_pnp_virtual_account_devices_sync": resourcePnpVirtualAccountDevicesSync(), - "catalystcenter_pnp_device_unclaim": resourcePnpDeviceUnclaim(), - "catalystcenter_pnp_device_config_preview": resourcePnpDeviceConfigPreview(), - "catalystcenter_pnp_device_site_claim": resourcePnpDeviceSiteClaim(), - "catalystcenter_pnp_device_reset": resourcePnpDeviceReset(), - "catalystcenter_pnp_device_import": resourcePnpDeviceImport(), - "catalystcenter_pnp_device_claim": resourcePnpDeviceClaim(), - "catalystcenter_network_create": resourceNetworkCreate(), - "catalystcenter_network_update": resourceNetworkUpdate(), - "catalystcenter_network_device_sync": resourceNetworkDeviceSync(), - "catalystcenter_network_device_export": resourceNetworkDeviceExport(), - "catalystcenter_network_device_update_role": resourceNetworkDeviceUpdateRole(), - "catalystcenter_command_runner_run_command": resourceCommandRunnerRunCommand(), - "catalystcenter_device_configurations_export": resourceDeviceConfigurationsExport(), - "catalystcenter_itsm_integration_events_retry": resourceItsmIntegrationEventsRetry(), - "catalystcenter_swim_image_url": resourceSwimImageURL(), - "catalystcenter_swim_image_file": resourceSwimImageFile(), - "catalystcenter_image_distribution": resourceImageDistribution(), - "catalystcenter_image_device_activation": resourceImageDeviceActivation(), - "catalystcenter_global_credential_update": resourceGlobalCredentialUpdate(), - "catalystcenter_global_credential_delete": resourceGlobalCredentialDelete(), - "catalystcenter_global_credential_snmpv2_write_community": resourceGlobalCredentialSNMPv2WriteCommunity(), - "catalystcenter_global_credential_snmpv2_read_community": resourceGlobalCredentialSNMPv2ReadCommunity(), - "catalystcenter_global_credential_netconf": resourceGlobalCredentialNetconf(), - "catalystcenter_global_credential_http_write": resourceGlobalCredentialHTTPWrite(), - "catalystcenter_global_credential_http_read": resourceGlobalCredentialHTTPRead(), - "catalystcenter_global_credential_cli": resourceGlobalCredentialCli(), - "catalystcenter_discovery_range_delete": resourceDiscoveryRangeDelete(), - "catalystcenter_device_replacement_deploy": resourceDeviceReplacementDeploy(), - "catalystcenter_compliance": resourceCompliance(), - "catalystcenter_wireless_provision_ssid_delete_reprovision": resourceWirelessProvisionSSIDDeleteReprovision(), - "catalystcenter_wireless_provision_ssid_create_provision": resourceWirelessProvisionSSIDCreateProvision(), - "catalystcenter_sensor_test_template_edit": resourceSensorTestTemplateEdit(), - "catalystcenter_configuration_template_clone": resourceConfigurationTemplateClone(), - "catalystcenter_deploy_template": resourceDeployTemplate(), - "catalystcenter_configuration_template_export_project": resourceConfigurationTemplateExportProject(), - "catalystcenter_configuration_template_export_template": resourceConfigurationTemplateExportTemplate(), - "catalystcenter_configuration_template_import_project": resourceConfigurationTemplateImportProject(), - "catalystcenter_configuration_template_import_template": resourceConfigurationTemplateImportTemplate(), - "catalystcenter_app_policy_intent_create": resourceAppPolicyIntentCreate(), - "catalystcenter_business_sda_wireless_controller_create": resourceBusinessSdaWirelessControllerCreate(), - "catalystcenter_business_sda_wireless_controller_delete": resourceBusinessSdaWirelessControllerDelete(), - "catalystcenter_assign_device_to_site": resourceAssignDeviceToSite(), - "catalystcenter_associate_site_to_network_profile": resourceAssociateSiteToNetworkProfile(), - "catalystcenter_pnp_device_authorize": resourcePnpDeviceAuthorize(), - "catalystcenter_disassociate_site_to_network_profile": resourceDisassociateSiteToNetworkProfile(), - "catalystcenter_event_email_config_create": resourceEventEmailConfigCreate(), - "catalystcenter_interface_update": resourceInterfaceUpdate(), - "catalystcenter_interface_operation_create": resourceInterfaceOperationCreate(), - "catalystcenter_lan_automation_create": resourceLanAutomationCreate(), - "catalystcenter_lan_automation_delete": resourceLanAutomationDelete(), - "catalystcenter_event_webhook_update": resourceEventWebhookUpdate(), - "catalystcenter_syslog_config_update": resourceSyslogConfigUpdate(), - "catalystcenter_event_webhook_create": resourceEventWebhookCreate(), - "catalystcenter_syslog_config_create": resourceSyslogConfigCreate(), - "catalystcenter_file_import": resourceFileImport(), - "catalystcenter_event_email_config_update": resourceEventEmailConfigUpdate(), - "catalystcenter_event_snmp_config_create": resourceEventSNMPConfigCreate(), - "catalystcenter_event_snmp_config_update": resourceEventSNMPConfigUpdate(), - "catalystcenter_execute_suggested_actions_commands": resourceExecuteSuggestedActionsCommands(), - "catalystcenter_wireless_accespoint_configuration": resourceWirelessAccespointConfiguration(), - "catalystcenter_credential_to_site_by_siteid_create_v2": resourceCredentialToSiteBySiteidCreateV2(), - "catalystcenter_sp_profile_delete_v2": resourceSpProfileDeleteV2(), - "catalystcenter_flexible_report_execute": resourceFlexibleReportExecute(), - "catalystcenter_integrate_ise": resourceIntegrateIse(), - "catalystcenter_lan_automation_update_device": resourceLanAutomationUpdateDevice(), - "catalystcenter_maps_export": resourceMapsExport(), - "catalystcenter_maps_import_start": resourceMapsImportStart(), - "catalystcenter_maps_import": resourceMapsImport(), - "catalystcenter_maps_import_perform": resourceMapsImportPerform(), - "catalystcenter_network_device_config_write_memory": resourceNetworkDeviceConfigWriteMemory(), - "catalystcenter_network_device_management_address_update": resourceNetworkDeviceManagementAddressUpdate(), - "catalystcenter_sda_anycast_gateways_create": resourceSdaAnycastGatewaysCreate(), - "catalystcenter_sda_anycast_gateways_update": resourceSdaAnycastGatewaysUpdate(), - "catalystcenter_sda_anycast_gateways_delete": resourceSdaAnycastGatewaysDelete(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreate(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdate(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDelete(), - "catalystcenter_lan_automation_v2": resourceLanAutomationV2(), - "catalystcenter_lan_automation_update_v2": resourceLanAutomationUpdateV2(), - "catalystcenter_network_devices_interfaces_query": resourceNetworkDevicesInterfacesQuery(), - "catalystcenter_wireless_accesspoint_configuration_create": resourceWirelessAccesspointConfigurationCreate(), - "catalystcenter_users_external_authentication_create": resourceUsersExternalAuthenticationCreate(), - "catalystcenter_assurance_events_query": resourceAssuranceEventsQuery(), - "catalystcenter_assurance_events_query_count": resourceAssuranceEventsQueryCount(), - "catalystcenter_assurance_issues_query": resourceAssuranceIssuesQuery(), - "catalystcenter_assurance_issues_query_count": resourceAssuranceIssuesQueryCount(), - "catalystcenter_assurance_issues_summary_analytics": resourceAssuranceIssuesSummaryAnalytics(), - "catalystcenter_assurance_issues_top_n_analytics": resourceAssuranceIssuesTopNAnalytics(), - "catalystcenter_assurance_issues_trend_analytics": resourceAssuranceIssuesTrendAnalytics(), - "catalystcenter_network_devices_query_count": resourceNetworkDevicesQueryCount(), - "catalystcenter_clients_query": resourceClientsQuery(), - "catalystcenter_clients_query_count": resourceClientsQueryCount(), - "catalystcenter_clients_summary_analytics": resourceClientsSummaryAnalytics(), - "catalystcenter_clients_top_n_analytics": resourceClientsTopNAnalytics(), - "catalystcenter_clients_trend_analytics": resourceClientsTrendAnalytics(), - "catalystcenter_clients_trend_analytics_id": resourceClientsTrendAnalyticsID(), - "catalystcenter_interfaces_query": resourceInterfacesQuery(), - "catalystcenter_interfaces_query_count": resourceInterfacesQueryCount(), - "catalystcenter_network_devices_query": resourceNetworkDevicesQuery(), - "catalystcenter_network_devices_summary_analytics": resourceNetworkDevicesSummaryAnalytics(), - "catalystcenter_network_devices_trend_analytics": resourceNetworkDevicesTrendAnalytics(), - "catalystcenter_network_devices_trend_analytics_id": resourceNetworkDevicesTrendAnalyticsID(), - "catalystcenter_site_health_summaries_summary_analytics_create": resourceSiteHealthSummariesSummaryAnalyticsCreate(), - "catalystcenter_assurance_issues_ignore": resourceAssuranceIssuesIgnore(), - "catalystcenter_assurance_issues_resolve": resourceAssuranceIssuesResolve(), - "catalystcenter_assurance_issues_update": resourceAssuranceIssuesUpdate(), - "catalystcenter_network_devices_issues_remediation_provision": resourceNetworkDevicesIssuesRemediationProvision(), - "catalystcenter_images_download": resourceImagesDownload(), - "catalystcenter_assign_to_site_apply": resourceAssignToSiteApply(), - "catalystcenter_network_devices_resync_interval_settings": resourceNetworkDevicesResyncIntervalSettings(), - "catalystcenter_network_devices_resync_interval_settings_override": resourceNetworkDevicesResyncIntervalSettingsOverride(), - "catalystcenter_network_devices_unassign_from_site_apply": resourceNetworkDevicesUnassignFromSiteApply(), - "catalystcenter_network_profiles_for_sites_site_assignments_bulk_create": resourceNetworkProfilesForSitesSiteAssignmentsBulkCreate(), - "catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete": resourceNetworkProfilesForSitesSiteAssignmentsBulkDelete(), - "catalystcenter_sda_multicast_v1_update": resourceSdaMulticastV1Update(), - "catalystcenter_sites_bulk": resourceSitesBulk(), - "catalystcenter_sites_device_credentials_apply": resourceSitesDeviceCredentialsApply(), - "catalystcenter_telemetry_settings_apply": resourceTelemetrySettingsApply(), - "catalystcenter_trusted_certificates_import": resourceTrustedCertificatesImport(), - "catalystcenter_wireless_access_points_factory_reset_request_provision": resourceWirelessAccessPointsFactoryResetRequestProvision(), - "catalystcenter_wireless_access_points_provision": resourceWirelessAccessPointsProvision(), - "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision": resourceWirelessControllersWirelessMobilityGroupsMobilityProvision(), - "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset": resourceWirelessControllersWirelessMobilityGroupsMobilityReset(), - "catalystcenter_wireless_controllers_assign_managed_ap_locations": resourceWirelessControllersAssignManagedApLocations(), - "catalystcenter_wireless_controllers_provision": resourceWirelessControllersProvision(), - "catalystcenter_floors_upload_image": resourceFloorsUploadImage(), - "catalystcenter_interfaces_members_associations_query": resourceInterfacesMembersAssociationsQuery(), - "catalystcenter_network_devices_members_associations_query": resourceNetworkDevicesMembersAssociationsQuery(), + "catalystcenter_reserve_ip_subpool": resourceReserveIPSubpool(), + "catalystcenter_reserve_ip_subpool_v1": resourceReserveIPSubpool(), + "catalystcenter_wireless_rf_profile": resourceWirelessRfProfile(), + "catalystcenter_wireless_rf_profile_v1": resourceWirelessRfProfile(), + "catalystcenter_wireless_profile": resourceWirelessProfile(), + "catalystcenter_wireless_profile_v1": resourceWirelessProfile(), + "catalystcenter_configuration_template_project": resourceConfigurationTemplateProject(), + "catalystcenter_configuration_template_project_v1": resourceConfigurationTemplateProject(), + "catalystcenter_tag": resourceTag(), + "catalystcenter_tag_v1": resourceTag(), + "catalystcenter_snmp_properties": resourceSNMPProperties(), + "catalystcenter_snmp_properties_v1": resourceSNMPProperties(), + "catalystcenter_pnp_global_settings": resourcePnpGlobalSettings(), + "catalystcenter_pnp_global_settings_v1": resourcePnpGlobalSettings(), + "catalystcenter_network_device_list": resourceNetworkDeviceList(), + "catalystcenter_network_device_list_v1": resourceNetworkDeviceList(), + "catalystcenter_network_device": resourceNetworkDevice(), + "catalystcenter_network_device_v1": resourceNetworkDevice(), + "catalystcenter_global_pool": resourceGlobalPool(), + "catalystcenter_global_pool_v1": resourceGlobalPool(), + "catalystcenter_path_trace": resourcePathTrace(), + "catalystcenter_path_trace_v1": resourcePathTrace(), + "catalystcenter_transit_peer_network": resourceTransitPeerNetwork(), + "catalystcenter_transit_peer_network_v1": resourceTransitPeerNetwork(), + "catalystcenter_event_subscription_syslog": resourceEventSubscriptionSyslog(), + "catalystcenter_event_subscription_syslog_v1": resourceEventSubscriptionSyslog(), + "catalystcenter_event_subscription_rest": resourceEventSubscriptionRest(), + "catalystcenter_event_subscription_rest_v1": resourceEventSubscriptionRest(), + "catalystcenter_event_subscription_email": resourceEventSubscriptionEmail(), + "catalystcenter_event_subscription_email_v1": resourceEventSubscriptionEmail(), + "catalystcenter_event_subscription": resourceEventSubscription(), + "catalystcenter_event_subscription_v1": resourceEventSubscription(), + "catalystcenter_wireless_dynamic_interface": resourceWirelessDynamicInterface(), + "catalystcenter_wireless_dynamic_interface_v1": resourceWirelessDynamicInterface(), + "catalystcenter_wireless_enterprise_ssid": resourceWirelessEnterpriseSSID(), + "catalystcenter_wireless_enterprise_ssid_v1": resourceWirelessEnterpriseSSID(), + "catalystcenter_discovery": resourceDiscovery(), + "catalystcenter_discovery_v1": resourceDiscovery(), + "catalystcenter_device_replacement": resourceDeviceReplacement(), + "catalystcenter_device_replacement_v1": resourceDeviceReplacement(), + "catalystcenter_reports": resourceReports(), + "catalystcenter_reports_v1": resourceReports(), + "catalystcenter_sda_multicast": resourceSdaMulticast(), + "catalystcenter_sda_multicast_v1": resourceSdaMulticast(), + "catalystcenter_sda_virtual_network_v1": resourceSdaVirtualNetwork(), + "catalystcenter_sda_virtual_network": resourceSdaVirtualNetwork(), + "catalystcenter_sda_provision_device": resourceSdaProvisionDevice(), + "catalystcenter_sda_provision_device_v1": resourceSdaProvisionDevice(), + "catalystcenter_sda_virtual_network_ip_pool": resourceSdaVirtualNetworkIPPool(), + "catalystcenter_sda_virtual_network_ip_pool_v1": resourceSdaVirtualNetworkIPPool(), + "catalystcenter_sda_port_assignment_for_user_device": resourceSdaPortAssignmentForUserDevice(), + "catalystcenter_sda_port_assignment_for_user_device_v1": resourceSdaPortAssignmentForUserDevice(), + "catalystcenter_sda_port_assignment_for_access_point": resourceSdaPortAssignmentForAccessPoint(), + "catalystcenter_sda_port_assignment_for_access_point_v1": resourceSdaPortAssignmentForAccessPoint(), + "catalystcenter_sda_fabric_site": resourceSdaFabricSite(), + "catalystcenter_sda_fabric_site_v1": resourceSdaFabricSite(), + "catalystcenter_sda_fabric_edge_device": resourceSdaFabricEdgeDevice(), + "catalystcenter_sda_fabric_edge_device_v1": resourceSdaFabricEdgeDevice(), + "catalystcenter_sda_fabric_control_plane_device": resourceSdaFabricControlPlaneDevice(), + "catalystcenter_sda_fabric_control_plane_device_v1": resourceSdaFabricControlPlaneDevice(), + "catalystcenter_sda_fabric_border_device": resourceSdaFabricBorderDevice(), + "catalystcenter_sda_fabric_border_device_v1": resourceSdaFabricBorderDevice(), + "catalystcenter_sda_fabric_authentication_profile": resourceSdaFabricAuthenticationProfile(), + "catalystcenter_sda_fabric_authentication_profile_v1": resourceSdaFabricAuthenticationProfile(), + "catalystcenter_applications": resourceApplications(), + "catalystcenter_applications_v1": resourceApplications(), + "catalystcenter_application_sets": resourceApplicationSets(), + "catalystcenter_application_sets_v1": resourceApplicationSets(), + "catalystcenter_pnp_workflow": resourcePnpWorkflow(), + "catalystcenter_pnp_workflow_v1": resourcePnpWorkflow(), + "catalystcenter_pnp_device": resourcePnpDevice(), + "catalystcenter_pnp_device_v1": resourcePnpDevice(), + "catalystcenter_configuration_template": resourceConfigurationTemplate(), + "catalystcenter_configuration_template_v1": resourceConfigurationTemplate(), + "catalystcenter_app_policy_queuing_profile": resourceAppPolicyQueuingProfile(), + "catalystcenter_app_policy_queuing_profile_v1": resourceAppPolicyQueuingProfile(), + "catalystcenter_business_sda_hostonboarding_ssid_ippool": resourceBusinessSdaHostonboardingSSIDIPpool(), + "catalystcenter_business_sda_hostonboarding_ssid_ippool_v1": resourceBusinessSdaHostonboardingSSIDIPpool(), + "catalystcenter_endpoint_analytics_profiling_rules": resourceEndpointAnalyticsProfilingRules(), + "catalystcenter_endpoint_analytics_profiling_rules_v1": resourceEndpointAnalyticsProfilingRules(), + "catalystcenter_qos_device_interface": resourceQosDeviceInterface(), + "catalystcenter_qos_device_interface_v1": resourceQosDeviceInterface(), + "catalystcenter_network_device_custom_prompt": resourceNetworkDeviceCustomPrompt(), + "catalystcenter_network_device_custom_prompt_v1": resourceNetworkDeviceCustomPrompt(), + "catalystcenter_service_provider": resourceServiceProvider(), + "catalystcenter_service_provider_v1": resourceServiceProvider(), + "catalystcenter_sensor": resourceSensor(), + "catalystcenter_sensor_v1": resourceSensor(), + "catalystcenter_license_device": resourceLicenseDevice(), + "catalystcenter_license_device_v1": resourceLicenseDevice(), + "catalystcenter_golden_tag_image": resourceGoldenTagImage(), + "catalystcenter_golden_tag_image_v1": resourceGoldenTagImage(), + "catalystcenter_device_reboot_apreboot": resourceDeviceRebootApreboot(), + "catalystcenter_device_reboot_apreboot_v1": resourceDeviceRebootApreboot(), + "catalystcenter_event_syslog_config": resourceEventSyslogConfig(), + "catalystcenter_event_syslog_config_v1": resourceEventSyslogConfig(), + "catalystcenter_integration_settings_instances_itsm": resourceIntegrationSettingsInstancesItsm(), + "catalystcenter_integration_settings_instances_itsm_v1": resourceIntegrationSettingsInstancesItsm(), + "catalystcenter_global_credential_v2": resourceGlobalCredentialV2(), + "catalystcenter_network_v2": resourceNetworkV2(), + "catalystcenter_service_provider_v2": resourceServiceProviderV2(), + "catalystcenter_user": resourceUser(), + "catalystcenter_user_v1": resourceUser(), + "catalystcenter_flexible_report_schedule": resourceFlexibleReportSchedule(), + "catalystcenter_flexible_report_schedule_v1": resourceFlexibleReportSchedule(), + "catalystcenter_sda_authentication_profiles": resourceSdaAuthenticationProfiles(), + "catalystcenter_sda_authentication_profiles_v1": resourceSdaAuthenticationProfiles(), + "catalystcenter_sda_extranet_policies": resourceSdaExtranetPolicies(), + "catalystcenter_sda_extranet_policies_v1": resourceSdaExtranetPolicies(), + "catalystcenter_sda_fabric_devices": resourceSdaFabricDevices(), + "catalystcenter_sda_fabric_devices_v1": resourceSdaFabricDevices(), + "catalystcenter_sda_fabric_devices_layer2_handoffs": resourceSdaFabricDevicesLayer2Handoffs(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_v1": resourceSdaFabricDevicesLayer2Handoffs(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits": resourceSdaFabricDevicesLayer2HandoffsIPTransits(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits_v1": resourceSdaFabricDevicesLayer2HandoffsIPTransits(), + "catalystcenter_sda_fabric_sites": resourceSdaFabricSites(), + "catalystcenter_sda_fabric_sites_v1": resourceSdaFabricSites(), + "catalystcenter_sda_fabric_zones": resourceSdaFabricZones(), + "catalystcenter_sda_fabric_zones_v1": resourceSdaFabricZones(), + "catalystcenter_sda_port_assignments": resourceSdaPortAssignments(), + "catalystcenter_sda_port_assignments_v1": resourceSdaPortAssignments(), + "catalystcenter_sda_provision_devices": resourceSdaProvisionDevices(), + "catalystcenter_sda_provision_devices_v1": resourceSdaProvisionDevices(), + "catalystcenter_application_set_v2": resourceApplicationSetV2(), + "catalystcenter_applications_v2": resourceApplicationsV2(), + "catalystcenter_users_external_servers_aaa_attribute": resourceUsersExternalServersAAAAttribute(), + "catalystcenter_users_external_servers_aaa_attribute_v1": resourceUsersExternalServersAAAAttribute(), + "catalystcenter_custom_issue_definitions": resourceCustomIssueDefinitions(), + "catalystcenter_custom_issue_definitions_v1": resourceCustomIssueDefinitions(), + "catalystcenter_diagnostic_validation_workflows": resourceDiagnosticValidationWorkflows(), + "catalystcenter_diagnostic_validation_workflows_v1": resourceDiagnosticValidationWorkflows(), + "catalystcenter_health_score_definitions": resourceHealthScoreDefinitions(), + "catalystcenter_health_score_definitions_v1": resourceHealthScoreDefinitions(), + "catalystcenter_images_distribution_server_settings": resourceImagesDistributionServerSettings(), + "catalystcenter_images_distribution_server_settings_v1": resourceImagesDistributionServerSettings(), + "catalystcenter_images_site_wise_product_names": resourceImagesSiteWiseProductNames(), + "catalystcenter_images_site_wise_product_names_v1": resourceImagesSiteWiseProductNames(), + "catalystcenter_license_setting": resourceLicenseSetting(), + "catalystcenter_license_setting_v1": resourceLicenseSetting(), + "catalystcenter_network_devices_device_controllability_settings": resourceNetworkDevicesDeviceControllabilitySettings(), + "catalystcenter_network_devices_device_controllability_settings_v1": resourceNetworkDevicesDeviceControllabilitySettings(), + "catalystcenter_network_devices_resync_interval_settings_id": resourceNetworkDevicesResyncIntervalSettingsID(), + "catalystcenter_network_devices_resync_interval_settings_id_v1": resourceNetworkDevicesResyncIntervalSettingsID(), + "catalystcenter_network_devices_network_profiles_for_sites": resourceNetworkDevicesNetworkProfilesForSites(), + "catalystcenter_network_devices_network_profiles_for_sites_v1": resourceNetworkDevicesNetworkProfilesForSites(), + "catalystcenter_network_profiles_for_sites_site_assignments": resourceNetworkProfilesForSitesSiteAssignments(), + "catalystcenter_network_profiles_for_sites_site_assignments_v1": resourceNetworkProfilesForSitesSiteAssignments(), + "catalystcenter_provisioning_settings": resourceProvisioningSettings(), + "catalystcenter_provisioning_settings_v1": resourceProvisioningSettings(), + "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id": resourceSdaFabricsVLANToSSIDsFabricID(), + "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id_v1": resourceSdaFabricsVLANToSSIDsFabricID(), + "catalystcenter_sda_layer2_virtual_networks": resourceSdaLayer2VirtualNetworks(), + "catalystcenter_sda_layer2_virtual_networks_v1": resourceSdaLayer2VirtualNetworks(), + "catalystcenter_sda_layer3_virtual_networks": resourceSdaLayer3VirtualNetworks(), + "catalystcenter_sda_layer3_virtual_networks_v1": resourceSdaLayer3VirtualNetworks(), + "catalystcenter_sda_multicast_virtual_networks": resourceSdaMulticastVirtualNetworks(), + "catalystcenter_sda_multicast_virtual_networks_v1": resourceSdaMulticastVirtualNetworks(), + "catalystcenter_sda_port_channels": resourceSdaPortChannels(), + "catalystcenter_sda_port_channels_v1": resourceSdaPortChannels(), + "catalystcenter_sda_transit_networks": resourceSdaTransitNetworks(), + "catalystcenter_sda_transit_networks_v1": resourceSdaTransitNetworks(), + "catalystcenter_sites_aaa_settings": resourceSitesAAASettings(), + "catalystcenter_sites_aaa_settings_v1": resourceSitesAAASettings(), + "catalystcenter_sites_banner_settings": resourceSitesBannerSettings(), + "catalystcenter_sites_banner_settings_v1": resourceSitesBannerSettings(), + "catalystcenter_sites_device_credentials": resourceSitesDeviceCredentials(), + "catalystcenter_sites_device_credentials_v1": resourceSitesDeviceCredentials(), + "catalystcenter_sites_dhcp_settings": resourceSitesDhcpSettings(), + "catalystcenter_sites_dhcp_settings_v1": resourceSitesDhcpSettings(), + "catalystcenter_sites_dns_settings": resourceSitesDNSSettings(), + "catalystcenter_sites_dns_settings_v1": resourceSitesDNSSettings(), + "catalystcenter_sites_image_distribution_settings": resourceSitesImageDistributionSettings(), + "catalystcenter_sites_image_distribution_settings_v1": resourceSitesImageDistributionSettings(), + "catalystcenter_sites_ntp_settings": resourceSitesNtpSettings(), + "catalystcenter_sites_ntp_settings_v1": resourceSitesNtpSettings(), + "catalystcenter_sites_telemetry_settings": resourceSitesTelemetrySettings(), + "catalystcenter_sites_telemetry_settings_v1": resourceSitesTelemetrySettings(), + "catalystcenter_sites_time_zone_settings": resourceSitesTimeZoneSettings(), + "catalystcenter_sites_time_zone_settings_v1": resourceSitesTimeZoneSettings(), + "catalystcenter_sites_wireless_settings_ssids": resourceSitesWirelessSettingsSSIDs(), + "catalystcenter_sites_wireless_settings_ssids_v1": resourceSitesWirelessSettingsSSIDs(), + "catalystcenter_system_issue_definitions": resourceSystemIssueDefinitions(), + "catalystcenter_system_issue_definitions_v1": resourceSystemIssueDefinitions(), + "catalystcenter_wireless_profiles": resourceWirelessProfiles(), + "catalystcenter_wireless_profiles_v1": resourceWirelessProfiles(), + "catalystcenter_wireless_settings_dot11be_profiles": resourceWirelessSettingsDot11BeProfiles(), + "catalystcenter_wireless_settings_dot11be_profiles_v1": resourceWirelessSettingsDot11BeProfiles(), + "catalystcenter_wireless_settings_interfaces": resourceWirelessSettingsInterfaces(), + "catalystcenter_wireless_settings_interfaces_v1": resourceWirelessSettingsInterfaces(), + "catalystcenter_wireless_settings_rf_profiles": resourceWirelessSettingsRfProfiles(), + "catalystcenter_wireless_settings_rf_profiles_v1": resourceWirelessSettingsRfProfiles(), + "catalystcenter_floors_settings_v2": resourceFloorsSettingsV2(), + "catalystcenter_ipam_server_setting": resourceIPamServerSetting(), + "catalystcenter_ipam_server_setting_v1": resourceIPamServerSetting(), + "catalystcenter_analytics_endpoints": resourceAnalyticsEndpoints(), + "catalystcenter_analytics_endpoints_v1": resourceAnalyticsEndpoints(), + "catalystcenter_analytics_profiling_rules": resourceAnalyticsProfilingRules(), + "catalystcenter_analytics_profiling_rules_v1": resourceAnalyticsProfilingRules(), + "catalystcenter_security_threats_rogue_allowed_list": resourceSecurityThreatsRogueAllowedList(), + "catalystcenter_security_threats_rogue_allowed_list_v1": resourceSecurityThreatsRogueAllowedList(), + "catalystcenter_site_assign_credential": resourceSiteAssignCredential(), + "catalystcenter_site_assign_credential_v1": resourceSiteAssignCredential(), + "catalystcenter_wireless_provision_device_create": resourceWirelessProvisionDeviceCreate(), + "catalystcenter_wireless_provision_device_create_v1": resourceWirelessProvisionDeviceCreate(), + "catalystcenter_wireless_provision_device_update": resourceWirelessProvisionDeviceUpdate(), + "catalystcenter_wireless_provision_device_update_v1": resourceWirelessProvisionDeviceUpdate(), + "catalystcenter_wireless_provision_access_point": resourceWirelessProvisionAccessPoint(), + "catalystcenter_wireless_provision_access_point_v1": resourceWirelessProvisionAccessPoint(), + "catalystcenter_template_preview": resourceTemplatePreview(), + "catalystcenter_template_preview_v1": resourceTemplatePreview(), + "catalystcenter_sensor_test_template_duplicate": resourceSensorTestTemplateDuplicate(), + "catalystcenter_sensor_test_template_duplicate_v1": resourceSensorTestTemplateDuplicate(), + "catalystcenter_sensor_test_run": resourceSensorTestRun(), + "catalystcenter_sensor_test_run_v1": resourceSensorTestRun(), + "catalystcenter_sensor_test_create": resourceSensorTestCreate(), + "catalystcenter_sensor_test_create_v1": resourceSensorTestCreate(), + "catalystcenter_pnp_virtual_account_deregister": resourcePnpVirtualAccountDeregister(), + "catalystcenter_pnp_virtual_account_deregister_v1": resourcePnpVirtualAccountDeregister(), + "catalystcenter_pnp_server_profile_update": resourcePnpServerProfileUpdate(), + "catalystcenter_pnp_server_profile_update_v1": resourcePnpServerProfileUpdate(), + "catalystcenter_pnp_virtual_account_add": resourcePnpVirtualAccountAdd(), + "catalystcenter_pnp_virtual_account_add_v1": resourcePnpVirtualAccountAdd(), + "catalystcenter_pnp_virtual_account_devices_sync": resourcePnpVirtualAccountDevicesSync(), + "catalystcenter_pnp_virtual_account_devices_sync_v1": resourcePnpVirtualAccountDevicesSync(), + "catalystcenter_pnp_device_unclaim": resourcePnpDeviceUnclaim(), + "catalystcenter_pnp_device_unclaim_v1": resourcePnpDeviceUnclaim(), + "catalystcenter_pnp_device_config_preview": resourcePnpDeviceConfigPreview(), + "catalystcenter_pnp_device_config_preview_v1": resourcePnpDeviceConfigPreview(), + "catalystcenter_pnp_device_site_claim": resourcePnpDeviceSiteClaim(), + "catalystcenter_pnp_device_site_claim_v1": resourcePnpDeviceSiteClaim(), + "catalystcenter_pnp_device_reset": resourcePnpDeviceReset(), + "catalystcenter_pnp_device_reset_v1": resourcePnpDeviceReset(), + "catalystcenter_pnp_device_import": resourcePnpDeviceImport(), + "catalystcenter_pnp_device_import_v1": resourcePnpDeviceImport(), + "catalystcenter_pnp_device_claim": resourcePnpDeviceClaim(), + "catalystcenter_pnp_device_claim_v1": resourcePnpDeviceClaim(), + "catalystcenter_network_create": resourceNetworkCreate(), + "catalystcenter_network_create_v1": resourceNetworkCreate(), + "catalystcenter_network_update": resourceNetworkUpdate(), + "catalystcenter_network_update_v1": resourceNetworkUpdate(), + "catalystcenter_network_device_sync": resourceNetworkDeviceSync(), + "catalystcenter_network_device_sync_v1": resourceNetworkDeviceSync(), + "catalystcenter_network_device_export": resourceNetworkDeviceExport(), + "catalystcenter_network_device_export_v1": resourceNetworkDeviceExport(), + "catalystcenter_network_device_update_role": resourceNetworkDeviceUpdateRole(), + "catalystcenter_network_device_update_role_v1": resourceNetworkDeviceUpdateRole(), + "catalystcenter_command_runner_run_command": resourceCommandRunnerRunCommand(), + "catalystcenter_command_runner_run_command_v1": resourceCommandRunnerRunCommand(), + "catalystcenter_device_configurations_export": resourceDeviceConfigurationsExport(), + "catalystcenter_device_configurations_export_v1": resourceDeviceConfigurationsExport(), + "catalystcenter_itsm_integration_events_retry": resourceItsmIntegrationEventsRetry(), + "catalystcenter_itsm_integration_events_retry_v1": resourceItsmIntegrationEventsRetry(), + "catalystcenter_swim_image_url": resourceSwimImageURL(), + "catalystcenter_swim_image_url_v1": resourceSwimImageURL(), + "catalystcenter_swim_image_file": resourceSwimImageFile(), + "catalystcenter_swim_image_file_v1": resourceSwimImageFile(), + "catalystcenter_image_distribution": resourceImageDistribution(), + "catalystcenter_image_distribution_v1": resourceImageDistribution(), + "catalystcenter_image_device_activation": resourceImageDeviceActivation(), + "catalystcenter_image_device_activation_v1": resourceImageDeviceActivation(), + "catalystcenter_global_credential_update": resourceGlobalCredentialUpdate(), + "catalystcenter_global_credential_update_v1": resourceGlobalCredentialUpdate(), + "catalystcenter_global_credential_delete": resourceGlobalCredentialDelete(), + "catalystcenter_global_credential_delete_v1": resourceGlobalCredentialDelete(), + "catalystcenter_discovery_range_delete": resourceDiscoveryRangeDelete(), + "catalystcenter_discovery_range_delete_v1": resourceDiscoveryRangeDelete(), + "catalystcenter_device_replacement_deploy": resourceDeviceReplacementDeploy(), + "catalystcenter_device_replacement_deploy_v1": resourceDeviceReplacementDeploy(), + "catalystcenter_compliance": resourceCompliance(), + "catalystcenter_compliance_v1": resourceCompliance(), + "catalystcenter_wireless_provision_ssid_delete_reprovision": resourceWirelessProvisionSSIDDeleteReprovision(), + "catalystcenter_wireless_provision_ssid_delete_reprovision_v1": resourceWirelessProvisionSSIDDeleteReprovision(), + "catalystcenter_wireless_provision_ssid_create_provision": resourceWirelessProvisionSSIDCreateProvision(), + "catalystcenter_wireless_provision_ssid_create_provision_v1": resourceWirelessProvisionSSIDCreateProvision(), + "catalystcenter_sensor_test_template_edit": resourceSensorTestTemplateEdit(), + "catalystcenter_sensor_test_template_edit_v1": resourceSensorTestTemplateEdit(), + "catalystcenter_configuration_template_clone": resourceConfigurationTemplateClone(), + "catalystcenter_configuration_template_clone_v1": resourceConfigurationTemplateClone(), + "catalystcenter_deploy_template_v2": resourceDeployTemplateV2(), + "catalystcenter_configuration_template_export_project": resourceConfigurationTemplateExportProject(), + "catalystcenter_configuration_template_export_project_v1": resourceConfigurationTemplateExportProject(), + "catalystcenter_configuration_template_export_template": resourceConfigurationTemplateExportTemplate(), + "catalystcenter_configuration_template_export_template_v1": resourceConfigurationTemplateExportTemplate(), + "catalystcenter_configuration_template_import_project": resourceConfigurationTemplateImportProject(), + "catalystcenter_configuration_template_import_project_v1": resourceConfigurationTemplateImportProject(), + "catalystcenter_configuration_template_import_template": resourceConfigurationTemplateImportTemplate(), + "catalystcenter_configuration_template_import_template_v1": resourceConfigurationTemplateImportTemplate(), + "catalystcenter_app_policy_intent_create": resourceAppPolicyIntentCreate(), + "catalystcenter_app_policy_intent_create_v1": resourceAppPolicyIntentCreate(), + "catalystcenter_business_sda_wireless_controller_create": resourceBusinessSdaWirelessControllerCreate(), + "catalystcenter_business_sda_wireless_controller_create_v1": resourceBusinessSdaWirelessControllerCreate(), + "catalystcenter_business_sda_wireless_controller_delete": resourceBusinessSdaWirelessControllerDelete(), + "catalystcenter_business_sda_wireless_controller_delete_v1": resourceBusinessSdaWirelessControllerDelete(), + "catalystcenter_profiling_rules_in_bulk_create": resourceProfilingRulesInBulkCreate(), + "catalystcenter_profiling_rules_in_bulk_create_v1": resourceProfilingRulesInBulkCreate(), + "catalystcenter_assign_device_to_site": resourceAssignDeviceToSite(), + "catalystcenter_assign_device_to_site_v1": resourceAssignDeviceToSite(), + "catalystcenter_associate_site_to_network_profile": resourceAssociateSiteToNetworkProfile(), + "catalystcenter_associate_site_to_network_profile_v1": resourceAssociateSiteToNetworkProfile(), + "catalystcenter_pnp_device_authorize": resourcePnpDeviceAuthorize(), + "catalystcenter_pnp_device_authorize_v1": resourcePnpDeviceAuthorize(), + "catalystcenter_disassociate_site_to_network_profile": resourceDisassociateSiteToNetworkProfile(), + "catalystcenter_disassociate_site_to_network_profile_v1": resourceDisassociateSiteToNetworkProfile(), + "catalystcenter_event_email_config_create": resourceEventEmailConfigCreate(), + "catalystcenter_event_email_config_create_v1": resourceEventEmailConfigCreate(), + "catalystcenter_interface_update": resourceInterfaceUpdate(), + "catalystcenter_interface_update_v1": resourceInterfaceUpdate(), + "catalystcenter_interface_operation_create": resourceInterfaceOperationCreate(), + "catalystcenter_interface_operation_create_v1": resourceInterfaceOperationCreate(), + "catalystcenter_lan_automation_create": resourceLanAutomationCreate(), + "catalystcenter_lan_automation_create_v1": resourceLanAutomationCreate(), + "catalystcenter_lan_automation_delete": resourceLanAutomationDelete(), + "catalystcenter_lan_automation_delete_v1": resourceLanAutomationDelete(), + "catalystcenter_event_webhook_update": resourceEventWebhookUpdate(), + "catalystcenter_event_webhook_update_v1": resourceEventWebhookUpdate(), + "catalystcenter_syslog_config_update": resourceSyslogConfigUpdate(), + "catalystcenter_syslog_config_update_v1": resourceSyslogConfigUpdate(), + "catalystcenter_event_webhook_create": resourceEventWebhookCreate(), + "catalystcenter_event_webhook_create_v1": resourceEventWebhookCreate(), + "catalystcenter_syslog_config_create": resourceSyslogConfigCreate(), + "catalystcenter_syslog_config_create_v1": resourceSyslogConfigCreate(), + "catalystcenter_file_import": resourceFileImport(), + "catalystcenter_file_import_v1": resourceFileImport(), + "catalystcenter_event_email_config_update": resourceEventEmailConfigUpdate(), + "catalystcenter_event_email_config_update_v1": resourceEventEmailConfigUpdate(), + "catalystcenter_event_snmp_config_create": resourceEventSNMPConfigCreate(), + "catalystcenter_event_snmp_config_create_v1": resourceEventSNMPConfigCreate(), + "catalystcenter_event_snmp_config_update": resourceEventSNMPConfigUpdate(), + "catalystcenter_event_snmp_config_update_v1": resourceEventSNMPConfigUpdate(), + "catalystcenter_execute_suggested_actions_commands": resourceExecuteSuggestedActionsCommands(), + "catalystcenter_execute_suggested_actions_commands_v1": resourceExecuteSuggestedActionsCommands(), + "catalystcenter_wireless_accespoint_configuration": resourceWirelessAccespointConfiguration(), + "catalystcenter_wireless_accespoint_configuration_v1": resourceWirelessAccespointConfiguration(), + "catalystcenter_credential_to_site_by_siteid_create_v2": resourceCredentialToSiteBySiteidCreateV2(), + "catalystcenter_sp_profile_delete_v2": resourceSpProfileDeleteV2(), + "catalystcenter_flexible_report_execute": resourceFlexibleReportExecute(), + "catalystcenter_flexible_report_execute_v1": resourceFlexibleReportExecute(), + "catalystcenter_integrate_ise": resourceIntegrateIse(), + "catalystcenter_integrate_ise_v1": resourceIntegrateIse(), + "catalystcenter_lan_automation_update_device": resourceLanAutomationUpdateDevice(), + "catalystcenter_lan_automation_update_device_v1": resourceLanAutomationUpdateDevice(), + "catalystcenter_maps_export": resourceMapsExport(), + "catalystcenter_maps_export_v1": resourceMapsExport(), + "catalystcenter_maps_import_start": resourceMapsImportStart(), + "catalystcenter_maps_import_start_v1": resourceMapsImportStart(), + "catalystcenter_maps_import": resourceMapsImport(), + "catalystcenter_maps_import_v1": resourceMapsImport(), + "catalystcenter_maps_import_perform": resourceMapsImportPerform(), + "catalystcenter_maps_import_perform_v1": resourceMapsImportPerform(), + "catalystcenter_network_device_config_write_memory": resourceNetworkDeviceConfigWriteMemory(), + "catalystcenter_network_device_config_write_memory_v1": resourceNetworkDeviceConfigWriteMemory(), + "catalystcenter_network_device_user_defined_field_delete": resourceNetworkDeviceUserDefinedFieldDelete(), + "catalystcenter_network_device_user_defined_field_delete_v1": resourceNetworkDeviceUserDefinedFieldDelete(), + "catalystcenter_network_device_user_defined_field_update": resourceNetworkDeviceUserDefinedFieldUpdate(), + "catalystcenter_network_device_user_defined_field_update_v1": resourceNetworkDeviceUserDefinedFieldUpdate(), + "catalystcenter_network_device_management_address_update": resourceNetworkDeviceManagementAddressUpdate(), + "catalystcenter_network_device_management_address_update_v1": resourceNetworkDeviceManagementAddressUpdate(), + "catalystcenter_sda_anycast_gateways_create": resourceSdaAnycastGatewaysCreate(), + "catalystcenter_sda_anycast_gateways_create_v1": resourceSdaAnycastGatewaysCreate(), + "catalystcenter_sda_anycast_gateways_update": resourceSdaAnycastGatewaysUpdate(), + "catalystcenter_sda_anycast_gateways_update_v1": resourceSdaAnycastGatewaysUpdate(), + "catalystcenter_sda_anycast_gateways_delete": resourceSdaAnycastGatewaysDelete(), + "catalystcenter_sda_anycast_gateways_delete_v1": resourceSdaAnycastGatewaysDelete(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreate(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create_v1": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreate(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdate(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update_v1": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdate(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDelete(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete_v1": resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDelete(), + "catalystcenter_lan_automation_v2": resourceLanAutomationV2(), + "catalystcenter_lan_automation_update_v2": resourceLanAutomationUpdateV2(), + "catalystcenter_network_devices_interfaces_query_v2": resourceNetworkDevicesInterfacesQueryV2(), + "catalystcenter_wireless_accespoint_configuration_v2": resourceWirelessAccespointConfigurationV2(), + "catalystcenter_users_external_authentication_create": resourceUsersExternalAuthenticationCreate(), + "catalystcenter_users_external_authentication_create_v1": resourceUsersExternalAuthenticationCreate(), + "catalystcenter_assurance_events_query": resourceAssuranceEventsQuery(), + "catalystcenter_assurance_events_query_v1": resourceAssuranceEventsQuery(), + "catalystcenter_assurance_events_query_count": resourceAssuranceEventsQueryCount(), + "catalystcenter_assurance_events_query_count_v1": resourceAssuranceEventsQueryCount(), + "catalystcenter_assurance_issues_query": resourceAssuranceIssuesQuery(), + "catalystcenter_assurance_issues_query_v1": resourceAssuranceIssuesQuery(), + "catalystcenter_assurance_issues_query_count": resourceAssuranceIssuesQueryCount(), + "catalystcenter_assurance_issues_query_count_v1": resourceAssuranceIssuesQueryCount(), + "catalystcenter_assurance_issues_summary_analytics": resourceAssuranceIssuesSummaryAnalytics(), + "catalystcenter_assurance_issues_summary_analytics_v1": resourceAssuranceIssuesSummaryAnalytics(), + "catalystcenter_assurance_issues_top_n_analytics": resourceAssuranceIssuesTopNAnalytics(), + "catalystcenter_assurance_issues_top_n_analytics_v1": resourceAssuranceIssuesTopNAnalytics(), + "catalystcenter_assurance_issues_trend_analytics": resourceAssuranceIssuesTrendAnalytics(), + "catalystcenter_assurance_issues_trend_analytics_v1": resourceAssuranceIssuesTrendAnalytics(), + "catalystcenter_network_devices_query_count": resourceNetworkDevicesQueryCount(), + "catalystcenter_network_devices_query_count_v1": resourceNetworkDevicesQueryCount(), + "catalystcenter_clients_query": resourceClientsQuery(), + "catalystcenter_clients_query_v1": resourceClientsQuery(), + "catalystcenter_clients_query_count": resourceClientsQueryCount(), + "catalystcenter_clients_query_count_v1": resourceClientsQueryCount(), + "catalystcenter_clients_summary_analytics": resourceClientsSummaryAnalytics(), + "catalystcenter_clients_summary_analytics_v1": resourceClientsSummaryAnalytics(), + "catalystcenter_clients_top_n_analytics": resourceClientsTopNAnalytics(), + "catalystcenter_clients_top_n_analytics_v1": resourceClientsTopNAnalytics(), + "catalystcenter_clients_trend_analytics": resourceClientsTrendAnalytics(), + "catalystcenter_clients_trend_analytics_v1": resourceClientsTrendAnalytics(), + "catalystcenter_clients_trend_analytics_id": resourceClientsTrendAnalyticsID(), + "catalystcenter_clients_trend_analytics_id_v1": resourceClientsTrendAnalyticsID(), + "catalystcenter_interfaces_query": resourceInterfacesQuery(), + "catalystcenter_interfaces_query_v1": resourceInterfacesQuery(), + "catalystcenter_interfaces_query_count": resourceInterfacesQueryCount(), + "catalystcenter_interfaces_query_count_v1": resourceInterfacesQueryCount(), + "catalystcenter_network_devices_query": resourceNetworkDevicesQuery(), + "catalystcenter_network_devices_query_v1": resourceNetworkDevicesQuery(), + "catalystcenter_network_devices_summary_analytics": resourceNetworkDevicesSummaryAnalytics(), + "catalystcenter_network_devices_summary_analytics_v1": resourceNetworkDevicesSummaryAnalytics(), + "catalystcenter_network_devices_trend_analytics": resourceNetworkDevicesTrendAnalytics(), + "catalystcenter_network_devices_trend_analytics_v1": resourceNetworkDevicesTrendAnalytics(), + "catalystcenter_network_devices_trend_analytics_id": resourceNetworkDevicesTrendAnalyticsID(), + "catalystcenter_network_devices_trend_analytics_id_v1": resourceNetworkDevicesTrendAnalyticsID(), + "catalystcenter_site_health_summaries_summary_analytics_create": resourceSiteHealthSummariesSummaryAnalyticsCreate(), + "catalystcenter_site_health_summaries_summary_analytics_create_v1": resourceSiteHealthSummariesSummaryAnalyticsCreate(), + "catalystcenter_assurance_issues_ignore": resourceAssuranceIssuesIgnore(), + "catalystcenter_assurance_issues_ignore_v1": resourceAssuranceIssuesIgnore(), + "catalystcenter_assurance_issues_resolve": resourceAssuranceIssuesResolve(), + "catalystcenter_assurance_issues_resolve_v1": resourceAssuranceIssuesResolve(), + "catalystcenter_assurance_issues_update": resourceAssuranceIssuesUpdate(), + "catalystcenter_assurance_issues_update_v1": resourceAssuranceIssuesUpdate(), + "catalystcenter_network_devices_issues_remediation_provision": resourceNetworkDevicesIssuesRemediationProvision(), + "catalystcenter_network_devices_issues_remediation_provision_v1": resourceNetworkDevicesIssuesRemediationProvision(), + "catalystcenter_images_download": resourceImagesDownload(), + "catalystcenter_images_download_v1": resourceImagesDownload(), + "catalystcenter_assign_to_site_apply": resourceAssignToSiteApply(), + "catalystcenter_assign_to_site_apply_v1": resourceAssignToSiteApply(), + "catalystcenter_network_devices_resync_interval_settings": resourceNetworkDevicesResyncIntervalSettings(), + "catalystcenter_network_devices_resync_interval_settings_v1": resourceNetworkDevicesResyncIntervalSettings(), + "catalystcenter_network_devices_resync_interval_settings_override": resourceNetworkDevicesResyncIntervalSettingsOverride(), + "catalystcenter_network_devices_resync_interval_settings_override_v1": resourceNetworkDevicesResyncIntervalSettingsOverride(), + "catalystcenter_network_devices_unassign_from_site_apply": resourceNetworkDevicesUnassignFromSiteApply(), + "catalystcenter_network_devices_unassign_from_site_apply_v1": resourceNetworkDevicesUnassignFromSiteApply(), + "catalystcenter_network_profiles_for_sites_site_assignments_bulk_create": resourceNetworkProfilesForSitesSiteAssignmentsBulkCreate(), + "catalystcenter_network_profiles_for_sites_site_assignments_bulk_create_v1": resourceNetworkProfilesForSitesSiteAssignmentsBulkCreate(), + "catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete": resourceNetworkProfilesForSitesSiteAssignmentsBulkDelete(), + "catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete_v1": resourceNetworkProfilesForSitesSiteAssignmentsBulkDelete(), + "catalystcenter_sda_multicast_v1_update": resourceSdaMulticastV1Update(), + "catalystcenter_sda_multicast_v1_update_v1": resourceSdaMulticastV1Update(), + "catalystcenter_sites_bulk": resourceSitesBulk(), + "catalystcenter_sites_bulk_v1": resourceSitesBulk(), + "catalystcenter_sites_device_credentials_apply": resourceSitesDeviceCredentialsApply(), + "catalystcenter_sites_device_credentials_apply_v1": resourceSitesDeviceCredentialsApply(), + "catalystcenter_telemetry_settings_apply": resourceTelemetrySettingsApply(), + "catalystcenter_telemetry_settings_apply_v1": resourceTelemetrySettingsApply(), + "catalystcenter_trusted_certificates_import": resourceTrustedCertificatesImport(), + "catalystcenter_trusted_certificates_import_v1": resourceTrustedCertificatesImport(), + "catalystcenter_wireless_access_points_factory_reset_request_provision": resourceWirelessAccessPointsFactoryResetRequestProvision(), + "catalystcenter_wireless_access_points_factory_reset_request_provision_v1": resourceWirelessAccessPointsFactoryResetRequestProvision(), + "catalystcenter_wireless_access_points_provision": resourceWirelessAccessPointsProvision(), + "catalystcenter_wireless_access_points_provision_v1": resourceWirelessAccessPointsProvision(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision": resourceWirelessControllersWirelessMobilityGroupsMobilityProvision(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision_v1": resourceWirelessControllersWirelessMobilityGroupsMobilityProvision(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset": resourceWirelessControllersWirelessMobilityGroupsMobilityReset(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset_v1": resourceWirelessControllersWirelessMobilityGroupsMobilityReset(), + "catalystcenter_wireless_controllers_assign_managed_ap_locations": resourceWirelessControllersAssignManagedApLocations(), + "catalystcenter_wireless_controllers_assign_managed_ap_locations_v1": resourceWirelessControllersAssignManagedApLocations(), + "catalystcenter_wireless_controllers_provision": resourceWirelessControllersProvision(), + "catalystcenter_wireless_controllers_provision_v1": resourceWirelessControllersProvision(), + "catalystcenter_floors_upload_image_v2": resourceFloorsUploadImageV2(), + "catalystcenter_interfaces_members_associations_query": resourceInterfacesMembersAssociationsQuery(), + "catalystcenter_interfaces_members_associations_query_v1": resourceInterfacesMembersAssociationsQuery(), + "catalystcenter_network_devices_members_associations_query": resourceNetworkDevicesMembersAssociationsQuery(), + "catalystcenter_network_devices_members_associations_query_v1": resourceNetworkDevicesMembersAssociationsQuery(), + "catalystcenter_analytics_cmdb_endpoints": resourceAnalyticsCmdbEndpoints(), + "catalystcenter_analytics_cmdb_endpoints_v1": resourceAnalyticsCmdbEndpoints(), + "catalystcenter_analytics_endpoints_anc_policy_update": resourceAnalyticsEndpointsAncPolicyUpdate(), + "catalystcenter_analytics_endpoints_anc_policy_update_v1": resourceAnalyticsEndpointsAncPolicyUpdate(), + "catalystcenter_analytics_endpoints_anc_policy_delete": resourceAnalyticsEndpointsAncPolicyDelete(), + "catalystcenter_analytics_endpoints_anc_policy_delete_v1": resourceAnalyticsEndpointsAncPolicyDelete(), + "catalystcenter_analytics_profiling_rules_bulk": resourceAnalyticsProfilingRulesBulk(), + "catalystcenter_analytics_profiling_rules_bulk_v1": resourceAnalyticsProfilingRulesBulk(), + "catalystcenter_security_rogue_additional_details": resourceSecurityRogueAdditionalDetails(), + "catalystcenter_security_rogue_additional_details_v1": resourceSecurityRogueAdditionalDetails(), + "catalystcenter_security_rogue_additional_details_count": resourceSecurityRogueAdditionalDetailsCount(), + "catalystcenter_security_rogue_additional_details_count_v1": resourceSecurityRogueAdditionalDetailsCount(), + "catalystcenter_security_rogue_wireless_containment_start": resourceSecurityRogueWirelessContainmentStart(), + "catalystcenter_security_rogue_wireless_containment_start_v1": resourceSecurityRogueWirelessContainmentStart(), + "catalystcenter_security_rogue_wireless_containment_stop": resourceSecurityRogueWirelessContainmentStop(), + "catalystcenter_security_rogue_wireless_containment_stop_v1": resourceSecurityRogueWirelessContainmentStop(), + "catalystcenter_security_threats_details": resourceSecurityThreatsDetails(), + "catalystcenter_security_threats_details_v1": resourceSecurityThreatsDetails(), + "catalystcenter_security_threats_details_count": resourceSecurityThreatsDetailsCount(), + "catalystcenter_security_threats_details_count_v1": resourceSecurityThreatsDetailsCount(), + "catalystcenter_security_threats_summary": resourceSecurityThreatsSummary(), + "catalystcenter_security_threats_summary_v1": resourceSecurityThreatsSummary(), + "catalystcenter_tags_interfaces_members_associations_query": resourceTagsInterfacesMembersAssociationsQuery(), + "catalystcenter_tags_interfaces_members_associations_query_v1": resourceTagsInterfacesMembersAssociationsQuery(), + "catalystcenter_tags_network_devices_members_associations_query": resourceTagsNetworkDevicesMembersAssociationsQuery(), + "catalystcenter_tags_network_devices_members_associations_query_v1": resourceTagsNetworkDevicesMembersAssociationsQuery(), + "catalystcenter_global_credential_snmpv2_write_community": resourceGlobalCredentialSNMPv2WriteCommunity(), + "catalystcenter_global_credential_snmpv2_read_community": resourceGlobalCredentialSNMPv2ReadCommunity(), + "catalystcenter_global_credential_netconf": resourceGlobalCredentialNetconf(), + "catalystcenter_global_credential_http_write": resourceGlobalCredentialHTTPWrite(), + "catalystcenter_global_credential_http_read": resourceGlobalCredentialHTTPRead(), + "catalystcenter_global_credential_cli": resourceGlobalCredentialCli(), + "catalystcenter_area": resourceArea(), + "catalystcenter_building": resourceBuilding(), + "catalystcenter_floor": resourceFloor(), + "catalystcenter_global_credential_snmpv2_write_community_v1": resourceGlobalCredentialSNMPv2WriteCommunity(), + "catalystcenter_global_credential_snmpv2_read_community_v1": resourceGlobalCredentialSNMPv2ReadCommunity(), + "catalystcenter_global_credential_netconf_v1": resourceGlobalCredentialNetconf(), + "catalystcenter_global_credential_http_write_v1": resourceGlobalCredentialHTTPWrite(), + "catalystcenter_global_credential_http_read_v1": resourceGlobalCredentialHTTPRead(), + "catalystcenter_global_credential_cli_v1": resourceGlobalCredentialCli(), + "catalystcenter_area_v1": resourceArea(), + "catalystcenter_building_v1": resourceBuilding(), + "catalystcenter_floor_v1": resourceFloor(), }, DataSourcesMap: map[string]*schema.Resource{ - "catalystcenter_reserve_ip_subpool": dataSourceReserveIPSubpool(), - "catalystcenter_wireless_rf_profile": dataSourceWirelessRfProfile(), - "catalystcenter_wireless_profile": dataSourceWirelessProfile(), - "catalystcenter_configuration_template_project": dataSourceConfigurationTemplateProject(), - "catalystcenter_tag": dataSourceTag(), - "catalystcenter_snmp_properties": dataSourceSNMPProperties(), - "catalystcenter_pnp_global_settings": dataSourcePnpGlobalSettings(), - "catalystcenter_network_device_list": dataSourceNetworkDeviceList(), - "catalystcenter_network_device": dataSourceNetworkDevice(), - "catalystcenter_global_pool": dataSourceGlobalPool(), - "catalystcenter_path_trace": dataSourcePathTrace(), - "catalystcenter_transit_peer_network": dataSourceTransitPeerNetwork(), - "catalystcenter_business_sda_virtual_network_summary": dataSourceBusinessSdaVirtualNetworkSummary(), - "catalystcenter_event_subscription_syslog": dataSourceEventSubscriptionSyslog(), - "catalystcenter_event_subscription_rest": dataSourceEventSubscriptionRest(), - "catalystcenter_event_subscription_email": dataSourceEventSubscriptionEmail(), - "catalystcenter_event_subscription": dataSourceEventSubscription(), - "catalystcenter_wireless_dynamic_interface": dataSourceWirelessDynamicInterface(), - "catalystcenter_wireless_enterprise_ssid": dataSourceWirelessEnterpriseSSID(), - "catalystcenter_discovery": dataSourceDiscovery(), - "catalystcenter_device_replacement": dataSourceDeviceReplacement(), - "catalystcenter_reports": dataSourceReports(), - "catalystcenter_sda_multicast": dataSourceSdaMulticast(), - "catalystcenter_sda_virtual_network_v2": dataSourceSdaVirtualNetworkV2(), - "catalystcenter_sda_provision_device": dataSourceSdaProvisionDevice(), - "catalystcenter_sda_virtual_network_ip_pool": dataSourceSdaVirtualNetworkIPPool(), - "catalystcenter_sda_virtual_network": dataSourceSdaVirtualNetwork(), - "catalystcenter_sda_port_assignment_for_user_device": dataSourceSdaPortAssignmentForUserDevice(), - "catalystcenter_sda_port_assignment_for_access_point": dataSourceSdaPortAssignmentForAccessPoint(), - "catalystcenter_sda_fabric_site": dataSourceSdaFabricSite(), - "catalystcenter_sda_fabric_edge_device": dataSourceSdaFabricEdgeDevice(), - "catalystcenter_sda_fabric_control_plane_device": dataSourceSdaFabricControlPlaneDevice(), - "catalystcenter_sda_fabric_border_device": dataSourceSdaFabricBorderDevice(), - "catalystcenter_sda_fabric_authentication_profile": dataSourceSdaFabricAuthenticationProfile(), - "catalystcenter_applications": dataSourceApplications(), - "catalystcenter_application_sets": dataSourceApplicationSets(), - "catalystcenter_pnp_workflow": dataSourcePnpWorkflow(), - "catalystcenter_pnp_device": dataSourcePnpDevice(), - "catalystcenter_configuration_template": dataSourceConfigurationTemplate(), - "catalystcenter_app_policy_queuing_profile": dataSourceAppPolicyQueuingProfile(), - "catalystcenter_business_sda_hostonboarding_ssid_ippool": dataSourceBusinessSdaHostonboardingSSIDIPpool(), - "catalystcenter_qos_device_interface": dataSourceQosDeviceInterface(), - "catalystcenter_tag_member": dataSourceTagMember(), - "catalystcenter_site": dataSourceSite(), - "catalystcenter_service_provider": dataSourceServiceProvider(), - "catalystcenter_sensor": dataSourceSensor(), - "catalystcenter_network": dataSourceNetwork(), - "catalystcenter_itsm_integration_events_failed": dataSourceItsmIntegrationEventsFailed(), - "catalystcenter_device_credential": dataSourceDeviceCredential(), - "catalystcenter_event_artifact_count": dataSourceEventArtifactCount(), - "catalystcenter_event_artifact": dataSourceEventArtifact(), - "catalystcenter_user_enrichment_details": dataSourceUserEnrichmentDetails(), - "catalystcenter_topology_vlan_details": dataSourceTopologyVLANDetails(), - "catalystcenter_topology_site": dataSourceTopologySite(), - "catalystcenter_topology_physical": dataSourceTopologyPhysical(), - "catalystcenter_topology_layer_3": dataSourceTopologyLayer3(), - "catalystcenter_topology_layer_2": dataSourceTopologyLayer2(), - "catalystcenter_configuration_template_version": dataSourceConfigurationTemplateVersion(), - "catalystcenter_configuration_template_deploy_status": dataSourceConfigurationTemplateDeployStatus(), - "catalystcenter_network_device_chassis_details": dataSourceNetworkDeviceChassisDetails(), - "catalystcenter_network_device_linecard_details": dataSourceNetworkDeviceLinecardDetails(), - "catalystcenter_network_device_stack_details": dataSourceNetworkDeviceStackDetails(), - "catalystcenter_network_device_supervisor_card_details": dataSourceNetworkDeviceSupervisorCardDetails(), - "catalystcenter_network_device_inventory_insight_link_mismatch": dataSourceNetworkDeviceInventoryInsightLinkMismatch(), - "catalystcenter_network_device_interface_poe": dataSourceNetworkDeviceInterfacePoe(), - "catalystcenter_system_health": dataSourceSystemHealth(), - "catalystcenter_system_health_count": dataSourceSystemHealthCount(), - "catalystcenter_system_performance": dataSourceSystemPerformance(), - "catalystcenter_system_performance_historical": dataSourceSystemPerformanceHistorical(), - "catalystcenter_platform_nodes_configuration_summary": dataSourcePlatformNodesConfigurationSummary(), - "catalystcenter_platform_release_summary": dataSourcePlatformReleaseSummary(), - "catalystcenter_task_operation": dataSourceTaskOperation(), - "catalystcenter_task_count": dataSourceTaskCount(), - "catalystcenter_task_tree": dataSourceTaskTree(), - "catalystcenter_task": dataSourceTask(), - "catalystcenter_tag_member_type": dataSourceTagMemberType(), - "catalystcenter_tag_count": dataSourceTagCount(), - "catalystcenter_tag_member_count": dataSourceTagMemberCount(), - "catalystcenter_site_count": dataSourceSiteCount(), - "catalystcenter_site_health": dataSourceSiteHealth(), - "catalystcenter_security_advisories_per_device": dataSourceSecurityAdvisoriesPerDevice(), - "catalystcenter_security_advisories_ids_per_device": dataSourceSecurityAdvisoriesIDsPerDevice(), - "catalystcenter_security_advisories_summary": dataSourceSecurityAdvisoriesSummary(), - "catalystcenter_security_advisories_devices": dataSourceSecurityAdvisoriesDevices(), - "catalystcenter_security_advisories": dataSourceSecurityAdvisories(), - "catalystcenter_pnp_workflow_count": dataSourcePnpWorkflowCount(), - "catalystcenter_pnp_virtual_accounts": dataSourcePnpVirtualAccounts(), - "catalystcenter_pnp_smart_account_domains": dataSourcePnpSmartAccountDomains(), - "catalystcenter_pnp_virtual_account_sync_result": dataSourcePnpVirtualAccountSyncResult(), - "catalystcenter_pnp_device_history": dataSourcePnpDeviceHistory(), - "catalystcenter_pnp_device_count": dataSourcePnpDeviceCount(), - "catalystcenter_topology_network_health": dataSourceTopologyNetworkHealth(), - "catalystcenter_network_device_register_for_wsa": dataSourceNetworkDeviceRegisterForWsa(), - "catalystcenter_network_device_by_serial_number": dataSourceNetworkDeviceBySerialNumber(), - "catalystcenter_network_device_module_count": dataSourceNetworkDeviceModuleCount(), - "catalystcenter_network_device_module": dataSourceNetworkDeviceModule(), - "catalystcenter_network_device_by_ip": dataSourceNetworkDeviceByIP(), - "catalystcenter_network_device_functional_capability": dataSourceNetworkDeviceFunctionalCapability(), - "catalystcenter_network_device_count": dataSourceNetworkDeviceCount(), - "catalystcenter_network_device_config_count": dataSourceNetworkDeviceConfigCount(), - "catalystcenter_network_device_config": dataSourceNetworkDeviceConfig(), - "catalystcenter_network_device_global_polling_interval": dataSourceNetworkDeviceGlobalPollingInterval(), - "catalystcenter_network_device_lexicographically_sorted": dataSourceNetworkDeviceLexicographicallySorted(), - "catalystcenter_network_device_range": dataSourceNetworkDeviceRange(), - "catalystcenter_network_device_wireless_lan": dataSourceNetworkDeviceWirelessLan(), - "catalystcenter_network_device_vlan": dataSourceNetworkDeviceVLAN(), - "catalystcenter_network_device_meraki_organization": dataSourceNetworkDeviceMerakiOrganization(), - "catalystcenter_network_device_polling_interval": dataSourceNetworkDevicePollingInterval(), - "catalystcenter_network_device_summary": dataSourceNetworkDeviceSummary(), - "catalystcenter_network_device_poe": dataSourceNetworkDevicePoe(), - "catalystcenter_network_device_equipment": dataSourceNetworkDeviceEquipment(), - "catalystcenter_dna_command_runner_keywords": dataSourceDnaCommandRunnerKeywords(), - "catalystcenter_site_membership": dataSourceSiteMembership(), - "catalystcenter_issues": dataSourceIssues(), - "catalystcenter_issues_enrichment_details": dataSourceIssuesEnrichmentDetails(), - "catalystcenter_device_interface_ospf": dataSourceDeviceInterfaceOspf(), - "catalystcenter_interface_network_device_detail": dataSourceInterfaceNetworkDeviceDetail(), - "catalystcenter_interface_network_device": dataSourceInterfaceNetworkDevice(), - "catalystcenter_interface_network_device_range": dataSourceInterfaceNetworkDeviceRange(), - "catalystcenter_device_interface_isis": dataSourceDeviceInterfaceIsis(), - "catalystcenter_device_interface_by_ip": dataSourceDeviceInterfaceByIP(), - "catalystcenter_device_interface_count": dataSourceDeviceInterfaceCount(), - "catalystcenter_device_interface": dataSourceDeviceInterface(), - "catalystcenter_swim_image_details": dataSourceSwimImageDetails(), - "catalystcenter_global_credential": dataSourceGlobalCredential(), - "catalystcenter_file_namespaces": dataSourceFileNamespaces(), - "catalystcenter_file_namespace_files": dataSourceFileNamespaceFiles(), - "catalystcenter_file": dataSourceFile(), - "catalystcenter_event_count": dataSourceEventCount(), - "catalystcenter_event": dataSourceEvent(), - "catalystcenter_event_subscription_count": dataSourceEventSubscriptionCount(), - "catalystcenter_event_subscription_details_syslog": dataSourceEventSubscriptionDetailsSyslog(), - "catalystcenter_event_subscription_details_rest": dataSourceEventSubscriptionDetailsRest(), - "catalystcenter_event_subscription_details_email": dataSourceEventSubscriptionDetailsEmail(), - "catalystcenter_event_series_count": dataSourceEventSeriesCount(), - "catalystcenter_event_series": dataSourceEventSeries(), - "catalystcenter_event_api_status": dataSourceEventAPIStatus(), - "catalystcenter_discovery_count": dataSourceDiscoveryCount(), - "catalystcenter_discovery_range": dataSourceDiscoveryRange(), - "catalystcenter_discovery_summary": dataSourceDiscoverySummary(), - "catalystcenter_discovery_device_count": dataSourceDiscoveryDeviceCount(), - "catalystcenter_discovery_device": dataSourceDiscoveryDevice(), - "catalystcenter_discovery_device_range": dataSourceDiscoveryDeviceRange(), - "catalystcenter_discovery_job_by_id": dataSourceDiscoveryJobByID(), - "catalystcenter_discovery_jobs": dataSourceDiscoveryJobs(), - "catalystcenter_device_replacement_count": dataSourceDeviceReplacementCount(), - "catalystcenter_device_health": dataSourceDeviceHealth(), - "catalystcenter_device_enrichment_details": dataSourceDeviceEnrichmentDetails(), - "catalystcenter_device_details": dataSourceDeviceDetails(), - "catalystcenter_reports_view_group_view": dataSourceReportsViewGroupView(), - "catalystcenter_reports_view_group": dataSourceReportsViewGroup(), - "catalystcenter_reports_executions_download": dataSourceReportsExecutionsDownload(), - "catalystcenter_reports_executions": dataSourceReportsExecutions(), - "catalystcenter_compliance_device_status_count": dataSourceComplianceDeviceStatusCount(), - "catalystcenter_compliance_device_details_count": dataSourceComplianceDeviceDetailsCount(), - "catalystcenter_compliance_device_details": dataSourceComplianceDeviceDetails(), - "catalystcenter_compliance_device_by_id_detail": dataSourceComplianceDeviceByIDDetail(), - "catalystcenter_compliance_device": dataSourceComplianceDevice(), - "catalystcenter_compliance_device_by_id": dataSourceComplianceDeviceByID(), - "catalystcenter_itsm_cmdb_sync_status": dataSourceItsmCmdbSyncStatus(), - "catalystcenter_client_proximity": dataSourceClientProximity(), - "catalystcenter_client_health": dataSourceClientHealth(), - "catalystcenter_client_enrichment_details": dataSourceClientEnrichmentDetails(), - "catalystcenter_client_detail": dataSourceClientDetail(), - "catalystcenter_sda_device_role": dataSourceSdaDeviceRole(), - "catalystcenter_sda_device": dataSourceSdaDevice(), - "catalystcenter_wireless_sensor_test_results": dataSourceWirelessSensorTestResults(), - "catalystcenter_applications_count": dataSourceApplicationsCount(), - "catalystcenter_application_sets_count": dataSourceApplicationSetsCount(), - "catalystcenter_applications_health": dataSourceApplicationsHealth(), - "catalystcenter_event_series_audit_logs": dataSourceEventSeriesAuditLogs(), - "catalystcenter_event_series_audit_logs_summary": dataSourceEventSeriesAuditLogsSummary(), - "catalystcenter_event_series_audit_logs_parent_records": dataSourceEventSeriesAuditLogsParentRecords(), - "catalystcenter_license_device_count": dataSourceLicenseDeviceCount(), - "catalystcenter_license_device_license_details": dataSourceLicenseDeviceLicenseDetails(), - "catalystcenter_license_device_license_summary": dataSourceLicenseDeviceLicenseSummary(), - "catalystcenter_license_term_details": dataSourceLicenseTermDetails(), - "catalystcenter_license_usage_details": dataSourceLicenseUsageDetails(), - "catalystcenter_license_device": dataSourceLicenseDevice(), - "catalystcenter_license_virtual_account_details": dataSourceLicenseVirtualAccountDetails(), - "catalystcenter_app_policy": dataSourceAppPolicy(), - "catalystcenter_app_policy_default": dataSourceAppPolicyDefault(), - "catalystcenter_app_policy_queuing_profile_count": dataSourceAppPolicyQueuingProfileCount(), - "catalystcenter_dnacaap_management_execution_status": dataSourceDnacaapManagementExecutionStatus(), - "catalystcenter_device_family_identifiers_details": dataSourceDeviceFamilyIDentifiersDetails(), - "catalystcenter_golden_tag_image": dataSourceGoldenTagImage(), - "catalystcenter_qos_device_interface_info_count": dataSourceQosDeviceInterfaceInfoCount(), - "catalystcenter_projects_details": dataSourceProjectsDetails(), - "catalystcenter_templates_details": dataSourceTemplatesDetails(), - "catalystcenter_network_device_interface_neighbor": dataSourceNetworkDeviceInterfaceNeighbor(), - "catalystcenter_lan_automation_log": dataSourceLanAutomationLog(), - "catalystcenter_buildings_planned_access_points": dataSourceBuildingsPlannedAccessPoints(), - "catalystcenter_lan_automation_status": dataSourceLanAutomationStatus(), - "catalystcenter_interface": dataSourceInterface(), - "catalystcenter_event_config_connector_types": dataSourceEventConfigConnectorTypes(), - "catalystcenter_lan_automation_count": dataSourceLanAutomationCount(), - "catalystcenter_planned_access_points": dataSourcePlannedAccessPoints(), - "catalystcenter_authentication_policy_servers": dataSourceAuthenticationPolicyServers(), - "catalystcenter_device_reboot_apreboot": dataSourceDeviceRebootApreboot(), - "catalystcenter_dnac_packages": dataSourceDnacPackages(), - "catalystcenter_eox_status_device": dataSourceEoxStatusDevice(), - "catalystcenter_eox_status_summary": dataSourceEoxStatusSummary(), - "catalystcenter_event_email_config": dataSourceEventEmailConfig(), - "catalystcenter_event_syslog_config": dataSourceEventSyslogConfig(), - "catalystcenter_integration_settings_instances_itsm": dataSourceIntegrationSettingsInstancesItsm(), - "catalystcenter_lan_automation_log_by_serial_number": dataSourceLanAutomationLogBySerialNumber(), - "catalystcenter_network_device_user_defined_field": dataSourceNetworkDeviceUserDefinedField(), - "catalystcenter_accesspoint_configuration_details_by_task_id": dataSourceAccesspointConfigurationDetailsByTaskID(), - "catalystcenter_wireless_accesspoint_configuration_summary": dataSourceWirelessAccesspointConfigurationSummary(), - "catalystcenter_global_credential_v2": dataSourceGlobalCredentialV2(), - "catalystcenter_network_v2": dataSourceNetworkV2(), - "catalystcenter_service_provider_v2": dataSourceServiceProviderV2(), - "catalystcenter_role_permissions": dataSourceRolePermissions(), - "catalystcenter_roles": dataSourceRoles(), - "catalystcenter_user": dataSourceUser(), - "catalystcenter_users_external_servers": dataSourceUsersExternalServers(), - "catalystcenter_flexible_report_content": dataSourceFlexibleReportContent(), - "catalystcenter_flexible_report_executions": dataSourceFlexibleReportExecutions(), - "catalystcenter_flexible_report_schedule": dataSourceFlexibleReportSchedule(), - "catalystcenter_flexible_report_schedules": dataSourceFlexibleReportSchedules(), - "catalystcenter_dna_event_snmp_config": dataSourceDnaEventSNMPConfig(), - "catalystcenter_integration_settings_itsm_instances": dataSourceIntegrationSettingsItsmInstances(), - "catalystcenter_integration_settings_status": dataSourceIntegrationSettingsStatus(), - "catalystcenter_ise_integration_status": dataSourceIseIntegrationStatus(), - "catalystcenter_lan_automation_sessions": dataSourceLanAutomationSessions(), - "catalystcenter_maps_import_status": dataSourceMapsImportStatus(), - "catalystcenter_maps_supported_access_points": dataSourceMapsSupportedAccessPoints(), - "catalystcenter_network_device_config_": dataSourceNetworkDeviceConfig(), - "catalystcenter_network_device_config_task": dataSourceNetworkDeviceConfigTask(), - "catalystcenter_network_device_ip_address": dataSourceNetworkDeviceIPAddress(), - "catalystcenter_sda_anycast_gateways": dataSourceSdaAnycastGateways(), - "catalystcenter_sda_anycast_gateways_count": dataSourceSdaAnycastGatewaysCount(), - "catalystcenter_sda_authentication_profiles": dataSourceSdaAuthenticationProfiles(), - "catalystcenter_sda_extranet_policies": dataSourceSdaExtranetPolicies(), - "catalystcenter_sda_extranet_policies_count": dataSourceSdaExtranetPoliciesCount(), - "catalystcenter_sda_fabric_devices": dataSourceSdaFabricDevices(), - "catalystcenter_sda_fabric_devices_count": dataSourceSdaFabricDevicesCount(), - "catalystcenter_sda_fabric_devices_layer2_handoffs": dataSourceSdaFabricDevicesLayer2Handoffs(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_count": dataSourceSdaFabricDevicesLayer2HandoffsCount(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits": dataSourceSdaFabricDevicesLayer2HandoffsIPTransits(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits_count": dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsCount(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits": dataSourceSdaFabricDevicesLayer2HandoffsSdaTransits(), - "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_count": dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsCount(), - "catalystcenter_sda_fabric_sites": dataSourceSdaFabricSites(), - "catalystcenter_sda_fabric_sites_count": dataSourceSdaFabricSitesCount(), - "catalystcenter_sda_fabric_zones": dataSourceSdaFabricZones(), - "catalystcenter_sda_fabric_zones_count": dataSourceSdaFabricZonesCount(), - "catalystcenter_sda_port_assignments": dataSourceSdaPortAssignments(), - "catalystcenter_sda_port_assignments_count": dataSourceSdaPortAssignmentsCount(), - "catalystcenter_sda_provision_devices": dataSourceSdaProvisionDevices(), - "catalystcenter_sda_provision_devices_count": dataSourceSdaProvisionDevicesCount(), - "catalystcenter_sda_site_member_member": dataSourceSdaSiteMemberMember(), - "catalystcenter_application_policy_application_set": dataSourceApplicationPolicyApplicationSet(), - "catalystcenter_application_policy_application_set_count": dataSourceApplicationPolicyApplicationSetCount(), - "catalystcenter_applications_v2": dataSourceApplicationsV2(), - "catalystcenter_applications_count_v2": dataSourceApplicationsCountV2(), - "catalystcenter_site_v2": dataSourceSiteV2(), - "catalystcenter_site_count_v2": dataSourceSiteCountV2(), - "catalystcenter_users_external_authentication": dataSourceUsersExternalAuthentication(), - "catalystcenter_users_external_servers_aaa_attribute": dataSourceUsersExternalServersAAAAttribute(), - "catalystcenter_assurance_events": dataSourceAssuranceEvents(), - "catalystcenter_assurance_events_count": dataSourceAssuranceEventsCount(), - "catalystcenter_assurance_events_child_events": dataSourceAssuranceEventsChildEvents(), - "catalystcenter_assurance_issues": dataSourceAssuranceIssues(), - "catalystcenter_assurance_issues_count": dataSourceAssuranceIssuesCount(), - "catalystcenter_clients": dataSourceClients(), - "catalystcenter_clients_count": dataSourceClientsCount(), - "catalystcenter_interfaces": dataSourceInterfaces(), - "catalystcenter_interfaces_count": dataSourceInterfacesCount(), - "catalystcenter_network_devices": dataSourceNetworkDevices(), - "catalystcenter_network_devices_count": dataSourceNetworkDevicesCount(), - "catalystcenter_site_health_summaries": dataSourceSiteHealthSummaries(), - "catalystcenter_site_health_summaries_count": dataSourceSiteHealthSummariesCount(), - "catalystcenter_site_health_summaries_summary_analytics": dataSourceSiteHealthSummariesSummaryAnalytics(), - "catalystcenter_assurance_get_sensor_test_results": dataSourceAssuranceGetSensorTestResults(), - "catalystcenter_areas": dataSourceAreas(), - "catalystcenter_custom_issue_definitions": dataSourceCustomIssueDefinitions(), - "catalystcenter_custom_issue_definitions_count": dataSourceCustomIssueDefinitionsCount(), - "catalystcenter_diagnostic_validation_sets": dataSourceDiagnosticValidationSets(), - "catalystcenter_diagnostic_validation_workflows": dataSourceDiagnosticValidationWorkflows(), - "catalystcenter_diagnostic_validation_workflows_count": dataSourceDiagnosticValidationWorkflowsCount(), - "catalystcenter_health_score_definitions": dataSourceHealthScoreDefinitions(), - "catalystcenter_images": dataSourceImages(), - "catalystcenter_images_count": dataSourceImagesCount(), - "catalystcenter_images_distribution_server_settings": dataSourceImagesDistributionServerSettings(), - "catalystcenter_images_addon_images": dataSourceImagesAddonImages(), - "catalystcenter_images_addon_images_count": dataSourceImagesAddonImagesCount(), - "catalystcenter_images_site_wise_product_names": dataSourceImagesSiteWiseProductNames(), - "catalystcenter_images_site_wise_product_names_count": dataSourceImagesSiteWiseProductNamesCount(), - "catalystcenter_license_setting": dataSourceLicenseSetting(), - "catalystcenter_network_device_image_updates": dataSourceNetworkDeviceImageUpdates(), - "catalystcenter_network_device_image_updates_count": dataSourceNetworkDeviceImageUpdatesCount(), - "catalystcenter_network_devices_assigned_to_site": dataSourceNetworkDevicesAssignedToSite(), - "catalystcenter_network_devices_assigned_to_site_count": dataSourceNetworkDevicesAssignedToSiteCount(), - "catalystcenter_network_devices_device_controllability_settings": dataSourceNetworkDevicesDeviceControllabilitySettings(), - "catalystcenter_network_devices_not_assigned_to_site": dataSourceNetworkDevicesNotAssignedToSite(), - "catalystcenter_network_devices_not_assigned_to_site_count": dataSourceNetworkDevicesNotAssignedToSiteCount(), - "catalystcenter_network_devices_assigned_to_site_id": dataSourceNetworkDevicesAssignedToSiteID(), - "catalystcenter_network_devices_resync_interval_settings_id": dataSourceNetworkDevicesResyncIntervalSettingsID(), - "catalystcenter_network_devices_network_profiles_for_sites": dataSourceNetworkDevicesNetworkProfilesForSites(), - "catalystcenter_network_devices_network_profiles_for_sites_count": dataSourceNetworkDevicesNetworkProfilesForSitesCount(), - "catalystcenter_network_profiles_for_sites_site_assignments": dataSourceNetworkProfilesForSitesSiteAssignments(), - "catalystcenter_network_profiles_for_sites_site_assignments_count": dataSourceNetworkProfilesForSitesSiteAssignmentsCount(), - "catalystcenter_product_names": dataSourceProductNames(), - "catalystcenter_product_names_count": dataSourceProductNamesCount(), - "catalystcenter_provisioning_settings": dataSourceProvisioningSettings(), - "catalystcenter_sda_fabrics_vlan_to_ssids": dataSourceSdaFabricsVLANToSSIDs(), - "catalystcenter_sda_fabrics_vlan_to_ssids_count": dataSourceSdaFabricsVLANToSSIDsCount(), - "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id": dataSourceSdaFabricsVLANToSSIDsFabricID(), - "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id_count": dataSourceSdaFabricsVLANToSSIDsFabricIDCount(), - "catalystcenter_sda_layer2_virtual_networks": dataSourceSdaLayer2VirtualNetworks(), - "catalystcenter_sda_layer2_virtual_networks_count": dataSourceSdaLayer2VirtualNetworksCount(), - "catalystcenter_sda_layer3_virtual_networks": dataSourceSdaLayer3VirtualNetworks(), - "catalystcenter_sda_layer3_virtual_networks_count": dataSourceSdaLayer3VirtualNetworksCount(), - "catalystcenter_sda_multicast_v1": dataSourceSdaMulticastV1(), - "catalystcenter_sda_multicast_virtual_networks": dataSourceSdaMulticastVirtualNetworks(), - "catalystcenter_sda_multicast_virtual_networks_count": dataSourceSdaMulticastVirtualNetworksCount(), - "catalystcenter_sda_port_channels": dataSourceSdaPortChannels(), - "catalystcenter_sda_port_channels_count": dataSourceSdaPortChannelsCount(), - "catalystcenter_sda_transit_networks": dataSourceSdaTransitNetworks(), - "catalystcenter_sda_transit_networks_count": dataSourceSdaTransitNetworksCount(), - "catalystcenter_site_wise_product_names": dataSourceSiteWiseProductNames(), - "catalystcenter_site_wise_product_names_count": dataSourceSiteWiseProductNamesCount(), - "catalystcenter_sites": dataSourceSites(), - "catalystcenter_sites_count": dataSourceSitesCount(), - "catalystcenter_sites_aaa_settings": dataSourceSitesAAASettings(), - "catalystcenter_sites_banner_settings": dataSourceSitesBannerSettings(), - "catalystcenter_sites_device_credentials": dataSourceSitesDeviceCredentials(), - "catalystcenter_sites_device_credentials_status": dataSourceSitesDeviceCredentialsStatus(), - "catalystcenter_sites_dhcp_settings": dataSourceSitesDhcpSettings(), - "catalystcenter_sites_dns_settings": dataSourceSitesDNSSettings(), - "catalystcenter_sites_image_distribution_settings": dataSourceSitesImageDistributionSettings(), - "catalystcenter_sites_ntp_settings": dataSourceSitesNtpSettings(), - "catalystcenter_sites_telemetry_settings": dataSourceSitesTelemetrySettings(), - "catalystcenter_sites_time_zone_settings": dataSourceSitesTimeZoneSettings(), - "catalystcenter_sites_profile_assignments": dataSourceSitesProfileAssignments(), - "catalystcenter_sites_profile_assignments_count": dataSourceSitesProfileAssignmentsCount(), - "catalystcenter_sites_wireless_settings_ssids": dataSourceSitesWirelessSettingsSSIDs(), - "catalystcenter_sites_wireless_settings_ssids_count": dataSourceSitesWirelessSettingsSSIDsCount(), - "catalystcenter_system_issue_definitions": dataSourceSystemIssueDefinitions(), - "catalystcenter_system_issue_definitions_count": dataSourceSystemIssueDefinitionsCount(), - "catalystcenter_tasks": dataSourceTasks(), - "catalystcenter_tasks_count": dataSourceTasksCount(), - "catalystcenter_tasks_detail": dataSourceTasksDetail(), - "catalystcenter_wireless_access_points_factory_reset_request_status": dataSourceWirelessAccessPointsFactoryResetRequestStatus(), - "catalystcenter_wireless_controllers_wireless_mobility_groups": dataSourceWirelessControllersWirelessMobilityGroups(), - "catalystcenter_wireless_controllers_wireless_mobility_groups_count": dataSourceWirelessControllersWirelessMobilityGroupsCount(), - "catalystcenter_wireless_controllers_anchor_managed_ap_locations": dataSourceWirelessControllersAnchorManagedApLocations(), - "catalystcenter_wireless_controllers_managed_ap_locations_count": dataSourceWirelessControllersManagedApLocationsCount(), - "catalystcenter_wireless_controllers_primary_managed_ap_locations": dataSourceWirelessControllersPrimaryManagedApLocations(), - "catalystcenter_wireless_controllers_secondary_managed_ap_locations": dataSourceWirelessControllersSecondaryManagedApLocations(), - "catalystcenter_wireless_controllers_ssid_details": dataSourceWirelessControllersSSIDDetails(), - "catalystcenter_wireless_controllers_ssid_details_count": dataSourceWirelessControllersSSIDDetailsCount(), - "catalystcenter_wireless_profiles": dataSourceWirelessProfiles(), - "catalystcenter_wireless_profiles_count": dataSourceWirelessProfilesCount(), - "catalystcenter_wireless_settings_dot11be_profiles": dataSourceWirelessSettingsDot11BeProfiles(), - "catalystcenter_wireless_settings_dot11be_profiles_count": dataSourceWirelessSettingsDot11BeProfilesCount(), - "catalystcenter_wireless_settings_interfaces": dataSourceWirelessSettingsInterfaces(), - "catalystcenter_wireless_settings_interfaces_count": dataSourceWirelessSettingsInterfacesCount(), - "catalystcenter_wireless_settings_rf_profiles": dataSourceWirelessSettingsRfProfiles(), - "catalystcenter_wireless_settings_rf_profiles_count": dataSourceWirelessSettingsRfProfilesCount(), - "catalystcenter_buildings": dataSourceBuildings(), - "catalystcenter_floors": dataSourceFloors(), - "catalystcenter_floors_settings": dataSourceFloorsSettings(), - "catalystcenter_intent_custom_issue_definitions": dataSourceIntentCustomIssueDefinitions(), - "catalystcenter_health_score_definitions_count": dataSourceHealthScoreDefinitionsCount(), - "catalystcenter_ipam_server_setting": dataSourceIPamServerSetting(), - "catalystcenter_interfaces_members_associations": dataSourceInterfacesMembersAssociations(), - "catalystcenter_interfaces_members_associations_count": dataSourceInterfacesMembersAssociationsCount(), - "catalystcenter_network_devices_members_associations": dataSourceNetworkDevicesMembersAssociations(), - "catalystcenter_network_devices_members_associations_count": dataSourceNetworkDevicesMembersAssociationsCount(), + "catalystcenter_reserve_ip_subpool": dataSourceReserveIPSubpool(), + "catalystcenter_reserve_ip_subpool_v1": dataSourceReserveIPSubpool(), + "catalystcenter_wireless_rf_profile": dataSourceWirelessRfProfile(), + "catalystcenter_wireless_rf_profile_v1": dataSourceWirelessRfProfile(), + "catalystcenter_wireless_profile": dataSourceWirelessProfile(), + "catalystcenter_wireless_profile_v1": dataSourceWirelessProfile(), + "catalystcenter_configuration_template_project": dataSourceConfigurationTemplateProject(), + "catalystcenter_configuration_template_project_v1": dataSourceConfigurationTemplateProject(), + "catalystcenter_tag": dataSourceTag(), + "catalystcenter_tag_v1": dataSourceTag(), + "catalystcenter_snmp_properties": dataSourceSNMPProperties(), + "catalystcenter_snmp_properties_v1": dataSourceSNMPProperties(), + "catalystcenter_pnp_global_settings": dataSourcePnpGlobalSettings(), + "catalystcenter_pnp_global_settings_v1": dataSourcePnpGlobalSettings(), + "catalystcenter_network_device_list": dataSourceNetworkDeviceList(), + "catalystcenter_network_device_list_v1": dataSourceNetworkDeviceList(), + "catalystcenter_network_device": dataSourceNetworkDevice(), + "catalystcenter_network_device_v1": dataSourceNetworkDevice(), + "catalystcenter_global_pool": dataSourceGlobalPool(), + "catalystcenter_global_pool_v1": dataSourceGlobalPool(), + "catalystcenter_path_trace": dataSourcePathTrace(), + "catalystcenter_path_trace_v1": dataSourcePathTrace(), + "catalystcenter_transit_peer_network": dataSourceTransitPeerNetwork(), + "catalystcenter_transit_peer_network_v1": dataSourceTransitPeerNetwork(), + "catalystcenter_business_sda_virtual_network_summary": dataSourceBusinessSdaVirtualNetworkSummary(), + "catalystcenter_business_sda_virtual_network_summary_v1": dataSourceBusinessSdaVirtualNetworkSummary(), + "catalystcenter_event_subscription_syslog": dataSourceEventSubscriptionSyslog(), + "catalystcenter_event_subscription_syslog_v1": dataSourceEventSubscriptionSyslog(), + "catalystcenter_event_subscription_rest": dataSourceEventSubscriptionRest(), + "catalystcenter_event_subscription_rest_v1": dataSourceEventSubscriptionRest(), + "catalystcenter_event_subscription_email": dataSourceEventSubscriptionEmail(), + "catalystcenter_event_subscription_email_v1": dataSourceEventSubscriptionEmail(), + "catalystcenter_event_subscription": dataSourceEventSubscription(), + "catalystcenter_event_subscription_v1": dataSourceEventSubscription(), + "catalystcenter_wireless_dynamic_interface": dataSourceWirelessDynamicInterface(), + "catalystcenter_wireless_dynamic_interface_v1": dataSourceWirelessDynamicInterface(), + "catalystcenter_wireless_enterprise_ssid": dataSourceWirelessEnterpriseSSID(), + "catalystcenter_wireless_enterprise_ssid_v1": dataSourceWirelessEnterpriseSSID(), + "catalystcenter_discovery": dataSourceDiscovery(), + "catalystcenter_discovery_v1": dataSourceDiscovery(), + "catalystcenter_device_replacement": dataSourceDeviceReplacement(), + "catalystcenter_device_replacement_v1": dataSourceDeviceReplacement(), + "catalystcenter_reports": dataSourceReports(), + "catalystcenter_reports_v1": dataSourceReports(), + "catalystcenter_sda_multicast": dataSourceSdaMulticast(), + "catalystcenter_sda_multicast_v1": dataSourceSdaMulticast(), + "catalystcenter_sda_virtual_network_v2": dataSourceSdaVirtualNetworkV2(), + "catalystcenter_sda_virtual_network": dataSourceSdaVirtualNetworkV2(), + "catalystcenter_sda_provision_device": dataSourceSdaProvisionDevice(), + "catalystcenter_sda_provision_device_v1": dataSourceSdaProvisionDevice(), + "catalystcenter_sda_virtual_network_ip_pool": dataSourceSdaVirtualNetworkIPPool(), + "catalystcenter_sda_virtual_network_ip_pool_v1": dataSourceSdaVirtualNetworkIPPool(), + "catalystcenter_sda_virtual_network_v1": dataSourceSdaVirtualNetwork(), + "catalystcenter_sda_port_assignment_for_user_device": dataSourceSdaPortAssignmentForUserDevice(), + "catalystcenter_sda_port_assignment_for_user_device_v1": dataSourceSdaPortAssignmentForUserDevice(), + "catalystcenter_sda_port_assignment_for_access_point": dataSourceSdaPortAssignmentForAccessPoint(), + "catalystcenter_sda_port_assignment_for_access_point_v1": dataSourceSdaPortAssignmentForAccessPoint(), + "catalystcenter_sda_fabric_site": dataSourceSdaFabricSite(), + "catalystcenter_sda_fabric_site_v1": dataSourceSdaFabricSite(), + "catalystcenter_sda_fabric_edge_device": dataSourceSdaFabricEdgeDevice(), + "catalystcenter_sda_fabric_edge_device_v1": dataSourceSdaFabricEdgeDevice(), + "catalystcenter_sda_fabric_control_plane_device": dataSourceSdaFabricControlPlaneDevice(), + "catalystcenter_sda_fabric_control_plane_device_v1": dataSourceSdaFabricControlPlaneDevice(), + "catalystcenter_sda_fabric_border_device": dataSourceSdaFabricBorderDevice(), + "catalystcenter_sda_fabric_border_device_v1": dataSourceSdaFabricBorderDevice(), + "catalystcenter_sda_fabric_authentication_profile": dataSourceSdaFabricAuthenticationProfile(), + "catalystcenter_sda_fabric_authentication_profile_v1": dataSourceSdaFabricAuthenticationProfile(), + "catalystcenter_applications": dataSourceApplications(), + "catalystcenter_applications_v1": dataSourceApplications(), + "catalystcenter_application_sets": dataSourceApplicationSets(), + "catalystcenter_application_sets_v1": dataSourceApplicationSets(), + "catalystcenter_pnp_workflow": dataSourcePnpWorkflow(), + "catalystcenter_pnp_workflow_v1": dataSourcePnpWorkflow(), + "catalystcenter_pnp_device": dataSourcePnpDevice(), + "catalystcenter_pnp_device_v1": dataSourcePnpDevice(), + "catalystcenter_configuration_template": dataSourceConfigurationTemplate(), + "catalystcenter_configuration_template_v1": dataSourceConfigurationTemplate(), + "catalystcenter_app_policy_queuing_profile": dataSourceAppPolicyQueuingProfile(), + "catalystcenter_app_policy_queuing_profile_v1": dataSourceAppPolicyQueuingProfile(), + "catalystcenter_business_sda_hostonboarding_ssid_ippool": dataSourceBusinessSdaHostonboardingSSIDIPpool(), + "catalystcenter_business_sda_hostonboarding_ssid_ippool_v1": dataSourceBusinessSdaHostonboardingSSIDIPpool(), + "catalystcenter_endpoint_analytics_profiling_rules": dataSourceEndpointAnalyticsProfilingRules(), + "catalystcenter_endpoint_analytics_profiling_rules_v1": dataSourceEndpointAnalyticsProfilingRules(), + "catalystcenter_qos_device_interface": dataSourceQosDeviceInterface(), + "catalystcenter_qos_device_interface_v1": dataSourceQosDeviceInterface(), + "catalystcenter_network_device_custom_prompt": dataSourceNetworkDeviceCustomPrompt(), + "catalystcenter_network_device_custom_prompt_v1": dataSourceNetworkDeviceCustomPrompt(), + "catalystcenter_tag_member": dataSourceTagMember(), + "catalystcenter_tag_member_v1": dataSourceTagMember(), + "catalystcenter_site": dataSourceSite(), + "catalystcenter_site_v1": dataSourceSite(), + "catalystcenter_service_provider": dataSourceServiceProvider(), + "catalystcenter_service_provider_v1": dataSourceServiceProvider(), + "catalystcenter_sensor": dataSourceSensor(), + "catalystcenter_sensor_v1": dataSourceSensor(), + "catalystcenter_threat_summary": dataSourceThreatSummary(), + "catalystcenter_threat_summary_v1": dataSourceThreatSummary(), + "catalystcenter_threat_detail_count": dataSourceThreatDetailCount(), + "catalystcenter_threat_detail_count_v1": dataSourceThreatDetailCount(), + "catalystcenter_threat_detail": dataSourceThreatDetail(), + "catalystcenter_threat_detail_v1": dataSourceThreatDetail(), + "catalystcenter_network": dataSourceNetwork(), + "catalystcenter_network_v1": dataSourceNetwork(), + "catalystcenter_itsm_integration_events_failed": dataSourceItsmIntegrationEventsFailed(), + "catalystcenter_itsm_integration_events_failed_v1": dataSourceItsmIntegrationEventsFailed(), + "catalystcenter_device_credential": dataSourceDeviceCredential(), + "catalystcenter_device_credential_v1": dataSourceDeviceCredential(), + "catalystcenter_event_artifact_count": dataSourceEventArtifactCount(), + "catalystcenter_event_artifact_count_v1": dataSourceEventArtifactCount(), + "catalystcenter_event_artifact": dataSourceEventArtifact(), + "catalystcenter_event_artifact_v1": dataSourceEventArtifact(), + "catalystcenter_user_enrichment_details": dataSourceUserEnrichmentDetails(), + "catalystcenter_user_enrichment_details_v1": dataSourceUserEnrichmentDetails(), + "catalystcenter_topology_vlan_details": dataSourceTopologyVLANDetails(), + "catalystcenter_topology_vlan_details_v1": dataSourceTopologyVLANDetails(), + "catalystcenter_topology_site": dataSourceTopologySite(), + "catalystcenter_topology_site_v1": dataSourceTopologySite(), + "catalystcenter_topology_physical": dataSourceTopologyPhysical(), + "catalystcenter_topology_physical_v1": dataSourceTopologyPhysical(), + "catalystcenter_topology_layer_3": dataSourceTopologyLayer3(), + "catalystcenter_topology_layer_3_v1": dataSourceTopologyLayer3(), + "catalystcenter_topology_layer_2": dataSourceTopologyLayer2(), + "catalystcenter_topology_layer_2_v1": dataSourceTopologyLayer2(), + "catalystcenter_configuration_template_version": dataSourceConfigurationTemplateVersion(), + "catalystcenter_configuration_template_version_v1": dataSourceConfigurationTemplateVersion(), + "catalystcenter_configuration_template_deploy_status": dataSourceConfigurationTemplateDeployStatus(), + "catalystcenter_configuration_template_deploy_status_v1": dataSourceConfigurationTemplateDeployStatus(), + "catalystcenter_network_device_chassis_details": dataSourceNetworkDeviceChassisDetails(), + "catalystcenter_network_device_chassis_details_v1": dataSourceNetworkDeviceChassisDetails(), + "catalystcenter_network_device_linecard_details": dataSourceNetworkDeviceLinecardDetails(), + "catalystcenter_network_device_linecard_details_v1": dataSourceNetworkDeviceLinecardDetails(), + "catalystcenter_network_device_stack_details": dataSourceNetworkDeviceStackDetails(), + "catalystcenter_network_device_stack_details_v1": dataSourceNetworkDeviceStackDetails(), + "catalystcenter_network_device_supervisor_card_details": dataSourceNetworkDeviceSupervisorCardDetails(), + "catalystcenter_network_device_supervisor_card_details_v1": dataSourceNetworkDeviceSupervisorCardDetails(), + "catalystcenter_network_device_inventory_insight_link_mismatch": dataSourceNetworkDeviceInventoryInsightLinkMismatch(), + "catalystcenter_network_device_inventory_insight_link_mismatch_v1": dataSourceNetworkDeviceInventoryInsightLinkMismatch(), + "catalystcenter_network_device_interface_poe": dataSourceNetworkDeviceInterfacePoe(), + "catalystcenter_network_device_interface_poe_v1": dataSourceNetworkDeviceInterfacePoe(), + "catalystcenter_system_health": dataSourceSystemHealth(), + "catalystcenter_system_health_v1": dataSourceSystemHealth(), + "catalystcenter_system_health_count": dataSourceSystemHealthCount(), + "catalystcenter_system_health_count_v1": dataSourceSystemHealthCount(), + "catalystcenter_system_performance": dataSourceSystemPerformance(), + "catalystcenter_system_performance_v1": dataSourceSystemPerformance(), + "catalystcenter_system_performance_historical": dataSourceSystemPerformanceHistorical(), + "catalystcenter_system_performance_historical_v1": dataSourceSystemPerformanceHistorical(), + "catalystcenter_platform_nodes_configuration_summary": dataSourcePlatformNodesConfigurationSummary(), + "catalystcenter_platform_nodes_configuration_summary_v1": dataSourcePlatformNodesConfigurationSummary(), + "catalystcenter_platform_release_summary": dataSourcePlatformReleaseSummary(), + "catalystcenter_platform_release_summary_v1": dataSourcePlatformReleaseSummary(), + "catalystcenter_task_operation": dataSourceTaskOperation(), + "catalystcenter_task_operation_v1": dataSourceTaskOperation(), + "catalystcenter_task_count": dataSourceTaskCount(), + "catalystcenter_task_count_v1": dataSourceTaskCount(), + "catalystcenter_task_tree": dataSourceTaskTree(), + "catalystcenter_task_tree_v1": dataSourceTaskTree(), + "catalystcenter_task": dataSourceTask(), + "catalystcenter_task_v1": dataSourceTask(), + "catalystcenter_tag_member_type": dataSourceTagMemberType(), + "catalystcenter_tag_member_type_v1": dataSourceTagMemberType(), + "catalystcenter_tag_count": dataSourceTagCount(), + "catalystcenter_tag_count_v1": dataSourceTagCount(), + "catalystcenter_tag_member_count": dataSourceTagMemberCount(), + "catalystcenter_tag_member_count_v1": dataSourceTagMemberCount(), + "catalystcenter_site_count": dataSourceSiteCount(), + "catalystcenter_site_count_v1": dataSourceSiteCount(), + "catalystcenter_site_health": dataSourceSiteHealth(), + "catalystcenter_site_health_v1": dataSourceSiteHealth(), + "catalystcenter_security_advisories_per_device": dataSourceSecurityAdvisoriesPerDevice(), + "catalystcenter_security_advisories_per_device_v1": dataSourceSecurityAdvisoriesPerDevice(), + "catalystcenter_security_advisories_ids_per_device": dataSourceSecurityAdvisoriesIDsPerDevice(), + "catalystcenter_security_advisories_ids_per_device_v1": dataSourceSecurityAdvisoriesIDsPerDevice(), + "catalystcenter_security_advisories_summary": dataSourceSecurityAdvisoriesSummary(), + "catalystcenter_security_advisories_summary_v1": dataSourceSecurityAdvisoriesSummary(), + "catalystcenter_security_advisories_devices": dataSourceSecurityAdvisoriesDevices(), + "catalystcenter_security_advisories_devices_v1": dataSourceSecurityAdvisoriesDevices(), + "catalystcenter_security_advisories": dataSourceSecurityAdvisories(), + "catalystcenter_security_advisories_v1": dataSourceSecurityAdvisories(), + "catalystcenter_pnp_workflow_count": dataSourcePnpWorkflowCount(), + "catalystcenter_pnp_workflow_count_v1": dataSourcePnpWorkflowCount(), + "catalystcenter_pnp_virtual_accounts": dataSourcePnpVirtualAccounts(), + "catalystcenter_pnp_virtual_accounts_v1": dataSourcePnpVirtualAccounts(), + "catalystcenter_pnp_smart_account_domains": dataSourcePnpSmartAccountDomains(), + "catalystcenter_pnp_smart_account_domains_v1": dataSourcePnpSmartAccountDomains(), + "catalystcenter_pnp_virtual_account_sync_result": dataSourcePnpVirtualAccountSyncResult(), + "catalystcenter_pnp_virtual_account_sync_result_v1": dataSourcePnpVirtualAccountSyncResult(), + "catalystcenter_pnp_device_history": dataSourcePnpDeviceHistory(), + "catalystcenter_pnp_device_history_v1": dataSourcePnpDeviceHistory(), + "catalystcenter_pnp_device_count": dataSourcePnpDeviceCount(), + "catalystcenter_pnp_device_count_v1": dataSourcePnpDeviceCount(), + "catalystcenter_topology_network_health": dataSourceTopologyNetworkHealth(), + "catalystcenter_topology_network_health_v1": dataSourceTopologyNetworkHealth(), + "catalystcenter_network_device_register_for_wsa": dataSourceNetworkDeviceRegisterForWsa(), + "catalystcenter_network_device_register_for_wsa_v1": dataSourceNetworkDeviceRegisterForWsa(), + "catalystcenter_network_device_by_serial_number": dataSourceNetworkDeviceBySerialNumber(), + "catalystcenter_network_device_by_serial_number_v1": dataSourceNetworkDeviceBySerialNumber(), + "catalystcenter_network_device_module_count": dataSourceNetworkDeviceModuleCount(), + "catalystcenter_network_device_module_count_v1": dataSourceNetworkDeviceModuleCount(), + "catalystcenter_network_device_module": dataSourceNetworkDeviceModule(), + "catalystcenter_network_device_module_v1": dataSourceNetworkDeviceModule(), + "catalystcenter_network_device_by_ip": dataSourceNetworkDeviceByIP(), + "catalystcenter_network_device_by_ip_v1": dataSourceNetworkDeviceByIP(), + "catalystcenter_network_device_functional_capability": dataSourceNetworkDeviceFunctionalCapability(), + "catalystcenter_network_device_functional_capability_v1": dataSourceNetworkDeviceFunctionalCapability(), + "catalystcenter_network_device_count": dataSourceNetworkDeviceCount(), + "catalystcenter_network_device_count_v1": dataSourceNetworkDeviceCount(), + "catalystcenter_network_device_config_count": dataSourceNetworkDeviceConfigCount(), + "catalystcenter_network_device_config_count_v1": dataSourceNetworkDeviceConfigCount(), + "catalystcenter_network_device_config": dataSourceNetworkDeviceConfig(), + "catalystcenter_network_device_config_v1": dataSourceNetworkDeviceConfig(), + "catalystcenter_network_device_global_polling_interval": dataSourceNetworkDeviceGlobalPollingInterval(), + "catalystcenter_network_device_global_polling_interval_v1": dataSourceNetworkDeviceGlobalPollingInterval(), + "catalystcenter_network_device_lexicographically_sorted": dataSourceNetworkDeviceLexicographicallySorted(), + "catalystcenter_network_device_lexicographically_sorted_v1": dataSourceNetworkDeviceLexicographicallySorted(), + "catalystcenter_network_device_range": dataSourceNetworkDeviceRange(), + "catalystcenter_network_device_range_v1": dataSourceNetworkDeviceRange(), + "catalystcenter_network_device_wireless_lan": dataSourceNetworkDeviceWirelessLan(), + "catalystcenter_network_device_wireless_lan_v1": dataSourceNetworkDeviceWirelessLan(), + "catalystcenter_network_device_vlan": dataSourceNetworkDeviceVLAN(), + "catalystcenter_network_device_vlan_v1": dataSourceNetworkDeviceVLAN(), + "catalystcenter_network_device_meraki_organization": dataSourceNetworkDeviceMerakiOrganization(), + "catalystcenter_network_device_meraki_organization_v1": dataSourceNetworkDeviceMerakiOrganization(), + "catalystcenter_network_device_polling_interval": dataSourceNetworkDevicePollingInterval(), + "catalystcenter_network_device_polling_interval_v1": dataSourceNetworkDevicePollingInterval(), + "catalystcenter_network_device_summary": dataSourceNetworkDeviceSummary(), + "catalystcenter_network_device_summary_v1": dataSourceNetworkDeviceSummary(), + "catalystcenter_network_device_poe": dataSourceNetworkDevicePoe(), + "catalystcenter_network_device_poe_v1": dataSourceNetworkDevicePoe(), + "catalystcenter_network_device_equipment": dataSourceNetworkDeviceEquipment(), + "catalystcenter_network_device_equipment_v1": dataSourceNetworkDeviceEquipment(), + "catalystcenter_dna_command_runner_keywords": dataSourceDnaCommandRunnerKeywords(), + "catalystcenter_dna_command_runner_keywords_v1": dataSourceDnaCommandRunnerKeywords(), + "catalystcenter_site_membership": dataSourceSiteMembership(), + "catalystcenter_site_membership_v1": dataSourceSiteMembership(), + "catalystcenter_issues": dataSourceIssues(), + "catalystcenter_issues_v1": dataSourceIssues(), + "catalystcenter_issues_enrichment_details": dataSourceIssuesEnrichmentDetails(), + "catalystcenter_issues_enrichment_details_v1": dataSourceIssuesEnrichmentDetails(), + "catalystcenter_device_interface_ospf": dataSourceDeviceInterfaceOspf(), + "catalystcenter_device_interface_ospf_v1": dataSourceDeviceInterfaceOspf(), + "catalystcenter_interface_network_device_detail": dataSourceInterfaceNetworkDeviceDetail(), + "catalystcenter_interface_network_device_detail_v1": dataSourceInterfaceNetworkDeviceDetail(), + "catalystcenter_interface_network_device": dataSourceInterfaceNetworkDevice(), + "catalystcenter_interface_network_device_v1": dataSourceInterfaceNetworkDevice(), + "catalystcenter_interface_network_device_range": dataSourceInterfaceNetworkDeviceRange(), + "catalystcenter_interface_network_device_range_v1": dataSourceInterfaceNetworkDeviceRange(), + "catalystcenter_device_interface_isis": dataSourceDeviceInterfaceIsis(), + "catalystcenter_device_interface_isis_v1": dataSourceDeviceInterfaceIsis(), + "catalystcenter_device_interface_by_ip": dataSourceDeviceInterfaceByIP(), + "catalystcenter_device_interface_by_ip_v1": dataSourceDeviceInterfaceByIP(), + "catalystcenter_device_interface_count": dataSourceDeviceInterfaceCount(), + "catalystcenter_device_interface_count_v1": dataSourceDeviceInterfaceCount(), + "catalystcenter_device_interface": dataSourceDeviceInterface(), + "catalystcenter_device_interface_v1": dataSourceDeviceInterface(), + "catalystcenter_swim_image_details": dataSourceSwimImageDetails(), + "catalystcenter_swim_image_details_v1": dataSourceSwimImageDetails(), + "catalystcenter_global_credential": dataSourceGlobalCredential(), + "catalystcenter_global_credential_v1": dataSourceGlobalCredential(), + "catalystcenter_file_namespaces": dataSourceFileNamespaces(), + "catalystcenter_file_namespaces_v1": dataSourceFileNamespaces(), + "catalystcenter_file_namespace_files": dataSourceFileNamespaceFiles(), + "catalystcenter_file_namespace_files_v1": dataSourceFileNamespaceFiles(), + "catalystcenter_file": dataSourceFile(), + "catalystcenter_file_v1": dataSourceFile(), + "catalystcenter_event_count": dataSourceEventCount(), + "catalystcenter_event_count_v1": dataSourceEventCount(), + "catalystcenter_event": dataSourceEvent(), + "catalystcenter_event_v1": dataSourceEvent(), + "catalystcenter_event_subscription_count": dataSourceEventSubscriptionCount(), + "catalystcenter_event_subscription_count_v1": dataSourceEventSubscriptionCount(), + "catalystcenter_event_subscription_details_syslog": dataSourceEventSubscriptionDetailsSyslog(), + "catalystcenter_event_subscription_details_syslog_v1": dataSourceEventSubscriptionDetailsSyslog(), + "catalystcenter_event_subscription_details_rest": dataSourceEventSubscriptionDetailsRest(), + "catalystcenter_event_subscription_details_rest_v1": dataSourceEventSubscriptionDetailsRest(), + "catalystcenter_event_subscription_details_email": dataSourceEventSubscriptionDetailsEmail(), + "catalystcenter_event_subscription_details_email_v1": dataSourceEventSubscriptionDetailsEmail(), + "catalystcenter_event_series_count": dataSourceEventSeriesCount(), + "catalystcenter_event_series_count_v1": dataSourceEventSeriesCount(), + "catalystcenter_event_series": dataSourceEventSeries(), + "catalystcenter_event_series_v1": dataSourceEventSeries(), + "catalystcenter_event_api_status": dataSourceEventAPIStatus(), + "catalystcenter_event_api_status_v1": dataSourceEventAPIStatus(), + "catalystcenter_discovery_count": dataSourceDiscoveryCount(), + "catalystcenter_discovery_count_v1": dataSourceDiscoveryCount(), + "catalystcenter_discovery_range": dataSourceDiscoveryRange(), + "catalystcenter_discovery_range_v1": dataSourceDiscoveryRange(), + "catalystcenter_discovery_summary": dataSourceDiscoverySummary(), + "catalystcenter_discovery_summary_v1": dataSourceDiscoverySummary(), + "catalystcenter_discovery_device_count": dataSourceDiscoveryDeviceCount(), + "catalystcenter_discovery_device_count_v1": dataSourceDiscoveryDeviceCount(), + "catalystcenter_discovery_device": dataSourceDiscoveryDevice(), + "catalystcenter_discovery_device_v1": dataSourceDiscoveryDevice(), + "catalystcenter_discovery_device_range": dataSourceDiscoveryDeviceRange(), + "catalystcenter_discovery_device_range_v1": dataSourceDiscoveryDeviceRange(), + "catalystcenter_discovery_job_by_id": dataSourceDiscoveryJobByID(), + "catalystcenter_discovery_job_by_id_v1": dataSourceDiscoveryJobByID(), + "catalystcenter_discovery_jobs": dataSourceDiscoveryJobs(), + "catalystcenter_discovery_jobs_v1": dataSourceDiscoveryJobs(), + "catalystcenter_device_replacement_count": dataSourceDeviceReplacementCount(), + "catalystcenter_device_replacement_count_v1": dataSourceDeviceReplacementCount(), + "catalystcenter_device_health": dataSourceDeviceHealth(), + "catalystcenter_device_health_v1": dataSourceDeviceHealth(), + "catalystcenter_device_enrichment_details": dataSourceDeviceEnrichmentDetails(), + "catalystcenter_device_enrichment_details_v1": dataSourceDeviceEnrichmentDetails(), + "catalystcenter_device_details": dataSourceDeviceDetails(), + "catalystcenter_device_details_v1": dataSourceDeviceDetails(), + "catalystcenter_reports_view_group_view": dataSourceReportsViewGroupView(), + "catalystcenter_reports_view_group_view_v1": dataSourceReportsViewGroupView(), + "catalystcenter_reports_view_group": dataSourceReportsViewGroup(), + "catalystcenter_reports_view_group_v1": dataSourceReportsViewGroup(), + "catalystcenter_reports_executions_download": dataSourceReportsExecutionsDownload(), + "catalystcenter_reports_executions_download_v1": dataSourceReportsExecutionsDownload(), + "catalystcenter_reports_executions": dataSourceReportsExecutions(), + "catalystcenter_reports_executions_v1": dataSourceReportsExecutions(), + "catalystcenter_compliance_device_status_count": dataSourceComplianceDeviceStatusCount(), + "catalystcenter_compliance_device_status_count_v1": dataSourceComplianceDeviceStatusCount(), + "catalystcenter_compliance_device_details_count": dataSourceComplianceDeviceDetailsCount(), + "catalystcenter_compliance_device_details_count_v1": dataSourceComplianceDeviceDetailsCount(), + "catalystcenter_compliance_device_details": dataSourceComplianceDeviceDetails(), + "catalystcenter_compliance_device_details_v1": dataSourceComplianceDeviceDetails(), + "catalystcenter_compliance_device_by_id_detail": dataSourceComplianceDeviceByIDDetail(), + "catalystcenter_compliance_device_by_id_detail_v1": dataSourceComplianceDeviceByIDDetail(), + "catalystcenter_compliance_device": dataSourceComplianceDevice(), + "catalystcenter_compliance_device_v1": dataSourceComplianceDevice(), + "catalystcenter_compliance_device_by_id": dataSourceComplianceDeviceByID(), + "catalystcenter_compliance_device_by_id_v1": dataSourceComplianceDeviceByID(), + "catalystcenter_itsm_cmdb_sync_status": dataSourceItsmCmdbSyncStatus(), + "catalystcenter_itsm_cmdb_sync_status_v1": dataSourceItsmCmdbSyncStatus(), + "catalystcenter_client_proximity": dataSourceClientProximity(), + "catalystcenter_client_proximity_v1": dataSourceClientProximity(), + "catalystcenter_client_health": dataSourceClientHealth(), + "catalystcenter_client_health_v1": dataSourceClientHealth(), + "catalystcenter_client_enrichment_details": dataSourceClientEnrichmentDetails(), + "catalystcenter_client_enrichment_details_v1": dataSourceClientEnrichmentDetails(), + "catalystcenter_client_detail": dataSourceClientDetail(), + "catalystcenter_client_detail_v1": dataSourceClientDetail(), + "catalystcenter_sda_device_role": dataSourceSdaDeviceRole(), + "catalystcenter_sda_device_role_v1": dataSourceSdaDeviceRole(), + "catalystcenter_sda_device": dataSourceSdaDevice(), + "catalystcenter_sda_device_v1": dataSourceSdaDevice(), + "catalystcenter_wireless_sensor_test_results": dataSourceWirelessSensorTestResults(), + "catalystcenter_wireless_sensor_test_results_v1": dataSourceWirelessSensorTestResults(), + "catalystcenter_applications_count": dataSourceApplicationsCount(), + "catalystcenter_applications_count_v1": dataSourceApplicationsCount(), + "catalystcenter_application_sets_count": dataSourceApplicationSetsCount(), + "catalystcenter_application_sets_count_v1": dataSourceApplicationSetsCount(), + "catalystcenter_applications_health": dataSourceApplicationsHealth(), + "catalystcenter_applications_health_v1": dataSourceApplicationsHealth(), + "catalystcenter_event_series_audit_logs": dataSourceEventSeriesAuditLogs(), + "catalystcenter_event_series_audit_logs_v1": dataSourceEventSeriesAuditLogs(), + "catalystcenter_event_series_audit_logs_summary": dataSourceEventSeriesAuditLogsSummary(), + "catalystcenter_event_series_audit_logs_summary_v1": dataSourceEventSeriesAuditLogsSummary(), + "catalystcenter_event_series_audit_logs_parent_records": dataSourceEventSeriesAuditLogsParentRecords(), + "catalystcenter_event_series_audit_logs_parent_records_v1": dataSourceEventSeriesAuditLogsParentRecords(), + "catalystcenter_license_device_count": dataSourceLicenseDeviceCount(), + "catalystcenter_license_device_count_v1": dataSourceLicenseDeviceCount(), + "catalystcenter_license_device_license_details": dataSourceLicenseDeviceLicenseDetails(), + "catalystcenter_license_device_license_details_v1": dataSourceLicenseDeviceLicenseDetails(), + "catalystcenter_license_device_license_summary": dataSourceLicenseDeviceLicenseSummary(), + "catalystcenter_license_device_license_summary_v1": dataSourceLicenseDeviceLicenseSummary(), + "catalystcenter_license_term_details": dataSourceLicenseTermDetails(), + "catalystcenter_license_term_details_v1": dataSourceLicenseTermDetails(), + "catalystcenter_license_usage_details": dataSourceLicenseUsageDetails(), + "catalystcenter_license_usage_details_v1": dataSourceLicenseUsageDetails(), + "catalystcenter_license_device": dataSourceLicenseDevice(), + "catalystcenter_license_device_v1": dataSourceLicenseDevice(), + "catalystcenter_license_virtual_account_details": dataSourceLicenseVirtualAccountDetails(), + "catalystcenter_license_virtual_account_details_v1": dataSourceLicenseVirtualAccountDetails(), + "catalystcenter_app_policy": dataSourceAppPolicy(), + "catalystcenter_app_policy_v1": dataSourceAppPolicy(), + "catalystcenter_app_policy_default": dataSourceAppPolicyDefault(), + "catalystcenter_app_policy_default_v1": dataSourceAppPolicyDefault(), + "catalystcenter_app_policy_queuing_profile_count": dataSourceAppPolicyQueuingProfileCount(), + "catalystcenter_app_policy_queuing_profile_count_v1": dataSourceAppPolicyQueuingProfileCount(), + "catalystcenter_dnacaap_management_execution_status": dataSourceDnacaapManagementExecutionStatus(), + "catalystcenter_dnacaap_management_execution_status_v1": dataSourceDnacaapManagementExecutionStatus(), + "catalystcenter_profiling_rules_count": dataSourceProfilingRulesCount(), + "catalystcenter_profiling_rules_count_v1": dataSourceProfilingRulesCount(), + "catalystcenter_device_family_identifiers_details": dataSourceDeviceFamilyIDentifiersDetails(), + "catalystcenter_device_family_identifiers_details_v1": dataSourceDeviceFamilyIDentifiersDetails(), + "catalystcenter_golden_tag_image": dataSourceGoldenTagImage(), + "catalystcenter_golden_tag_image_v1": dataSourceGoldenTagImage(), + "catalystcenter_qos_device_interface_info_count": dataSourceQosDeviceInterfaceInfoCount(), + "catalystcenter_qos_device_interface_info_count_v1": dataSourceQosDeviceInterfaceInfoCount(), + "catalystcenter_projects_details_v2": dataSourceProjectsDetailsV2(), + "catalystcenter_templates_details_v2": dataSourceTemplatesDetailsV2(), + "catalystcenter_network_device_interface_neighbor": dataSourceNetworkDeviceInterfaceNeighbor(), + "catalystcenter_network_device_interface_neighbor_v1": dataSourceNetworkDeviceInterfaceNeighbor(), + "catalystcenter_lan_automation_log": dataSourceLanAutomationLog(), + "catalystcenter_lan_automation_log_v1": dataSourceLanAutomationLog(), + "catalystcenter_buildings_planned_access_points": dataSourceBuildingsPlannedAccessPoints(), + "catalystcenter_buildings_planned_access_points_v1": dataSourceBuildingsPlannedAccessPoints(), + "catalystcenter_lan_automation_status": dataSourceLanAutomationStatus(), + "catalystcenter_lan_automation_status_v1": dataSourceLanAutomationStatus(), + "catalystcenter_interface": dataSourceInterface(), + "catalystcenter_interface_v1": dataSourceInterface(), + "catalystcenter_event_config_connector_types": dataSourceEventConfigConnectorTypes(), + "catalystcenter_event_config_connector_types_v1": dataSourceEventConfigConnectorTypes(), + "catalystcenter_lan_automation_count": dataSourceLanAutomationCount(), + "catalystcenter_lan_automation_count_v1": dataSourceLanAutomationCount(), + "catalystcenter_planned_access_points": dataSourcePlannedAccessPoints(), + "catalystcenter_planned_access_points_v1": dataSourcePlannedAccessPoints(), + "catalystcenter_authentication_policy_servers": dataSourceAuthenticationPolicyServers(), + "catalystcenter_authentication_policy_servers_v1": dataSourceAuthenticationPolicyServers(), + "catalystcenter_device_reboot_apreboot": dataSourceDeviceRebootApreboot(), + "catalystcenter_device_reboot_apreboot_v1": dataSourceDeviceRebootApreboot(), + "catalystcenter_dnac_packages": dataSourceDnacPackages(), + "catalystcenter_dnac_packages_v1": dataSourceDnacPackages(), + "catalystcenter_eox_status_device": dataSourceEoXStatusDevice(), + "catalystcenter_eox_status_device_v1": dataSourceEoXStatusDevice(), + "catalystcenter_eox_status_summary": dataSourceEoXStatusSummary(), + "catalystcenter_eox_status_summary_v1": dataSourceEoXStatusSummary(), + "catalystcenter_event_email_config": dataSourceEventEmailConfig(), + "catalystcenter_event_email_config_v1": dataSourceEventEmailConfig(), + "catalystcenter_event_syslog_config": dataSourceEventSyslogConfig(), + "catalystcenter_event_syslog_config_v1": dataSourceEventSyslogConfig(), + "catalystcenter_integration_settings_instances_itsm": dataSourceIntegrationSettingsInstancesItsm(), + "catalystcenter_integration_settings_instances_itsm_v1": dataSourceIntegrationSettingsInstancesItsm(), + "catalystcenter_lan_automation_log_by_serial_number": dataSourceLanAutomationLogBySerialNumber(), + "catalystcenter_lan_automation_log_by_serial_number_v1": dataSourceLanAutomationLogBySerialNumber(), + "catalystcenter_network_device_user_defined_field": dataSourceNetworkDeviceUserDefinedField(), + "catalystcenter_network_device_user_defined_field_v1": dataSourceNetworkDeviceUserDefinedField(), + "catalystcenter_accesspoint_configuration_details_by_task_id": dataSourceAccesspointConfigurationDetailsByTaskID(), + "catalystcenter_accesspoint_configuration_details_by_task_id_v1": dataSourceAccesspointConfigurationDetailsByTaskID(), + "catalystcenter_wireless_accesspoint_configuration_summary": dataSourceWirelessAccesspointConfigurationSummary(), + "catalystcenter_wireless_accesspoint_configuration_summary_v1": dataSourceWirelessAccesspointConfigurationSummary(), + "catalystcenter_global_credential_v2": dataSourceGlobalCredentialV2(), + "catalystcenter_network_v2": dataSourceNetworkV2(), + "catalystcenter_service_provider_v2": dataSourceServiceProviderV2(), + "catalystcenter_role_permissions": dataSourceRolePermissions(), + "catalystcenter_role_permissions_v1": dataSourceRolePermissions(), + "catalystcenter_roles": dataSourceRoles(), + "catalystcenter_roles_v1": dataSourceRoles(), + "catalystcenter_user": dataSourceUser(), + "catalystcenter_user_v1": dataSourceUser(), + "catalystcenter_users_external_servers": dataSourceUsersExternalServers(), + "catalystcenter_users_external_servers_v1": dataSourceUsersExternalServers(), + "catalystcenter_flexible_report_content": dataSourceFlexibleReportContent(), + "catalystcenter_flexible_report_content_v1": dataSourceFlexibleReportContent(), + "catalystcenter_flexible_report_executions": dataSourceFlexibleReportExecutions(), + "catalystcenter_flexible_report_executions_v1": dataSourceFlexibleReportExecutions(), + "catalystcenter_flexible_report_schedule": dataSourceFlexibleReportSchedule(), + "catalystcenter_flexible_report_schedule_v1": dataSourceFlexibleReportSchedule(), + "catalystcenter_flexible_report_schedules": dataSourceFlexibleReportSchedules(), + "catalystcenter_flexible_report_schedules_v1": dataSourceFlexibleReportSchedules(), + "catalystcenter_dna_event_snmp_config": dataSourceDnaEventSNMPConfig(), + "catalystcenter_dna_event_snmp_config_v1": dataSourceDnaEventSNMPConfig(), + "catalystcenter_integration_settings_itsm_instances": dataSourceIntegrationSettingsItsmInstances(), + "catalystcenter_integration_settings_itsm_instances_v1": dataSourceIntegrationSettingsItsmInstances(), + "catalystcenter_integration_settings_status": dataSourceIntegrationSettingsStatus(), + "catalystcenter_integration_settings_status_v1": dataSourceIntegrationSettingsStatus(), + "catalystcenter_ise_integration_status": dataSourceIseIntegrationStatus(), + "catalystcenter_ise_integration_status_v1": dataSourceIseIntegrationStatus(), + "catalystcenter_lan_automation_sessions": dataSourceLanAutomationSessions(), + "catalystcenter_lan_automation_sessions_v1": dataSourceLanAutomationSessions(), + "catalystcenter_maps_import_status": dataSourceMapsImportStatus(), + "catalystcenter_maps_import_status_v1": dataSourceMapsImportStatus(), + "catalystcenter_maps_supported_access_points": dataSourceMapsSupportedAccessPoints(), + "catalystcenter_maps_supported_access_points_v1": dataSourceMapsSupportedAccessPoints(), + "catalystcenter_network_device_config_": dataSourceNetworkDeviceConfig(), + "catalystcenter_network_device_config__v1": dataSourceNetworkDeviceConfig(), + "catalystcenter_network_device_config_task": dataSourceNetworkDeviceConfigTask(), + "catalystcenter_network_device_config_task_v1": dataSourceNetworkDeviceConfigTask(), + "catalystcenter_network_device_ip_address": dataSourceNetworkDeviceIPAddress(), + "catalystcenter_network_device_ip_address_v1": dataSourceNetworkDeviceIPAddress(), + "catalystcenter_sda_anycast_gateways": dataSourceSdaAnycastGateways(), + "catalystcenter_sda_anycast_gateways_v1": dataSourceSdaAnycastGateways(), + "catalystcenter_sda_anycast_gateways_count": dataSourceSdaAnycastGatewaysCount(), + "catalystcenter_sda_anycast_gateways_count_v1": dataSourceSdaAnycastGatewaysCount(), + "catalystcenter_sda_authentication_profiles": dataSourceSdaAuthenticationProfiles(), + "catalystcenter_sda_authentication_profiles_v1": dataSourceSdaAuthenticationProfiles(), + "catalystcenter_sda_extranet_policies": dataSourceSdaExtranetPolicies(), + "catalystcenter_sda_extranet_policies_v1": dataSourceSdaExtranetPolicies(), + "catalystcenter_sda_extranet_policies_count": dataSourceSdaExtranetPoliciesCount(), + "catalystcenter_sda_extranet_policies_count_v1": dataSourceSdaExtranetPoliciesCount(), + "catalystcenter_sda_fabric_devices": dataSourceSdaFabricDevices(), + "catalystcenter_sda_fabric_devices_v1": dataSourceSdaFabricDevices(), + "catalystcenter_sda_fabric_devices_count": dataSourceSdaFabricDevicesCount(), + "catalystcenter_sda_fabric_devices_count_v1": dataSourceSdaFabricDevicesCount(), + "catalystcenter_sda_fabric_devices_layer2_handoffs": dataSourceSdaFabricDevicesLayer2Handoffs(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_v1": dataSourceSdaFabricDevicesLayer2Handoffs(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_count": dataSourceSdaFabricDevicesLayer2HandoffsCount(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_count_v1": dataSourceSdaFabricDevicesLayer2HandoffsCount(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits": dataSourceSdaFabricDevicesLayer2HandoffsIPTransits(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits_v1": dataSourceSdaFabricDevicesLayer2HandoffsIPTransits(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits_count": dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsCount(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits_count_v1": dataSourceSdaFabricDevicesLayer2HandoffsIPTransitsCount(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits": dataSourceSdaFabricDevicesLayer2HandoffsSdaTransits(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_v1": dataSourceSdaFabricDevicesLayer2HandoffsSdaTransits(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_count": dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsCount(), + "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_count_v1": dataSourceSdaFabricDevicesLayer2HandoffsSdaTransitsCount(), + "catalystcenter_sda_fabric_sites": dataSourceSdaFabricSites(), + "catalystcenter_sda_fabric_sites_v1": dataSourceSdaFabricSites(), + "catalystcenter_sda_fabric_sites_count": dataSourceSdaFabricSitesCount(), + "catalystcenter_sda_fabric_sites_count_v1": dataSourceSdaFabricSitesCount(), + "catalystcenter_sda_fabric_zones": dataSourceSdaFabricZones(), + "catalystcenter_sda_fabric_zones_v1": dataSourceSdaFabricZones(), + "catalystcenter_sda_fabric_zones_count": dataSourceSdaFabricZonesCount(), + "catalystcenter_sda_fabric_zones_count_v1": dataSourceSdaFabricZonesCount(), + "catalystcenter_sda_port_assignments": dataSourceSdaPortAssignments(), + "catalystcenter_sda_port_assignments_v1": dataSourceSdaPortAssignments(), + "catalystcenter_sda_port_assignments_count": dataSourceSdaPortAssignmentsCount(), + "catalystcenter_sda_port_assignments_count_v1": dataSourceSdaPortAssignmentsCount(), + "catalystcenter_sda_provision_devices": dataSourceSdaProvisionDevices(), + "catalystcenter_sda_provision_devices_v1": dataSourceSdaProvisionDevices(), + "catalystcenter_sda_provision_devices_count": dataSourceSdaProvisionDevicesCount(), + "catalystcenter_sda_provision_devices_count_v1": dataSourceSdaProvisionDevicesCount(), + "catalystcenter_sda_site_member_member": dataSourceSdaSiteMemberMember(), + "catalystcenter_sda_site_member_member_v1": dataSourceSdaSiteMemberMember(), + "catalystcenter_application_set_v2": dataSourceApplicationSetV2(), + "catalystcenter_application_sets_count_v2": dataSourceApplicationSetsCountV2(), + "catalystcenter_applications_v2": dataSourceApplicationsV2(), + "catalystcenter_applications_count_v2": dataSourceApplicationsCountV2(), + "catalystcenter_site_v2": dataSourceSiteV2(), + "catalystcenter_site_count_v2": dataSourceSiteCountV2(), + "catalystcenter_users_external_authentication": dataSourceUsersExternalAuthentication(), + "catalystcenter_users_external_authentication_v1": dataSourceUsersExternalAuthentication(), + "catalystcenter_users_external_servers_aaa_attribute": dataSourceUsersExternalServersAAAAttribute(), + "catalystcenter_users_external_servers_aaa_attribute_v1": dataSourceUsersExternalServersAAAAttribute(), + "catalystcenter_assurance_events": dataSourceAssuranceEvents(), + "catalystcenter_assurance_events_v1": dataSourceAssuranceEvents(), + "catalystcenter_assurance_events_count": dataSourceAssuranceEventsCount(), + "catalystcenter_assurance_events_count_v1": dataSourceAssuranceEventsCount(), + "catalystcenter_assurance_events_child_events": dataSourceAssuranceEventsChildEvents(), + "catalystcenter_assurance_events_child_events_v1": dataSourceAssuranceEventsChildEvents(), + "catalystcenter_assurance_issues": dataSourceAssuranceIssues(), + "catalystcenter_assurance_issues_v1": dataSourceAssuranceIssues(), + "catalystcenter_assurance_issues_count": dataSourceAssuranceIssuesCount(), + "catalystcenter_assurance_issues_count_v1": dataSourceAssuranceIssuesCount(), + "catalystcenter_clients": dataSourceClients(), + "catalystcenter_clients_v1": dataSourceClients(), + "catalystcenter_clients_count": dataSourceClientsCount(), + "catalystcenter_clients_count_v1": dataSourceClientsCount(), + "catalystcenter_interfaces": dataSourceInterfaces(), + "catalystcenter_interfaces_v1": dataSourceInterfaces(), + "catalystcenter_interfaces_count": dataSourceInterfacesCount(), + "catalystcenter_interfaces_count_v1": dataSourceInterfacesCount(), + "catalystcenter_network_devices": dataSourceNetworkDevices(), + "catalystcenter_network_devices_v1": dataSourceNetworkDevices(), + "catalystcenter_network_devices_count": dataSourceNetworkDevicesCount(), + "catalystcenter_network_devices_count_v1": dataSourceNetworkDevicesCount(), + "catalystcenter_site_health_summaries": dataSourceSiteHealthSummaries(), + "catalystcenter_site_health_summaries_v1": dataSourceSiteHealthSummaries(), + "catalystcenter_site_health_summaries_count": dataSourceSiteHealthSummariesCount(), + "catalystcenter_site_health_summaries_count_v1": dataSourceSiteHealthSummariesCount(), + "catalystcenter_site_health_summaries_summary_analytics": dataSourceSiteHealthSummariesSummaryAnalytics(), + "catalystcenter_site_health_summaries_summary_analytics_v1": dataSourceSiteHealthSummariesSummaryAnalytics(), + "catalystcenter_assurance_get_sensor_test_results": dataSourceAssuranceGetSensorTestResults(), + "catalystcenter_assurance_get_sensor_test_results_v1": dataSourceAssuranceGetSensorTestResults(), + "catalystcenter_areas": dataSourceAreas(), + "catalystcenter_areas_v1": dataSourceAreas(), + "catalystcenter_custom_issue_definitions": dataSourceCustomIssueDefinitions(), + "catalystcenter_custom_issue_definitions_v1": dataSourceCustomIssueDefinitions(), + "catalystcenter_custom_issue_definitions_count": dataSourceCustomIssueDefinitionsCount(), + "catalystcenter_custom_issue_definitions_count_v1": dataSourceCustomIssueDefinitionsCount(), + "catalystcenter_diagnostic_validation_sets": dataSourceDiagnosticValidationSets(), + "catalystcenter_diagnostic_validation_sets_v1": dataSourceDiagnosticValidationSets(), + "catalystcenter_diagnostic_validation_workflows": dataSourceDiagnosticValidationWorkflows(), + "catalystcenter_diagnostic_validation_workflows_v1": dataSourceDiagnosticValidationWorkflows(), + "catalystcenter_diagnostic_validation_workflows_count": dataSourceDiagnosticValidationWorkflowsCount(), + "catalystcenter_diagnostic_validation_workflows_count_v1": dataSourceDiagnosticValidationWorkflowsCount(), + "catalystcenter_health_score_definitions": dataSourceHealthScoreDefinitions(), + "catalystcenter_health_score_definitions_v1": dataSourceHealthScoreDefinitions(), + "catalystcenter_images": dataSourceImages(), + "catalystcenter_images_v1": dataSourceImages(), + "catalystcenter_images_count": dataSourceImagesCount(), + "catalystcenter_images_count_v1": dataSourceImagesCount(), + "catalystcenter_images_distribution_server_settings": dataSourceImagesDistributionServerSettings(), + "catalystcenter_images_distribution_server_settings_v1": dataSourceImagesDistributionServerSettings(), + "catalystcenter_images_addon_images": dataSourceImagesAddonImages(), + "catalystcenter_images_addon_images_v1": dataSourceImagesAddonImages(), + "catalystcenter_images_addon_images_count": dataSourceImagesAddonImagesCount(), + "catalystcenter_images_addon_images_count_v1": dataSourceImagesAddonImagesCount(), + "catalystcenter_images_site_wise_product_names": dataSourceImagesSiteWiseProductNames(), + "catalystcenter_images_site_wise_product_names_v1": dataSourceImagesSiteWiseProductNames(), + "catalystcenter_images_site_wise_product_names_count": dataSourceImagesSiteWiseProductNamesCount(), + "catalystcenter_images_site_wise_product_names_count_v1": dataSourceImagesSiteWiseProductNamesCount(), + "catalystcenter_license_setting": dataSourceLicenseSetting(), + "catalystcenter_license_setting_v1": dataSourceLicenseSetting(), + "catalystcenter_network_device_image_updates": dataSourceNetworkDeviceImageUpdates(), + "catalystcenter_network_device_image_updates_v1": dataSourceNetworkDeviceImageUpdates(), + "catalystcenter_network_device_image_updates_count": dataSourceNetworkDeviceImageUpdatesCount(), + "catalystcenter_network_device_image_updates_count_v1": dataSourceNetworkDeviceImageUpdatesCount(), + "catalystcenter_network_devices_assigned_to_site": dataSourceNetworkDevicesAssignedToSite(), + "catalystcenter_network_devices_assigned_to_site_v1": dataSourceNetworkDevicesAssignedToSite(), + "catalystcenter_network_devices_assigned_to_site_count": dataSourceNetworkDevicesAssignedToSiteCount(), + "catalystcenter_network_devices_assigned_to_site_count_v1": dataSourceNetworkDevicesAssignedToSiteCount(), + "catalystcenter_network_devices_device_controllability_settings": dataSourceNetworkDevicesDeviceControllabilitySettings(), + "catalystcenter_network_devices_device_controllability_settings_v1": dataSourceNetworkDevicesDeviceControllabilitySettings(), + "catalystcenter_network_devices_not_assigned_to_site": dataSourceNetworkDevicesNotAssignedToSite(), + "catalystcenter_network_devices_not_assigned_to_site_v1": dataSourceNetworkDevicesNotAssignedToSite(), + "catalystcenter_network_devices_not_assigned_to_site_count": dataSourceNetworkDevicesNotAssignedToSiteCount(), + "catalystcenter_network_devices_not_assigned_to_site_count_v1": dataSourceNetworkDevicesNotAssignedToSiteCount(), + "catalystcenter_network_devices_assigned_to_site_id": dataSourceNetworkDevicesAssignedToSiteID(), + "catalystcenter_network_devices_assigned_to_site_id_v1": dataSourceNetworkDevicesAssignedToSiteID(), + "catalystcenter_network_devices_resync_interval_settings_id": dataSourceNetworkDevicesResyncIntervalSettingsID(), + "catalystcenter_network_devices_resync_interval_settings_id_v1": dataSourceNetworkDevicesResyncIntervalSettingsID(), + "catalystcenter_network_devices_network_profiles_for_sites": dataSourceNetworkDevicesNetworkProfilesForSites(), + "catalystcenter_network_devices_network_profiles_for_sites_v1": dataSourceNetworkDevicesNetworkProfilesForSites(), + "catalystcenter_network_devices_network_profiles_for_sites_count": dataSourceNetworkDevicesNetworkProfilesForSitesCount(), + "catalystcenter_network_devices_network_profiles_for_sites_count_v1": dataSourceNetworkDevicesNetworkProfilesForSitesCount(), + "catalystcenter_network_profiles_for_sites_site_assignments": dataSourceNetworkProfilesForSitesSiteAssignments(), + "catalystcenter_network_profiles_for_sites_site_assignments_v1": dataSourceNetworkProfilesForSitesSiteAssignments(), + "catalystcenter_network_profiles_for_sites_site_assignments_count": dataSourceNetworkProfilesForSitesSiteAssignmentsCount(), + "catalystcenter_network_profiles_for_sites_site_assignments_count_v1": dataSourceNetworkProfilesForSitesSiteAssignmentsCount(), + "catalystcenter_product_names": dataSourceProductNames(), + "catalystcenter_product_names_v1": dataSourceProductNames(), + "catalystcenter_product_names_count": dataSourceProductNamesCount(), + "catalystcenter_product_names_count_v1": dataSourceProductNamesCount(), + "catalystcenter_provisioning_settings": dataSourceProvisioningSettings(), + "catalystcenter_provisioning_settings_v1": dataSourceProvisioningSettings(), + "catalystcenter_sda_fabrics_vlan_to_ssids": dataSourceSdaFabricsVLANToSSIDs(), + "catalystcenter_sda_fabrics_vlan_to_ssids_v1": dataSourceSdaFabricsVLANToSSIDs(), + "catalystcenter_sda_fabrics_vlan_to_ssids_count": dataSourceSdaFabricsVLANToSSIDsCount(), + "catalystcenter_sda_fabrics_vlan_to_ssids_count_v1": dataSourceSdaFabricsVLANToSSIDsCount(), + "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id": dataSourceSdaFabricsVLANToSSIDsFabricID(), + "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id_v1": dataSourceSdaFabricsVLANToSSIDsFabricID(), + "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id_count": dataSourceSdaFabricsVLANToSSIDsFabricIDCount(), + "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id_count_v1": dataSourceSdaFabricsVLANToSSIDsFabricIDCount(), + "catalystcenter_sda_layer2_virtual_networks": dataSourceSdaLayer2VirtualNetworks(), + "catalystcenter_sda_layer2_virtual_networks_v1": dataSourceSdaLayer2VirtualNetworks(), + "catalystcenter_sda_layer2_virtual_networks_count": dataSourceSdaLayer2VirtualNetworksCount(), + "catalystcenter_sda_layer2_virtual_networks_count_v1": dataSourceSdaLayer2VirtualNetworksCount(), + "catalystcenter_sda_layer3_virtual_networks": dataSourceSdaLayer3VirtualNetworks(), + "catalystcenter_sda_layer3_virtual_networks_v1": dataSourceSdaLayer3VirtualNetworks(), + "catalystcenter_sda_layer3_virtual_networks_count": dataSourceSdaLayer3VirtualNetworksCount(), + "catalystcenter_sda_layer3_virtual_networks_count_v1": dataSourceSdaLayer3VirtualNetworksCount(), + "catalystcenter_sda_multicast_v1_v1": dataSourceSdaMulticastV1(), + "catalystcenter_sda_multicast_virtual_networks": dataSourceSdaMulticastVirtualNetworks(), + "catalystcenter_sda_multicast_virtual_networks_v1": dataSourceSdaMulticastVirtualNetworks(), + "catalystcenter_sda_multicast_virtual_networks_count": dataSourceSdaMulticastVirtualNetworksCount(), + "catalystcenter_sda_multicast_virtual_networks_count_v1": dataSourceSdaMulticastVirtualNetworksCount(), + "catalystcenter_sda_port_channels": dataSourceSdaPortChannels(), + "catalystcenter_sda_port_channels_v1": dataSourceSdaPortChannels(), + "catalystcenter_sda_port_channels_count": dataSourceSdaPortChannelsCount(), + "catalystcenter_sda_port_channels_count_v1": dataSourceSdaPortChannelsCount(), + "catalystcenter_sda_transit_networks": dataSourceSdaTransitNetworks(), + "catalystcenter_sda_transit_networks_v1": dataSourceSdaTransitNetworks(), + "catalystcenter_sda_transit_networks_count": dataSourceSdaTransitNetworksCount(), + "catalystcenter_sda_transit_networks_count_v1": dataSourceSdaTransitNetworksCount(), + "catalystcenter_site_wise_product_names": dataSourceSiteWiseProductNames(), + "catalystcenter_site_wise_product_names_v1": dataSourceSiteWiseProductNames(), + "catalystcenter_site_wise_product_names_count": dataSourceSiteWiseProductNamesCount(), + "catalystcenter_site_wise_product_names_count_v1": dataSourceSiteWiseProductNamesCount(), + "catalystcenter_sites": dataSourceSites(), + "catalystcenter_sites_v1": dataSourceSites(), + "catalystcenter_sites_count": dataSourceSitesCount(), + "catalystcenter_sites_count_v1": dataSourceSitesCount(), + "catalystcenter_sites_aaa_settings": dataSourceSitesAAASettings(), + "catalystcenter_sites_aaa_settings_v1": dataSourceSitesAAASettings(), + "catalystcenter_sites_banner_settings": dataSourceSitesBannerSettings(), + "catalystcenter_sites_banner_settings_v1": dataSourceSitesBannerSettings(), + "catalystcenter_sites_device_credentials": dataSourceSitesDeviceCredentials(), + "catalystcenter_sites_device_credentials_v1": dataSourceSitesDeviceCredentials(), + "catalystcenter_sites_device_credentials_status": dataSourceSitesDeviceCredentialsStatus(), + "catalystcenter_sites_device_credentials_status_v1": dataSourceSitesDeviceCredentialsStatus(), + "catalystcenter_sites_dhcp_settings": dataSourceSitesDhcpSettings(), + "catalystcenter_sites_dhcp_settings_v1": dataSourceSitesDhcpSettings(), + "catalystcenter_sites_dns_settings": dataSourceSitesDNSSettings(), + "catalystcenter_sites_dns_settings_v1": dataSourceSitesDNSSettings(), + "catalystcenter_sites_image_distribution_settings": dataSourceSitesImageDistributionSettings(), + "catalystcenter_sites_image_distribution_settings_v1": dataSourceSitesImageDistributionSettings(), + "catalystcenter_sites_ntp_settings": dataSourceSitesNtpSettings(), + "catalystcenter_sites_ntp_settings_v1": dataSourceSitesNtpSettings(), + "catalystcenter_sites_telemetry_settings": dataSourceSitesTelemetrySettings(), + "catalystcenter_sites_telemetry_settings_v1": dataSourceSitesTelemetrySettings(), + "catalystcenter_sites_time_zone_settings": dataSourceSitesTimeZoneSettings(), + "catalystcenter_sites_time_zone_settings_v1": dataSourceSitesTimeZoneSettings(), + "catalystcenter_sites_profile_assignments": dataSourceSitesProfileAssignments(), + "catalystcenter_sites_profile_assignments_v1": dataSourceSitesProfileAssignments(), + "catalystcenter_sites_profile_assignments_count": dataSourceSitesProfileAssignmentsCount(), + "catalystcenter_sites_profile_assignments_count_v1": dataSourceSitesProfileAssignmentsCount(), + "catalystcenter_sites_wireless_settings_ssids": dataSourceSitesWirelessSettingsSSIDs(), + "catalystcenter_sites_wireless_settings_ssids_v1": dataSourceSitesWirelessSettingsSSIDs(), + "catalystcenter_sites_wireless_settings_ssids_count": dataSourceSitesWirelessSettingsSSIDsCount(), + "catalystcenter_sites_wireless_settings_ssids_count_v1": dataSourceSitesWirelessSettingsSSIDsCount(), + "catalystcenter_system_issue_definitions": dataSourceSystemIssueDefinitions(), + "catalystcenter_system_issue_definitions_v1": dataSourceSystemIssueDefinitions(), + "catalystcenter_system_issue_definitions_count": dataSourceSystemIssueDefinitionsCount(), + "catalystcenter_system_issue_definitions_count_v1": dataSourceSystemIssueDefinitionsCount(), + "catalystcenter_tasks": dataSourceTasks(), + "catalystcenter_tasks_v1": dataSourceTasks(), + "catalystcenter_tasks_count": dataSourceTasksCount(), + "catalystcenter_tasks_count_v1": dataSourceTasksCount(), + "catalystcenter_tasks_detail": dataSourceTasksDetail(), + "catalystcenter_tasks_detail_v1": dataSourceTasksDetail(), + "catalystcenter_wireless_access_points_factory_reset_request_status": dataSourceWirelessAccessPointsFactoryResetRequestStatus(), + "catalystcenter_wireless_access_points_factory_reset_request_status_v1": dataSourceWirelessAccessPointsFactoryResetRequestStatus(), + "catalystcenter_wireless_controllers_wireless_mobility_groups": dataSourceWirelessControllersWirelessMobilityGroups(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_v1": dataSourceWirelessControllersWirelessMobilityGroups(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_count": dataSourceWirelessControllersWirelessMobilityGroupsCount(), + "catalystcenter_wireless_controllers_wireless_mobility_groups_count_v1": dataSourceWirelessControllersWirelessMobilityGroupsCount(), + "catalystcenter_wireless_controllers_anchor_managed_ap_locations": dataSourceWirelessControllersAnchorManagedApLocations(), + "catalystcenter_wireless_controllers_anchor_managed_ap_locations_v1": dataSourceWirelessControllersAnchorManagedApLocations(), + "catalystcenter_wireless_controllers_managed_ap_locations_count": dataSourceWirelessControllersManagedApLocationsCount(), + "catalystcenter_wireless_controllers_managed_ap_locations_count_v1": dataSourceWirelessControllersManagedApLocationsCount(), + "catalystcenter_wireless_controllers_primary_managed_ap_locations": dataSourceWirelessControllersPrimaryManagedApLocations(), + "catalystcenter_wireless_controllers_primary_managed_ap_locations_v1": dataSourceWirelessControllersPrimaryManagedApLocations(), + "catalystcenter_wireless_controllers_secondary_managed_ap_locations": dataSourceWirelessControllersSecondaryManagedApLocations(), + "catalystcenter_wireless_controllers_secondary_managed_ap_locations_v1": dataSourceWirelessControllersSecondaryManagedApLocations(), + "catalystcenter_wireless_controllers_ssid_details": dataSourceWirelessControllersSSIDDetails(), + "catalystcenter_wireless_controllers_ssid_details_v1": dataSourceWirelessControllersSSIDDetails(), + "catalystcenter_wireless_controllers_ssid_details_count": dataSourceWirelessControllersSSIDDetailsCount(), + "catalystcenter_wireless_controllers_ssid_details_count_v1": dataSourceWirelessControllersSSIDDetailsCount(), + "catalystcenter_wireless_profiles": dataSourceWirelessProfiles(), + "catalystcenter_wireless_profiles_v1": dataSourceWirelessProfiles(), + "catalystcenter_wireless_profiles_count": dataSourceWirelessProfilesCount(), + "catalystcenter_wireless_profiles_count_v1": dataSourceWirelessProfilesCount(), + "catalystcenter_wireless_settings_dot11be_profiles": dataSourceWirelessSettingsDot11BeProfiles(), + "catalystcenter_wireless_settings_dot11be_profiles_v1": dataSourceWirelessSettingsDot11BeProfiles(), + "catalystcenter_wireless_settings_dot11be_profiles_count": dataSourceWirelessSettingsDot11BeProfilesCount(), + "catalystcenter_wireless_settings_dot11be_profiles_count_v1": dataSourceWirelessSettingsDot11BeProfilesCount(), + "catalystcenter_wireless_settings_interfaces": dataSourceWirelessSettingsInterfaces(), + "catalystcenter_wireless_settings_interfaces_v1": dataSourceWirelessSettingsInterfaces(), + "catalystcenter_wireless_settings_interfaces_count": dataSourceWirelessSettingsInterfacesCount(), + "catalystcenter_wireless_settings_interfaces_count_v1": dataSourceWirelessSettingsInterfacesCount(), + "catalystcenter_wireless_settings_rf_profiles": dataSourceWirelessSettingsRfProfiles(), + "catalystcenter_wireless_settings_rf_profiles_v1": dataSourceWirelessSettingsRfProfiles(), + "catalystcenter_wireless_settings_rf_profiles_count": dataSourceWirelessSettingsRfProfilesCount(), + "catalystcenter_wireless_settings_rf_profiles_count_v1": dataSourceWirelessSettingsRfProfilesCount(), + "catalystcenter_buildings": dataSourceBuildings(), + "catalystcenter_buildings_v1": dataSourceBuildings(), + "catalystcenter_floors": dataSourceFloors(), + "catalystcenter_floors_v1": dataSourceFloors(), + "catalystcenter_floors_settings_v2": dataSourceFloorsSettingsV2(), + "catalystcenter_intent_custom_issue_definitions": dataSourceIntentCustomIssueDefinitions(), + "catalystcenter_intent_custom_issue_definitions_v1": dataSourceIntentCustomIssueDefinitions(), + "catalystcenter_health_score_definitions_count": dataSourceHealthScoreDefinitionsCount(), + "catalystcenter_health_score_definitions_count_v1": dataSourceHealthScoreDefinitionsCount(), + "catalystcenter_ipam_server_setting": dataSourceIPamServerSetting(), + "catalystcenter_ipam_server_setting_v1": dataSourceIPamServerSetting(), + "catalystcenter_interfaces_members_associations": dataSourceInterfacesMembersAssociations(), + "catalystcenter_interfaces_members_associations_v1": dataSourceInterfacesMembersAssociations(), + "catalystcenter_interfaces_members_associations_count": dataSourceInterfacesMembersAssociationsCount(), + "catalystcenter_interfaces_members_associations_count_v1": dataSourceInterfacesMembersAssociationsCount(), + "catalystcenter_network_devices_members_associations": dataSourceNetworkDevicesMembersAssociations(), + "catalystcenter_network_devices_members_associations_v1": dataSourceNetworkDevicesMembersAssociations(), + "catalystcenter_network_devices_members_associations_count": dataSourceNetworkDevicesMembersAssociationsCount(), + "catalystcenter_network_devices_members_associations_count_v1": dataSourceNetworkDevicesMembersAssociationsCount(), + "catalystcenter_analytics_anc_policies": dataSourceAnalyticsAncPolicies(), + "catalystcenter_analytics_anc_policies_v1": dataSourceAnalyticsAncPolicies(), + "catalystcenter_analytics_dictionaries": dataSourceAnalyticsDictionaries(), + "catalystcenter_analytics_dictionaries_v1": dataSourceAnalyticsDictionaries(), + "catalystcenter_analytics_endpoints": dataSourceAnalyticsEndpoints(), + "catalystcenter_analytics_endpoints_v1": dataSourceAnalyticsEndpoints(), + "catalystcenter_analytics_endpoints_count": dataSourceAnalyticsEndpointsCount(), + "catalystcenter_analytics_endpoints_count_v1": dataSourceAnalyticsEndpointsCount(), + "catalystcenter_analytics_profiling_rules": dataSourceAnalyticsProfilingRules(), + "catalystcenter_analytics_profiling_rules_v1": dataSourceAnalyticsProfilingRules(), + "catalystcenter_analytics_profiling_rules_count": dataSourceAnalyticsProfilingRulesCount(), + "catalystcenter_analytics_profiling_rules_count_v1": dataSourceAnalyticsProfilingRulesCount(), + "catalystcenter_analytics_tasks": dataSourceAnalyticsTasks(), + "catalystcenter_analytics_tasks_v1": dataSourceAnalyticsTasks(), + "catalystcenter_security_rogue_wireless_containment_status": dataSourceSecurityRogueWirelessContainmentStatus(), + "catalystcenter_security_rogue_wireless_containment_status_v1": dataSourceSecurityRogueWirelessContainmentStatus(), + "catalystcenter_security_threats_level": dataSourceSecurityThreatsLevel(), + "catalystcenter_security_threats_level_v1": dataSourceSecurityThreatsLevel(), + "catalystcenter_security_threats_rogue_allowed_list": dataSourceSecurityThreatsRogueAllowedList(), + "catalystcenter_security_threats_rogue_allowed_list_v1": dataSourceSecurityThreatsRogueAllowedList(), + "catalystcenter_security_threats_rogue_allowed_list_count": dataSourceSecurityThreatsRogueAllowedListCount(), + "catalystcenter_security_threats_rogue_allowed_list_count_v1": dataSourceSecurityThreatsRogueAllowedListCount(), + "catalystcenter_security_threats_type": dataSourceSecurityThreatsType(), + "catalystcenter_security_threats_type_v1": dataSourceSecurityThreatsType(), + "catalystcenter_tags_interfaces_members_associations": dataSourceTagsInterfacesMembersAssociations(), + "catalystcenter_tags_interfaces_members_associations_v1": dataSourceTagsInterfacesMembersAssociations(), + "catalystcenter_tags_interfaces_members_associations_count": dataSourceTagsInterfacesMembersAssociationsCount(), + "catalystcenter_tags_interfaces_members_associations_count_v1": dataSourceTagsInterfacesMembersAssociationsCount(), + "catalystcenter_disasterrecovery_system_operationstatus": dataSourceDisasterrecoverySystemOperationstatus(), + "catalystcenter_disasterrecovery_system_operationstatus_v1": dataSourceDisasterrecoverySystemOperationstatus(), + "catalystcenter_disasterrecovery_system_status": dataSourceDisasterrecoverySystemStatus(), + "catalystcenter_disasterrecovery_system_status_v1": dataSourceDisasterrecoverySystemStatus(), + "catalystcenter_tags_network_devices_members_associations": dataSourceTagsNetworkDevicesMembersAssociations(), + "catalystcenter_tags_network_devices_members_associations_v1": dataSourceTagsNetworkDevicesMembersAssociations(), + "catalystcenter_tags_network_devices_members_associations_count": dataSourceTagsNetworkDevicesMembersAssociationsCount(), + "catalystcenter_tags_network_devices_members_associations_count_v1": dataSourceTagsNetworkDevicesMembersAssociationsCount(), }, ConfigureContextFunc: providerConfigure, } diff --git a/catalystcenter/resource_analytics_cmdb_endpoints.go b/catalystcenter/resource_analytics_cmdb_endpoints.go new file mode 100644 index 0000000..3ec1dee --- /dev/null +++ b/catalystcenter/resource_analytics_cmdb_endpoints.go @@ -0,0 +1,247 @@ +package catalystcenter + +import ( + "context" + + "fmt" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceAnalyticsCmdbEndpoints() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on AI Endpoint Analytics. + +- Processes incoming CMDB endpoints data and imports the same in AI Endpoint Analytics. +`, + + CreateContext: resourceAnalyticsCmdbEndpointsCreate, + ReadContext: resourceAnalyticsCmdbEndpointsRead, + DeleteContext: resourceAnalyticsCmdbEndpointsDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "payload": &schema.Schema{ + Description: `Array of RequestAIEndpointAnalyticsProcessCMDBEndpointsV1`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "asset_tag": &schema.Schema{ + Description: `Asset tag. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "department": &schema.Schema{ + Description: `Department that asset belongs to. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "display_name": &schema.Schema{ + Description: `Display name of the asset. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "last_update_timestamp": &schema.Schema{ + Description: `Last update timestamp in epoch milliseconds. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "location": &schema.Schema{ + Description: `Location of the asset. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `MAC address of the endpoint. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "managed_by": &schema.Schema{ + Description: `Asset managed by. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "model": &schema.Schema{ + Description: `Asset model. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "model_category": &schema.Schema{ + Description: `Category of the model. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "serial_number": &schema.Schema{ + Description: `Serial number of the endpoint. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceAnalyticsCmdbEndpointsCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestAnalyticsCmdbEndpointsProcessCmdbEndpointsV1(ctx, "parameters.0", d) + + // has_unknown_response: True + + response1, err := client.AIEndpointAnalytics.ProcessCmdbEndpointsV1(request1) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { + diags = append(diags, diagError( + "Failure when setting ProcessCmdbEndpointsV1 response", + err)) + return diags + } + d.SetId(getUnixTimeString()) + return diags + +} +func resourceAnalyticsCmdbEndpointsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceAnalyticsCmdbEndpointsDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestAnalyticsCmdbEndpointsProcessCmdbEndpointsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsProcessCmdbEndpointsV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsProcessCmdbEndpointsV1{} + if v := expandRequestAnalyticsCmdbEndpointsProcessCmdbEndpointsV1ItemArray(ctx, key+".payload", d); v != nil { + request = *v + } + return &request +} + +func expandRequestAnalyticsCmdbEndpointsProcessCmdbEndpointsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemAIEndpointAnalyticsProcessCmdbEndpointsV1 { + request := []catalystcentersdkgo.RequestItemAIEndpointAnalyticsProcessCmdbEndpointsV1{} + key = fixKeyAccess(key) + o := d.Get(key) + if o == nil { + return nil + } + objs := o.([]interface{}) + if len(objs) == 0 { + return nil + } + for item_no := range objs { + i := expandRequestAnalyticsCmdbEndpointsProcessCmdbEndpointsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + if i != nil { + request = append(request, *i) + } + } + return &request +} + +func expandRequestAnalyticsCmdbEndpointsProcessCmdbEndpointsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemAIEndpointAnalyticsProcessCmdbEndpointsV1 { + request := catalystcentersdkgo.RequestItemAIEndpointAnalyticsProcessCmdbEndpointsV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".mac_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mac_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mac_address")))) { + request.MacAddress = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".serial_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".serial_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".serial_number")))) { + request.SerialNumber = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".asset_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".asset_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".asset_tag")))) { + request.AssetTag = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".model_category")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".model_category")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".model_category")))) { + request.ModelCategory = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".model")))) { + request.Model = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".display_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".display_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".display_name")))) { + request.DisplayName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".department")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".department")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".department")))) { + request.Department = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".location")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location")))) { + request.Location = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".managed_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".managed_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".managed_by")))) { + request.ManagedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_update_timestamp")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_update_timestamp")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_update_timestamp")))) { + request.LastUpdateTimestamp = interfaceToIntPtr(v) + } + return &request +} diff --git a/catalystcenter/resource_analytics_endpoints.go b/catalystcenter/resource_analytics_endpoints.go new file mode 100644 index 0000000..9fb7649 --- /dev/null +++ b/catalystcenter/resource_analytics_endpoints.go @@ -0,0 +1,494 @@ +package catalystcenter + +import ( + "context" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceAnalyticsEndpoints() *schema.Resource { + return &schema.Resource{ + Description: `It manages create, read, update and delete operations on AI Endpoint Analytics. + +- Register a new endpoint in the system. + +- Update attributes of a registered endpoint. + +- Deletes the endpoint for the given unique identifier 'epId'. +`, + + CreateContext: resourceAnalyticsEndpointsCreate, + ReadContext: resourceAnalyticsEndpointsRead, + UpdateContext: resourceAnalyticsEndpointsUpdate, + DeleteContext: resourceAnalyticsEndpointsDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "anc_policy": &schema.Schema{ + Description: `ANC policy currently applied to the endpoint in ISE. +`, + Type: schema.TypeString, + Computed: true, + }, + "attributes": &schema.Schema{ + Description: `Various endpoint attributes grouped by dictionaries (e.g. IP, DHCP, etc). +`, + Type: schema.TypeString, //TEST, + Computed: true, + }, + "device_type": &schema.Schema{ + Description: `Type of the device represented by this endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "duid": &schema.Schema{ + Description: `Unique DUID. +`, + Type: schema.TypeString, + Computed: true, + }, + "granular_anc_policy": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "name": &schema.Schema{ + Description: `Name of the granular ANC policy. +`, + Type: schema.TypeString, + Computed: true, + }, + "nas_ip_address": &schema.Schema{ + Description: `IP address of the network device where endpoint is attached. +`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `Hardware manufacturer for the endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `Hardware model of the endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "id": &schema.Schema{ + Description: `Unique identifier for the endpoint. +`, + Type: schema.TypeString, + Computed: true, + }, + "last_probe_collection_timestamp": &schema.Schema{ + Description: `Last probe collection timestamp in epoch milliseconds. +`, + Type: schema.TypeInt, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `MAC address of the endpoint. +`, + Type: schema.TypeString, + Computed: true, + }, + "operating_system": &schema.Schema{ + Description: `Operating system of the endpoint. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "random_mac": &schema.Schema{ + Description: `Flag to indicate whether MAC address is a randomized one or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "registered": &schema.Schema{ + Description: `Flag to indicate whether this is a manually registered endpoint or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "trust_data": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ai_spoofing_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to AI spoofing. +`, + Type: schema.TypeString, + Computed: true, + }, + "auth_method": &schema.Schema{ + Description: `Authentication method. +`, + Type: schema.TypeString, + Computed: true, + }, + "changed_profile_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to changing profile labels. +`, + Type: schema.TypeString, + Computed: true, + }, + "concurrent_mac_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to concurrent MAC address. +`, + Type: schema.TypeString, + Computed: true, + }, + "ip_blocklist_detected": &schema.Schema{ + Description: `Flag to fetch endpoints hitting IP blocklist or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "nat_trust_level": &schema.Schema{ + Description: `Trust level of the endpoint due to NAT access. +`, + Type: schema.TypeString, + Computed: true, + }, + "posture_status": &schema.Schema{ + Description: `Posture status. +`, + Type: schema.TypeString, + Computed: true, + }, + "trust_score": &schema.Schema{ + Description: `Overall trust score of the endpoint. +`, + Type: schema.TypeInt, + Computed: true, + }, + "unauth_port_detected": &schema.Schema{ + Description: `Flag to fetch endpoints exposing unauthorized ports or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "weak_cred_detected": &schema.Schema{ + Description: `Flag to fetch endpoints having weak credentials or not. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `Type of the device represented by this endpoint. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "ep_id": &schema.Schema{ + Description: `epId path parameter. Unique identifier for the endpoint. +`, + Type: schema.TypeString, + Required: true, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `Hardware manufacturer for the endpoint. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "hardware_model": &schema.Schema{ + Description: `Hardware model of the endpoint. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `MAC address of the endpoint. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func resourceAnalyticsEndpointsCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestAnalyticsEndpointsRegisterAnEndpointV1(ctx, "parameters.0", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + + vEpID, okEpID := resourceItem["ep_id"] + vvEpID := interfaceToString(vEpID) + vMacAdress := resourceItem["mac_address"] + vvMacAdress := interfaceToString(vMacAdress) + if okEpID && vvEpID != "" { + getResponse2, _, err := client.AIEndpointAnalytics.GetEndpointDetailsV1(vvEpID, nil) + if err == nil && getResponse2 != nil { + resourceMap := make(map[string]string) + resourceMap["ep_id"] = vvEpID + d.SetId(joinResourceID(resourceMap)) + return resourceAnalyticsEndpointsRead(ctx, d, m) + } + } else { + queryParamImport := catalystcentersdkgo.QueryTheEndpointsV1QueryParams{ + MacAddress: vvMacAdress, + } + + response2, _, err := client.AIEndpointAnalytics.QueryTheEndpoints(&queryParamImport) + + if response2 != nil && err == nil && *response2.TotalResults > 0 { + items := *response2.Items + item := items[0] + resourceMap := make(map[string]string) + resourceMap["ep_id"] = item.ID + d.SetId(joinResourceID(resourceMap)) + return resourceAnalyticsEndpointsRead(ctx, d, m) + } + } + restyResp1, err := client.AIEndpointAnalytics.RegisterAnEndpointV1(request1) + if err != nil { + if restyResp1 != nil { + diags = append(diags, diagErrorWithResponse( + "Failure when executing RegisterAnEndpointV1", err, restyResp1.String())) + return diags + } + diags = append(diags, diagError( + "Failure when executing RegisterAnEndpointV1", err)) + return diags + } + + // TODO REVIEW + queryParamValidate := catalystcentersdkgo.QueryTheEndpointsV1QueryParams{ + MacAddress: vvMacAdress, + } + item3, _, err := client.AIEndpointAnalytics.QueryTheEndpointsV1(&queryParamValidate) + if err != nil || item3 == nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing RegisterAnEndpointV1", err, + "Failure at RegisterAnEndpointV1, unexpected response", "")) + return diags + } + if item3 != nil && err == nil && *item3.TotalResults > 0 { + items := *item3.Items + item := items[0] + resourceMap := make(map[string]string) + resourceMap["ep_id"] = item.ID + d.SetId(joinResourceID(resourceMap)) + return resourceAnalyticsEndpointsRead(ctx, d, m) + } else { + diags = append(diags, diagErrorWithAlt( + "Failure when executing RegisterAnEndpointV1", err, + "Failure at RegisterAnEndpointV1, unexpected response", "")) + return diags + } +} + +func resourceAnalyticsEndpointsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvID := resourceMap["ep_id"] + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetEndpointDetailsV1") + vvEpID := vvID + queryParams1 := catalystcentersdkgo.GetEndpointDetailsV1QueryParams{} + + // has_unknown_response: None + + response1, restyResp1, err := client.AIEndpointAnalytics.GetEndpointDetailsV1(vvEpID, &queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem2 := flattenAIEndpointAnalyticsGetEndpointDetailsV1Item(response1) + if err := d.Set("item", vItem2); err != nil { + diags = append(diags, diagError( + "Failure when setting GetEndpointDetailsV1 response", + err)) + return diags + } + + } + return diags +} + +func resourceAnalyticsEndpointsUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvID := resourceMap["ep_id"] + + if d.HasChange("parameters") { + log.Printf("[DEBUG] ID used for update operation %s", vvID) + request1 := expandRequestAnalyticsEndpointsUpdateARegisteredEndpointV1(ctx, "parameters.0", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + restyResp1, err := client.AIEndpointAnalytics.UpdateARegisteredEndpointV1(vvID, request1) + if err != nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing UpdateARegisteredEndpointV1", err, restyResp1.String(), + "Failure at UpdateARegisteredEndpointV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing UpdateARegisteredEndpointV1", err, + "Failure at UpdateARegisteredEndpointV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + } + + return resourceAnalyticsEndpointsRead(ctx, d, m) +} + +func resourceAnalyticsEndpointsDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvID := resourceMap["ep_id"] + + restyResp1, err := client.AIEndpointAnalytics.DeleteAnEndpointV1(vvID) + if err != nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing DeleteAnEndpointV1", err, restyResp1.String(), + "Failure at DeleteAnEndpointV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing DeleteAnEndpointV1", err, + "Failure at DeleteAnEndpointV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + // d.SetId("") is automatically called assuming delete returns no errors, but + // it is added here for explicitness. + d.SetId("") + + return diags +} +func expandRequestAnalyticsEndpointsRegisterAnEndpointV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsRegisterAnEndpointV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsRegisterAnEndpointV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".mac_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mac_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mac_address")))) { + request.MacAddress = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsEndpointsUpdateARegisteredEndpointV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateARegisteredEndpointV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateARegisteredEndpointV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} diff --git a/catalystcenter/resource_analytics_endpoints_anc_policy_delete.go b/catalystcenter/resource_analytics_endpoints_anc_policy_delete.go new file mode 100644 index 0000000..2485eac --- /dev/null +++ b/catalystcenter/resource_analytics_endpoints_anc_policy_delete.go @@ -0,0 +1,100 @@ +package catalystcenter + +import ( + "context" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceAnalyticsEndpointsAncPolicyDelete() *schema.Resource { + return &schema.Resource{ + Description: `It performs delete operation on AI Endpoint Analytics. + +- Revokes given ANC policy from the endpoint. +`, + + CreateContext: resourceAnalyticsEndpointsAncPolicyDeleteCreate, + ReadContext: resourceAnalyticsEndpointsAncPolicyDeleteRead, + DeleteContext: resourceAnalyticsEndpointsAncPolicyDeleteDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ep_id": &schema.Schema{ + Description: `epId path parameter. Unique identifier for the endpoint. +`, + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + }, + }, + }, + } +} + +func resourceAnalyticsEndpointsAncPolicyDeleteCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + + vEpID := resourceItem["ep_id"] + + vvEpID := vEpID.(string) + + // has_unknown_response: True + + response1, err := client.AIEndpointAnalytics.RevokeAncPolicyV1(vvEpID) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { + diags = append(diags, diagError( + "Failure when setting RevokeAncPolicyV1 response", + err)) + return diags + } + d.SetId(getUnixTimeString()) + return diags + +} +func resourceAnalyticsEndpointsAncPolicyDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceAnalyticsEndpointsAncPolicyDeleteDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} diff --git a/catalystcenter/resource_analytics_endpoints_anc_policy_update.go b/catalystcenter/resource_analytics_endpoints_anc_policy_update.go new file mode 100644 index 0000000..8608418 --- /dev/null +++ b/catalystcenter/resource_analytics_endpoints_anc_policy_update.go @@ -0,0 +1,181 @@ +package catalystcenter + +import ( + "context" + + "fmt" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceAnalyticsEndpointsAncPolicyUpdate() *schema.Resource { + return &schema.Resource{ + Description: `It performs update operation on AI Endpoint Analytics. + +- Applies given ANC policy to the endpoint. +`, + + CreateContext: resourceAnalyticsEndpointsAncPolicyUpdateCreate, + ReadContext: resourceAnalyticsEndpointsAncPolicyUpdateRead, + DeleteContext: resourceAnalyticsEndpointsAncPolicyUpdateDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ep_id": &schema.Schema{ + Description: `epId path parameter. Unique identifier for the endpoint. +`, + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "anc_policy": &schema.Schema{ + Description: `ANC policy name. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "granular_anc_policy": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "name": &schema.Schema{ + Description: `Name of the granular ANC policy. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "nas_ip_address": &schema.Schema{ + Description: `IP address of the network device where endpoint is attached. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceAnalyticsEndpointsAncPolicyUpdateCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + + vEpID := resourceItem["ep_id"] + + vvEpID := vEpID.(string) + request1 := expandRequestAnalyticsEndpointsAncPolicyUpdateApplyAncPolicyV1(ctx, "parameters.0", d) + + // has_unknown_response: True + + response1, err := client.AIEndpointAnalytics.ApplyAncPolicyV1(vvEpID, request1) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { + diags = append(diags, diagError( + "Failure when setting ApplyAncPolicyV1 response", + err)) + return diags + } + d.SetId(getUnixTimeString()) + return diags + +} +func resourceAnalyticsEndpointsAncPolicyUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceAnalyticsEndpointsAncPolicyUpdateDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestAnalyticsEndpointsAncPolicyUpdateApplyAncPolicyV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsApplyAncPolicyV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsApplyAncPolicyV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".anc_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".anc_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".anc_policy")))) { + request.AncPolicy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".granular_anc_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".granular_anc_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".granular_anc_policy")))) { + request.GranularAncPolicy = expandRequestAnalyticsEndpointsAncPolicyUpdateApplyAncPolicyV1GranularAncPolicyArray(ctx, key+".granular_anc_policy", d) + } + return &request +} + +func expandRequestAnalyticsEndpointsAncPolicyUpdateApplyAncPolicyV1GranularAncPolicyArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestAIEndpointAnalyticsApplyAncPolicyV1GranularAncPolicy { + request := []catalystcentersdkgo.RequestAIEndpointAnalyticsApplyAncPolicyV1GranularAncPolicy{} + key = fixKeyAccess(key) + o := d.Get(key) + if o == nil { + return nil + } + objs := o.([]interface{}) + if len(objs) == 0 { + return nil + } + for item_no := range objs { + i := expandRequestAnalyticsEndpointsAncPolicyUpdateApplyAncPolicyV1GranularAncPolicy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + if i != nil { + request = append(request, *i) + } + } + return &request +} + +func expandRequestAnalyticsEndpointsAncPolicyUpdateApplyAncPolicyV1GranularAncPolicy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsApplyAncPolicyV1GranularAncPolicy { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsApplyAncPolicyV1GranularAncPolicy{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { + request.Name = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".nas_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".nas_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".nas_ip_address")))) { + request.NasIPAddress = interfaceToString(v) + } + return &request +} diff --git a/catalystcenter/resource_analytics_profiling_rules.go b/catalystcenter/resource_analytics_profiling_rules.go new file mode 100644 index 0000000..5e9c5f4 --- /dev/null +++ b/catalystcenter/resource_analytics_profiling_rules.go @@ -0,0 +1,866 @@ +package catalystcenter + +import ( + "context" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceAnalyticsProfilingRules() *schema.Resource { + return &schema.Resource{ + Description: `It manages create, read, update and delete operations on AI Endpoint Analytics. + +- Creates profiling rule from the request body. + +- Updates the profiling rule for the given 'ruleId'. + +- Deletes the profiling rule for the given 'ruleId'. +`, + + CreateContext: resourceAnalyticsProfilingRulesCreate, + ReadContext: resourceAnalyticsProfilingRulesRead, + UpdateContext: resourceAnalyticsProfilingRulesUpdate, + DeleteContext: resourceAnalyticsProfilingRulesDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Computed: true, + }, + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Computed: true, + }, + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Computed: true, + }, + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Computed: true, + }, + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "result": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Computed: true, + }, + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "result": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceAnalyticsProfilingRulesCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1(ctx, "parameters.0", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + + vRuleID, okRuleID := resourceItem["rule_id"] + vvRuleID := interfaceToString(vRuleID) + vRuleName := resourceItem["rule_name"] + vvRuleName := interfaceToString(vRuleName) + if okRuleID && vvRuleID != "" { + getResponse2, _, err := client.AIEndpointAnalytics.GetDetailsOfASingleProfilingRuleV1(vvRuleID) + if err == nil && getResponse2 != nil { + + resourceMap := make(map[string]string) + + resourceMap["rule_id"] = vvRuleID + d.SetId(joinResourceID(resourceMap)) + return resourceAnalyticsProfilingRulesRead(ctx, d, m) + } + } else { + queryParamImport := catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams{} + + response2, err := searchAIEndpointAnalyticsGetListOfProfilingRulesV1(m, queryParamImport, vvRuleID, vvRuleName) + if response2 != nil && err == nil { + resourceMap := make(map[string]string) + resourceMap["rule_id"] = response2.RuleID + d.SetId(joinResourceID(resourceMap)) + return resourceAnalyticsProfilingRulesRead(ctx, d, m) + } + } + resp1, restyResp1, err := client.AIEndpointAnalytics.CreateAProfilingRuleV1(request1) + if err != nil || resp1 == nil { + if restyResp1 != nil { + diags = append(diags, diagErrorWithResponse( + "Failure when executing CreateAProfilingRuleV1", err, restyResp1.String())) + return diags + } + diags = append(diags, diagError( + "Failure when executing CreateAProfilingRuleV1", err)) + return diags + } + // TODO REVIEW + queryParamValidate := catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams{} + item3, _, err := client.AIEndpointAnalytics.GetListOfProfilingRulesV1(&queryParamValidate) + if err != nil || item3 == nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing CreateAProfilingRuleV1", err, + "Failure at CreateAProfilingRuleV1, unexpected response", "")) + return diags + } + + resourceMap := make(map[string]string) + + d.SetId(joinResourceID(resourceMap)) + return resourceAnalyticsProfilingRulesRead(ctx, d, m) +} + +func resourceAnalyticsProfilingRulesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + + vvID := resourceMap["id"] + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetDetailsOfASingleProfilingRuleV1") + + // has_unknown_response: None + + response1, restyResp1, err := client.AIEndpointAnalytics.GetDetailsOfASingleProfilingRuleV1(vvID) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + // Review flatten function used + vItem1 := flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetListOfProfilingRulesV1 search response", + err)) + return diags + } + + } + return diags +} + +func resourceAnalyticsProfilingRulesUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + + vvID := resourceMap["id"] + if d.HasChange("parameters") { + log.Printf("[DEBUG] ID used for update operation %s", vvID) + request1 := expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1(ctx, "parameters.0", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + restyResp1, err := client.AIEndpointAnalytics.UpdateAnExistingProfilingRuleV1(vvID, request1) + if err != nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing UpdateAnExistingProfilingRuleV1", err, restyResp1.String(), + "Failure at UpdateAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing UpdateAnExistingProfilingRuleV1", err, + "Failure at UpdateAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + } + + return resourceAnalyticsProfilingRulesRead(ctx, d, m) +} + +func resourceAnalyticsProfilingRulesDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + + vvID := resourceMap["id"] + + restyResp1, err := client.AIEndpointAnalytics.DeleteAnExistingProfilingRuleV1(vvID) + if err != nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing DeleteAnExistingProfilingRuleV1", err, restyResp1.String(), + "Failure at DeleteAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing DeleteAnExistingProfilingRuleV1", err, + "Failure at DeleteAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + // d.SetId("") is automatically called assuming delete returns no errors, but + // it is added here for explicitness. + d.SetId("") + + return diags +} +func expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_id")))) { + request.RuleID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_name")))) { + request.RuleName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_type")))) { + request.RuleType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_version")))) { + request.RuleVersion = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_priority")))) { + request.RulePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_priority")))) { + request.SourcePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_deleted")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_deleted")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_deleted")))) { + request.IsDeleted = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_by")))) { + request.LastModifiedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_on")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_on")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_on")))) { + request.LastModifiedOn = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".plugin_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".plugin_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".plugin_id")))) { + request.PluginID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".cluster_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cluster_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cluster_id")))) { + request.ClusterID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rejected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rejected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rejected")))) { + request.Rejected = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".result")))) { + request.Result = expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1Result(ctx, key+".result.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_groups")))) { + request.ConditionGroups = expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroups(ctx, key+".condition_groups.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".used_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".used_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".used_attributes")))) { + request.UsedAttributes = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1Result(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1Result { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1Result{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operating_system")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operating_system")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operating_system")))) { + request.OperatingSystem = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroups { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroups{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition")))) { + request.Condition = expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroupsCondition(ctx, key+".condition.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_group")))) { + request.ConditionGroup = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroupsCondition(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroupsCondition { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroupsCondition{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute")))) { + request.Attribute = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_dictionary")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_dictionary")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_dictionary")))) { + request.AttributeDictionary = interfaceToString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_id")))) { + request.RuleID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_name")))) { + request.RuleName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_type")))) { + request.RuleType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_version")))) { + request.RuleVersion = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_priority")))) { + request.RulePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_priority")))) { + request.SourcePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_deleted")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_deleted")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_deleted")))) { + request.IsDeleted = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_by")))) { + request.LastModifiedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_on")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_on")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_on")))) { + request.LastModifiedOn = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".plugin_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".plugin_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".plugin_id")))) { + request.PluginID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".cluster_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cluster_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cluster_id")))) { + request.ClusterID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rejected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rejected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rejected")))) { + request.Rejected = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".result")))) { + request.Result = expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1Result(ctx, key+".result.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_groups")))) { + request.ConditionGroups = expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroups(ctx, key+".condition_groups.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".used_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".used_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".used_attributes")))) { + request.UsedAttributes = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1Result(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1Result { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1Result{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operating_system")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operating_system")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operating_system")))) { + request.OperatingSystem = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroups { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroups{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition")))) { + request.Condition = expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroupsCondition(ctx, key+".condition.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_group")))) { + request.ConditionGroup = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroupsCondition(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroupsCondition { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroupsCondition{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute")))) { + request.Attribute = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_dictionary")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_dictionary")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_dictionary")))) { + request.AttributeDictionary = interfaceToString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func searchAIEndpointAnalyticsGetListOfProfilingRulesV1(m interface{}, queryParams catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams, vID string, vName string) (*catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRules, error) { + client := m.(*catalystcentersdkgo.Client) + var err error + var foundItem *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRules + if vName != "" || vID != "" { + queryParams.Offset = 1 + nResponse, _, err := client.AIEndpointAnalytics.GetListOfProfilingRules(&queryParams) + maxPageSize := len(*nResponse.ProfilingRules) + for len(*nResponse.ProfilingRules) > 0 { + for _, item := range *nResponse.ProfilingRules { + if vName == item.RuleName || vID == item.RuleID { + foundItem = &item + return foundItem, err + } + } + queryParams.Limit = float64(maxPageSize) + queryParams.Offset += float64(maxPageSize) + nResponse, _, err = client.AIEndpointAnalytics.GetListOfProfilingRules(&queryParams) + if nResponse == nil || nResponse.ProfilingRules == nil { + break + } + } + return nil, err + } + return foundItem, err +} diff --git a/catalystcenter/resource_analytics_profiling_rules_bulk.go b/catalystcenter/resource_analytics_profiling_rules_bulk.go new file mode 100644 index 0000000..4d8313a --- /dev/null +++ b/catalystcenter/resource_analytics_profiling_rules_bulk.go @@ -0,0 +1,470 @@ +package catalystcenter + +import ( + "context" + + "fmt" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceAnalyticsProfilingRulesBulk() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on AI Endpoint Analytics. + +- This data source action imports the given list of profiling rules. For each record, 1) If 'ruleType' for a record is +not 'Custom Rule', then it is rejected. 2) If 'ruleId' is provided in the input record, + 2a) Record with same 'ruleId' exists in the system, then it is replaced with new data. + 2b) Record with same 'ruleId' does not exist, then it is inserted in the database. +3) If 'ruleId' is not provided in the input record, then new 'ruleId' is generated by the system, and record is +inserted. +`, + + CreateContext: resourceAnalyticsProfilingRulesBulkCreate, + ReadContext: resourceAnalyticsProfilingRulesBulkRead, + DeleteContext: resourceAnalyticsProfilingRulesBulkDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "profiling_rules": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + ForceNew: true, + Computed: true, + }, + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + ForceNew: true, + Computed: true, + }, + "result": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceAnalyticsProfilingRulesBulkCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1(ctx, "parameters.0", d) + + // has_unknown_response: True + + response1, err := client.AIEndpointAnalytics.ImportProfilingRulesInBulkV1(request1) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { + diags = append(diags, diagError( + "Failure when setting ImportProfilingRulesInBulkV1 response", + err)) + return diags + } + d.SetId(getUnixTimeString()) + return diags + +} +func resourceAnalyticsProfilingRulesBulkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceAnalyticsProfilingRulesBulkDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".profiling_rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profiling_rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profiling_rules")))) { + request.ProfilingRules = expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesArray(ctx, key+".profiling_rules", d) + } + return &request +} + +func expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules { + request := []catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules{} + key = fixKeyAccess(key) + o := d.Get(key) + if o == nil { + return nil + } + objs := o.([]interface{}) + if len(objs) == 0 { + return nil + } + for item_no := range objs { + i := expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + if i != nil { + request = append(request, *i) + } + } + return &request +} + +func expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_id")))) { + request.RuleID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_name")))) { + request.RuleName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_type")))) { + request.RuleType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_version")))) { + request.RuleVersion = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_priority")))) { + request.RulePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_priority")))) { + request.SourcePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_deleted")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_deleted")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_deleted")))) { + request.IsDeleted = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_by")))) { + request.LastModifiedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_on")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_on")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_on")))) { + request.LastModifiedOn = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".plugin_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".plugin_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".plugin_id")))) { + request.PluginID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".cluster_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cluster_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cluster_id")))) { + request.ClusterID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rejected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rejected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rejected")))) { + request.Rejected = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".result")))) { + request.Result = expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesResult(ctx, key+".result.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_groups")))) { + request.ConditionGroups = expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesConditionGroups(ctx, key+".condition_groups.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".used_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".used_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".used_attributes")))) { + request.UsedAttributes = interfaceToSliceString(v) + } + return &request +} + +func expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesResult(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesResult { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesResult{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operating_system")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operating_system")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operating_system")))) { + request.OperatingSystem = interfaceToSliceString(v) + } + return &request +} + +func expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesConditionGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroups { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroups{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition")))) { + request.Condition = expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition(ctx, key+".condition.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_group")))) { + request.ConditionGroup = interfaceToSliceString(v) + } + return &request +} + +func expandRequestAnalyticsProfilingRulesBulkImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute")))) { + request.Attribute = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_dictionary")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_dictionary")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_dictionary")))) { + request.AttributeDictionary = interfaceToString(v) + } + return &request +} diff --git a/catalystcenter/resource_app_policy_intent_create.go b/catalystcenter/resource_app_policy_intent_create.go index 51d2709..4773302 100644 --- a/catalystcenter/resource_app_policy_intent_create.go +++ b/catalystcenter/resource_app_policy_intent_create.go @@ -601,20 +601,18 @@ func resourceAppPolicyIntentCreateCreate(ctx context.Context, d *schema.Resource client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestAppPolicyIntentCreateApplicationPolicyIntent(ctx, "parameters.0", d) + request1 := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.ApplicationPolicy.ApplicationPolicyIntent(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ApplicationPolicy.ApplicationPolicyIntentV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ApplicationPolicyIntent", err)) + "Failure when executing ApplicationPolicyIntentV1", err)) return diags } @@ -622,7 +620,7 @@ func resourceAppPolicyIntentCreateCreate(ctx context.Context, d *schema.Resource if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ApplicationPolicyIntent", err)) + "Failure when executing ApplicationPolicyIntentV1", err)) return diags } taskId := response1.Response.TaskID @@ -656,22 +654,20 @@ func resourceAppPolicyIntentCreateCreate(ctx context.Context, d *schema.Resource } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ApplicationPolicyIntent", err1)) + "Failure when executing ApplicationPolicyIntentV1", err1)) return diags } } - vItem1 := flattenApplicationPolicyApplicationPolicyIntentItem(response1.Response) + vItem1 := flattenApplicationPolicyApplicationPolicyIntentV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ApplicationPolicyIntent response", + "Failure when setting ApplicationPolicyIntentV1 response", err)) return diags } - d.SetId(getUnixTimeString()) return diags - } func resourceAppPolicyIntentCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -686,13 +682,13 @@ func resourceAppPolicyIntentCreateDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntent(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntent { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntent{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1 { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".create_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".create_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".create_list")))) { - request.CreateList = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListArray(ctx, key+".create_list", d) + request.CreateList = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListArray(ctx, key+".create_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".update_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".update_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".update_list")))) { - request.UpdateList = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListArray(ctx, key+".update_list", d) + request.UpdateList = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListArray(ctx, key+".update_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".delete_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".delete_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".delete_list")))) { request.DeleteList = interfaceToSliceString(v) @@ -700,8 +696,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntent(ctx context.Conte return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateList { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateList{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateList { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -712,7 +708,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListArray(ct return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -720,8 +716,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListArray(ct return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateList { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateList{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateList { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -735,36 +731,36 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateList(ctx con request.Priority = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".advanced_policy_scope")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".advanced_policy_scope")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".advanced_policy_scope")))) { - request.AdvancedPolicyScope = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvancedPolicyScope(ctx, key+".advanced_policy_scope.0", d) + request.AdvancedPolicyScope = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListAdvancedPolicyScope(ctx, key+".advanced_policy_scope.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".exclusive_contract")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".exclusive_contract")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".exclusive_contract")))) { - request.ExclusiveContract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiveContract(ctx, key+".exclusive_contract.0", d) + request.ExclusiveContract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListExclusiveContract(ctx, key+".exclusive_contract.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".contract")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".contract")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".contract")))) { - request.Contract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListContract(ctx, key+".contract.0", d) + request.Contract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListContract(ctx, key+".contract.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".producer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".producer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".producer")))) { - request.Producer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducer(ctx, key+".producer.0", d) + request.Producer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListProducer(ctx, key+".producer.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".consumer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".consumer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".consumer")))) { - request.Consumer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumer(ctx, key+".consumer.0", d) + request.Consumer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListConsumer(ctx, key+".consumer.0", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvancedPolicyScope(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListAdvancedPolicyScope { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListAdvancedPolicyScope{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListAdvancedPolicyScope(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListAdvancedPolicyScope { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListAdvancedPolicyScope{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".advanced_policy_scope_element")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".advanced_policy_scope_element")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".advanced_policy_scope_element")))) { - request.AdvancedPolicyScopeElement = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx, key+".advanced_policy_scope_element", d) + request.AdvancedPolicyScopeElement = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx, key+".advanced_policy_scope_element", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElement { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElement { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -775,7 +771,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvanced return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -783,8 +779,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvanced return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElement { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElement { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".group_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".group_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".group_id")))) { request.GroupID = interfaceToSliceString(v) } @@ -794,16 +790,16 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListAdvanced return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiveContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListExclusiveContract { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListExclusiveContract{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListExclusiveContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListExclusiveContract { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListExclusiveContract{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".clause")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".clause")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".clause")))) { - request.Clause = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiveContractClauseArray(ctx, key+".clause", d) + request.Clause = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListExclusiveContractClauseArray(ctx, key+".clause", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiveContractClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListExclusiveContractClause { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListExclusiveContractClause{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListExclusiveContractClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListExclusiveContractClause { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListExclusiveContractClause{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -814,7 +810,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiv return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiveContractClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListExclusiveContractClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -822,8 +818,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiv return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiveContractClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListExclusiveContractClause { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListExclusiveContractClause{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListExclusiveContractClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListExclusiveContractClause { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListExclusiveContractClause{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { request.Type = interfaceToString(v) } @@ -839,24 +835,24 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListExclusiv return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListContract { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListContract{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListContract { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListContract{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListProducer { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListProducer{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListProducer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListProducer { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListProducer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".scalable_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".scalable_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".scalable_group")))) { - request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducerScalableGroupArray(ctx, key+".scalable_group", d) + request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListProducerScalableGroupArray(ctx, key+".scalable_group", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListProducerScalableGroup { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListProducerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListProducerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListProducerScalableGroup { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListProducerScalableGroup{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -867,7 +863,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducer return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListProducerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -875,24 +871,24 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducer return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListProducerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListProducerScalableGroup { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListProducerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListProducerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListProducerScalableGroup { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListProducerScalableGroup{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListConsumer { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListConsumer{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListConsumer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListConsumer { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListConsumer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".scalable_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".scalable_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".scalable_group")))) { - request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumerScalableGroupArray(ctx, key+".scalable_group", d) + request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListConsumerScalableGroupArray(ctx, key+".scalable_group", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListConsumerScalableGroup { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListConsumerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListConsumerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListConsumerScalableGroup { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListConsumerScalableGroup{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -903,7 +899,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumer return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListConsumerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -911,16 +907,16 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumer return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentCreateListConsumerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListConsumerScalableGroup { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentCreateListConsumerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1CreateListConsumerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListConsumerScalableGroup { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1CreateListConsumerScalableGroup{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateList { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateList{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateList { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -931,7 +927,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListArray(ct return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -939,8 +935,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListArray(ct return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateList { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateList{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateList { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -957,25 +953,25 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateList(ctx con request.Priority = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".advanced_policy_scope")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".advanced_policy_scope")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".advanced_policy_scope")))) { - request.AdvancedPolicyScope = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvancedPolicyScope(ctx, key+".advanced_policy_scope.0", d) + request.AdvancedPolicyScope = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListAdvancedPolicyScope(ctx, key+".advanced_policy_scope.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".exclusive_contract")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".exclusive_contract")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".exclusive_contract")))) { - request.ExclusiveContract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiveContract(ctx, key+".exclusive_contract.0", d) + request.ExclusiveContract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListExclusiveContract(ctx, key+".exclusive_contract.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".contract")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".contract")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".contract")))) { - request.Contract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListContract(ctx, key+".contract.0", d) + request.Contract = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListContract(ctx, key+".contract.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".producer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".producer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".producer")))) { - request.Producer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducer(ctx, key+".producer.0", d) + request.Producer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListProducer(ctx, key+".producer.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".consumer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".consumer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".consumer")))) { - request.Consumer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumer(ctx, key+".consumer.0", d) + request.Consumer = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListConsumer(ctx, key+".consumer.0", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvancedPolicyScope(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListAdvancedPolicyScope { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListAdvancedPolicyScope{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListAdvancedPolicyScope(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListAdvancedPolicyScope { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListAdvancedPolicyScope{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -983,13 +979,13 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvanced request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".advanced_policy_scope_element")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".advanced_policy_scope_element")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".advanced_policy_scope_element")))) { - request.AdvancedPolicyScopeElement = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx, key+".advanced_policy_scope_element", d) + request.AdvancedPolicyScopeElement = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx, key+".advanced_policy_scope_element", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElementArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1000,7 +996,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvanced return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1008,8 +1004,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvanced return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListAdvancedPolicyScopeAdvancedPolicyScopeElement{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1022,19 +1018,19 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListAdvanced return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiveContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListExclusiveContract { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListExclusiveContract{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListExclusiveContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListExclusiveContract { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListExclusiveContract{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".clause")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".clause")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".clause")))) { - request.Clause = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiveContractClauseArray(ctx, key+".clause", d) + request.Clause = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListExclusiveContractClauseArray(ctx, key+".clause", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiveContractClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListExclusiveContractClause { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListExclusiveContractClause{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListExclusiveContractClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListExclusiveContractClause { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListExclusiveContractClause{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1045,7 +1041,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiv return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiveContractClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListExclusiveContractClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1053,8 +1049,8 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiv return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiveContractClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListExclusiveContractClause { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListExclusiveContractClause{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListExclusiveContractClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListExclusiveContractClause { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListExclusiveContractClause{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1073,27 +1069,27 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListExclusiv return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListContract { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListContract{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListContract(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListContract { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListContract{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListProducer { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListProducer{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListProducer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListProducer { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListProducer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".scalable_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".scalable_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".scalable_group")))) { - request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducerScalableGroupArray(ctx, key+".scalable_group", d) + request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListProducerScalableGroupArray(ctx, key+".scalable_group", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListProducerScalableGroup { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListProducerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListProducerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListProducerScalableGroup { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListProducerScalableGroup{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1104,7 +1100,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducer return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListProducerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1112,27 +1108,27 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducer return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListProducerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListProducerScalableGroup { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListProducerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListProducerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListProducerScalableGroup { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListProducerScalableGroup{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListConsumer { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListConsumer{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListConsumer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListConsumer { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListConsumer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".scalable_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".scalable_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".scalable_group")))) { - request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumerScalableGroupArray(ctx, key+".scalable_group", d) + request.ScalableGroup = expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListConsumerScalableGroupArray(ctx, key+".scalable_group", d) } return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListConsumerScalableGroup { - request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListConsumerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListConsumerScalableGroupArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListConsumerScalableGroup { + request := []catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListConsumerScalableGroup{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1143,7 +1139,7 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumer return nil } for item_no := range objs { - i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListConsumerScalableGroup(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1151,15 +1147,15 @@ func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumer return &request } -func expandRequestAppPolicyIntentCreateApplicationPolicyIntentUpdateListConsumerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListConsumerScalableGroup { - request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentUpdateListConsumerScalableGroup{} +func expandRequestAppPolicyIntentCreateApplicationPolicyIntentV1UpdateListConsumerScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListConsumerScalableGroup { + request := catalystcentersdkgo.RequestApplicationPolicyApplicationPolicyIntentV1UpdateListConsumerScalableGroup{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } return &request } -func flattenApplicationPolicyApplicationPolicyIntentItem(item *catalystcentersdkgo.ResponseApplicationPolicyApplicationPolicyIntentResponse) []map[string]interface{} { +func flattenApplicationPolicyApplicationPolicyIntentV1Item(item *catalystcentersdkgo.ResponseApplicationPolicyApplicationPolicyIntentV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_app_policy_queuing_profile.go b/catalystcenter/resource_app_policy_queuing_profile.go index b57e3e5..f1cb9ac 100644 --- a/catalystcenter/resource_app_policy_queuing_profile.go +++ b/catalystcenter/resource_app_policy_queuing_profile.go @@ -459,7 +459,7 @@ func resourceAppPolicyQueuingProfile() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestApplicationPolicyCreateApplicationPolicyQueuingProfile`, + Description: `Array of RequestApplicationPolicyCreateApplicationPolicyQueuingProfileV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -628,16 +628,16 @@ func resourceAppPolicyQueuingProfileCreate(ctx context.Context, d *schema.Resour var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfile(ctx, "parameters.0", d) + request1 := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] vvID := interfaceToString(vID) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetApplicationPolicyQueuingProfileQueryParams{} + queryParamImport := catalystcentersdkgo.GetApplicationPolicyQueuingProfileV1QueryParams{} queryParamImport.Name = vvName - item2, err := searchApplicationPolicyGetApplicationPolicyQueuingProfile(m, queryParamImport, vvID) + item2, err := searchApplicationPolicyGetApplicationPolicyQueuingProfileV1(m, queryParamImport, vvID) if err == nil && item2 != nil { resourceMap := make(map[string]string) resourceMap["name"] = vvName @@ -645,20 +645,20 @@ func resourceAppPolicyQueuingProfileCreate(ctx context.Context, d *schema.Resour d.SetId(joinResourceID(resourceMap)) return resourceAppPolicyQueuingProfileRead(ctx, d, m) } - resp1, restyResp1, err := client.ApplicationPolicy.CreateApplicationPolicyQueuingProfile(request1) + resp1, restyResp1, err := client.ApplicationPolicy.CreateApplicationPolicyQueuingProfileV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing CreateApplicationPolicyQueuingProfile", err, restyResp1.String())) + "Failure when executing CreateApplicationPolicyQueuingProfileV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing CreateApplicationPolicyQueuingProfile", err)) + "Failure when executing CreateApplicationPolicyQueuingProfileV1", err)) return diags } if resp1.Response == nil { diags = append(diags, diagError( - "Failure when executing CreateApplicationPolicyQueuingProfile", err)) + "Failure when executing CreateApplicationPolicyQueuingProfileV1", err)) return diags } taskId := resp1.Response.TaskID @@ -680,17 +680,17 @@ func resourceAppPolicyQueuingProfileCreate(ctx context.Context, d *schema.Resour errorMsg := response2.Response.Progress + "Failure Reason: " + response2.Response.FailureReason err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing CreateApplicationPolicyQueuingProfile", err1)) + "Failure when executing CreateApplicationPolicyQueuingProfileV1", err1)) return diags } } - queryParamValidate := catalystcentersdkgo.GetApplicationPolicyQueuingProfileQueryParams{} + queryParamValidate := catalystcentersdkgo.GetApplicationPolicyQueuingProfileV1QueryParams{} queryParamValidate.Name = vvName - item3, err := searchApplicationPolicyGetApplicationPolicyQueuingProfile(m, queryParamValidate, vvID) + item3, err := searchApplicationPolicyGetApplicationPolicyQueuingProfileV1(m, queryParamValidate, vvID) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing CreateApplicationPolicyQueuingProfile", err, - "Failure at CreateApplicationPolicyQueuingProfile, unexpected response", "")) + "Failure when executing CreateApplicationPolicyQueuingProfileV1", err, + "Failure at CreateApplicationPolicyQueuingProfileV1, unexpected response", "")) return diags } @@ -711,22 +711,22 @@ func resourceAppPolicyQueuingProfileRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetApplicationPolicyQueuingProfile") - queryParams1 := catalystcentersdkgo.GetApplicationPolicyQueuingProfileQueryParams{} + log.Printf("[DEBUG] Selected method: GetApplicationPolicyQueuingProfileV1") + queryParams1 := catalystcentersdkgo.GetApplicationPolicyQueuingProfileV1QueryParams{} queryParams1.Name = vvName - item1, err := searchApplicationPolicyGetApplicationPolicyQueuingProfile(m, queryParams1, vvID) + item1, err := searchApplicationPolicyGetApplicationPolicyQueuingProfileV1(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponse{ + items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1Response{ *item1, } - vItem1 := flattenApplicationPolicyGetApplicationPolicyQueuingProfileItems(&items) + vItem1 := flattenApplicationPolicyGetApplicationPolicyQueuingProfileV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetApplicationPolicyQueuingProfile search response", + "Failure when setting GetApplicationPolicyQueuingProfileV1 search response", err)) return diags } @@ -743,7 +743,7 @@ func resourceAppPolicyQueuingProfileUpdate(ctx context.Context, d *schema.Resour resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfile(ctx, "parameters.0", d) + request1 := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -858,9 +858,9 @@ func resourceAppPolicyQueuingProfileDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationPolicyQueuingProfile { - request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationPolicyQueuingProfile{} - if v := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemArray(ctx, key+".payload", d); v != nil { +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationPolicyQueuingProfileV1 { + request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationPolicyQueuingProfileV1{} + if v := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -869,8 +869,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfile(c return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfile { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfile{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -881,7 +881,7 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -892,8 +892,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfile { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfile{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { request.Description = interfaceToString(v) } @@ -901,7 +901,7 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".clause")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".clause")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".clause")))) { - request.Clause = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseArray(ctx, key+".clause", d) + request.Clause = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseArray(ctx, key+".clause", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -909,8 +909,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClause { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClause{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1Clause { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1Clause{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -921,7 +921,7 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -932,8 +932,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClause { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClause{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1Clause { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1Clause{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { request.Type = interfaceToString(v) } @@ -941,10 +941,10 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt request.IsCommonBetweenAllInterfaceSpeeds = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_speed_bandwidth_clauses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_speed_bandwidth_clauses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_speed_bandwidth_clauses")))) { - request.InterfaceSpeedBandwidthClauses = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesArray(ctx, key+".interface_speed_bandwidth_clauses", d) + request.InterfaceSpeedBandwidthClauses = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesArray(ctx, key+".interface_speed_bandwidth_clauses", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tc_dscp_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tc_dscp_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tc_dscp_settings")))) { - request.TcDscpSettings = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseTcDscpSettingsArray(ctx, key+".tc_dscp_settings", d) + request.TcDscpSettings = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettingsArray(ctx, key+".tc_dscp_settings", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -952,8 +952,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -964,7 +964,7 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClauses(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClauses(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -975,13 +975,13 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClauses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClauses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_speed")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_speed")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_speed")))) { request.InterfaceSpeed = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tc_bandwidth_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tc_bandwidth_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tc_bandwidth_settings")))) { - request.TcBandwidthSettings = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx, key+".tc_bandwidth_settings", d) + request.TcBandwidthSettings = expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx, key+".tc_bandwidth_settings", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -989,8 +989,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1001,7 +1001,7 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1012,8 +1012,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bandwidth_percentage")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bandwidth_percentage")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bandwidth_percentage")))) { request.BandwidthPercentage = interfaceToIntPtr(v) } @@ -1026,8 +1026,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseTcDscpSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseTcDscpSettings { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseTcDscpSettings{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1038,7 +1038,7 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseTcDscpSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1049,8 +1049,8 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileItemClauseTcDscpSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseTcDscpSettings { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileClauseTcDscpSettings{} +func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".dscp")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dscp")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dscp")))) { request.Dscp = interfaceToString(v) } @@ -1063,9 +1063,9 @@ func expandRequestAppPolicyQueuingProfileCreateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyUpdateApplicationPolicyQueuingProfile { - request := catalystcentersdkgo.RequestApplicationPolicyUpdateApplicationPolicyQueuingProfile{} - if v := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemArray(ctx, key+".payload", d); v != nil { +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyUpdateApplicationPolicyQueuingProfileV1 { + request := catalystcentersdkgo.RequestApplicationPolicyUpdateApplicationPolicyQueuingProfileV1{} + if v := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -1074,8 +1074,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfile(c return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfile { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfile{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1086,7 +1086,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1097,8 +1097,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfile { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfile{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1109,7 +1109,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".clause")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".clause")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".clause")))) { - request.Clause = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseArray(ctx, key+".clause", d) + request.Clause = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseArray(ctx, key+".clause", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1117,8 +1117,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClause { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClause{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1Clause { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1Clause{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1129,7 +1129,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClause(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1140,8 +1140,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClause { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClause{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClause(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1Clause { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1Clause{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToIntPtr(v) } @@ -1152,10 +1152,10 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt request.IsCommonBetweenAllInterfaceSpeeds = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_speed_bandwidth_clauses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_speed_bandwidth_clauses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_speed_bandwidth_clauses")))) { - request.InterfaceSpeedBandwidthClauses = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesArray(ctx, key+".interface_speed_bandwidth_clauses", d) + request.InterfaceSpeedBandwidthClauses = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesArray(ctx, key+".interface_speed_bandwidth_clauses", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tc_dscp_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tc_dscp_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tc_dscp_settings")))) { - request.TcDscpSettings = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseTcDscpSettingsArray(ctx, key+".tc_dscp_settings", d) + request.TcDscpSettings = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettingsArray(ctx, key+".tc_dscp_settings", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1163,8 +1163,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1175,7 +1175,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClauses(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClauses(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1186,8 +1186,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClauses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClauses{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClauses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClauses{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToIntPtr(v) } @@ -1195,7 +1195,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt request.InterfaceSpeed = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tc_bandwidth_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tc_bandwidth_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tc_bandwidth_settings")))) { - request.TcBandwidthSettings = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx, key+".tc_bandwidth_settings", d) + request.TcBandwidthSettings = expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx, key+".tc_bandwidth_settings", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1203,8 +1203,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1215,7 +1215,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1226,8 +1226,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseInterfaceSpeedBandwidthClausesTcBandwidthSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToIntPtr(v) } @@ -1243,8 +1243,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseTcDscpSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseTcDscpSettings { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseTcDscpSettings{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1255,7 +1255,7 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return nil } for item_no := range objs { - i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseTcDscpSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1266,8 +1266,8 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileItemClauseTcDscpSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseTcDscpSettings { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileClauseTcDscpSettings{} +func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileV1ItemClauseTcDscpSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateApplicationPolicyQueuingProfileV1ClauseTcDscpSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToIntPtr(v) } @@ -1283,12 +1283,12 @@ func expandRequestAppPolicyQueuingProfileUpdateApplicationPolicyQueuingProfileIt return &request } -func searchApplicationPolicyGetApplicationPolicyQueuingProfile(m interface{}, queryParams catalystcentersdkgo.GetApplicationPolicyQueuingProfileQueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponse, error) { +func searchApplicationPolicyGetApplicationPolicyQueuingProfileV1(m interface{}, queryParams catalystcentersdkgo.GetApplicationPolicyQueuingProfileV1QueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponse - var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfile - ite, _, err = client.ApplicationPolicy.GetApplicationPolicyQueuingProfile(&queryParams) + var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1Response + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1 + ite, _, err = client.ApplicationPolicy.GetApplicationPolicyQueuingProfileV1(&queryParams) if err != nil || ite == nil { return foundItem, err @@ -1298,7 +1298,7 @@ func searchApplicationPolicyGetApplicationPolicyQueuingProfile(m interface{}, qu for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileResponse + var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationPolicyQueuingProfileV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_application_policy_application_set.go b/catalystcenter/resource_application_set_v2.go similarity index 84% rename from catalystcenter/resource_application_policy_application_set.go rename to catalystcenter/resource_application_set_v2.go index 9416e02..b0d4ec6 100644 --- a/catalystcenter/resource_application_policy_application_set.go +++ b/catalystcenter/resource_application_set_v2.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceApplicationPolicyApplicationSet() *schema.Resource { +func resourceApplicationSetV2() *schema.Resource { return &schema.Resource{ Description: `It manages create, read and delete operations on Application Policy. @@ -24,10 +24,10 @@ func resourceApplicationPolicyApplicationSet() *schema.Resource { - Delete existing custom application set by id `, - CreateContext: resourceApplicationPolicyApplicationSetCreate, - ReadContext: resourceApplicationPolicyApplicationSetRead, - UpdateContext: resourceApplicationPolicyApplicationSetUpdate, - DeleteContext: resourceApplicationPolicyApplicationSetDelete, + CreateContext: resourceApplicationSetV2Create, + ReadContext: resourceApplicationSetV2Read, + UpdateContext: resourceApplicationSetV2Update, + DeleteContext: resourceApplicationSetV2Delete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -144,55 +144,55 @@ func resourceApplicationPolicyApplicationSet() *schema.Resource { "default_business_relevance": &schema.Schema{ Description: `Default business relevance - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "id": &schema.Schema{ Description: `id path parameter. Id of custom application set to delete - `, +`, Type: schema.TypeString, - Optional: true, + Required: true, }, "name": &schema.Schema{ Description: `Application Set name - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "namespace": &schema.Schema{ Description: `Namespace, should be set to scalablegroup:application - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "qualifier": &schema.Schema{ Description: `Qualifier, should be set to application - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "scalable_group_external_handle": &schema.Schema{ Description: `Scalable group external handle, should be set to application set name - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "scalable_group_type": &schema.Schema{ Description: `Scalable group type, should be set to APPLICATION_GROUP - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "type": &schema.Schema{ Description: `Type, should be set to scalablegroup - `, +`, Type: schema.TypeString, Optional: true, Computed: true, @@ -207,20 +207,20 @@ func resourceApplicationPolicyApplicationSet() *schema.Resource { } } -func resourceApplicationPolicyApplicationSetCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceApplicationSetV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestApplicationPolicyApplicationSetCreateApplicationSets(ctx, "parameters.0", d) + request1 := expandRequestApplicationPolicyApplicationSetCreateApplicationSetsV2(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetApplicationSets2QueryParams{} + queryParamImport := catalystcentersdkgo.GetApplicationSetsV2QueryParams{} queryParamImport.Name = vvName - item2, err := searchApplicationPolicyGetApplicationSets2(m, queryParamImport, "") + item2, err := searchApplicationPolicyGetApplicationSetsV2(m, queryParamImport, "") if err == nil && item2 != nil { resourceMap := make(map[string]string) resourceMap["name"] = vvName @@ -268,9 +268,9 @@ func resourceApplicationPolicyApplicationSetCreate(ctx context.Context, d *schem return diags } } - queryParamValidate := catalystcentersdkgo.GetApplicationSets2QueryParams{} + queryParamValidate := catalystcentersdkgo.GetApplicationSetsV2QueryParams{} queryParamValidate.Name = vvName - item3, err := searchApplicationPolicyGetApplicationSets2(m, queryParamValidate, "") + item3, err := searchApplicationPolicyGetApplicationSetsV2(m, queryParamValidate, "") if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( "Failure when executing CreateApplicationSet", err, @@ -283,10 +283,10 @@ func resourceApplicationPolicyApplicationSetCreate(ctx context.Context, d *schem resourceMap["id"] = item3.ID d.SetId(joinResourceID(resourceMap)) - return resourceApplicationPolicyApplicationSetRead(ctx, d, m) + return resourceApplicationSetV2Read(ctx, d, m) } -func resourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceApplicationSetV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { var diags diag.Diagnostics resourceID := d.Id() @@ -298,18 +298,18 @@ func resourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetApplicationSets") - queryParams1 := catalystcentersdkgo.GetApplicationSets2QueryParams{} + queryParams1 := catalystcentersdkgo.GetApplicationSetsV2QueryParams{} queryParams1.Name = vvName - item1, err := searchApplicationPolicyGetApplicationSets2(m, queryParams1, vvID) + item1, err := searchApplicationPolicyGetApplicationSetsV2(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2Response{ + items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2Response{ *item1, } - vItem1 := flattenApplicationPolicyGetApplicationSets2Items(&items) + vItem1 := flattenApplicationPolicyGetApplicationSetsV2Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetApplicationSets search response", @@ -321,11 +321,11 @@ func resourceApplicationPolicyApplicationSetRead(ctx context.Context, d *schema. return diags } -func resourceApplicationPolicyApplicationSetUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - return resourceApplicationPolicyApplicationSetRead(ctx, d, m) +func resourceApplicationSetV2Update(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + return resourceApplicationSetV2Read(ctx, d, m) } -func resourceApplicationPolicyApplicationSetDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceApplicationSetV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) @@ -334,7 +334,11 @@ func resourceApplicationPolicyApplicationSetDelete(ctx context.Context, d *schem resourceID := d.Id() resourceMap := separateResourceID(resourceID) vvID := resourceMap["id"] - response1, restyResp1, err := client.ApplicationPolicy.DeleteApplicationSet(vvID) + + response1, restyResp1, err := client.ApplicationPolicy.DeleteApplicationSet( + &catalystcentersdkgo.DeleteApplicationSetV1QueryParams{ + ID: vvID, + }) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) @@ -384,9 +388,9 @@ func resourceApplicationPolicyApplicationSetDelete(ctx context.Context, d *schem return diags } -func expandRequestApplicationPolicyApplicationSetCreateApplicationSets(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSets { - request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSets{} - if v := expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSetsV2 { + request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSetsV2{} + if v := expandRequestApplicationPolicyApplicationSetCreateApplicationSetsV2ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -395,8 +399,8 @@ func expandRequestApplicationPolicyApplicationSetCreateApplicationSets(ctx conte return &request } -func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSets { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSets{} +func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsV2ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetsV2 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetsV2{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -407,7 +411,7 @@ func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItemArray( return nil } for item_no := range objs { - i := expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationPolicyApplicationSetCreateApplicationSetsV2Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -418,8 +422,8 @@ func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItemArray( return &request } -func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSets { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSets{} +func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsV2Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetsV2 { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetsV2{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -447,12 +451,12 @@ func expandRequestApplicationPolicyApplicationSetCreateApplicationSetsItem(ctx c return &request } -func searchApplicationPolicyGetApplicationSets2(m interface{}, queryParams catalystcentersdkgo.GetApplicationSets2QueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2Response, error) { +func searchApplicationPolicyGetApplicationSetsV2(m interface{}, queryParams catalystcentersdkgo.GetApplicationSetsV2QueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2Response - var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2 - ite, _, err = client.ApplicationPolicy.GetApplicationSets2(&queryParams) + var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2Response + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2 + ite, _, err = client.ApplicationPolicy.GetApplicationSetsV2(&queryParams) if err != nil || ite == nil { return foundItem, err @@ -462,7 +466,7 @@ func searchApplicationPolicyGetApplicationSets2(m interface{}, queryParams catal for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets2Response + var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV2Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_application_sets.go b/catalystcenter/resource_application_sets.go index e656b49..79f35cc 100644 --- a/catalystcenter/resource_application_sets.go +++ b/catalystcenter/resource_application_sets.go @@ -76,7 +76,7 @@ func resourceApplicationSets() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestApplicationPolicyCreateApplicationSet`, + Description: `Array of RequestApplicationPolicyCreateApplicationSetV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -111,14 +111,14 @@ func resourceApplicationSetsCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestApplicationSetsCreateApplicationSet(ctx, "parameters.0", d) + request1 := expandRequestApplicationSetsCreateApplicationSetV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetApplicationSetsQueryParams{} + queryParamImport := catalystcentersdkgo.GetApplicationSetsV1QueryParams{} queryParamImport.Name = vvName - item2, err := searchApplicationPolicyGetApplicationSets(m, queryParamImport, "") + item2, err := searchApplicationPolicyGetApplicationSetsV1(m, queryParamImport, "") if err == nil && item2 != nil { resourceMap := make(map[string]string) resourceMap["name"] = vvName @@ -165,9 +165,9 @@ func resourceApplicationSetsCreate(ctx context.Context, d *schema.ResourceData, return diags } } - queryParamValidate := catalystcentersdkgo.GetApplicationSetsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetApplicationSetsV1QueryParams{} queryParamValidate.Name = vvName - item3, err := searchApplicationPolicyGetApplicationSets(m, queryParamValidate, "") + item3, err := searchApplicationPolicyGetApplicationSetsV1(m, queryParamValidate, "") if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( "Failure when executing CreateApplicationSet", err, @@ -194,18 +194,18 @@ func resourceApplicationSetsRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetApplicationSets") - queryParams1 := catalystcentersdkgo.GetApplicationSetsQueryParams{} + queryParams1 := catalystcentersdkgo.GetApplicationSetsV1QueryParams{} queryParams1.Name = vvName - item1, err := searchApplicationPolicyGetApplicationSets(m, queryParams1, vvID) + item1, err := searchApplicationPolicyGetApplicationSetsV1(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse{ + items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response{ *item1, } - vItem1 := flattenApplicationPolicyGetApplicationSetsItems(&items) + vItem1 := flattenApplicationPolicyGetApplicationSetsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetApplicationSets search response", @@ -238,7 +238,9 @@ func resourceApplicationSetsDelete(ctx context.Context, d *schema.ResourceData, vvID := resourceMap["id"] - response1, restyResp1, err := client.ApplicationPolicy.DeleteApplicationSet(vvID) + response1, restyResp1, err := client.ApplicationPolicy.DeleteApplicationSet(&catalystcentersdkgo.DeleteApplicationSetV1QueryParams{ + ID: vvID, + }) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) @@ -288,9 +290,9 @@ func resourceApplicationSetsDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestApplicationSetsCreateApplicationSet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSet { - request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSet{} - if v := expandRequestApplicationSetsCreateApplicationSetItemArray(ctx, key+".payload", d); v != nil { +func expandRequestApplicationSetsCreateApplicationSetV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSetV1 { + request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationSetV1{} + if v := expandRequestApplicationSetsCreateApplicationSetV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -299,8 +301,8 @@ func expandRequestApplicationSetsCreateApplicationSet(ctx context.Context, key s return &request } -func expandRequestApplicationSetsCreateApplicationSetItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSet { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSet{} +func expandRequestApplicationSetsCreateApplicationSetV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -311,7 +313,7 @@ func expandRequestApplicationSetsCreateApplicationSetItemArray(ctx context.Conte return nil } for item_no := range objs { - i := expandRequestApplicationSetsCreateApplicationSetItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationSetsCreateApplicationSetV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -322,8 +324,8 @@ func expandRequestApplicationSetsCreateApplicationSetItemArray(ctx context.Conte return &request } -func expandRequestApplicationSetsCreateApplicationSetItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSet { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSet{} +func expandRequestApplicationSetsCreateApplicationSetV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationSetV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -333,18 +335,17 @@ func expandRequestApplicationSetsCreateApplicationSetItem(ctx context.Context, k return &request } -func searchApplicationPolicyGetApplicationSets(m interface{}, queryParams catalystcentersdkgo.GetApplicationSetsQueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse, error) { +func searchApplicationPolicyGetApplicationSetsV1(m interface{}, queryParams catalystcentersdkgo.GetApplicationSetsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse - var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets + var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1 if vID != "" { queryParams.Offset = 1 queryParams.Name = "" nResponse, _, err := client.ApplicationPolicy.GetApplicationSets(&queryParams) maxPageSize := len(*nResponse.Response) for len(*nResponse.Response) > 0 { - for _, item := range *nResponse.Response { if vID == item.ID { foundItem = &item @@ -353,14 +354,14 @@ func searchApplicationPolicyGetApplicationSets(m interface{}, queryParams cataly } queryParams.Limit = float64(maxPageSize) queryParams.Offset += float64(maxPageSize) - nResponse, _, err = client.ApplicationPolicy.GetApplicationSets(&queryParams) + nResponse, _, err = client.ApplicationPolicy.GetApplicationSetsV1(&queryParams) if nResponse == nil || nResponse.Response == nil { break } } return nil, err } else if queryParams.Name != "" { - ite, _, err = client.ApplicationPolicy.GetApplicationSets(&queryParams) + ite, _, err = client.ApplicationPolicy.GetApplicationSetsV1(&queryParams) if err != nil || ite == nil { return foundItem, err } @@ -377,4 +378,5 @@ func searchApplicationPolicyGetApplicationSets(m interface{}, queryParams cataly return foundItem, err } return foundItem, err + } diff --git a/catalystcenter/resource_applications.go b/catalystcenter/resource_applications.go index 8fe3c36..49d57aa 100644 --- a/catalystcenter/resource_applications.go +++ b/catalystcenter/resource_applications.go @@ -245,14 +245,14 @@ func resourceApplications() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestApplicationPolicyCreateApplication`, + Description: `Array of RequestApplicationPolicyCreateApplicationV1`, Type: schema.TypeList, Optional: true, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestApplicationPolicyCreateApplication`, + Description: `Array of RequestApplicationPolicyCreateApplicationV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -481,7 +481,7 @@ func resourceApplicationsCreate(ctx context.Context, d *schema.ResourceData, m i vID := resourceItem["id"] vvID := interfaceToString(vID) vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetApplicationsQueryParams{} + queryParamImport := catalystcentersdkgo.GetApplicationsV1QueryParams{} queryParamImport.Name = vvName item2, err := searchApplicationPolicyGetApplications(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -530,7 +530,7 @@ func resourceApplicationsCreate(ctx context.Context, d *schema.ResourceData, m i return diags } } - queryParamValidate := catalystcentersdkgo.GetApplicationsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetApplicationsV1QueryParams{} queryParamValidate.Name = vvName item3, err := searchApplicationPolicyGetApplications(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -558,7 +558,7 @@ func resourceApplicationsRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetApplications") - queryParams1 := catalystcentersdkgo.GetApplicationsQueryParams{} + queryParams1 := catalystcentersdkgo.GetApplicationsV1QueryParams{} queryParams1.Name = vvName item1, err := searchApplicationPolicyGetApplications(m, queryParams1, vvID) if err != nil || item1 == nil { @@ -566,10 +566,12 @@ func resourceApplicationsRead(ctx context.Context, d *schema.ResourceData, m int return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponse{ + items := []catalystcentersdkgo.ResponseItemApplicationPolicyGetApplicationsV1{ *item1, } - vItem1 := flattenApplicationPolicyGetApplicationsItems(&items) + var items2 catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV1 + items2 = items + vItem1 := flattenApplicationPolicyGetApplicationsV1Items(&items2) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetApplications search response", @@ -657,7 +659,9 @@ func resourceApplicationsDelete(ctx context.Context, d *schema.ResourceData, m i vvID := resourceMap["id"] - response1, restyResp1, err := client.ApplicationPolicy.DeleteApplication(vvID) + response1, restyResp1, err := client.ApplicationPolicy.DeleteApplication(&catalystcentersdkgo.DeleteApplicationV1QueryParams{ + ID: vvID, + }) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) @@ -707,8 +711,8 @@ func resourceApplicationsDelete(ctx context.Context, d *schema.ResourceData, m i return diags } -func expandRequestApplicationsCreateApplication(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplication { - request := catalystcentersdkgo.RequestApplicationPolicyCreateApplication{} +func expandRequestApplicationsCreateApplication(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationV1 { + request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationV1{} if v := expandRequestApplicationsCreateApplicationItemArray(ctx, key+".payload", d); v != nil { request = *v } @@ -718,8 +722,8 @@ func expandRequestApplicationsCreateApplication(ctx context.Context, key string, return &request } -func expandRequestApplicationsCreateApplicationItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplication { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplication{} +func expandRequestApplicationsCreateApplicationItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -741,8 +745,8 @@ func expandRequestApplicationsCreateApplicationItemArray(ctx context.Context, ke return &request } -func expandRequestApplicationsCreateApplicationItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplication { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplication{} +func expandRequestApplicationsCreateApplicationItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -764,8 +768,8 @@ func expandRequestApplicationsCreateApplicationItem(ctx context.Context, key str return &request } -func expandRequestApplicationsCreateApplicationItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkApplications { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkApplications{} +func expandRequestApplicationsCreateApplicationItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkApplications { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkApplications{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -787,8 +791,8 @@ func expandRequestApplicationsCreateApplicationItemNetworkApplicationsArray(ctx return &request } -func expandRequestApplicationsCreateApplicationItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkApplications { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkApplications{} +func expandRequestApplicationsCreateApplicationItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkApplications { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkApplications{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".app_protocol")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".app_protocol")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".app_protocol")))) { request.AppProtocol = interfaceToString(v) } @@ -843,8 +847,8 @@ func expandRequestApplicationsCreateApplicationItemNetworkApplications(ctx conte return &request } -func expandRequestApplicationsCreateApplicationItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkIDentity { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkIDentity{} +func expandRequestApplicationsCreateApplicationItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkIDentity { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkIDentity{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -866,8 +870,8 @@ func expandRequestApplicationsCreateApplicationItemNetworkIDentityArray(ctx cont return &request } -func expandRequestApplicationsCreateApplicationItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkIDentity { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationNetworkIDentity{} +func expandRequestApplicationsCreateApplicationItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkIDentity { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1NetworkIDentity{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".display_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".display_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".display_name")))) { request.DisplayName = interfaceToString(v) } @@ -889,8 +893,8 @@ func expandRequestApplicationsCreateApplicationItemNetworkIDentity(ctx context.C return &request } -func expandRequestApplicationsCreateApplicationItemApplicationSet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationApplicationSet { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationApplicationSet{} +func expandRequestApplicationsCreateApplicationItemApplicationSet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1ApplicationSet { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationV1ApplicationSet{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } @@ -949,8 +953,8 @@ func expandRequestApplicationsCreateApplicationItemIndicativeNetworkIDentity(ctx return &request } -func expandRequestApplicationsEditApplication(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyEditApplication { - request := catalystcentersdkgo.RequestApplicationPolicyEditApplication{} +func expandRequestApplicationsEditApplication(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyEditApplicationV1 { + request := catalystcentersdkgo.RequestApplicationPolicyEditApplicationV1{} if v := expandRequestApplicationsEditApplicationItemArray(ctx, key+".payload", d); v != nil { request = *v } @@ -960,8 +964,8 @@ func expandRequestApplicationsEditApplication(ctx context.Context, key string, d return &request } -func expandRequestApplicationsEditApplicationItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplication { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplication{} +func expandRequestApplicationsEditApplicationItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -983,8 +987,8 @@ func expandRequestApplicationsEditApplicationItemArray(ctx context.Context, key return &request } -func expandRequestApplicationsEditApplicationItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplication { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplication{} +func expandRequestApplicationsEditApplicationItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1006,8 +1010,8 @@ func expandRequestApplicationsEditApplicationItem(ctx context.Context, key strin return &request } -func expandRequestApplicationsEditApplicationItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkApplications { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkApplications{} +func expandRequestApplicationsEditApplicationItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkApplications { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkApplications{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1029,8 +1033,8 @@ func expandRequestApplicationsEditApplicationItemNetworkApplicationsArray(ctx co return &request } -func expandRequestApplicationsEditApplicationItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkApplications { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkApplications{} +func expandRequestApplicationsEditApplicationItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkApplications { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkApplications{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1088,8 +1092,8 @@ func expandRequestApplicationsEditApplicationItemNetworkApplications(ctx context return &request } -func expandRequestApplicationsEditApplicationItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkIDentity { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkIDentity{} +func expandRequestApplicationsEditApplicationItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkIDentity { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkIDentity{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1111,8 +1115,8 @@ func expandRequestApplicationsEditApplicationItemNetworkIDentityArray(ctx contex return &request } -func expandRequestApplicationsEditApplicationItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkIDentity { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationNetworkIDentity{} +func expandRequestApplicationsEditApplicationItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkIDentity { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1NetworkIDentity{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1137,8 +1141,8 @@ func expandRequestApplicationsEditApplicationItemNetworkIDentity(ctx context.Con return &request } -func expandRequestApplicationsEditApplicationItemApplicationSet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationApplicationSet { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationApplicationSet{} +func expandRequestApplicationsEditApplicationItemApplicationSet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1ApplicationSet { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationV1ApplicationSet{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } @@ -1148,27 +1152,29 @@ func expandRequestApplicationsEditApplicationItemApplicationSet(ctx context.Cont return &request } -func searchApplicationPolicyGetApplications(m interface{}, queryParams catalystcentersdkgo.GetApplicationsQueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponse, error) { +func searchApplicationPolicyGetApplications(m interface{}, queryParams catalystcentersdkgo.GetApplicationsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseItemApplicationPolicyGetApplicationsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponse - var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplications + + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.ApplicationPolicy.GetApplications(nil) - maxPageSize := len(*nResponse.Response) - for len(*nResponse.Response) > 0 { + if err != nil { + return nil, err + } + maxPageSize := len(*nResponse) + for len(*nResponse) > 0 { - for _, item := range *nResponse.Response { + for _, item := range *nResponse { if vID == item.ID { - foundItem = &item - return foundItem, err + return &item, err } } queryParams.Limit = float64(maxPageSize) queryParams.Offset += float64(maxPageSize) nResponse, _, err = client.ApplicationPolicy.GetApplications(&queryParams) - if nResponse == nil || nResponse.Response == nil { + if nResponse == nil { break } } @@ -1176,19 +1182,18 @@ func searchApplicationPolicyGetApplications(m interface{}, queryParams catalystc } else if queryParams.Name != "" { ite, _, err = client.ApplicationPolicy.GetApplications(&queryParams) if err != nil || ite == nil { - return foundItem, err + return nil, err } - itemsCopy := *ite.Response + itemsCopy := *ite if itemsCopy == nil { - return foundItem, err + return nil, err } for _, item := range itemsCopy { if item.Name == queryParams.Name { - foundItem = &item - return foundItem, err + return &item, err } } - return foundItem, err + return nil, err } - return foundItem, err + return nil, err } diff --git a/catalystcenter/resource_applications_v2.go b/catalystcenter/resource_applications_v2.go index 4de1c58..847851f 100644 --- a/catalystcenter/resource_applications_v2.go +++ b/catalystcenter/resource_applications_v2.go @@ -777,16 +777,16 @@ func resourceApplicationsV2Create(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestApplicationsV2CreateApplications(ctx, "parameters.0", d) + request1 := expandRequestApplicationsV2CreateApplicationsV2(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] vvID := interfaceToString(vID) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetApplicationsQueryParams{} + queryParamImport := catalystcentersdkgo.GetApplicationsV2QueryParams{} queryParamImport.Name = vvName - item2, err := searchApplicationPolicyGetApplications(m, queryParamImport, "") + item2, err := searchApplicationPolicyGetApplicationsV2(m, queryParamImport, "") if err == nil && item2 != nil { resourceMap := make(map[string]string) resourceMap["id"] = item2.ID @@ -833,9 +833,9 @@ func resourceApplicationsV2Create(ctx context.Context, d *schema.ResourceData, m return diags } } - queryParamValidate := catalystcentersdkgo.GetApplicationsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetApplicationsV2QueryParams{} queryParamValidate.Name = vvName - item3, err := searchApplicationPolicyGetApplications(m, queryParamValidate, vvID) + item3, err := searchApplicationPolicyGetApplicationsV2(m, queryParamValidate, vvID) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( "Failure when executing CreateApplications", err, @@ -862,18 +862,18 @@ func resourceApplicationsV2Read(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetApplications") - queryParams1 := catalystcentersdkgo.GetApplicationsQueryParams{} + queryParams1 := catalystcentersdkgo.GetApplicationsV2QueryParams{} queryParams1.Name = vvName - item1, err := searchApplicationPolicyGetApplications(m, queryParams1, vvID) + item1, err := searchApplicationPolicyGetApplicationsV2(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsResponse{ + items := []catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2Response{ *item1, } - vItem1 := flattenApplicationPolicyGetApplicationsItems(&items) + vItem1 := flattenApplicationPolicyGetApplicationsV2Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetApplications search response", @@ -893,7 +893,7 @@ func resourceApplicationsV2Update(ctx context.Context, d *schema.ResourceData, m resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestApplicationsV2EditApplications(ctx, "parameters.0", d) + request1 := expandRequestApplicationsV2EditApplicationsV2(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -958,7 +958,9 @@ func resourceApplicationsV2Delete(ctx context.Context, d *schema.ResourceData, m resourceID := d.Id() resourceMap := separateResourceID(resourceID) vvID := resourceMap["id"] - response1, restyResp1, err := client.ApplicationPolicy.DeleteApplication(vvID) + response1, restyResp1, err := client.ApplicationPolicy.DeleteApplication(&catalystcentersdkgo.DeleteApplicationV1QueryParams{ + ID: vvID, + }) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) @@ -1008,9 +1010,9 @@ func resourceApplicationsV2Delete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestApplicationsV2CreateApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplications { - request := catalystcentersdkgo.RequestApplicationPolicyCreateApplications{} - if v := expandRequestApplicationsV2CreateApplicationsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestApplicationsV2CreateApplicationsV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateApplicationsV2 { + request := catalystcentersdkgo.RequestApplicationPolicyCreateApplicationsV2{} + if v := expandRequestApplicationsV2CreateApplicationsV2ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -1019,8 +1021,8 @@ func expandRequestApplicationsV2CreateApplications(ctx context.Context, key stri return &request } -func expandRequestApplicationsV2CreateApplicationsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplications { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplications{} +func expandRequestApplicationsV2CreateApplicationsV2ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1031,7 +1033,7 @@ func expandRequestApplicationsV2CreateApplicationsItemArray(ctx context.Context, return nil } for item_no := range objs { - i := expandRequestApplicationsV2CreateApplicationsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2CreateApplicationsV2Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1042,22 +1044,22 @@ func expandRequestApplicationsV2CreateApplicationsItemArray(ctx context.Context, return &request } -func expandRequestApplicationsV2CreateApplicationsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplications { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplications{} +func expandRequestApplicationsV2CreateApplicationsV2Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2 { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_applications")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_applications")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_applications")))) { - request.NetworkApplications = expandRequestApplicationsV2CreateApplicationsItemNetworkApplicationsArray(ctx, key+".network_applications", d) + request.NetworkApplications = expandRequestApplicationsV2CreateApplicationsV2ItemNetworkApplicationsArray(ctx, key+".network_applications", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_scalable_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_scalable_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_scalable_group")))) { - request.ParentScalableGroup = expandRequestApplicationsV2CreateApplicationsItemParentScalableGroup(ctx, key+".parent_scalable_group.0", d) + request.ParentScalableGroup = expandRequestApplicationsV2CreateApplicationsV2ItemParentScalableGroup(ctx, key+".parent_scalable_group.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_identity")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_identity")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_identity")))) { - request.NetworkIDentity = expandRequestApplicationsV2CreateApplicationsItemNetworkIDentityArray(ctx, key+".network_identity", d) + request.NetworkIDentity = expandRequestApplicationsV2CreateApplicationsV2ItemNetworkIDentityArray(ctx, key+".network_identity", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".indicative_network_identity")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".indicative_network_identity")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".indicative_network_identity")))) { - request.IndicativeNetworkIDentity = expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentityArray(ctx, key+".indicative_network_identity", d) + request.IndicativeNetworkIDentity = expandRequestApplicationsV2CreateApplicationsV2ItemIndicativeNetworkIDentityArray(ctx, key+".indicative_network_identity", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".scalable_group_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".scalable_group_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".scalable_group_type")))) { request.ScalableGroupType = interfaceToString(v) @@ -1071,8 +1073,8 @@ func expandRequestApplicationsV2CreateApplicationsItem(ctx context.Context, key return &request } -func expandRequestApplicationsV2CreateApplicationsItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkApplications { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkApplications{} +func expandRequestApplicationsV2CreateApplicationsV2ItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkApplications { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkApplications{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1083,7 +1085,7 @@ func expandRequestApplicationsV2CreateApplicationsItemNetworkApplicationsArray(c return nil } for item_no := range objs { - i := expandRequestApplicationsV2CreateApplicationsItemNetworkApplications(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2CreateApplicationsV2ItemNetworkApplications(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1094,8 +1096,8 @@ func expandRequestApplicationsV2CreateApplicationsItemNetworkApplicationsArray(c return &request } -func expandRequestApplicationsV2CreateApplicationsItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkApplications { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkApplications{} +func expandRequestApplicationsV2CreateApplicationsV2ItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkApplications { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkApplications{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".help_string")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".help_string")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".help_string")))) { request.HelpString = interfaceToString(v) } @@ -1138,8 +1140,8 @@ func expandRequestApplicationsV2CreateApplicationsItemNetworkApplications(ctx co return &request } -func expandRequestApplicationsV2CreateApplicationsItemParentScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsParentScalableGroup { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsParentScalableGroup{} +func expandRequestApplicationsV2CreateApplicationsV2ItemParentScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2ParentScalableGroup { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2ParentScalableGroup{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } @@ -1149,8 +1151,8 @@ func expandRequestApplicationsV2CreateApplicationsItemParentScalableGroup(ctx co return &request } -func expandRequestApplicationsV2CreateApplicationsItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkIDentity { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkIDentity{} +func expandRequestApplicationsV2CreateApplicationsV2ItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkIDentity { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkIDentity{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1161,7 +1163,7 @@ func expandRequestApplicationsV2CreateApplicationsItemNetworkIDentityArray(ctx c return nil } for item_no := range objs { - i := expandRequestApplicationsV2CreateApplicationsItemNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2CreateApplicationsV2ItemNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1172,8 +1174,8 @@ func expandRequestApplicationsV2CreateApplicationsItemNetworkIDentityArray(ctx c return &request } -func expandRequestApplicationsV2CreateApplicationsItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkIDentity { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsNetworkIDentity{} +func expandRequestApplicationsV2CreateApplicationsV2ItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkIDentity { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2NetworkIDentity{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".protocol")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".protocol")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".protocol")))) { request.Protocol = interfaceToString(v) } @@ -1195,8 +1197,8 @@ func expandRequestApplicationsV2CreateApplicationsItemNetworkIDentity(ctx contex return &request } -func expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsIndicativeNetworkIDentity { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsIndicativeNetworkIDentity{} +func expandRequestApplicationsV2CreateApplicationsV2ItemIndicativeNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2IndicativeNetworkIDentity { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2IndicativeNetworkIDentity{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1207,7 +1209,7 @@ func expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentityA return nil } for item_no := range objs { - i := expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2CreateApplicationsV2ItemIndicativeNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1218,8 +1220,8 @@ func expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentityA return &request } -func expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsIndicativeNetworkIDentity { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsIndicativeNetworkIDentity{} +func expandRequestApplicationsV2CreateApplicationsV2ItemIndicativeNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2IndicativeNetworkIDentity { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateApplicationsV2IndicativeNetworkIDentity{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".protocol")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".protocol")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".protocol")))) { request.Protocol = interfaceToString(v) } @@ -1244,9 +1246,9 @@ func expandRequestApplicationsV2CreateApplicationsItemIndicativeNetworkIDentity( return &request } -func expandRequestApplicationsV2EditApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyEditApplications { - request := catalystcentersdkgo.RequestApplicationPolicyEditApplications{} - if v := expandRequestApplicationsV2EditApplicationsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestApplicationsV2EditApplicationsV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyEditApplicationsV2 { + request := catalystcentersdkgo.RequestApplicationPolicyEditApplicationsV2{} + if v := expandRequestApplicationsV2EditApplicationsV2ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -1255,8 +1257,8 @@ func expandRequestApplicationsV2EditApplications(ctx context.Context, key string return &request } -func expandRequestApplicationsV2EditApplicationsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplications { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplications{} +func expandRequestApplicationsV2EditApplicationsV2ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1267,7 +1269,7 @@ func expandRequestApplicationsV2EditApplicationsItemArray(ctx context.Context, k return nil } for item_no := range objs { - i := expandRequestApplicationsV2EditApplicationsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2EditApplicationsV2Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1278,8 +1280,8 @@ func expandRequestApplicationsV2EditApplicationsItemArray(ctx context.Context, k return &request } -func expandRequestApplicationsV2EditApplicationsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplications { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplications{} +func expandRequestApplicationsV2EditApplicationsV2Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2 { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1293,7 +1295,7 @@ func expandRequestApplicationsV2EditApplicationsItem(ctx context.Context, key st request.InstanceVersion = interfaceToFloat64Ptr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".indicative_network_identity")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".indicative_network_identity")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".indicative_network_identity")))) { - request.IndicativeNetworkIDentity = expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentityArray(ctx, key+".indicative_network_identity", d) + request.IndicativeNetworkIDentity = expandRequestApplicationsV2EditApplicationsV2ItemIndicativeNetworkIDentityArray(ctx, key+".indicative_network_identity", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) @@ -1302,13 +1304,13 @@ func expandRequestApplicationsV2EditApplicationsItem(ctx context.Context, key st request.Namespace = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_applications")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_applications")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_applications")))) { - request.NetworkApplications = expandRequestApplicationsV2EditApplicationsItemNetworkApplicationsArray(ctx, key+".network_applications", d) + request.NetworkApplications = expandRequestApplicationsV2EditApplicationsV2ItemNetworkApplicationsArray(ctx, key+".network_applications", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_identity")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_identity")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_identity")))) { - request.NetworkIDentity = expandRequestApplicationsV2EditApplicationsItemNetworkIDentityArray(ctx, key+".network_identity", d) + request.NetworkIDentity = expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentityArray(ctx, key+".network_identity", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_scalable_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_scalable_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_scalable_group")))) { - request.ParentScalableGroup = expandRequestApplicationsV2EditApplicationsItemParentScalableGroup(ctx, key+".parent_scalable_group.0", d) + request.ParentScalableGroup = expandRequestApplicationsV2EditApplicationsV2ItemParentScalableGroup(ctx, key+".parent_scalable_group.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qualifier")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qualifier")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qualifier")))) { request.Qualifier = interfaceToString(v) @@ -1328,8 +1330,8 @@ func expandRequestApplicationsV2EditApplicationsItem(ctx context.Context, key st return &request } -func expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsIndicativeNetworkIDentity { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsIndicativeNetworkIDentity{} +func expandRequestApplicationsV2EditApplicationsV2ItemIndicativeNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2IndicativeNetworkIDentity { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2IndicativeNetworkIDentity{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1340,7 +1342,7 @@ func expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentityArr return nil } for item_no := range objs { - i := expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2EditApplicationsV2ItemIndicativeNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1351,8 +1353,8 @@ func expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentityArr return &request } -func expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsIndicativeNetworkIDentity { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsIndicativeNetworkIDentity{} +func expandRequestApplicationsV2EditApplicationsV2ItemIndicativeNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2IndicativeNetworkIDentity { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2IndicativeNetworkIDentity{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1377,8 +1379,8 @@ func expandRequestApplicationsV2EditApplicationsItemIndicativeNetworkIDentity(ct return &request } -func expandRequestApplicationsV2EditApplicationsItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkApplications { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkApplications{} +func expandRequestApplicationsV2EditApplicationsV2ItemNetworkApplicationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkApplications { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkApplications{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1389,7 +1391,7 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkApplicationsArray(ctx return nil } for item_no := range objs { - i := expandRequestApplicationsV2EditApplicationsItemNetworkApplications(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2EditApplicationsV2ItemNetworkApplications(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1400,8 +1402,8 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkApplicationsArray(ctx return &request } -func expandRequestApplicationsV2EditApplicationsItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkApplications { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkApplications{} +func expandRequestApplicationsV2EditApplicationsV2ItemNetworkApplications(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkApplications { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkApplications{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1462,8 +1464,8 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkApplications(ctx cont return &request } -func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentity { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentity{} +func expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentityArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentity { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentity{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1474,7 +1476,7 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityArray(ctx con return nil } for item_no := range objs { - i := expandRequestApplicationsV2EditApplicationsItemNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentity(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1485,8 +1487,8 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityArray(ctx con return &request } -func expandRequestApplicationsV2EditApplicationsItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentity { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentity{} +func expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentity { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentity{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1497,7 +1499,7 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentity(ctx context. request.IPv4Subnet = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv6_subnet")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv6_subnet")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv6_subnet")))) { - request.IPv6Subnet = expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6SubnetArray(ctx, key+".ipv6_subnet", d) + request.IPv6Subnet = expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentityIPv6SubnetArray(ctx, key+".ipv6_subnet", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".lower_port")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".lower_port")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".lower_port")))) { request.LowerPort = interfaceToFloat64Ptr(v) @@ -1517,8 +1519,8 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentity(ctx context. return &request } -func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6SubnetArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentityIPv6Subnet { - request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentityIPv6Subnet{} +func expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentityIPv6SubnetArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentityIPv6Subnet { + request := []catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentityIPv6Subnet{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1529,7 +1531,7 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6SubnetArr return nil } for item_no := range objs { - i := expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6Subnet(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentityIPv6Subnet(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1540,8 +1542,8 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6SubnetArr return &request } -func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6Subnet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentityIPv6Subnet { - var request catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsNetworkIDentityIPv6Subnet +func expandRequestApplicationsV2EditApplicationsV2ItemNetworkIDentityIPv6Subnet(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentityIPv6Subnet { + var request catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2NetworkIDentityIPv6Subnet request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1549,8 +1551,8 @@ func expandRequestApplicationsV2EditApplicationsItemNetworkIDentityIPv6Subnet(ct return &request } -func expandRequestApplicationsV2EditApplicationsItemParentScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsParentScalableGroup { - request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsParentScalableGroup{} +func expandRequestApplicationsV2EditApplicationsV2ItemParentScalableGroup(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2ParentScalableGroup { + request := catalystcentersdkgo.RequestItemApplicationPolicyEditApplicationsV2ParentScalableGroup{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id_ref")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id_ref")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id_ref")))) { request.IDRef = interfaceToString(v) } @@ -1559,3 +1561,45 @@ func expandRequestApplicationsV2EditApplicationsItemParentScalableGroup(ctx cont } return &request } + +func searchApplicationPolicyGetApplicationsV2(m interface{}, queryParams catalystcentersdkgo.GetApplicationsV2QueryParams, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2Response, error) { + client := m.(*catalystcentersdkgo.Client) + var err error + var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2Response + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationsV2 + if vID != "" { + queryParams.Offset = 1 + nResponse, _, err := client.ApplicationPolicy.GetApplicationsV2(nil) + maxPageSize := len(*nResponse.Response) + for len(*nResponse.Response) > 0 { + time.Sleep(15 * time.Second) + for _, item := range *nResponse.Response { + if vID == item.ID { + foundItem = &item + return foundItem, err + } + } + queryParams.Limit = float64(maxPageSize) + queryParams.Offset += float64(maxPageSize) + nResponse, _, err = client.ApplicationPolicy.GetApplicationsV2(&queryParams) + } + return nil, err + } else if queryParams.Name != "" { + ite, _, err = client.ApplicationPolicy.GetApplicationsV2(&queryParams) + if err != nil || ite == nil { + return foundItem, err + } + itemsCopy := *ite.Response + if itemsCopy == nil { + return foundItem, err + } + for _, item := range itemsCopy { + if item.Name == queryParams.Name { + foundItem = &item + return foundItem, err + } + } + return foundItem, err + } + return foundItem, err +} diff --git a/catalystcenter/resource_area.go b/catalystcenter/resource_area.go index 169a0ea..7fab31b 100644 --- a/catalystcenter/resource_area.go +++ b/catalystcenter/resource_area.go @@ -214,7 +214,7 @@ func resourceAreaCreate(ctx context.Context, d *schema.ResourceData, m interface newPathName := []string{"Global", newName} newName = strings.Join(newPathName, "/") } - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams1.Name = newName queryParams1.SiteID = vvSiteID log.Printf("[DEBUG] newName => %s", newName) @@ -226,7 +226,7 @@ func resourceAreaCreate(ctx context.Context, d *schema.ResourceData, m interface d.SetId(joinResourceID(resourceMap)) return resourceAreaRead(ctx, d, m) } - headers := catalystcentersdkgo.CreateSiteHeaderParams{} + headers := catalystcentersdkgo.CreateSiteV1HeaderParams{} headers.Persistbapioutput = "false" headers.Runsync = "false" /*if okTimeout { @@ -283,7 +283,7 @@ func resourceAreaCreate(ctx context.Context, d *schema.ResourceData, m interface return diags } } - queryParams2 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams2 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams2.Name = newName // queryParams2.SiteID = vvSiteID item2, err := searchSitesGetSite(m, queryParams2) @@ -312,7 +312,7 @@ func resourceAreaRead(ctx context.Context, d *schema.ResourceData, m interface{} selectedMethod := 1 if selectedMethod == 1 { - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams1.Name = vName // queryParams1.SiteID = vSiteID log.Printf("[DEBUG] Read name => %s", queryParams1.Name) @@ -327,7 +327,7 @@ func resourceAreaRead(ctx context.Context, d *schema.ResourceData, m interface{} return diags } parameters := d.Get("parameters").([]interface{}) - vItem1 := flattenSitesGetAreaItems(response1.Response, parameters) + vItem1 := flattenSitesGetAreaParams(response1.Response, parameters) log.Printf("[DEBUG] response flatten sent => %v", responseInterfaceToString(vItem1)) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -361,7 +361,7 @@ func resourceAreaUpdate(ctx context.Context, d *schema.ResourceData, m interface if d.HasChange("parameters") { request1 := expandRequestSiteUpdateSite(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - headers := catalystcentersdkgo.UpdateSiteHeaderParams{} + headers := catalystcentersdkgo.UpdateSiteV1HeaderParams{} headers.Persistbapioutput = "false" headers.Runsync = "false" /*if vTimeout != "" { @@ -406,7 +406,7 @@ func resourceAreaDelete(ctx context.Context, d *schema.ResourceData, m interface resourceMap := separateResourceID(resourceID) vSiteID := resourceMap["site_id"] // time.Sleep(1 * time.Minute) - // queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + // queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} // queryParams1.Name = vName // queryParams1.SiteID = vSiteID // item, err := searchSitesGetSite(m, queryParams1) @@ -483,8 +483,8 @@ func resourceAreaDelete(ctx context.Context, d *schema.ResourceData, m interface } // fixKeyAccess(key + ".type") now is fixKeyAccess("area.type") -func expandRequestSiteCreateSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSite { - request := catalystcentersdkgo.RequestSitesCreateSite{} +func expandRequestSiteCreateSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1 { + request := catalystcentersdkgo.RequestSitesCreateSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess("area.type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess("area.type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess("area.type")))) { request.Type = interfaceToString(v) } @@ -500,8 +500,8 @@ func expandRequestSiteCreateSite(ctx context.Context, key string, d *schema.Reso return &request } -func expandRequestSiteCreateSiteSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteSite { - request := catalystcentersdkgo.RequestSitesCreateSiteSite{} +func expandRequestSiteCreateSiteSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1Site { + request := catalystcentersdkgo.RequestSitesCreateSiteV1Site{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".area")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".area")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".area")))) { request.Area = expandRequestSiteCreateSiteSiteArea(ctx, key+".area.0", d) } /* @@ -517,8 +517,8 @@ func expandRequestSiteCreateSiteSite(ctx context.Context, key string, d *schema. return &request } -func expandRequestSiteCreateSiteSiteArea(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteSiteArea { - request := catalystcentersdkgo.RequestSitesCreateSiteSiteArea{} +func expandRequestSiteCreateSiteSiteArea(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1SiteArea { + request := catalystcentersdkgo.RequestSitesCreateSiteV1SiteArea{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -532,8 +532,8 @@ func expandRequestSiteCreateSiteSiteArea(ctx context.Context, key string, d *sch } // GetOkExists(fixKeyAccess(key + ".type")) now is GetOkExists(fixKeyAccess("area.type")) -func expandRequestSiteUpdateSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSite { - request := catalystcentersdkgo.RequestSitesUpdateSite{} +func expandRequestSiteUpdateSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1 { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess("area.type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess("area.type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess("area.type")))) { request.Type = interfaceToString(v) } @@ -549,8 +549,8 @@ func expandRequestSiteUpdateSite(ctx context.Context, key string, d *schema.Reso return &request } -func expandRequestSiteUpdateSiteSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteSite { - request := catalystcentersdkgo.RequestSitesUpdateSiteSite{} +func expandRequestSiteUpdateSiteSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1Site { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1Site{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".area")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".area")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".area")))) { request.Area = expandRequestSiteUpdateSiteSiteArea(ctx, key+".area.0", d) } /* @@ -566,8 +566,8 @@ func expandRequestSiteUpdateSiteSite(ctx context.Context, key string, d *schema. return &request } -func expandRequestSiteUpdateSiteSiteArea(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteSiteArea { - request := catalystcentersdkgo.RequestSitesUpdateSiteSiteArea{} +func expandRequestSiteUpdateSiteSiteArea(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1SiteArea { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1SiteArea{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -580,11 +580,11 @@ func expandRequestSiteUpdateSiteSiteArea(ctx context.Context, key string, d *sch return &request } -func searchSitesGetSite(m interface{}, queryParams catalystcentersdkgo.GetSiteQueryParams) (*catalystcentersdkgo.ResponseSitesGetSiteResponse, error) { +func searchSitesGetSite(m interface{}, queryParams catalystcentersdkgo.GetSiteV1QueryParams) (*catalystcentersdkgo.ResponseSitesGetSiteV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSitesGetSiteResponse - // var ite *catalystcentersdkgo.ResponseSitesGetSite + var foundItem *catalystcentersdkgo.ResponseSitesGetSiteV1Response + // var ite *catalystcentersdkgo.ResponseSitesGetSiteV1 if queryParams.SiteID == "" { ite, restyResp1, err := client.Sites.GetSite(&queryParams) if err != nil { @@ -602,7 +602,7 @@ func searchSitesGetSite(m interface{}, queryParams catalystcentersdkgo.GetSiteQu for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.SiteNameHierarchy == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseSitesGetSiteResponse + var getItem *catalystcentersdkgo.ResponseSitesGetSiteV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_assign_device_to_site.go b/catalystcenter/resource_assign_device_to_site.go index 0a190b3..91d5063 100644 --- a/catalystcenter/resource_assign_device_to_site.go +++ b/catalystcenter/resource_assign_device_to_site.go @@ -112,9 +112,9 @@ func resourceAssignDeviceToSiteCreate(ctx context.Context, d *schema.ResourceDat vPersistbapioutput := resourceItem["persistbapioutput"] vvSiteID := vSiteID.(string) - request1 := expandRequestAssignDeviceToSiteAssignDevicesToSite(ctx, "parameters.0", d) + request1 := expandRequestAssignDeviceToSiteAssignDevicesToSiteV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.AssignDevicesToSiteHeaderParams{} + headerParams1 := catalystcentersdkgo.AssignDevicesToSiteV1HeaderParams{} headerParams1.Runsync = vRunsync.(string) @@ -122,18 +122,16 @@ func resourceAssignDeviceToSiteCreate(ctx context.Context, d *schema.ResourceDat headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Sites.AssignDevicesToSite(vvSiteID, request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sites.AssignDevicesToSiteV1(vvSiteID, request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AssignDevicesToSite", err)) + "Failure when executing AssignDevicesToSiteV1", err)) return diags } @@ -169,23 +167,22 @@ func resourceAssignDeviceToSiteCreate(ctx context.Context, d *schema.ResourceDat if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing AssignDevicesToSite", err, - "Failure at AssignDevicesToSite execution", bapiError)) + "Failure when executing AssignDevicesToSiteV1", err, + "Failure at AssignDevicesToSiteV1 execution", bapiError)) return diags } } - vItem1 := flattenSitesAssignDevicesToSiteItem(response1) + vItem1 := flattenSitesAssignDevicesToSiteV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AssignDevicesToSite response", + "Failure when setting AssignDevicesToSiteV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceAssignDeviceToSiteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -200,16 +197,16 @@ func resourceAssignDeviceToSiteDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestAssignDeviceToSiteAssignDevicesToSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesAssignDevicesToSite { - request := catalystcentersdkgo.RequestSitesAssignDevicesToSite{} +func expandRequestAssignDeviceToSiteAssignDevicesToSiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesAssignDevicesToSiteV1 { + request := catalystcentersdkgo.RequestSitesAssignDevicesToSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device")))) { - request.Device = expandRequestAssignDeviceToSiteAssignDevicesToSiteDeviceArray(ctx, key+".device", d) + request.Device = expandRequestAssignDeviceToSiteAssignDevicesToSiteV1DeviceArray(ctx, key+".device", d) } return &request } -func expandRequestAssignDeviceToSiteAssignDevicesToSiteDeviceArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSitesAssignDevicesToSiteDevice { - request := []catalystcentersdkgo.RequestSitesAssignDevicesToSiteDevice{} +func expandRequestAssignDeviceToSiteAssignDevicesToSiteV1DeviceArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSitesAssignDevicesToSiteV1Device { + request := []catalystcentersdkgo.RequestSitesAssignDevicesToSiteV1Device{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -220,7 +217,7 @@ func expandRequestAssignDeviceToSiteAssignDevicesToSiteDeviceArray(ctx context.C return nil } for item_no := range objs { - i := expandRequestAssignDeviceToSiteAssignDevicesToSiteDevice(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssignDeviceToSiteAssignDevicesToSiteV1Device(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -228,15 +225,15 @@ func expandRequestAssignDeviceToSiteAssignDevicesToSiteDeviceArray(ctx context.C return &request } -func expandRequestAssignDeviceToSiteAssignDevicesToSiteDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesAssignDevicesToSiteDevice { - request := catalystcentersdkgo.RequestSitesAssignDevicesToSiteDevice{} +func expandRequestAssignDeviceToSiteAssignDevicesToSiteV1Device(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesAssignDevicesToSiteV1Device { + request := catalystcentersdkgo.RequestSitesAssignDevicesToSiteV1Device{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip")))) { request.IP = interfaceToString(v) } return &request } -func flattenSitesAssignDevicesToSiteItem(item *catalystcentersdkgo.ResponseSitesAssignDevicesToSite) []map[string]interface{} { +func flattenSitesAssignDevicesToSiteV1Item(item *catalystcentersdkgo.ResponseSitesAssignDevicesToSiteV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_assign_to_site_apply.go b/catalystcenter/resource_assign_to_site_apply.go index 6efb604..8bae166 100644 --- a/catalystcenter/resource_assign_to_site_apply.go +++ b/catalystcenter/resource_assign_to_site_apply.go @@ -25,7 +25,7 @@ func resourceAssignToSiteApply() *schema.Resource { - Assign unprovisioned network devices to a site. Along with that it can also be used to assign unprovisioned network devices to a different site. If device controllability is enabled, it will be triggered once device assigned to site successfully. Device Controllability can be enabled/disabled using -'/dna/intent/api/v1/networkDevices/deviceControllability/settings'. +*/dna/intent/api/v1/networkDevices/deviceControllability/settings*. `, CreateContext: resourceAssignToSiteApplyCreate, @@ -95,7 +95,7 @@ func resourceAssignToSiteApplyCreate(ctx context.Context, d *schema.ResourceData client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestAssignToSiteApplyAssignNetworkDevicesToASite(ctx, "parameters.0", d) + request1 := expandRequestAssignToSiteApplyAssignNetworkDevicesToASiteV1(ctx, "parameters.0", d) response1, restyResp1, err := client.SiteDesign.AssignNetworkDevicesToASite(request1) @@ -108,7 +108,7 @@ func resourceAssignToSiteApplyCreate(ctx context.Context, d *schema.ResourceData log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AssignNetworkDevicesToASite", err)) + "Failure when executing ApplicationPolicyIntent", err)) return diags } @@ -116,7 +116,7 @@ func resourceAssignToSiteApplyCreate(ctx context.Context, d *schema.ResourceData if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing AssignNetworkDevicesToASite", err)) + "Failure when executing AssignNetworkDevicesToASiteV1", err)) return diags } taskId := response1.Response.TaskID @@ -150,19 +150,18 @@ func resourceAssignToSiteApplyCreate(ctx context.Context, d *schema.ResourceData } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing AssignNetworkDevicesToASite", err1)) + "Failure when executing AssignNetworkDevicesToASiteV1", err1)) return diags } } - vItem1 := flattenSiteDesignAssignNetworkDevicesToASiteItem(response1.Response) + vItem1 := flattenSiteDesignAssignNetworkDevicesToASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AssignNetworkDevicesToASite response", + "Failure when setting AssignNetworkDevicesToASiteV1 response", err)) return diags } - d.SetId(getUnixTimeString()) return diags @@ -180,8 +179,8 @@ func resourceAssignToSiteApplyDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestAssignToSiteApplyAssignNetworkDevicesToASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignNetworkDevicesToASite { - request := catalystcentersdkgo.RequestSiteDesignAssignNetworkDevicesToASite{} +func expandRequestAssignToSiteApplyAssignNetworkDevicesToASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignNetworkDevicesToASiteV1 { + request := catalystcentersdkgo.RequestSiteDesignAssignNetworkDevicesToASiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_ids")))) { request.DeviceIDs = interfaceToSliceString(v) } @@ -191,7 +190,7 @@ func expandRequestAssignToSiteApplyAssignNetworkDevicesToASite(ctx context.Conte return &request } -func flattenSiteDesignAssignNetworkDevicesToASiteItem(item *catalystcentersdkgo.ResponseSiteDesignAssignNetworkDevicesToASiteResponse) []map[string]interface{} { +func flattenSiteDesignAssignNetworkDevicesToASiteV1Item(item *catalystcentersdkgo.ResponseSiteDesignAssignNetworkDevicesToASiteV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_associate_site_to_network_profile.go b/catalystcenter/resource_associate_site_to_network_profile.go index 83f2732..3638a99 100644 --- a/catalystcenter/resource_associate_site_to_network_profile.go +++ b/catalystcenter/resource_associate_site_to_network_profile.go @@ -92,14 +92,16 @@ func resourceAssociateSiteToNetworkProfileCreate(ctx context.Context, d *schema. vvNetworkProfileID := vNetworkProfileID.(string) vvSiteID := vSiteID.(string) - response1, restyResp1, err := client.SiteDesign.Associate(vvNetworkProfileID, vvSiteID) + // has_unknown_response: None + + response1, restyResp1, err := client.SiteDesign.AssociateV1(vvNetworkProfileID, vvSiteID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing Associate", err)) + "Failure when executing AssociateV1", err)) return diags } @@ -107,7 +109,7 @@ func resourceAssociateSiteToNetworkProfileCreate(ctx context.Context, d *schema. if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing Associate", err)) + "Failure when executing AssociateV1", err)) return diags } taskId := response1.Response.TaskID @@ -141,22 +143,20 @@ func resourceAssociateSiteToNetworkProfileCreate(ctx context.Context, d *schema. } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing Associate", err1)) + "Failure when executing AssociateV1", err1)) return diags } } - - vItem1 := flattenSiteDesignAssociateItem(response1.Response) + vItem1 := flattenSiteDesignAssociateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting Associate response", + "Failure when setting AssociateV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceAssociateSiteToNetworkProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -171,7 +171,7 @@ func resourceAssociateSiteToNetworkProfileDelete(ctx context.Context, d *schema. return diags } -func flattenSiteDesignAssociateItem(item *catalystcentersdkgo.ResponseSiteDesignAssociateResponse) []map[string]interface{} { +func flattenSiteDesignAssociateV1Item(item *catalystcentersdkgo.ResponseSiteDesignAssociateV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_assurance_events_query.go b/catalystcenter/resource_assurance_events_query.go index d5aa2cf..4673249 100644 --- a/catalystcenter/resource_assurance_events_query.go +++ b/catalystcenter/resource_assurance_events_query.go @@ -801,35 +801,31 @@ func resourceAssuranceEventsQueryCreate(ctx context.Context, d *schema.ResourceD vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFilters(ctx, "parameters.0", d) + request1 := expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.QueryAssuranceEventsWithFiltersHeaderParams{} + headerParams1 := catalystcentersdkgo.QueryAssuranceEventsWithFiltersV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Devices.QueryAssuranceEventsWithFilters(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.QueryAssuranceEventsWithFiltersV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing QueryAssuranceEventsWithFilters", err)) + "Failure when executing QueryAssuranceEventsWithFiltersV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenDevicesQueryAssuranceEventsWithFiltersItems(response1.Response) + vItems1 := flattenDevicesQueryAssuranceEventsWithFiltersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting QueryAssuranceEventsWithFilters response", + "Failure when setting QueryAssuranceEventsWithFiltersV1 response", err)) return diags } @@ -837,6 +833,8 @@ func resourceAssuranceEventsQueryCreate(ctx context.Context, d *schema.ResourceD d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceAssuranceEventsQueryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -851,8 +849,8 @@ func resourceAssuranceEventsQueryDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFilters { - request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFilters{} +func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1 { + request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_family")))) { request.DeviceFamily = interfaceToSliceString(v) } @@ -869,16 +867,16 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFilters(ctx contex request.Views = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPage(ctx, key+".page.0", d) + request.Page = expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersFilters { - request := []catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersFilters{} +func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1Filters { + request := []catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -889,7 +887,7 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFiltersArra return nil } for item_no := range objs { - i := expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -897,8 +895,8 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFiltersArra return &request } -func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersFilters { - request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersFilters{} +func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1Filters { + request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -911,8 +909,8 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersFilters(ctx return &request } -func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersPage { - request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersPage{} +func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1Page { + request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".offset")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".offset")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".offset")))) { request.Offset = interfaceToIntPtr(v) } @@ -920,13 +918,13 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPage(ctx co request.Limit = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersPageSortBy { - request := []catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersPageSortBy{} +func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1PageSortBy { + request := []catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -937,7 +935,7 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortByA return nil } for item_no := range objs { - i := expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -945,8 +943,8 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortByA return &request } -func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersPageSortBy { - request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersPageSortBy{} +func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1PageSortBy { + request := catalystcentersdkgo.RequestDevicesQueryAssuranceEventsWithFiltersV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -956,7 +954,7 @@ func expandRequestAssuranceEventsQueryQueryAssuranceEventsWithFiltersPageSortBy( return &request } -func flattenDevicesQueryAssuranceEventsWithFiltersItems(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersResponse) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsWithFiltersV1Items(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersV1Response) []map[string]interface{} { if items == nil { return nil } @@ -998,7 +996,7 @@ func flattenDevicesQueryAssuranceEventsWithFiltersItems(items *[]catalystcenters respItem["new_radio_channel_list"] = item.NewRadioChannelList respItem["duid"] = item.Duid respItem["roam_type"] = item.RoamType - respItem["candidate_a_ps"] = flattenDevicesQueryAssuranceEventsWithFiltersItemsCandidateAPs(item.CandidateAPs) + respItem["candidate_a_ps"] = flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsCandidateAPs(item.CandidateAPs) respItem["replaced_device_serial_number"] = item.ReplacedDeviceSerialNumber respItem["old_radio_channel_list"] = item.OldRadioChannelList respItem["ssid"] = item.SSID @@ -1007,14 +1005,14 @@ func flattenDevicesQueryAssuranceEventsWithFiltersItems(items *[]catalystcenters respItem["ipv4"] = item.IPv4 respItem["wlc_id"] = item.WlcID respItem["ipv6"] = item.IPv6 - respItem["missing_response_a_ps"] = flattenDevicesQueryAssuranceEventsWithFiltersItemsMissingResponseAPs(item.MissingResponseAPs) + respItem["missing_response_a_ps"] = flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsMissingResponseAPs(item.MissingResponseAPs) respItem["timestamp"] = item.Timestamp respItem["severity"] = item.Severity respItem["current_radio_power_level"] = item.CurrentRadioPowerLevel respItem["new_radio_channel_width"] = item.NewRadioChannelWidth respItem["assoc_snr"] = item.AssocSnr respItem["auth_server_ip"] = item.AuthServerIP - respItem["child_events"] = flattenDevicesQueryAssuranceEventsWithFiltersItemsChildEvents(item.ChildEvents) + respItem["child_events"] = flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsChildEvents(item.ChildEvents) respItem["connected_interface_name"] = item.ConnectedInterfaceName respItem["dhcp_server_ip"] = item.DhcpServerIP respItem["management_ip_address"] = item.ManagementIPAddress @@ -1029,14 +1027,14 @@ func flattenDevicesQueryAssuranceEventsWithFiltersItems(items *[]catalystcenters respItem["udn_name"] = item.UdnName respItem["facility"] = item.Facility respItem["last_ap_reset_type"] = item.LastApResetType - respItem["invalid_ie_a_ps"] = flattenDevicesQueryAssuranceEventsWithFiltersItemsInvalidIeAPs(item.InvalidIeAPs) + respItem["invalid_ie_a_ps"] = flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsInvalidIeAPs(item.InvalidIeAPs) respItem["username"] = item.Username respItems = append(respItems, respItem) } return respItems } -func flattenDevicesQueryAssuranceEventsWithFiltersItemsCandidateAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersResponseCandidateAPs) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsCandidateAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersV1ResponseCandidateAPs) []map[string]interface{} { if items == nil { return nil } @@ -1053,7 +1051,7 @@ func flattenDevicesQueryAssuranceEventsWithFiltersItemsCandidateAPs(items *[]cat return respItems } -func flattenDevicesQueryAssuranceEventsWithFiltersItemsMissingResponseAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersResponseMissingResponseAPs) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsMissingResponseAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersV1ResponseMissingResponseAPs) []map[string]interface{} { if items == nil { return nil } @@ -1071,7 +1069,7 @@ func flattenDevicesQueryAssuranceEventsWithFiltersItemsMissingResponseAPs(items return respItems } -func flattenDevicesQueryAssuranceEventsWithFiltersItemsChildEvents(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersResponseChildEvents) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsChildEvents(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersV1ResponseChildEvents) []map[string]interface{} { if items == nil { return nil } @@ -1094,7 +1092,7 @@ func flattenDevicesQueryAssuranceEventsWithFiltersItemsChildEvents(items *[]cata return respItems } -func flattenDevicesQueryAssuranceEventsWithFiltersItemsInvalidIeAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersResponseInvalidIeAPs) []map[string]interface{} { +func flattenDevicesQueryAssuranceEventsWithFiltersV1ItemsInvalidIeAPs(items *[]catalystcentersdkgo.ResponseDevicesQueryAssuranceEventsWithFiltersV1ResponseInvalidIeAPs) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_assurance_events_query_count.go b/catalystcenter/resource_assurance_events_query_count.go index a8d560c..f50ee2c 100644 --- a/catalystcenter/resource_assurance_events_query_count.go +++ b/catalystcenter/resource_assurance_events_query_count.go @@ -133,35 +133,31 @@ func resourceAssuranceEventsQueryCountCreate(ctx context.Context, d *schema.Reso vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFilters(ctx, "parameters.0", d) + request1 := expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.CountTheNumberOfEventsWithFiltersHeaderParams{} + headerParams1 := catalystcentersdkgo.CountTheNumberOfEventsWithFiltersV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Devices.CountTheNumberOfEventsWithFilters(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.CountTheNumberOfEventsWithFiltersV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CountTheNumberOfEventsWithFilters", err)) + "Failure when executing CountTheNumberOfEventsWithFiltersV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDevicesCountTheNumberOfEventsWithFiltersItem(response1.Response) + vItem1 := flattenDevicesCountTheNumberOfEventsWithFiltersV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CountTheNumberOfEventsWithFilters response", + "Failure when setting CountTheNumberOfEventsWithFiltersV1 response", err)) return diags } @@ -169,6 +165,8 @@ func resourceAssuranceEventsQueryCountCreate(ctx context.Context, d *schema.Reso d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceAssuranceEventsQueryCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -183,8 +181,8 @@ func resourceAssuranceEventsQueryCountDelete(ctx context.Context, d *schema.Reso return diags } -func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFilters { - request := catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFilters{} +func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersV1 { + request := catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_family")))) { request.DeviceFamily = interfaceToSliceString(v) } @@ -195,13 +193,13 @@ func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFilters(ctx request.EndTime = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersV1FiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersFilters { - request := []catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersFilters{} +func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersV1Filters { + request := []catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -212,7 +210,7 @@ func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFilt return nil } for item_no := range objs { - i := expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -220,8 +218,8 @@ func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFilt return &request } -func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersFilters { - request := catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersFilters{} +func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersV1Filters { + request := catalystcentersdkgo.RequestDevicesCountTheNumberOfEventsWithFiltersV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -234,7 +232,7 @@ func expandRequestAssuranceEventsQueryCountCountTheNumberOfEventsWithFiltersFilt return &request } -func flattenDevicesCountTheNumberOfEventsWithFiltersItem(item *catalystcentersdkgo.ResponseDevicesCountTheNumberOfEventsWithFiltersResponse) []map[string]interface{} { +func flattenDevicesCountTheNumberOfEventsWithFiltersV1Item(item *catalystcentersdkgo.ResponseDevicesCountTheNumberOfEventsWithFiltersV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_ignore.go b/catalystcenter/resource_assurance_issues_ignore.go index 396b8d8..bf374ce 100644 --- a/catalystcenter/resource_assurance_issues_ignore.go +++ b/catalystcenter/resource_assurance_issues_ignore.go @@ -97,35 +97,34 @@ func resourceAssuranceIssuesIgnoreCreate(ctx context.Context, d *schema.Resource vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesIgnoreIgnoreTheGivenListOfIssues(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesIgnoreIgnoreTheGivenListOfIssuesV1(ctx, "parameters.0", d) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } - headerParams1 := catalystcentersdkgo.IgnoreTheGivenListOfIssuesHeaderParams{} + headerParams1 := catalystcentersdkgo.IgnoreTheGivenListOfIssuesV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.IgnoreTheGivenListOfIssues(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.IgnoreTheGivenListOfIssuesV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing IgnoreTheGivenListOfIssues", err)) + "Failure when executing IgnoreTheGivenListOfIssuesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenIssuesIgnoreTheGivenListOfIssuesItem(response1.Response) + vItem1 := flattenIssuesIgnoreTheGivenListOfIssuesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting IgnoreTheGivenListOfIssues response", + "Failure when setting IgnoreTheGivenListOfIssuesV1 response", err)) return diags } @@ -133,6 +132,8 @@ func resourceAssuranceIssuesIgnoreCreate(ctx context.Context, d *schema.Resource d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceAssuranceIssuesIgnoreRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -147,15 +148,15 @@ func resourceAssuranceIssuesIgnoreDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestAssuranceIssuesIgnoreIgnoreTheGivenListOfIssues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesIgnoreTheGivenListOfIssues { - request := catalystcentersdkgo.RequestIssuesIgnoreTheGivenListOfIssues{} +func expandRequestAssuranceIssuesIgnoreIgnoreTheGivenListOfIssuesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesIgnoreTheGivenListOfIssuesV1 { + request := catalystcentersdkgo.RequestIssuesIgnoreTheGivenListOfIssuesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".issue_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".issue_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".issue_ids")))) { request.IssueIDs = interfaceToSliceString(v) } return &request } -func flattenIssuesIgnoreTheGivenListOfIssuesItem(item *catalystcentersdkgo.ResponseIssuesIgnoreTheGivenListOfIssuesResponse) []map[string]interface{} { +func flattenIssuesIgnoreTheGivenListOfIssuesV1Item(item *catalystcentersdkgo.ResponseIssuesIgnoreTheGivenListOfIssuesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_query.go b/catalystcenter/resource_assurance_issues_query.go index a582a9b..b6216e9 100644 --- a/catalystcenter/resource_assurance_issues_query.go +++ b/catalystcenter/resource_assurance_issues_query.go @@ -341,37 +341,33 @@ func resourceAssuranceIssuesQueryCreate(ctx context.Context, d *schema.ResourceD vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFilters(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.GetTheDetailsOfIssuesForGivenSetOfFiltersHeaderParams{} + headerParams1 := catalystcentersdkgo.GetTheDetailsOfIssuesForGivenSetOfFiltersV1HeaderParams{} headerParams1.AcceptLanguage = vAcceptLanguage.(string) headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTheDetailsOfIssuesForGivenSetOfFilters(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.GetTheDetailsOfIssuesForGivenSetOfFiltersV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetTheDetailsOfIssuesForGivenSetOfFilters", err)) + "Failure when executing GetTheDetailsOfIssuesForGivenSetOfFiltersV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItems(response1.Response) + vItems1 := flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheDetailsOfIssuesForGivenSetOfFilters response", + "Failure when setting GetTheDetailsOfIssuesForGivenSetOfFiltersV1 response", err)) return diags } @@ -379,6 +375,8 @@ func resourceAssuranceIssuesQueryCreate(ctx context.Context, d *schema.ResourceD d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceAssuranceIssuesQueryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -393,8 +391,8 @@ func resourceAssuranceIssuesQueryDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFilters { - request := catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFilters{} +func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1 { + request := catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -402,13 +400,13 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFilters( request.EndTime = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFilters { - request := []catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFilters{} +func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Filters { + request := []catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -419,7 +417,7 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersF return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -427,8 +425,8 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersF return &request } -func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFilters { - request := catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFilters{} +func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Filters { + request := catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -442,13 +440,13 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersF request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFilters { - request := []catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFilters{} +func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFilters { + request := []catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -459,7 +457,7 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersF return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -467,8 +465,8 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersF return &request } -func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFilters { - request := catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersFiltersFilters{} +func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFilters { + request := catalystcentersdkgo.RequestIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1FiltersFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -481,7 +479,7 @@ func expandRequestAssuranceIssuesQueryGetTheDetailsOfIssuesForGivenSetOfFiltersF return &request } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItems(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponse) []map[string]interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Items(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1Response) []map[string]interface{} { if items == nil { return nil } @@ -502,21 +500,21 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItems(items *[]cataly respItem["most_recent_occurred_time"] = item.MostRecentOccurredTime respItem["status"] = item.Status respItem["is_global"] = boolPtrToString(item.IsGlobal) - respItem["updated_by"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsUpdatedBy(item.UpdatedBy) - respItem["updated_time"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsUpdatedTime(item.UpdatedTime) - respItem["notes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsNotes(item.Notes) - respItem["site_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteID(item.SiteID) - respItem["site_hierarchy_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteHierarchyID(item.SiteHierarchyID) - respItem["site_name"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteName(item.SiteName) - respItem["site_hierarchy"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteHierarchy(item.SiteHierarchy) - respItem["suggested_actions"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSuggestedActions(item.SuggestedActions) - respItem["additional_attributes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsAdditionalAttributes(item.AdditionalAttributes) + respItem["updated_by"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsUpdatedBy(item.UpdatedBy) + respItem["updated_time"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsUpdatedTime(item.UpdatedTime) + respItem["notes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsNotes(item.Notes) + respItem["site_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteID(item.SiteID) + respItem["site_hierarchy_id"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteHierarchyID(item.SiteHierarchyID) + respItem["site_name"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteName(item.SiteName) + respItem["site_hierarchy"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteHierarchy(item.SiteHierarchy) + respItem["suggested_actions"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSuggestedActions(item.SuggestedActions) + respItem["additional_attributes"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsAdditionalAttributes(item.AdditionalAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsUpdatedBy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseUpdatedBy) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsUpdatedBy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseUpdatedBy) interface{} { if item == nil { return nil } @@ -526,7 +524,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsUpdatedBy(item * } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsUpdatedTime(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseUpdatedTime) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsUpdatedTime(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseUpdatedTime) interface{} { if item == nil { return nil } @@ -536,7 +534,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsUpdatedTime(item } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsNotes(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseNotes) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsNotes(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseNotes) interface{} { if item == nil { return nil } @@ -546,7 +544,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsNotes(item *cata } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseSiteID) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseSiteID) interface{} { if item == nil { return nil } @@ -556,7 +554,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteID(item *cat } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteHierarchyID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseSiteHierarchyID) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteHierarchyID(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseSiteHierarchyID) interface{} { if item == nil { return nil } @@ -566,7 +564,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteHierarchyID( } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteName(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseSiteName) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteName(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseSiteName) interface{} { if item == nil { return nil } @@ -576,7 +574,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteName(item *c } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteHierarchy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseSiteHierarchy) interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSiteHierarchy(item *catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseSiteHierarchy) interface{} { if item == nil { return nil } @@ -586,7 +584,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSiteHierarchy(it } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseSuggestedActions) []map[string]interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseSuggestedActions) []map[string]interface{} { if items == nil { return nil } @@ -594,13 +592,13 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSuggestedActions for _, item := range *items { respItem := make(map[string]interface{}) respItem["message"] = item.Message - respItem["steps"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSuggestedActionsSteps(item.Steps) + respItem["steps"] = flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSuggestedActionsSteps(item.Steps) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseSuggestedActionsSteps) []interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsSuggestedActionsSteps(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseSuggestedActionsSteps) []interface{} { if items == nil { return nil } @@ -612,7 +610,7 @@ func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsSuggestedActions return respItems } -func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersItemsAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersResponseAdditionalAttributes) []map[string]interface{} { +func flattenIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ItemsAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTheDetailsOfIssuesForGivenSetOfFiltersV1ResponseAdditionalAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_query_count.go b/catalystcenter/resource_assurance_issues_query_count.go index 8059afe..221d7b1 100644 --- a/catalystcenter/resource_assurance_issues_query_count.go +++ b/catalystcenter/resource_assurance_issues_query_count.go @@ -176,35 +176,31 @@ func resourceAssuranceIssuesQueryCountCreate(ctx context.Context, d *schema.Reso vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFilters(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.GetTheTotalNumberOfIssuesForGivenSetOfFiltersHeaderParams{} + headerParams1 := catalystcentersdkgo.GetTheTotalNumberOfIssuesForGivenSetOfFiltersV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTheTotalNumberOfIssuesForGivenSetOfFilters(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.GetTheTotalNumberOfIssuesForGivenSetOfFiltersV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetTheTotalNumberOfIssuesForGivenSetOfFilters", err)) + "Failure when executing GetTheTotalNumberOfIssuesForGivenSetOfFiltersV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersItems(response1.Filters) + vItems1 := flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Items(response1.Filters) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTheTotalNumberOfIssuesForGivenSetOfFilters response", + "Failure when setting GetTheTotalNumberOfIssuesForGivenSetOfFiltersV1 response", err)) return diags } @@ -212,6 +208,8 @@ func resourceAssuranceIssuesQueryCountCreate(ctx context.Context, d *schema.Reso d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceAssuranceIssuesQueryCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -226,8 +224,8 @@ func resourceAssuranceIssuesQueryCountDelete(ctx context.Context, d *schema.Reso return diags } -func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFilters { - request := catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFilters{} +func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1 { + request := catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -235,13 +233,13 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO request.EndTime = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters { - request := []catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters{} +func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters { + request := []catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -252,7 +250,7 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -260,8 +258,8 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO return &request } -func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters { - request := catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters{} +func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters { + request := catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -275,13 +273,13 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFilters { - request := []catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFilters{} +func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFilters { + request := []catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -292,7 +290,7 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -300,8 +298,8 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO return &request } -func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFilters { - request := catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFiltersFilters{} +func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFilters { + request := catalystcentersdkgo.RequestIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1FiltersFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -314,7 +312,7 @@ func expandRequestAssuranceIssuesQueryCountGetTheTotalNumberOfIssuesForGivenSetO return &request } -func flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersItems(items *[]catalystcentersdkgo.ResponseIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersFilters) []map[string]interface{} { +func flattenIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Items(items *[]catalystcentersdkgo.ResponseIssuesGetTheTotalNumberOfIssuesForGivenSetOfFiltersV1Filters) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_resolve.go b/catalystcenter/resource_assurance_issues_resolve.go index 8201bab..c88e8ee 100644 --- a/catalystcenter/resource_assurance_issues_resolve.go +++ b/catalystcenter/resource_assurance_issues_resolve.go @@ -97,35 +97,31 @@ func resourceAssuranceIssuesResolveCreate(ctx context.Context, d *schema.Resourc vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesResolveResolveTheGivenListsOfIssues(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesResolveResolveTheGivenListsOfIssuesV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.ResolveTheGivenListsOfIssuesHeaderParams{} + headerParams1 := catalystcentersdkgo.ResolveTheGivenListsOfIssuesV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.ResolveTheGivenListsOfIssues(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.ResolveTheGivenListsOfIssuesV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ResolveTheGivenListsOfIssues", err)) + "Failure when executing ResolveTheGivenListsOfIssuesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenIssuesResolveTheGivenListsOfIssuesItem(response1.Response) + vItem1 := flattenIssuesResolveTheGivenListsOfIssuesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ResolveTheGivenListsOfIssues response", + "Failure when setting ResolveTheGivenListsOfIssuesV1 response", err)) return diags } @@ -147,15 +143,15 @@ func resourceAssuranceIssuesResolveDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestAssuranceIssuesResolveResolveTheGivenListsOfIssues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesResolveTheGivenListsOfIssues { - request := catalystcentersdkgo.RequestIssuesResolveTheGivenListsOfIssues{} +func expandRequestAssuranceIssuesResolveResolveTheGivenListsOfIssuesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesResolveTheGivenListsOfIssuesV1 { + request := catalystcentersdkgo.RequestIssuesResolveTheGivenListsOfIssuesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".issue_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".issue_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".issue_ids")))) { request.IssueIDs = interfaceToSliceString(v) } return &request } -func flattenIssuesResolveTheGivenListsOfIssuesItem(item *catalystcentersdkgo.ResponseIssuesResolveTheGivenListsOfIssuesResponse) []map[string]interface{} { +func flattenIssuesResolveTheGivenListsOfIssuesV1Item(item *catalystcentersdkgo.ResponseIssuesResolveTheGivenListsOfIssuesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_summary_analytics.go b/catalystcenter/resource_assurance_issues_summary_analytics.go index 33a4668..d33762b 100644 --- a/catalystcenter/resource_assurance_issues_summary_analytics.go +++ b/catalystcenter/resource_assurance_issues_summary_analytics.go @@ -360,37 +360,33 @@ func resourceAssuranceIssuesSummaryAnalyticsCreate(ctx context.Context, d *schem vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.GetSummaryAnalyticsDataOfIssuesHeaderParams{} + headerParams1 := catalystcentersdkgo.GetSummaryAnalyticsDataOfIssuesV1HeaderParams{} headerParams1.AcceptLanguage = vAcceptLanguage.(string) headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetSummaryAnalyticsDataOfIssues(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.GetSummaryAnalyticsDataOfIssuesV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetSummaryAnalyticsDataOfIssues", err)) + "Failure when executing GetSummaryAnalyticsDataOfIssuesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenIssuesGetSummaryAnalyticsDataOfIssuesItem(response1.Response) + vItem1 := flattenIssuesGetSummaryAnalyticsDataOfIssuesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSummaryAnalyticsDataOfIssues response", + "Failure when setting GetSummaryAnalyticsDataOfIssuesV1 response", err)) return diags } @@ -412,8 +408,8 @@ func resourceAssuranceIssuesSummaryAnalyticsDelete(ctx context.Context, d *schem return diags } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssues { - request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssues{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1 { + request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -421,7 +417,7 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues request.EndTime = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".group_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".group_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".group_by")))) { request.GroupBy = interfaceToSliceString(v) @@ -430,16 +426,16 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesPage(ctx, key+".page.0", d) + request.Page = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFilters { - request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFilters{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1Filters { + request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -450,7 +446,7 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -458,8 +454,8 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFilters { - request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFilters{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1Filters { + request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -473,13 +469,13 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1FiltersFiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFiltersFilters { - request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFiltersFilters{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1FiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1FiltersFilters { + request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1FiltersFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -490,7 +486,7 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1FiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -498,8 +494,8 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFiltersFilters { - request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesFiltersFilters{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1FiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1FiltersFilters { + request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1FiltersFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -512,8 +508,8 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesAggregateAttributes { - request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesAggregateAttributes{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1AggregateAttributes { + request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -524,7 +520,7 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -532,8 +528,8 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesAggregateAttributes { - request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesAggregateAttributes{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1AggregateAttributes { + request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -543,8 +539,8 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesPage { - request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesPage{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1Page { + request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -552,13 +548,13 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesPageSortBy { - request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesPageSortBy{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1PageSortBy { + request := []catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -569,7 +565,7 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -577,8 +573,8 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesPageSortBy { - request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesPageSortBy{} +func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssuesV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1PageSortBy { + request := catalystcentersdkgo.RequestIssuesGetSummaryAnalyticsDataOfIssuesV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -588,20 +584,20 @@ func expandRequestAssuranceIssuesSummaryAnalyticsGetSummaryAnalyticsDataOfIssues return &request } -func flattenIssuesGetSummaryAnalyticsDataOfIssuesItem(item *catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesResponse) []map[string]interface{} { +func flattenIssuesGetSummaryAnalyticsDataOfIssuesV1Item(item *catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["groups"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroups(item.Groups) - respItem["attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesItemAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesItemAggregateAttributes(item.AggregateAttributes) + respItem["groups"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemGroups(item.Groups) + respItem["attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemAggregateAttributes(item.AggregateAttributes) return []map[string]interface{}{ respItem, } } -func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroups(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesResponseGroups) []map[string]interface{} { +func flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemGroups(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -609,14 +605,14 @@ func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroups(items *[]catalystcen for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroupsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesResponseGroupsAttributes) []map[string]interface{} { +func flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemGroupsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -630,7 +626,7 @@ func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroupsAttributes(items *[]c return respItems } -func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } @@ -645,7 +641,7 @@ func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemGroupsAggregateAttributes(i return respItems } -func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesResponseAttributes) []map[string]interface{} { +func flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesV1ResponseAttributes) []map[string]interface{} { if items == nil { return nil } @@ -659,7 +655,7 @@ func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemAttributes(items *[]catalys return respItems } -func flattenIssuesGetSummaryAnalyticsDataOfIssuesItemAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesResponseAggregateAttributes) []map[string]interface{} { +func flattenIssuesGetSummaryAnalyticsDataOfIssuesV1ItemAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetSummaryAnalyticsDataOfIssuesV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_top_n_analytics.go b/catalystcenter/resource_assurance_issues_top_n_analytics.go index 60b1242..36356a0 100644 --- a/catalystcenter/resource_assurance_issues_top_n_analytics.go +++ b/catalystcenter/resource_assurance_issues_top_n_analytics.go @@ -324,37 +324,33 @@ func resourceAssuranceIssuesTopNAnalyticsCreate(ctx context.Context, d *schema.R vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssues(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.GetTopNAnalyticsDataOfIssuesHeaderParams{} + headerParams1 := catalystcentersdkgo.GetTopNAnalyticsDataOfIssuesV1HeaderParams{} headerParams1.AcceptLanguage = vAcceptLanguage.(string) headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTopNAnalyticsDataOfIssues(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.GetTopNAnalyticsDataOfIssuesV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetTopNAnalyticsDataOfIssues", err)) + "Failure when executing GetTopNAnalyticsDataOfIssuesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenIssuesGetTopNAnalyticsDataOfIssuesItems(response1.Response) + vItems1 := flattenIssuesGetTopNAnalyticsDataOfIssuesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTopNAnalyticsDataOfIssues response", + "Failure when setting GetTopNAnalyticsDataOfIssuesV1 response", err)) return diags } @@ -376,8 +372,8 @@ func resourceAssuranceIssuesTopNAnalyticsDelete(ctx context.Context, d *schema.R return diags } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssues { - request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssues{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1 { + request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -388,7 +384,7 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssues(ctx c request.TopN = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".group_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".group_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".group_by")))) { request.GroupBy = interfaceToSliceString(v) @@ -397,16 +393,16 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssues(ctx c request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPage(ctx, key+".page.0", d) + request.Page = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFilters { - request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFilters{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1Filters { + request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -417,7 +413,7 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilter return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -425,8 +421,8 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilter return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFilters { - request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFilters{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1Filters { + request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -440,13 +436,13 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilter request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1FiltersFiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFiltersFilters { - request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFiltersFilters{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1FiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1FiltersFilters { + request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1FiltersFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -457,7 +453,7 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilter return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1FiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -465,8 +461,8 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilter return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFiltersFilters { - request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesFiltersFilters{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1FiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1FiltersFilters { + request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1FiltersFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -479,8 +475,8 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesFilter return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesAggregateAttributes { - request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesAggregateAttributes{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1AggregateAttributes { + request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -491,7 +487,7 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggreg return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -499,8 +495,8 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggreg return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesAggregateAttributes { - request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesAggregateAttributes{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1AggregateAttributes { + request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -510,8 +506,8 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesAggreg return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesPage { - request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesPage{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1Page { + request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -519,13 +515,13 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPage(c request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesPageSortBy { - request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesPageSortBy{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1PageSortBy { + request := []catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -536,7 +532,7 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSo return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -544,8 +540,8 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSo return &request } -func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesPageSortBy { - request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesPageSortBy{} +func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1PageSortBy { + request := catalystcentersdkgo.RequestIssuesGetTopNAnalyticsDataOfIssuesV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -555,7 +551,7 @@ func expandRequestAssuranceIssuesTopNAnalyticsGetTopNAnalyticsDataOfIssuesPageSo return &request } -func flattenIssuesGetTopNAnalyticsDataOfIssuesItems(items *[]catalystcentersdkgo.ResponseIssuesGetTopNAnalyticsDataOfIssuesResponse) []map[string]interface{} { +func flattenIssuesGetTopNAnalyticsDataOfIssuesV1Items(items *[]catalystcentersdkgo.ResponseIssuesGetTopNAnalyticsDataOfIssuesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -563,14 +559,14 @@ func flattenIssuesGetTopNAnalyticsDataOfIssuesItems(items *[]catalystcentersdkgo for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenIssuesGetTopNAnalyticsDataOfIssuesItemsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenIssuesGetTopNAnalyticsDataOfIssuesItemsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenIssuesGetTopNAnalyticsDataOfIssuesV1ItemsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenIssuesGetTopNAnalyticsDataOfIssuesV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTopNAnalyticsDataOfIssuesItemsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTopNAnalyticsDataOfIssuesResponseAttributes) []map[string]interface{} { +func flattenIssuesGetTopNAnalyticsDataOfIssuesV1ItemsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTopNAnalyticsDataOfIssuesV1ResponseAttributes) []map[string]interface{} { if items == nil { return nil } @@ -584,7 +580,7 @@ func flattenIssuesGetTopNAnalyticsDataOfIssuesItemsAttributes(items *[]catalystc return respItems } -func flattenIssuesGetTopNAnalyticsDataOfIssuesItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTopNAnalyticsDataOfIssuesResponseAggregateAttributes) []map[string]interface{} { +func flattenIssuesGetTopNAnalyticsDataOfIssuesV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTopNAnalyticsDataOfIssuesV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_trend_analytics.go b/catalystcenter/resource_assurance_issues_trend_analytics.go index e17f790..7c8de58 100644 --- a/catalystcenter/resource_assurance_issues_trend_analytics.go +++ b/catalystcenter/resource_assurance_issues_trend_analytics.go @@ -334,37 +334,33 @@ func resourceAssuranceIssuesTrendAnalyticsCreate(ctx context.Context, d *schema. vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssues(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.GetTrendAnalyticsDataOfIssuesHeaderParams{} + headerParams1 := catalystcentersdkgo.GetTrendAnalyticsDataOfIssuesV1HeaderParams{} headerParams1.AcceptLanguage = vAcceptLanguage.(string) headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.GetTrendAnalyticsDataOfIssues(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.GetTrendAnalyticsDataOfIssuesV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetTrendAnalyticsDataOfIssues", err)) + "Failure when executing GetTrendAnalyticsDataOfIssuesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenIssuesGetTrendAnalyticsDataOfIssuesItems(response1.Response) + vItems1 := flattenIssuesGetTrendAnalyticsDataOfIssuesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTrendAnalyticsDataOfIssues response", + "Failure when setting GetTrendAnalyticsDataOfIssuesV1 response", err)) return diags } @@ -386,8 +382,8 @@ func resourceAssuranceIssuesTrendAnalyticsDelete(ctx context.Context, d *schema. return diags } -func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssues { - request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssues{} +func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1 { + request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -398,7 +394,7 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssues(ctx request.TrendInterval = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".group_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".group_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".group_by")))) { request.GroupBy = interfaceToSliceString(v) @@ -407,16 +403,16 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssues(ctx request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesPage(ctx, key+".page.0", d) + request.Page = expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesFilters { - request := []catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesFilters{} +func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1Filters { + request := []catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -427,7 +423,7 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFilt return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -435,8 +431,8 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFilt return &request } -func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesFilters { - request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesFilters{} +func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1Filters { + request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -449,8 +445,8 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesFilt return &request } -func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesAggregateAttributes { - request := []catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesAggregateAttributes{} +func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1AggregateAttributes { + request := []catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -461,7 +457,7 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggr return nil } for item_no := range objs { - i := expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -469,8 +465,8 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggr return &request } -func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesAggregateAttributes { - request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesAggregateAttributes{} +func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1AggregateAttributes { + request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -480,8 +476,8 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesAggr return &request } -func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesPage { - request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesPage{} +func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1Page { + request := catalystcentersdkgo.RequestIssuesGetTrendAnalyticsDataOfIssuesV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -494,7 +490,7 @@ func expandRequestAssuranceIssuesTrendAnalyticsGetTrendAnalyticsDataOfIssuesPage return &request } -func flattenIssuesGetTrendAnalyticsDataOfIssuesItems(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesResponse) []map[string]interface{} { +func flattenIssuesGetTrendAnalyticsDataOfIssuesV1Items(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -502,15 +498,15 @@ func flattenIssuesGetTrendAnalyticsDataOfIssuesItems(items *[]catalystcentersdkg for _, item := range *items { respItem := make(map[string]interface{}) respItem["timestamp"] = item.Timestamp - respItem["groups"] = flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroups(item.Groups) - respItem["attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesItemsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesItemsAggregateAttributes(item.AggregateAttributes) + respItem["groups"] = flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsGroups(item.Groups) + respItem["attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroups(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesResponseGroups) []map[string]interface{} { +func flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsGroups(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -518,14 +514,14 @@ func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroups(items *[]catalystcent for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesResponseGroupsAttributes) []map[string]interface{} { +func flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -539,7 +535,7 @@ func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroupsAttributes(items *[]ca return respItems } -func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } @@ -554,7 +550,7 @@ func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsGroupsAggregateAttributes(it return respItems } -func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesResponseAttributes) []map[string]interface{} { +func flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesV1ResponseAttributes) []map[string]interface{} { if items == nil { return nil } @@ -568,7 +564,7 @@ func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsAttributes(items *[]catalyst return respItems } -func flattenIssuesGetTrendAnalyticsDataOfIssuesItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesResponseAggregateAttributes) []map[string]interface{} { +func flattenIssuesGetTrendAnalyticsDataOfIssuesV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseIssuesGetTrendAnalyticsDataOfIssuesV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_assurance_issues_update.go b/catalystcenter/resource_assurance_issues_update.go index 974057f..dda8718 100644 --- a/catalystcenter/resource_assurance_issues_update.go +++ b/catalystcenter/resource_assurance_issues_update.go @@ -236,37 +236,33 @@ func resourceAssuranceIssuesUpdateCreate(ctx context.Context, d *schema.Resource vXCaLLERID := resourceItem["xca_lle_rid"] vvID := vID.(string) - request1 := expandRequestAssuranceIssuesUpdateUpdateTheGivenIssueByUpdatingSelectedFields(ctx, "parameters.0", d) + request1 := expandRequestAssuranceIssuesUpdateUpdateTheGivenIssueByUpdatingSelectedFieldsV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.UpdateTheGivenIssueByUpdatingSelectedFieldsHeaderParams{} + headerParams1 := catalystcentersdkgo.UpdateTheGivenIssueByUpdatingSelectedFieldsV1HeaderParams{} headerParams1.AcceptLanguage = vAcceptLanguage.(string) headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Issues.UpdateTheGivenIssueByUpdatingSelectedFields(vvID, request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.UpdateTheGivenIssueByUpdatingSelectedFieldsV1(vvID, request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateTheGivenIssueByUpdatingSelectedFields", err)) + "Failure when executing UpdateTheGivenIssueByUpdatingSelectedFieldsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItem(response1.Response) + vItem1 := flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateTheGivenIssueByUpdatingSelectedFields response", + "Failure when setting UpdateTheGivenIssueByUpdatingSelectedFieldsV1 response", err)) return diags } @@ -288,15 +284,15 @@ func resourceAssuranceIssuesUpdateDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestAssuranceIssuesUpdateUpdateTheGivenIssueByUpdatingSelectedFields(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesUpdateTheGivenIssueByUpdatingSelectedFields { - request := catalystcentersdkgo.RequestIssuesUpdateTheGivenIssueByUpdatingSelectedFields{} +func expandRequestAssuranceIssuesUpdateUpdateTheGivenIssueByUpdatingSelectedFieldsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1 { + request := catalystcentersdkgo.RequestIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".notes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".notes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".notes")))) { request.Notes = interfaceToString(v) } return &request } -func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItem(item *catalystcentersdkgo.ResponseIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsResponse) []map[string]interface{} { +func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1Item(item *catalystcentersdkgo.ResponseIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1Response) []map[string]interface{} { if item == nil { return nil } @@ -322,14 +318,14 @@ func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItem(item *catalyst respItem["site_hierarchy_id"] = item.SiteHierarchyID respItem["site_name"] = item.SiteName respItem["site_hierarchy"] = item.SiteHierarchy - respItem["suggested_actions"] = flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItemSuggestedActions(item.SuggestedActions) - respItem["additional_attributes"] = flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItemAdditionalAttributes(item.AdditionalAttributes) + respItem["suggested_actions"] = flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1ItemSuggestedActions(item.SuggestedActions) + respItem["additional_attributes"] = flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1ItemAdditionalAttributes(item.AdditionalAttributes) return []map[string]interface{}{ respItem, } } -func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItemSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsResponseSuggestedActions) []map[string]interface{} { +func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1ItemSuggestedActions(items *[]catalystcentersdkgo.ResponseIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1ResponseSuggestedActions) []map[string]interface{} { if items == nil { return nil } @@ -342,7 +338,7 @@ func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItemSuggestedAction return respItems } -func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsItemAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsResponseAdditionalAttributes) []map[string]interface{} { +func flattenIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1ItemAdditionalAttributes(items *[]catalystcentersdkgo.ResponseIssuesUpdateTheGivenIssueByUpdatingSelectedFieldsV1ResponseAdditionalAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_building.go b/catalystcenter/resource_building.go index 81ae719..24e140d 100644 --- a/catalystcenter/resource_building.go +++ b/catalystcenter/resource_building.go @@ -281,7 +281,7 @@ func resourceBuildingCreate(ctx context.Context, d *schema.ResourceData, m inter newPathName := []string{"Global", newName} newName = strings.Join(newPathName, "/") } - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams1.Name = newName queryParams1.SiteID = vvSiteID log.Printf("[DEBUG] newName => %s", newName) @@ -293,7 +293,7 @@ func resourceBuildingCreate(ctx context.Context, d *schema.ResourceData, m inter d.SetId(joinResourceID(resourceMap)) return resourceBuildingRead(ctx, d, m) } - headers := catalystcentersdkgo.CreateSiteHeaderParams{} + headers := catalystcentersdkgo.CreateSiteV1HeaderParams{} headers.Persistbapioutput = "false" headers.Runsync = "false" /*if okTimeout { @@ -351,7 +351,7 @@ func resourceBuildingCreate(ctx context.Context, d *schema.ResourceData, m inter return diags } } - queryParams2 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams2 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams2.Name = newName // queryParams2.SiteID = vvSiteID item2, err := searchSitesGetSite(m, queryParams2) @@ -380,7 +380,7 @@ func resourceBuildingRead(ctx context.Context, d *schema.ResourceData, m interfa selectedMethod := 1 if selectedMethod == 1 { - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams1.Name = vName // queryParams1.SiteID = vSiteID log.Printf("[DEBUG] Read name => %s", queryParams1.Name) @@ -395,7 +395,7 @@ func resourceBuildingRead(ctx context.Context, d *schema.ResourceData, m interfa return diags } parameters := d.Get("parameters").([]interface{}) - vItem1 := flattenSitesGetSiteItems(response1.Response, parameters) + vItem1 := flattenSitesGetSiteParams(response1.Response, parameters) log.Printf("[DEBUG] response flatten sent => %v", responseInterfaceToString(vItem1)) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -428,7 +428,7 @@ func resourceBuildingUpdate(ctx context.Context, d *schema.ResourceData, m inter if d.HasChange("parameters") { request1 := expandRequestSiteUpdateBuilding(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - headers := catalystcentersdkgo.UpdateSiteHeaderParams{} + headers := catalystcentersdkgo.UpdateSiteV1HeaderParams{} headers.Persistbapioutput = "false" headers.Runsync = "false" /*if vTimeout != "" { @@ -463,8 +463,8 @@ func resourceBuildingUpdate(ctx context.Context, d *schema.ResourceData, m inter } // GetOkExists(fixKeyAccess(key + ".type")) now is GetOkExists(fixKeyAccess("building.type")) -func expandRequestSiteUpdateBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSite { - request := catalystcentersdkgo.RequestSitesUpdateSite{} +func expandRequestSiteUpdateBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1 { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess("building.type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess("building.type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess("building.type")))) { request.Type = interfaceToString(v) } @@ -480,8 +480,8 @@ func expandRequestSiteUpdateBuilding(ctx context.Context, key string, d *schema. return &request } -func expandRequestSiteUpdateBuildingBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteSite { - request := catalystcentersdkgo.RequestSitesUpdateSiteSite{} +func expandRequestSiteUpdateBuildingBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1Site { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1Site{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".building")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".building")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".building")))) { request.Building = expandRequestSiteUpdateSiteSiteBuilding(ctx, key+".building.0", d) } @@ -492,8 +492,8 @@ func expandRequestSiteUpdateBuildingBuilding(ctx context.Context, key string, d } // fixKeyAccess(key + ".type") now is fixKeyAccess("building.type") -func expandRequestSiteCreateBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSite { - request := catalystcentersdkgo.RequestSitesCreateSite{} +func expandRequestSiteCreateBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1 { + request := catalystcentersdkgo.RequestSitesCreateSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess("building.type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess("building.type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess("building.type")))) { request.Type = interfaceToString(v) } @@ -509,8 +509,8 @@ func expandRequestSiteCreateBuilding(ctx context.Context, key string, d *schema. return &request } -func expandRequestSiteCreateBuildingBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteSite { - request := catalystcentersdkgo.RequestSitesCreateSiteSite{} +func expandRequestSiteCreateBuildingBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1Site { + request := catalystcentersdkgo.RequestSitesCreateSiteV1Site{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".building")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".building")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".building")))) { request.Building = expandRequestSiteCreateSiteSiteBuilding(ctx, key+".building.0", d) } @@ -520,8 +520,8 @@ func expandRequestSiteCreateBuildingBuilding(ctx context.Context, key string, d return &request } -func expandRequestSiteCreateSiteSiteBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteSiteBuilding { - request := catalystcentersdkgo.RequestSitesCreateSiteSiteBuilding{} +func expandRequestSiteCreateSiteSiteBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1SiteBuilding { + request := catalystcentersdkgo.RequestSitesCreateSiteV1SiteBuilding{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -546,8 +546,8 @@ func expandRequestSiteCreateSiteSiteBuilding(ctx context.Context, key string, d return &request } -func expandRequestSiteUpdateSiteSiteBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteSiteBuilding { - request := catalystcentersdkgo.RequestSitesUpdateSiteSiteBuilding{} +func expandRequestSiteUpdateSiteSiteBuilding(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1SiteBuilding { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1SiteBuilding{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -579,7 +579,7 @@ func resourceBuildingDelete(ctx context.Context, d *schema.ResourceData, m inter resourceMap := separateResourceID(resourceID) vSiteID := resourceMap["site_id"] // time.Sleep(1 * time.Minute) - // queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + // queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} // queryParams1.Name = vName // queryParams1.SiteID = vSiteID // item, err := searchSitesGetSite(m, queryParams1) diff --git a/catalystcenter/resource_business_sda_hostonboarding_ssid_ippool.go b/catalystcenter/resource_business_sda_hostonboarding_ssid_ippool.go index 055b8eb..9000370 100644 --- a/catalystcenter/resource_business_sda_hostonboarding_ssid_ippool.go +++ b/catalystcenter/resource_business_sda_hostonboarding_ssid_ippool.go @@ -2,7 +2,6 @@ package catalystcenter import ( "context" - "errors" "reflect" "time" @@ -90,7 +89,7 @@ func resourceBusinessSdaHostonboardingSSIDIPpool() *schema.Resource { `, Type: schema.TypeString, Optional: true, - Default: "", + Computed: true, }, "ssid_names": &schema.Schema{ Description: `List of SSIDs @@ -107,7 +106,7 @@ func resourceBusinessSdaHostonboardingSSIDIPpool() *schema.Resource { `, Type: schema.TypeString, Optional: true, - Default: "", + Computed: true, }, }, }, @@ -122,84 +121,33 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolCreate(ctx context.Context, d *s var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestBusinessSdaHostonboardingSSIDIPpoolAddSSIDToIPPoolMapping(ctx, "parameters.0", d) + request1 := expandRequestBusinessSdaHostonboardingSSIDIPpoolAddSSIDToIPPoolMappingV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vVLANName := resourceItem["vlan_name"] vvVLANName := interfaceToString(vVLANName) vSiteNameHierarchy := resourceItem["site_name_hierarchy"] vvSiteNameHierarchy := interfaceToString(vSiteNameHierarchy) - queryParamImport := catalystcentersdkgo.GetSSIDToIPPoolMappingQueryParams{} + queryParamImport := catalystcentersdkgo.GetSSIDToIPPoolMappingV1QueryParams{} queryParamImport.VLANName = vvVLANName queryParamImport.SiteNameHierarchy = vvSiteNameHierarchy - item2, _, err := client.FabricWireless.GetSSIDToIPPoolMapping(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.FabricWireless.GetSSIDToIPPoolMappingV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["vlan_name"] = item2.VLANName resourceMap["site_name_hierarchy"] = vvSiteNameHierarchy - request2 := expandRequestBusinessSdaHostonboardingSSIDIPpoolUpdateSSIDToIPPoolMapping(ctx, "parameters.0", d) - log.Printf("[DEBUG] update request => %s", responseInterfaceToString(*request2)) - response3, restyResp3, err := client.FabricWireless.UpdateSSIDToIPPoolMapping(request2) - if err != nil || response3 == nil { - if restyResp3 != nil { - log.Printf("[DEBUG] resty response for update operation => %v", restyResp3.String()) - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing UpdateSSIDToIPPoolMapping", err, restyResp3.String(), - "Failure at UpdateSSIDToIPPoolMapping, unexpected response", "")) - return diags - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing UpdateSSIDToIPPoolMapping", err, - "Failure at UpdateSSIDToIPPoolMapping, unexpected response", "")) - return diags - } - - executionId2 := response3.ExecutionID - log.Printf("[DEBUG] executionId2 => %s", executionId2) - if executionId2 != "" { - time.Sleep(5 * time.Second) - response4, restyResp4, err := client.Task.GetBusinessAPIExecutionDetails(executionId2) - if err != nil || response4 == nil { - if restyResp4 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp4.String()) - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing GetExecutionByID", err, - "Failure at GetExecutionByID, unexpected response", "")) - return diags - } - for statusIsPending(response4.Status) { - time.Sleep(10 * time.Second) - response4, restyResp4, err = client.Task.GetBusinessAPIExecutionDetails(executionId2) - if err != nil || response4 == nil { - if restyResp4 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp4.String()) - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing GetExecutionByID", err, - "Failure at GetExecutionByID, unexpected response", "")) - return diags - } - } - if statusIsFailure(response4.Status) { - log.Printf("[DEBUG] Error %s", response4.BapiError) - diags = append(diags, diagError( - "Failure when executing Loading resource", err)) - return diags - } - } d.SetId(joinResourceID(resourceMap)) return resourceBusinessSdaHostonboardingSSIDIPpoolRead(ctx, d, m) } - resp1, restyResp1, err := client.FabricWireless.AddSSIDToIPPoolMapping(request1) + resp1, restyResp1, err := client.FabricWireless.AddSSIDToIPPoolMappingV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddSSIDToIPPoolMapping", err, restyResp1.String())) + "Failure when executing AddSSIDToIPPoolMappingV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddSSIDToIPPoolMapping", err)) + "Failure when executing AddSSIDToIPPoolMappingV1", err)) return diags } executionId := resp1.ExecutionID @@ -216,7 +164,7 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolCreate(ctx context.Context, d *s "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -229,17 +177,26 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolCreate(ctx context.Context, d *s return diags } } - if statusIsFailure(response2.Status) { - bapiError := response2.BapiError - diags = append(diags, diagErrorWithAlt( - "Failure when executing AddSSIDToIPPoolMapping", err, - "Failure at AddSSIDToIPPoolMapping execution", bapiError)) + if response2.Status == "FAILURE" { + log.Printf("[DEBUG] Error %s", response2.BapiError) + diags = append(diags, diagError( + "Failure when executing AddSSIDToIPPoolMappingV1", err)) return diags } } + queryParamValidate := catalystcentersdkgo.GetSSIDToIPPoolMappingV1QueryParams{} + queryParamValidate.VLANName = vvVLANName + queryParamValidate.SiteNameHierarchy = vvSiteNameHierarchy + item3, _, err := client.FabricWireless.GetSSIDToIPPoolMappingV1(&queryParamValidate) + if err != nil || item3 == nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing AddSSIDToIPPoolMappingV1", err, + "Failure at AddSSIDToIPPoolMappingV1, unexpected response", "")) + return diags + } resourceMap := make(map[string]string) - resourceMap["vlan_name"] = vvVLANName + resourceMap["vlan_name"] = item3.VLANName resourceMap["site_name_hierarchy"] = vvSiteNameHierarchy d.SetId(joinResourceID(resourceMap)) @@ -260,14 +217,16 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSSIDToIPPoolMapping") - queryParams1 := catalystcentersdkgo.GetSSIDToIPPoolMappingQueryParams{} + log.Printf("[DEBUG] Selected method: GetSSIDToIPPoolMappingV1") + queryParams1 := catalystcentersdkgo.GetSSIDToIPPoolMappingV1QueryParams{} queryParams1.VLANName = vVLANName queryParams1.SiteNameHierarchy = vSiteNameHierarchy - response1, restyResp1, err := client.FabricWireless.GetSSIDToIPPoolMapping(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.FabricWireless.GetSSIDToIPPoolMappingV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -279,10 +238,10 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolRead(ctx context.Context, d *sch log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenFabricWirelessGetSSIDToIPPoolMappingItem(response1) + vItem1 := flattenFabricWirelessGetSSIDToIPPoolMappingV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSSIDToIPPoolMapping response", + "Failure when setting GetSSIDToIPPoolMappingV1 response", err)) return diags } @@ -299,20 +258,20 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolUpdate(ctx context.Context, d *s var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestBusinessSdaHostonboardingSSIDIPpoolUpdateSSIDToIPPoolMapping(ctx, "parameters.0", d) + request1 := expandRequestBusinessSdaHostonboardingSSIDIPpoolUpdateSSIDToIPPoolMappingV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - response1, restyResp1, err := client.FabricWireless.UpdateSSIDToIPPoolMapping(request1) + response1, restyResp1, err := client.FabricWireless.UpdateSSIDToIPPoolMappingV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing UpdateSSIDToIPPoolMapping", err, restyResp1.String(), - "Failure at UpdateSSIDToIPPoolMapping, unexpected response", "")) + "Failure when executing UpdateSSIDToIPPoolMappingV1", err, restyResp1.String(), + "Failure at UpdateSSIDToIPPoolMappingV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing UpdateSSIDToIPPoolMapping", err, - "Failure at UpdateSSIDToIPPoolMapping, unexpected response", "")) + "Failure when executing UpdateSSIDToIPPoolMappingV1", err, + "Failure at UpdateSSIDToIPPoolMappingV1, unexpected response", "")) return diags } @@ -346,7 +305,7 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolUpdate(ctx context.Context, d *s if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing UpdateSSIDToIPPoolMapping", err)) + "Failure when executing UpdateSSIDToIPPoolMappingV1", err)) return diags } } @@ -358,14 +317,12 @@ func resourceBusinessSdaHostonboardingSSIDIPpoolUpdate(ctx context.Context, d *s func resourceBusinessSdaHostonboardingSSIDIPpoolDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { var diags diag.Diagnostics - err := errors.New("Delete not possible in this resource") - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing BusinessSdaHostonboardingSSIDIPpool", err, "Delete method is not supported", - "Failure at BusinessSdaHostonboardingSSIDIPpoolDelete, unexpected response", "")) + // NOTE: Unable to delete BusinessSdaHostonboardingSSIDIPpool on Dna Center + // Returning empty diags to delete it on Terraform return diags } -func expandRequestBusinessSdaHostonboardingSSIDIPpoolAddSSIDToIPPoolMapping(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessAddSSIDToIPPoolMapping { - request := catalystcentersdkgo.RequestFabricWirelessAddSSIDToIPPoolMapping{} +func expandRequestBusinessSdaHostonboardingSSIDIPpoolAddSSIDToIPPoolMappingV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessAddSSIDToIPPoolMappingV1 { + request := catalystcentersdkgo.RequestFabricWirelessAddSSIDToIPPoolMappingV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".vlan_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".vlan_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".vlan_name")))) { request.VLANName = interfaceToString(v) } @@ -384,8 +341,8 @@ func expandRequestBusinessSdaHostonboardingSSIDIPpoolAddSSIDToIPPoolMapping(ctx return &request } -func expandRequestBusinessSdaHostonboardingSSIDIPpoolUpdateSSIDToIPPoolMapping(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessUpdateSSIDToIPPoolMapping { - request := catalystcentersdkgo.RequestFabricWirelessUpdateSSIDToIPPoolMapping{} +func expandRequestBusinessSdaHostonboardingSSIDIPpoolUpdateSSIDToIPPoolMappingV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessUpdateSSIDToIPPoolMappingV1 { + request := catalystcentersdkgo.RequestFabricWirelessUpdateSSIDToIPPoolMappingV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".vlan_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".vlan_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".vlan_name")))) { request.VLANName = interfaceToString(v) } diff --git a/catalystcenter/resource_business_sda_wireless_controller_create.go b/catalystcenter/resource_business_sda_wireless_controller_create.go index fea2e19..d328bbe 100644 --- a/catalystcenter/resource_business_sda_wireless_controller_create.go +++ b/catalystcenter/resource_business_sda_wireless_controller_create.go @@ -89,20 +89,18 @@ func resourceBusinessSdaWirelessControllerCreateCreate(ctx context.Context, d *s client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestBusinessSdaWirelessControllerCreateAddWLCToFabricDomain(ctx, "parameters.0", d) + request1 := expandRequestBusinessSdaWirelessControllerCreateAddWLCToFabricDomainV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.FabricWireless.AddWLCToFabricDomain(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.FabricWireless.AddWLCToFabricDomainV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AddWLCToFabricDomain", err)) + "Failure when executing AddWLCToFabricDomainV1", err)) return diags } @@ -138,16 +136,15 @@ func resourceBusinessSdaWirelessControllerCreateCreate(ctx context.Context, d *s if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing AddWLCToFabricDomain", err, - "Failure at AddWLCToFabricDomain execution", bapiError)) + "Failure when executing AddWLCToFabricDomainV1", err, + "Failure at AddWLCToFabricDomainV1 execution", bapiError)) return diags } } - - vItem1 := flattenFabricWirelessAddWLCToFabricDomainItem(response1) + vItem1 := flattenFabricWirelessAddWLCToFabricDomainV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AddWLCToFabricDomain response", + "Failure when setting AddWLCToFabricDomainV1 response", err)) return diags } @@ -169,8 +166,8 @@ func resourceBusinessSdaWirelessControllerCreateDelete(ctx context.Context, d *s return diags } -func expandRequestBusinessSdaWirelessControllerCreateAddWLCToFabricDomain(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessAddWLCToFabricDomain { - request := catalystcentersdkgo.RequestFabricWirelessAddWLCToFabricDomain{} +func expandRequestBusinessSdaWirelessControllerCreateAddWLCToFabricDomainV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessAddWLCToFabricDomainV1 { + request := catalystcentersdkgo.RequestFabricWirelessAddWLCToFabricDomainV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_name")))) { request.DeviceName = interfaceToString(v) } @@ -180,7 +177,7 @@ func expandRequestBusinessSdaWirelessControllerCreateAddWLCToFabricDomain(ctx co return &request } -func flattenFabricWirelessAddWLCToFabricDomainItem(item *catalystcentersdkgo.ResponseFabricWirelessAddWLCToFabricDomain) []map[string]interface{} { +func flattenFabricWirelessAddWLCToFabricDomainV1Item(item *catalystcentersdkgo.ResponseFabricWirelessAddWLCToFabricDomainV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_business_sda_wireless_controller_delete.go b/catalystcenter/resource_business_sda_wireless_controller_delete.go index eb300a1..64c528b 100644 --- a/catalystcenter/resource_business_sda_wireless_controller_delete.go +++ b/catalystcenter/resource_business_sda_wireless_controller_delete.go @@ -84,21 +84,23 @@ func resourceBusinessSdaWirelessControllerDeleteCreate(ctx context.Context, d *s vPersistbapioutput := resourceItem["persistbapioutput"] - headerParams1 := catalystcentersdkgo.RemoveWLCFromFabricDomainHeaderParams{} - queryParams1 := catalystcentersdkgo.RemoveWLCFromFabricDomainQueryParams{} + headerParams1 := catalystcentersdkgo.RemoveWLCFromFabricDomainV1HeaderParams{} + queryParams1 := catalystcentersdkgo.RemoveWLCFromFabricDomainV1QueryParams{} queryParams1.DeviceIPAddress = vDeviceIPAddress.(string) headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.FabricWireless.RemoveWLCFromFabricDomain(&headerParams1, &queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.FabricWireless.RemoveWLCFromFabricDomainV1(&headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RemoveWLCFromFabricDomain", err)) + "Failure when executing RemoveWLCFromFabricDomainV1", err)) return diags } @@ -134,16 +136,15 @@ func resourceBusinessSdaWirelessControllerDeleteCreate(ctx context.Context, d *s if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing RemoveWLCFromFabricDomain", err, - "Failure at RemoveWLCFromFabricDomain execution", bapiError)) + "Failure when executing RemoveWLCFromFabricDomainV1", err, + "Failure at RemoveWLCFromFabricDomainV1 execution", bapiError)) return diags } } - - vItem1 := flattenFabricWirelessRemoveWLCFromFabricDomainItem(response1) + vItem1 := flattenFabricWirelessRemoveWLCFromFabricDomainV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RemoveWLCFromFabricDomain response", + "Failure when setting RemoveWLCFromFabricDomainV1 response", err)) return diags } @@ -165,7 +166,7 @@ func resourceBusinessSdaWirelessControllerDeleteDelete(ctx context.Context, d *s return diags } -func flattenFabricWirelessRemoveWLCFromFabricDomainItem(item *catalystcentersdkgo.ResponseFabricWirelessRemoveWLCFromFabricDomain) []map[string]interface{} { +func flattenFabricWirelessRemoveWLCFromFabricDomainV1Item(item *catalystcentersdkgo.ResponseFabricWirelessRemoveWLCFromFabricDomainV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_clients_query.go b/catalystcenter/resource_clients_query.go index 2fb1b13..f30ece2 100644 --- a/catalystcenter/resource_clients_query.go +++ b/catalystcenter/resource_clients_query.go @@ -957,35 +957,31 @@ func resourceClientsQueryCreate(ctx context.Context, d *schema.ResourceData, m i vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes(ctx, "parameters.0", d) + request1 := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesHeaderParams{} + headerParams1 := catalystcentersdkgo.RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Clients.RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes", err)) + "Failure when executing RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItems(response1.Response) + vItems1 := flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes response", + "Failure when setting RetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1 response", err)) return diags } @@ -1007,8 +1003,8 @@ func resourceClientsQueryDelete(ctx context.Context, d *schema.ResourceData, m i return diags } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes { - request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributes{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1 { + request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -1022,19 +1018,19 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPage(ctx, key+".page.0", d) + request.Page = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFilters { - request := []catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFilters{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Filters { + request := []catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1045,7 +1041,7 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return nil } for item_no := range objs { - i := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1053,8 +1049,8 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFilters { - request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesFilters{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Filters { + request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -1067,8 +1063,8 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributes { - request := []catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributes{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributes { + request := []catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1079,7 +1075,7 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return nil } for item_no := range objs { - i := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1087,8 +1083,8 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributes { - request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesAggregateAttributes{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributes { + request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -1098,8 +1094,8 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPage { - request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPage{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Page { + request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -1107,13 +1103,13 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortBy { - request := []catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortBy{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortBy { + request := []catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1124,7 +1120,7 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return nil } for item_no := range objs { - i := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1132,8 +1128,8 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return &request } -func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortBy { - request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesPageSortBy{} +func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortBy { + request := catalystcentersdkgo.RequestClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -1143,7 +1139,7 @@ func expandRequestClientsQueryRetrievesTheListOfClientsByApplyingComplexFiltersW return &request } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItems(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponse) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Items(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -1169,19 +1165,19 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup respItem["connection_status"] = item.ConnectionStatus respItem["tracked"] = item.Tracked respItem["is_private_mac_address"] = boolPtrToString(item.IsPrivateMacAddress) - respItem["health"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsHealth(item.Health) - respItem["traffic"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsTraffic(item.Traffic) - respItem["connected_network_device"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsConnectedNetworkDevice(item.ConnectedNetworkDevice) - respItem["connection"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsConnection(item.Connection) - respItem["onboarding"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsOnboarding(item.Onboarding) - respItem["latency"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsLatency(item.Latency) - respItem["aggregate_attributes"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsAggregateAttributes(item.AggregateAttributes) + respItem["health"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsHealth(item.Health) + respItem["traffic"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsTraffic(item.Traffic) + respItem["connected_network_device"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsConnectedNetworkDevice(item.ConnectedNetworkDevice) + respItem["connection"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsConnection(item.Connection) + respItem["onboarding"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsOnboarding(item.Onboarding) + respItem["latency"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsLatency(item.Latency) + respItem["aggregate_attributes"] = flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsHealth(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseHealth) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsHealth(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseHealth) []map[string]interface{} { if item == nil { return nil } @@ -1202,7 +1198,7 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsTraffic(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseTraffic) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsTraffic(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseTraffic) []map[string]interface{} { if item == nil { return nil } @@ -1229,7 +1225,7 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsConnectedNetworkDevice(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseConnectedNetworkDevice) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsConnectedNetworkDevice(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseConnectedNetworkDevice) []map[string]interface{} { if item == nil { return nil } @@ -1249,7 +1245,7 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsConnection(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseConnection) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsConnection(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseConnection) []map[string]interface{} { if item == nil { return nil } @@ -1290,7 +1286,7 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsOnboarding(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseOnboarding) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsOnboarding(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseOnboarding) []map[string]interface{} { if item == nil { return nil } @@ -1326,7 +1322,7 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsLatency(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseLatency) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsLatency(item *catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseLatency) []map[string]interface{} { if item == nil { return nil } @@ -1342,7 +1338,7 @@ func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSup } -func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesResponseAggregateAttributes) []map[string]interface{} { +func flattenClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheListOfClientsByApplyingComplexFiltersWhileAlsoSupportingAggregateAttributesV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_clients_query_count.go b/catalystcenter/resource_clients_query_count.go index a24cdf4..f91b320 100644 --- a/catalystcenter/resource_clients_query_count.go +++ b/catalystcenter/resource_clients_query_count.go @@ -122,35 +122,31 @@ func resourceClientsQueryCountCreate(ctx context.Context, d *schema.ResourceData vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFilters(ctx, "parameters.0", d) + request1 := expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.RetrievesTheNumberOfClientsByApplyingComplexFiltersHeaderParams{} + headerParams1 := catalystcentersdkgo.RetrievesTheNumberOfClientsByApplyingComplexFiltersV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesTheNumberOfClientsByApplyingComplexFilters(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Clients.RetrievesTheNumberOfClientsByApplyingComplexFiltersV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetrievesTheNumberOfClientsByApplyingComplexFilters", err)) + "Failure when executing RetrievesTheNumberOfClientsByApplyingComplexFiltersV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersItem(response1.Response) + vItem1 := flattenClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheNumberOfClientsByApplyingComplexFilters response", + "Failure when setting RetrievesTheNumberOfClientsByApplyingComplexFiltersV1 response", err)) return diags } @@ -172,8 +168,8 @@ func resourceClientsQueryCountDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFilters { - request := catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFilters{} +func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1 { + request := catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -181,13 +177,13 @@ func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexF request.EndTime = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersV1FiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersFilters { - request := []catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersFilters{} +func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Filters { + request := []catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -198,7 +194,7 @@ func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexF return nil } for item_no := range objs { - i := expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -206,8 +202,8 @@ func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexF return &request } -func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersFilters { - request := catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersFilters{} +func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Filters { + request := catalystcentersdkgo.RequestClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -220,7 +216,7 @@ func expandRequestClientsQueryCountRetrievesTheNumberOfClientsByApplyingComplexF return &request } -func flattenClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersItem(item *catalystcentersdkgo.ResponseClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersResponse) []map[string]interface{} { +func flattenClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Item(item *catalystcentersdkgo.ResponseClientsRetrievesTheNumberOfClientsByApplyingComplexFiltersV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_clients_summary_analytics.go b/catalystcenter/resource_clients_summary_analytics.go index 93c47f6..9946659 100644 --- a/catalystcenter/resource_clients_summary_analytics.go +++ b/catalystcenter/resource_clients_summary_analytics.go @@ -271,35 +271,31 @@ func resourceClientsSummaryAnalyticsCreate(ctx context.Context, d *schema.Resour vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClients(ctx, "parameters.0", d) + request1 := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.RetrievesSummaryAnalyticsDataRelatedToClientsHeaderParams{} + headerParams1 := catalystcentersdkgo.RetrievesSummaryAnalyticsDataRelatedToClientsV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesSummaryAnalyticsDataRelatedToClients(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Clients.RetrievesSummaryAnalyticsDataRelatedToClientsV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetrievesSummaryAnalyticsDataRelatedToClients", err)) + "Failure when executing RetrievesSummaryAnalyticsDataRelatedToClientsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItem(response1.Response) + vItem1 := flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesSummaryAnalyticsDataRelatedToClients response", + "Failure when setting RetrievesSummaryAnalyticsDataRelatedToClientsV1 response", err)) return diags } @@ -321,8 +317,8 @@ func resourceClientsSummaryAnalyticsDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClients(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClients { - request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClients{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1 { + request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -336,19 +332,19 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsPage(ctx, key+".page.0", d) + request.Page = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsFilters { - request := []catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsFilters{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Filters { + request := []catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -359,7 +355,7 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return nil } for item_no := range objs { - i := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -367,8 +363,8 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsFilters { - request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsFilters{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Filters { + request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -381,8 +377,8 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributes { - request := []catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributes{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributes { + request := []catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -393,7 +389,7 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return nil } for item_no := range objs { - i := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -401,8 +397,8 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributes { - request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsAggregateAttributes{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributes { + request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -412,8 +408,8 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsPage { - request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsPage{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Page { + request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -421,13 +417,13 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC request.Cursor = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortBy { - request := []catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortBy{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortBy { + request := []catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -438,7 +434,7 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return nil } for item_no := range objs { - i := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -446,8 +442,8 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return &request } -func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortBy { - request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsPageSortBy{} +func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortBy { + request := catalystcentersdkgo.RequestClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -457,18 +453,18 @@ func expandRequestClientsSummaryAnalyticsRetrievesSummaryAnalyticsDataRelatedToC return &request } -func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItem(item *catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsResponse) []map[string]interface{} { +func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Item(item *catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["groups"] = flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroups(item.Groups) + respItem["groups"] = flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ItemGroups(item.Groups) return []map[string]interface{}{ respItem, } } -func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroups(items *[]catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsResponseGroups) []map[string]interface{} { +func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ItemGroups(items *[]catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -476,14 +472,14 @@ func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroups(items for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ItemGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ItemGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroupsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsResponseGroupsAttributes) []map[string]interface{} { +func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ItemGroupsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -497,7 +493,7 @@ func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroupsAttrib return respItems } -func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsItemGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ItemGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSummaryAnalyticsDataRelatedToClientsV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_clients_top_n_analytics.go b/catalystcenter/resource_clients_top_n_analytics.go index f0f100c..46744ce 100644 --- a/catalystcenter/resource_clients_top_n_analytics.go +++ b/catalystcenter/resource_clients_top_n_analytics.go @@ -277,35 +277,31 @@ func resourceClientsTopNAnalyticsCreate(ctx context.Context, d *schema.ResourceD vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClients(ctx, "parameters.0", d) + request1 := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.RetrievesTheTopNAnalyticsDataRelatedToClientsHeaderParams{} + headerParams1 := catalystcentersdkgo.RetrievesTheTopNAnalyticsDataRelatedToClientsV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesTheTopNAnalyticsDataRelatedToClients(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Clients.RetrievesTheTopNAnalyticsDataRelatedToClientsV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetrievesTheTopNAnalyticsDataRelatedToClients", err)) + "Failure when executing RetrievesTheTopNAnalyticsDataRelatedToClientsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItems(response1.Response) + vItems1 := flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheTopNAnalyticsDataRelatedToClients response", + "Failure when setting RetrievesTheTopNAnalyticsDataRelatedToClientsV1 response", err)) return diags } @@ -327,8 +323,8 @@ func resourceClientsTopNAnalyticsDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClients(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClients { - request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClients{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1 { + request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -345,19 +341,19 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsPage(ctx, key+".page.0", d) + request.Page = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsFilters { - request := []catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsFilters{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Filters { + request := []catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -368,7 +364,7 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return nil } for item_no := range objs { - i := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -376,8 +372,8 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsFilters { - request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsFilters{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Filters { + request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -390,8 +386,8 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributes { - request := []catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributes{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributes { + request := []catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -402,7 +398,7 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return nil } for item_no := range objs { - i := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -410,8 +406,8 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributes { - request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsAggregateAttributes{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributes { + request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -421,8 +417,8 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsPage { - request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsPage{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Page { + request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -430,13 +426,13 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie request.Cursor = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortBy { - request := []catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortBy{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortBy { + request := []catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -447,7 +443,7 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return nil } for item_no := range objs { - i := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -455,8 +451,8 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return &request } -func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortBy { - request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsPageSortBy{} +func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortBy { + request := catalystcentersdkgo.RequestClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -466,7 +462,7 @@ func expandRequestClientsTopNAnalyticsRetrievesTheTopNAnalyticsDataRelatedToClie return &request } -func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItems(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTopNAnalyticsDataRelatedToClientsResponse) []map[string]interface{} { +func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Items(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -474,14 +470,14 @@ func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItems(items *[]c for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItemsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItemsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1ItemsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItemsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTopNAnalyticsDataRelatedToClientsResponseAttributes) []map[string]interface{} { +func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1ItemsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1ResponseAttributes) []map[string]interface{} { if items == nil { return nil } @@ -495,7 +491,7 @@ func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItemsAttributes( return respItems } -func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTopNAnalyticsDataRelatedToClientsResponseAggregateAttributes) []map[string]interface{} { +func flattenClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTopNAnalyticsDataRelatedToClientsV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_clients_trend_analytics.go b/catalystcenter/resource_clients_trend_analytics.go index 2cbb8c2..639e4d0 100644 --- a/catalystcenter/resource_clients_trend_analytics.go +++ b/catalystcenter/resource_clients_trend_analytics.go @@ -276,35 +276,31 @@ func resourceClientsTrendAnalyticsCreate(ctx context.Context, d *schema.Resource vXCaLLERID := resourceItem["xca_lle_rid"] - request1 := expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClients(ctx, "parameters.0", d) + request1 := expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.RetrievesTheTrendAnalyticsDataRelatedToClientsHeaderParams{} + headerParams1 := catalystcentersdkgo.RetrievesTheTrendAnalyticsDataRelatedToClientsV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesTheTrendAnalyticsDataRelatedToClients(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Clients.RetrievesTheTrendAnalyticsDataRelatedToClientsV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetrievesTheTrendAnalyticsDataRelatedToClients", err)) + "Failure when executing RetrievesTheTrendAnalyticsDataRelatedToClientsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItems(response1.Response) + vItems1 := flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesTheTrendAnalyticsDataRelatedToClients response", + "Failure when setting RetrievesTheTrendAnalyticsDataRelatedToClientsV1 response", err)) return diags } @@ -326,8 +322,8 @@ func resourceClientsTrendAnalyticsDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClients(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClients { - request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClients{} +func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1 { + request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -344,19 +340,19 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsPage(ctx, key+".page.0", d) + request.Page = expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsFilters { - request := []catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsFilters{} +func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Filters { + request := []catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -367,7 +363,7 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return nil } for item_no := range objs { - i := expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -375,8 +371,8 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return &request } -func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsFilters { - request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsFilters{} +func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Filters { + request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -389,8 +385,8 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return &request } -func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributes { - request := []catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributes{} +func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributes { + request := []catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -401,7 +397,7 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return nil } for item_no := range objs { - i := expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -409,8 +405,8 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return &request } -func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributes { - request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsAggregateAttributes{} +func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributes { + request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -420,8 +416,8 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return &request } -func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsPage { - request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsPage{} +func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Page { + request := catalystcentersdkgo.RequestClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -434,7 +430,7 @@ func expandRequestClientsTrendAnalyticsRetrievesTheTrendAnalyticsDataRelatedToCl return &request } -func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItems(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsResponse) []map[string]interface{} { +func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Items(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -442,13 +438,13 @@ func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItems(items *[] for _, item := range *items { respItem := make(map[string]interface{}) respItem["timestamp"] = item.Timestamp - respItem["groups"] = flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroups(item.Groups) + respItem["groups"] = flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ItemsGroups(item.Groups) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroups(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsResponseGroups) []map[string]interface{} { +func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ItemsGroups(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -456,14 +452,14 @@ func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroups(ite for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ItemsGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ItemsGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsResponseGroupsAttributes) []map[string]interface{} { +func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -477,7 +473,7 @@ func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroupsAttr return respItems } -func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesTheTrendAnalyticsDataRelatedToClientsV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_clients_trend_analytics_id.go b/catalystcenter/resource_clients_trend_analytics_id.go index f1de663..d01d1ce 100644 --- a/catalystcenter/resource_clients_trend_analytics_id.go +++ b/catalystcenter/resource_clients_trend_analytics_id.go @@ -285,35 +285,31 @@ func resourceClientsTrendAnalyticsIDCreate(ctx context.Context, d *schema.Resour vXCaLLERID := resourceItem["xca_lle_rid"] vvID := vID.(string) - request1 := expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTime(ctx, "parameters.0", d) + request1 := expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.RetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeHeaderParams{} + headerParams1 := catalystcentersdkgo.RetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1HeaderParams{} headerParams1.XCaLLERID = vXCaLLERID.(string) - response1, restyResp1, err := client.Clients.RetrievesSpecificClientInformationOverASpecifiedPeriodOfTime(vvID, request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Clients.RetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1(vvID, request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetrievesSpecificClientInformationOverASpecifiedPeriodOfTime", err)) + "Failure when executing RetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItems(response1.Response) + vItems1 := flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting RetrievesSpecificClientInformationOverASpecifiedPeriodOfTime response", + "Failure when setting RetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1 response", err)) return diags } @@ -335,8 +331,8 @@ func resourceClientsTrendAnalyticsIDDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTime(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTime { - request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTime{} +func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1 { + request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -353,19 +349,19 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimePage(ctx, key+".page.0", d) + request.Page = expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFilters { - request := []catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFilters{} +func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Filters { + request := []catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -376,7 +372,7 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return nil } for item_no := range objs { - i := expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -384,8 +380,8 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return &request } -func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFilters { - request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeFilters{} +func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Filters { + request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -398,8 +394,8 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return &request } -func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributes { - request := []catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributes{} +func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributes { + request := []catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -410,7 +406,7 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return nil } for item_no := range objs { - i := expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -418,8 +414,8 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return &request } -func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributes { - request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeAggregateAttributes{} +func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributes { + request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -429,8 +425,8 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return &request } -func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimePage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimePage { - request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimePage{} +func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Page { + request := catalystcentersdkgo.RequestClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -443,7 +439,7 @@ func expandRequestClientsTrendAnalyticsIDRetrievesSpecificClientInformationOverA return &request } -func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItems(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeResponse) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Items(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1Response) []map[string]interface{} { if items == nil { return nil } @@ -451,13 +447,13 @@ func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeI for _, item := range *items { respItem := make(map[string]interface{}) respItem["timestamp"] = item.Timestamp - respItem["groups"] = flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItemsGroups(item.Groups) + respItem["groups"] = flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ItemsGroups(item.Groups) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItemsGroups(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeResponseGroups) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ItemsGroups(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -465,14 +461,14 @@ func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeI for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItemsGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItemsGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ItemsGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ItemsGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeResponseGroupsAttributes) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -486,7 +482,7 @@ func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeI return respItems } -func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseClientsRetrievesSpecificClientInformationOverASpecifiedPeriodOfTimeV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_command_runner_run_command.go b/catalystcenter/resource_command_runner_run_command.go index 6db909b..cef4738 100644 --- a/catalystcenter/resource_command_runner_run_command.go +++ b/catalystcenter/resource_command_runner_run_command.go @@ -115,30 +115,23 @@ func resourceCommandRunnerRunCommandCreate(ctx context.Context, d *schema.Resour client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestCommandRunnerRunCommandRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration(ctx, "parameters.0", d) + request1 := expandRequestCommandRunnerRunCommandRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.CommandRunner.RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.CommandRunner.RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration", err)) + "Failure when executing RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - if response1.Response == nil { - diags = append(diags, diagError( - "Failure when executing RunReadOnlyCommandsOnDevices", err)) - return diags - } taskId := response1.Response.TaskID log.Printf("[DEBUG] TASKID => %s", taskId) if taskId != "" { @@ -175,10 +168,13 @@ func resourceCommandRunnerRunCommandCreate(ctx context.Context, d *schema.Resour } } - vItem1 := flattenCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration response", + "Failure when setting RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1 response", err)) return diags } @@ -200,8 +196,8 @@ func resourceCommandRunnerRunCommandDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestCommandRunnerRunCommandRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration { - request := catalystcentersdkgo.RequestCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration{} +func expandRequestCommandRunnerRunCommandRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1 { + request := catalystcentersdkgo.RequestCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".commands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".commands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".commands")))) { request.Commands = interfaceToSliceString(v) } @@ -220,7 +216,7 @@ func expandRequestCommandRunnerRunCommandRunReadOnlyCommandsOnDevicesToGetTheirR return &request } -func flattenCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationItem(item *catalystcentersdkgo.ResponseCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationResponse) []map[string]interface{} { +func flattenCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1Item(item *catalystcentersdkgo.ResponseCommandRunnerRunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfigurationV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_compliance.go b/catalystcenter/resource_compliance.go index 23d00f9..cc65948 100644 --- a/catalystcenter/resource_compliance.go +++ b/catalystcenter/resource_compliance.go @@ -63,7 +63,7 @@ func resourceCompliance() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "categories": &schema.Schema{ - Description: `Category can have any value among 'INTENT'(mapped to compliance types: NETWORK_SETTINGS,NETWORK_PROFILEWORKFLOW,FABRIC,APPLICATION_VISIBILITY), 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'EOX' , 'NETWORK_SETTINGS' + Description: `Category can have any value among 'INTENT'(mapped to compliance types: NETWORK_SETTINGS,NETWORK_PROFILE,WORKFLOW,FABRIC,APPLICATION_VISIBILITY), 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'EOX' , 'NETWORK_SETTINGS' `, Type: schema.TypeList, Optional: true, @@ -105,20 +105,18 @@ func resourceComplianceCreate(ctx context.Context, d *schema.ResourceData, m int client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestComplianceRunCompliance(ctx, "parameters.0", d) + request1 := expandRequestComplianceRunComplianceV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Compliance.RunCompliance(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Compliance.RunComplianceV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RunCompliance", err)) + "Failure when executing RunComplianceV1", err)) return diags } @@ -126,7 +124,7 @@ func resourceComplianceCreate(ctx context.Context, d *schema.ResourceData, m int if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing RunCompliance", err)) + "Failure when executing RunComplianceV1", err)) return diags } taskId := response1.Response.TaskID @@ -160,22 +158,24 @@ func resourceComplianceCreate(ctx context.Context, d *schema.ResourceData, m int } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing RunCompliance", err1)) + "Failure when executing RunComplianceV1", err1)) return diags } } - vItem1 := flattenComplianceRunComplianceItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenComplianceRunComplianceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RunCompliance response", + "Failure when setting RunComplianceV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceComplianceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -190,8 +190,8 @@ func resourceComplianceDelete(ctx context.Context, d *schema.ResourceData, m int return diags } -func expandRequestComplianceRunCompliance(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestComplianceRunCompliance { - request := catalystcentersdkgo.RequestComplianceRunCompliance{} +func expandRequestComplianceRunComplianceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestComplianceRunComplianceV1 { + request := catalystcentersdkgo.RequestComplianceRunComplianceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".trigger_full")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".trigger_full")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".trigger_full")))) { request.TriggerFull = interfaceToBoolPtr(v) } @@ -204,7 +204,7 @@ func expandRequestComplianceRunCompliance(ctx context.Context, key string, d *sc return &request } -func flattenComplianceRunComplianceItem(item *catalystcentersdkgo.ResponseComplianceRunComplianceResponse) []map[string]interface{} { +func flattenComplianceRunComplianceV1Item(item *catalystcentersdkgo.ResponseComplianceRunComplianceV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_configuration_template.go b/catalystcenter/resource_configuration_template.go index 38830e4..377d3d9 100644 --- a/catalystcenter/resource_configuration_template.go +++ b/catalystcenter/resource_configuration_template.go @@ -1137,7 +1137,7 @@ func resourceConfigurationTemplate() *schema.Resource { `, Type: schema.TypeString, Optional: true, - Default: "", + Computed: true, }, "project_name": &schema.Schema{ Description: `Project name @@ -1695,7 +1695,8 @@ func resourceConfigurationTemplate() *schema.Resource { Description: `Project UUID `, Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, }, "project_name": &schema.Schema{ Description: `Project name @@ -2222,7 +2223,7 @@ func resourceConfigurationTemplateCreate(ctx context.Context, d *schema.Resource var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestConfigurationTemplateCreateTemplate(ctx, "parameters.0", d) + request1 := expandRequestConfigurationTemplateCreateTemplateV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vTemplateID := resourceItem["template_id"] @@ -2260,7 +2261,7 @@ func resourceConfigurationTemplateCreate(ctx context.Context, d *schema.Resource return resourceConfigurationTemplateRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParamImport := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} queryParamImport.Name = vvProjectName log.Print("[DEBUG] 1") response2, err := searchConfigurationTemplatesGetsTheTemplatesAvailable(m, queryParamImport, vvName) @@ -2317,7 +2318,7 @@ func resourceConfigurationTemplateCreate(ctx context.Context, d *schema.Resource return diags } } - queryParamValidate := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} queryParamValidate.Name = vvProjectName item3, err := searchConfigurationTemplatesGetsTheTemplatesAvailable(m, queryParamValidate, vvName) if err != nil || item3 == nil { @@ -2350,7 +2351,7 @@ func resourceConfigurationTemplateRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetsDetailsOfAGivenTemplate") - queryParams1 := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParams1 := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} queryParams1.Name = vProjectName // response1, err := searchConfigurationTemplatesGetsTheTemplatesAvailable(m, queryParams1, vTemplateName) @@ -2368,7 +2369,7 @@ func resourceConfigurationTemplateRead(ctx context.Context, d *schema.ResourceDa // items := catalystcentersdkgo.ResponseConfigurationTemplatesGetsDetailsOfAGivenTemplate{ // *response1, - vItem1 := flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateItem(response1) + vItem1 := flattenConfigurationTemplatesGetsDetailsOfAGivenTemplateV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetsTheTemplatesAvailable search response", @@ -2395,7 +2396,7 @@ func resourceConfigurationTemplateUpdate(ctx context.Context, d *schema.Resource resourceMap := separateResourceID(resourceID) vID := resourceMap["template_id"] if d.HasChange("parameters") { - request1 := expandRequestConfigurationTemplateUpdateTemplate(ctx, "parameters.0", d) + request1 := expandRequestConfigurationTemplateUpdateTemplateV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && request1.ID == "" { request1.ID = vID @@ -2509,10 +2510,10 @@ func resourceConfigurationTemplateDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestConfigurationTemplateCreateTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplate { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplate{} +func expandRequestConfigurationTemplateCreateTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { - request.Tags = expandRequestConfigurationTemplateCreateTemplateTagsArray(ctx, key+".tags", d) + request.Tags = expandRequestConfigurationTemplateCreateTemplateV1TagsArray(ctx, key+".tags", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".author")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".author")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".author")))) { request.Author = interfaceToString(v) @@ -2521,7 +2522,7 @@ func expandRequestConfigurationTemplateCreateTemplate(ctx context.Context, key s request.Composite = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".containing_templates")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".containing_templates")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".containing_templates")))) { - request.ContainingTemplates = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesArray(ctx, key+".containing_templates", d) + request.ContainingTemplates = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesArray(ctx, key+".containing_templates", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".create_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".create_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".create_time")))) { request.CreateTime = interfaceToIntPtr(v) @@ -2533,7 +2534,7 @@ func expandRequestConfigurationTemplateCreateTemplate(ctx context.Context, key s request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_types")))) { - request.DeviceTypes = expandRequestConfigurationTemplateCreateTemplateDeviceTypesArray(ctx, key+".device_types", d) + request.DeviceTypes = expandRequestConfigurationTemplateCreateTemplateV1DeviceTypesArray(ctx, key+".device_types", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".failure_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".failure_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".failure_policy")))) { request.FailurePolicy = interfaceToString(v) @@ -2566,7 +2567,7 @@ func expandRequestConfigurationTemplateCreateTemplate(ctx context.Context, key s request.RollbackTemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_params")))) { - request.RollbackTemplateParams = expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) + request.RollbackTemplateParams = expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".software_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".software_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".software_type")))) { request.SoftwareType = interfaceToString(v) @@ -2581,10 +2582,10 @@ func expandRequestConfigurationTemplateCreateTemplate(ctx context.Context, key s request.TemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_params")))) { - request.TemplateParams = expandRequestConfigurationTemplateCreateTemplateTemplateParamsArray(ctx, key+".template_params", d) + request.TemplateParams = expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsArray(ctx, key+".template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".validation_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".validation_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".validation_errors")))) { - request.ValidationErrors = expandRequestConfigurationTemplateCreateTemplateValidationErrors(ctx, key+".validation_errors.0", d) + request.ValidationErrors = expandRequestConfigurationTemplateCreateTemplateV1ValidationErrors(ctx, key+".validation_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".version")))) { request.Version = interfaceToString(v) @@ -2595,8 +2596,8 @@ func expandRequestConfigurationTemplateCreateTemplate(ctx context.Context, key s return &request } -func expandRequestConfigurationTemplateCreateTemplateTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTags { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTags{} +func expandRequestConfigurationTemplateCreateTemplateV1TagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1Tags { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1Tags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2607,7 +2608,7 @@ func expandRequestConfigurationTemplateCreateTemplateTagsArray(ctx context.Conte return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1Tags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2618,8 +2619,8 @@ func expandRequestConfigurationTemplateCreateTemplateTagsArray(ctx context.Conte return &request } -func expandRequestConfigurationTemplateCreateTemplateTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTags { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTags{} +func expandRequestConfigurationTemplateCreateTemplateV1Tags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1Tags { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1Tags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2632,8 +2633,8 @@ func expandRequestConfigurationTemplateCreateTemplateTags(ctx context.Context, k return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplates { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplates{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplates { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplates{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2644,7 +2645,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesArray(ct return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplates(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplates(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2655,10 +2656,10 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesArray(ct return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplates { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplates{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplates { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplates{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { - request.Tags = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTagsArray(ctx, key+".tags", d) + request.Tags = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTagsArray(ctx, key+".tags", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".composite")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".composite")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".composite")))) { request.Composite = interfaceToBoolPtr(v) @@ -2667,7 +2668,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplates(ctx con request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_types")))) { - request.DeviceTypes = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTypesArray(ctx, key+".device_types", d) + request.DeviceTypes = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesDeviceTypesArray(ctx, key+".device_types", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -2682,13 +2683,13 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplates(ctx con request.ProjectName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_params")))) { - request.RollbackTemplateParams = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) + request.RollbackTemplateParams = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_content")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_content")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_content")))) { request.TemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_params")))) { - request.TemplateParams = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsArray(ctx, key+".template_params", d) + request.TemplateParams = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsArray(ctx, key+".template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".version")))) { request.Version = interfaceToString(v) @@ -2699,8 +2700,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplates(ctx con return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTags { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTags{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTags { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2711,7 +2712,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTagsArra return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2722,8 +2723,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTagsArra return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTags { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTags{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTags { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2736,8 +2737,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTags(ctx return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesDeviceTypes { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesDeviceTypes{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesDeviceTypes { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesDeviceTypes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2748,7 +2749,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTy return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2759,8 +2760,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTy return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesDeviceTypes { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesDeviceTypes{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesDeviceTypes { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesDeviceTypes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_family")))) { request.ProductFamily = interfaceToString(v) } @@ -2776,8 +2777,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesDeviceTy return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2788,7 +2789,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2799,8 +2800,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -2847,13 +2848,13 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2861,8 +2862,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2873,7 +2874,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2884,8 +2885,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2901,8 +2902,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsSelection{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -2913,7 +2914,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2921,8 +2922,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2930,8 +2931,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2942,7 +2943,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2953,8 +2954,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -3001,13 +3002,13 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3015,8 +3016,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3027,7 +3028,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3038,8 +3039,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -3055,8 +3056,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsSelection{} +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -3067,7 +3068,7 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3075,8 +3076,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateCreateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3084,8 +3085,8 @@ func expandRequestConfigurationTemplateCreateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateCreateTemplateDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateDeviceTypes { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateDeviceTypes{} +func expandRequestConfigurationTemplateCreateTemplateV1DeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1DeviceTypes { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1DeviceTypes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3096,7 +3097,7 @@ func expandRequestConfigurationTemplateCreateTemplateDeviceTypesArray(ctx contex return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1DeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3107,8 +3108,8 @@ func expandRequestConfigurationTemplateCreateTemplateDeviceTypesArray(ctx contex return &request } -func expandRequestConfigurationTemplateCreateTemplateDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateDeviceTypes { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateDeviceTypes{} +func expandRequestConfigurationTemplateCreateTemplateV1DeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1DeviceTypes { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1DeviceTypes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_family")))) { request.ProductFamily = interfaceToString(v) } @@ -3124,8 +3125,8 @@ func expandRequestConfigurationTemplateCreateTemplateDeviceTypes(ctx context.Con return &request } -func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3136,7 +3137,7 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsArray return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3147,8 +3148,8 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsArray return &request } -func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -3195,13 +3196,13 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParams(ctx request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3209,8 +3210,8 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParams(ctx return &request } -func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3221,7 +3222,7 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRange return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3232,8 +3233,8 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRange return &request } -func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -3249,8 +3250,8 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsRange return &request } -func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsSelection{} +func expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -3261,7 +3262,7 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelec request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3269,8 +3270,8 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelec return &request } -func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateRollbackTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateCreateTemplateV1RollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1RollbackTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3278,8 +3279,8 @@ func expandRequestConfigurationTemplateCreateTemplateRollbackTemplateParamsSelec return &request } -func expandRequestConfigurationTemplateCreateTemplateTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3290,7 +3291,7 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsArray(ctx con return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1TemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3301,8 +3302,8 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsArray(ctx con return &request } -func expandRequestConfigurationTemplateCreateTemplateTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParams{} +func expandRequestConfigurationTemplateCreateTemplateV1TemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -3349,13 +3350,13 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParams(ctx context. request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateCreateTemplateTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3363,8 +3364,8 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParams(ctx context. return &request } -func expandRequestConfigurationTemplateCreateTemplateTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3375,7 +3376,7 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsRangeArray(ct return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateCreateTemplateTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3386,8 +3387,8 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsRangeArray(ct return &request } -func expandRequestConfigurationTemplateCreateTemplateTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsRange{} +func expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -3403,8 +3404,8 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsRange(ctx con return &request } -func expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsSelection{} +func expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -3415,7 +3416,7 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelection(ctx request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3423,8 +3424,8 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelection(ctx return &request } -func expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateCreateTemplateV1TemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1TemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3432,13 +3433,13 @@ func expandRequestConfigurationTemplateCreateTemplateTemplateParamsSelectionSele return &request } -func expandRequestConfigurationTemplateCreateTemplateValidationErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateValidationErrors { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateValidationErrors{} +func expandRequestConfigurationTemplateCreateTemplateV1ValidationErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ValidationErrors { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ValidationErrors{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_errors")))) { - request.RollbackTemplateErrors = expandRequestConfigurationTemplateCreateTemplateValidationErrorsRollbackTemplateErrors(ctx, key+".rollback_template_errors.0", d) + request.RollbackTemplateErrors = expandRequestConfigurationTemplateCreateTemplateV1ValidationErrorsRollbackTemplateErrors(ctx, key+".rollback_template_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_errors")))) { - request.TemplateErrors = expandRequestConfigurationTemplateCreateTemplateValidationErrorsTemplateErrors(ctx, key+".template_errors.0", d) + request.TemplateErrors = expandRequestConfigurationTemplateCreateTemplateV1ValidationErrorsTemplateErrors(ctx, key+".template_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_id")))) { request.TemplateID = interfaceToString(v) @@ -3452,8 +3453,8 @@ func expandRequestConfigurationTemplateCreateTemplateValidationErrors(ctx contex return &request } -func expandRequestConfigurationTemplateCreateTemplateValidationErrorsRollbackTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateValidationErrorsRollbackTemplateErrors { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateValidationErrorsRollbackTemplateErrors +func expandRequestConfigurationTemplateCreateTemplateV1ValidationErrorsRollbackTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ValidationErrorsRollbackTemplateErrors { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ValidationErrorsRollbackTemplateErrors request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3461,8 +3462,8 @@ func expandRequestConfigurationTemplateCreateTemplateValidationErrorsRollbackTem return &request } -func expandRequestConfigurationTemplateCreateTemplateValidationErrorsTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateValidationErrorsTemplateErrors { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateValidationErrorsTemplateErrors +func expandRequestConfigurationTemplateCreateTemplateV1ValidationErrorsTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ValidationErrorsTemplateErrors { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateTemplateV1ValidationErrorsTemplateErrors request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3470,10 +3471,10 @@ func expandRequestConfigurationTemplateCreateTemplateValidationErrorsTemplateErr return &request } -func expandRequestConfigurationTemplateUpdateTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplate { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplate{} +func expandRequestConfigurationTemplateUpdateTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { - request.Tags = expandRequestConfigurationTemplateUpdateTemplateTagsArray(ctx, key+".tags", d) + request.Tags = expandRequestConfigurationTemplateUpdateTemplateV1TagsArray(ctx, key+".tags", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".author")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".author")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".author")))) { request.Author = interfaceToString(v) @@ -3482,7 +3483,7 @@ func expandRequestConfigurationTemplateUpdateTemplate(ctx context.Context, key s request.Composite = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".containing_templates")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".containing_templates")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".containing_templates")))) { - request.ContainingTemplates = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesArray(ctx, key+".containing_templates", d) + request.ContainingTemplates = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesArray(ctx, key+".containing_templates", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".create_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".create_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".create_time")))) { request.CreateTime = interfaceToIntPtr(v) @@ -3494,7 +3495,7 @@ func expandRequestConfigurationTemplateUpdateTemplate(ctx context.Context, key s request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_types")))) { - request.DeviceTypes = expandRequestConfigurationTemplateUpdateTemplateDeviceTypesArray(ctx, key+".device_types", d) + request.DeviceTypes = expandRequestConfigurationTemplateUpdateTemplateV1DeviceTypesArray(ctx, key+".device_types", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".failure_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".failure_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".failure_policy")))) { request.FailurePolicy = interfaceToString(v) @@ -3527,7 +3528,7 @@ func expandRequestConfigurationTemplateUpdateTemplate(ctx context.Context, key s request.RollbackTemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_params")))) { - request.RollbackTemplateParams = expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) + request.RollbackTemplateParams = expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".software_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".software_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".software_type")))) { request.SoftwareType = interfaceToString(v) @@ -3542,10 +3543,10 @@ func expandRequestConfigurationTemplateUpdateTemplate(ctx context.Context, key s request.TemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_params")))) { - request.TemplateParams = expandRequestConfigurationTemplateUpdateTemplateTemplateParamsArray(ctx, key+".template_params", d) + request.TemplateParams = expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsArray(ctx, key+".template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".validation_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".validation_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".validation_errors")))) { - request.ValidationErrors = expandRequestConfigurationTemplateUpdateTemplateValidationErrors(ctx, key+".validation_errors.0", d) + request.ValidationErrors = expandRequestConfigurationTemplateUpdateTemplateV1ValidationErrors(ctx, key+".validation_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".version")))) { request.Version = interfaceToString(v) @@ -3556,8 +3557,8 @@ func expandRequestConfigurationTemplateUpdateTemplate(ctx context.Context, key s return &request } -func expandRequestConfigurationTemplateUpdateTemplateTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTags { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTags{} +func expandRequestConfigurationTemplateUpdateTemplateV1TagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1Tags { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1Tags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3568,7 +3569,7 @@ func expandRequestConfigurationTemplateUpdateTemplateTagsArray(ctx context.Conte return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1Tags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3579,8 +3580,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTagsArray(ctx context.Conte return &request } -func expandRequestConfigurationTemplateUpdateTemplateTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTags { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTags{} +func expandRequestConfigurationTemplateUpdateTemplateV1Tags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1Tags { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1Tags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -3593,8 +3594,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTags(ctx context.Context, k return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplates { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplates{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplates { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplates{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3605,7 +3606,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesArray(ct return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplates(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplates(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3616,10 +3617,10 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesArray(ct return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplates { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplates{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplates { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplates{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { - request.Tags = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTagsArray(ctx, key+".tags", d) + request.Tags = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTagsArray(ctx, key+".tags", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".composite")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".composite")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".composite")))) { request.Composite = interfaceToBoolPtr(v) @@ -3628,7 +3629,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplates(ctx con request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_types")))) { - request.DeviceTypes = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTypesArray(ctx, key+".device_types", d) + request.DeviceTypes = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesDeviceTypesArray(ctx, key+".device_types", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -3643,13 +3644,13 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplates(ctx con request.ProjectName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_params")))) { - request.RollbackTemplateParams = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) + request.RollbackTemplateParams = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_content")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_content")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_content")))) { request.TemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_params")))) { - request.TemplateParams = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsArray(ctx, key+".template_params", d) + request.TemplateParams = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsArray(ctx, key+".template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".version")))) { request.Version = interfaceToString(v) @@ -3660,8 +3661,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplates(ctx con return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTags { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTags{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTags { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3672,7 +3673,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTagsArra return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3683,8 +3684,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTagsArra return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTags { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTags{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTags { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -3697,8 +3698,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTags(ctx return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesDeviceTypes { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesDeviceTypes{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesDeviceTypes { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesDeviceTypes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3709,7 +3710,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTy return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3720,8 +3721,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTy return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesDeviceTypes { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesDeviceTypes{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesDeviceTypes { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesDeviceTypes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_family")))) { request.ProductFamily = interfaceToString(v) } @@ -3737,8 +3738,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesDeviceTy return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3749,7 +3750,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3760,8 +3761,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -3808,13 +3809,13 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3822,8 +3823,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3834,7 +3835,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3845,8 +3846,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -3862,8 +3863,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsSelection{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -3874,7 +3875,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3882,8 +3883,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesRollbackTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3891,8 +3892,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesRollback return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3903,7 +3904,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3914,8 +3915,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -3962,13 +3963,13 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -3976,8 +3977,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3988,7 +3989,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3999,8 +4000,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -4016,8 +4017,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsSelection{} +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -4028,7 +4029,7 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4036,8 +4037,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateContainingTemplatesTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateUpdateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ContainingTemplatesTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4045,8 +4046,8 @@ func expandRequestConfigurationTemplateUpdateTemplateContainingTemplatesTemplate return &request } -func expandRequestConfigurationTemplateUpdateTemplateDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateDeviceTypes { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateDeviceTypes{} +func expandRequestConfigurationTemplateUpdateTemplateV1DeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1DeviceTypes { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1DeviceTypes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -4057,7 +4058,7 @@ func expandRequestConfigurationTemplateUpdateTemplateDeviceTypesArray(ctx contex return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1DeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -4068,8 +4069,8 @@ func expandRequestConfigurationTemplateUpdateTemplateDeviceTypesArray(ctx contex return &request } -func expandRequestConfigurationTemplateUpdateTemplateDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateDeviceTypes { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateDeviceTypes{} +func expandRequestConfigurationTemplateUpdateTemplateV1DeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1DeviceTypes { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1DeviceTypes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_family")))) { request.ProductFamily = interfaceToString(v) } @@ -4085,8 +4086,8 @@ func expandRequestConfigurationTemplateUpdateTemplateDeviceTypes(ctx context.Con return &request } -func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -4097,7 +4098,7 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsArray return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -4108,8 +4109,8 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsArray return &request } -func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -4156,13 +4157,13 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParams(ctx request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4170,8 +4171,8 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParams(ctx return &request } -func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -4182,7 +4183,7 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRange return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -4193,8 +4194,8 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRange return &request } -func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -4210,8 +4211,8 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsRange return &request } -func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsSelection{} +func expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -4222,7 +4223,7 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelec request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4230,8 +4231,8 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelec return &request } -func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateRollbackTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateUpdateTemplateV1RollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1RollbackTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4239,8 +4240,8 @@ func expandRequestConfigurationTemplateUpdateTemplateRollbackTemplateParamsSelec return &request } -func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParams { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -4251,7 +4252,7 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsArray(ctx con return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1TemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -4262,8 +4263,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsArray(ctx con return &request } -func expandRequestConfigurationTemplateUpdateTemplateTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParams { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParams{} +func expandRequestConfigurationTemplateUpdateTemplateV1TemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParams { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -4310,13 +4311,13 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParams(ctx context. request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsSelection(ctx, key+".selection.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4324,8 +4325,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParams(ctx context. return &request } -func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsRange { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsRange { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -4336,7 +4337,7 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRangeArray(ct return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -4347,8 +4348,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRangeArray(ct return &request } -func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsRange { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsRange{} +func expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsRange { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -4364,8 +4365,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsRange(ctx con return &request } -func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsSelection { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsSelection{} +func expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsSelection { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -4376,7 +4377,7 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelection(ctx request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4384,8 +4385,8 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelection(ctx return &request } -func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateUpdateTemplateV1TemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1TemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4393,13 +4394,13 @@ func expandRequestConfigurationTemplateUpdateTemplateTemplateParamsSelectionSele return &request } -func expandRequestConfigurationTemplateUpdateTemplateValidationErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateValidationErrors { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateValidationErrors{} +func expandRequestConfigurationTemplateUpdateTemplateV1ValidationErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ValidationErrors { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ValidationErrors{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_errors")))) { - request.RollbackTemplateErrors = expandRequestConfigurationTemplateUpdateTemplateValidationErrorsRollbackTemplateErrors(ctx, key+".rollback_template_errors.0", d) + request.RollbackTemplateErrors = expandRequestConfigurationTemplateUpdateTemplateV1ValidationErrorsRollbackTemplateErrors(ctx, key+".rollback_template_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_errors")))) { - request.TemplateErrors = expandRequestConfigurationTemplateUpdateTemplateValidationErrorsTemplateErrors(ctx, key+".template_errors.0", d) + request.TemplateErrors = expandRequestConfigurationTemplateUpdateTemplateV1ValidationErrorsTemplateErrors(ctx, key+".template_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_id")))) { request.TemplateID = interfaceToString(v) @@ -4413,8 +4414,8 @@ func expandRequestConfigurationTemplateUpdateTemplateValidationErrors(ctx contex return &request } -func expandRequestConfigurationTemplateUpdateTemplateValidationErrorsRollbackTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateValidationErrorsRollbackTemplateErrors { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateValidationErrorsRollbackTemplateErrors +func expandRequestConfigurationTemplateUpdateTemplateV1ValidationErrorsRollbackTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ValidationErrorsRollbackTemplateErrors { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ValidationErrorsRollbackTemplateErrors request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4422,8 +4423,8 @@ func expandRequestConfigurationTemplateUpdateTemplateValidationErrorsRollbackTem return &request } -func expandRequestConfigurationTemplateUpdateTemplateValidationErrorsTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateValidationErrorsTemplateErrors { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateValidationErrorsTemplateErrors +func expandRequestConfigurationTemplateUpdateTemplateV1ValidationErrorsTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ValidationErrorsTemplateErrors { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateTemplateV1ValidationErrorsTemplateErrors request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -4431,10 +4432,10 @@ func expandRequestConfigurationTemplateUpdateTemplateValidationErrorsTemplateErr return &request } -func searchConfigurationTemplatesGetsTheTemplatesAvailable(m interface{}, queryParams catalystcentersdkgo.GetsAListOfProjectsQueryParams, vName string) (*catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsTemplates, error) { +func searchConfigurationTemplatesGetsTheTemplatesAvailable(m interface{}, queryParams catalystcentersdkgo.GetsAListOfProjectsV1QueryParams, vName string) (*catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1Templates, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsTemplates + var foundItem *catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1Templates log.Print("[DEBUG] 4") nResponse, _, err := client.ConfigurationTemplates.GetsAListOfProjects(&queryParams) log.Print("[DEBUG] 5") diff --git a/catalystcenter/resource_configuration_template_clone.go b/catalystcenter/resource_configuration_template_clone.go index 94efc95..2bd7b30 100644 --- a/catalystcenter/resource_configuration_template_clone.go +++ b/catalystcenter/resource_configuration_template_clone.go @@ -99,16 +99,18 @@ func resourceConfigurationTemplateCloneCreate(ctx context.Context, d *schema.Res vvName := vName.(string) vvTemplateID := vTemplateID.(string) vvProjectID := vProjectID.(string) - queryParams1 := catalystcentersdkgo.CreatesACloneOfTheGivenTemplateQueryParams{} + queryParams1 := catalystcentersdkgo.CreatesACloneOfTheGivenTemplateV1QueryParams{} - response1, restyResp1, err := client.ConfigurationTemplates.CreatesACloneOfTheGivenTemplate(vvName, vvTemplateID, vvProjectID, &queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.ConfigurationTemplates.CreatesACloneOfTheGivenTemplateV1(vvName, vvTemplateID, vvProjectID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreatesACloneOfTheGivenTemplate", err)) + "Failure when executing CreatesACloneOfTheGivenTemplateV1", err)) return diags } @@ -154,18 +156,16 @@ func resourceConfigurationTemplateCloneCreate(ctx context.Context, d *schema.Res return diags } } - - vItem1 := flattenConfigurationTemplatesCreatesACloneOfTheGivenTemplateItem(response1.Response) + vItem1 := flattenConfigurationTemplatesCreatesACloneOfTheGivenTemplateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreatesACloneOfTheGivenTemplate response", + "Failure when setting CreatesACloneOfTheGivenTemplateV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceConfigurationTemplateCloneRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -180,7 +180,7 @@ func resourceConfigurationTemplateCloneDelete(ctx context.Context, d *schema.Res return diags } -func flattenConfigurationTemplatesCreatesACloneOfTheGivenTemplateItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesCreatesACloneOfTheGivenTemplateResponse) []map[string]interface{} { +func flattenConfigurationTemplatesCreatesACloneOfTheGivenTemplateV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesCreatesACloneOfTheGivenTemplateV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_configuration_template_export_project.go b/catalystcenter/resource_configuration_template_export_project.go index 2b5c1d2..8034e8f 100644 --- a/catalystcenter/resource_configuration_template_export_project.go +++ b/catalystcenter/resource_configuration_template_export_project.go @@ -59,7 +59,7 @@ func resourceConfigurationTemplateExportProject() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteria`, + Description: `Array of RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -79,20 +79,18 @@ func resourceConfigurationTemplateExportProjectCreate(ctx context.Context, d *sc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteria(ctx, "parameters.0", d) + request1 := expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.ConfigurationTemplates.ExportsTheProjectsForAGivenCriteria(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ConfigurationTemplates.ExportsTheProjectsForAGivenCriteriaV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExportsTheProjectsForAGivenCriteria", err)) + "Failure when executing ExportsTheProjectsForAGivenCriteriaV1", err)) return diags } @@ -139,10 +137,13 @@ func resourceConfigurationTemplateExportProjectCreate(ctx context.Context, d *sc } } - vItem1 := flattenConfigurationTemplatesExportsTheProjectsForAGivenCriteriaItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ExportsTheProjectsForAGivenCriteria response", + "Failure when setting ExportsTheProjectsForAGivenCriteriaV1 response", err)) return diags } @@ -164,16 +165,16 @@ func resourceConfigurationTemplateExportProjectDelete(ctx context.Context, d *sc return diags } -func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteria(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteria { - request := catalystcentersdkgo.RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteria{} - if v := expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaItemArray(ctx, key+".payload", d); v != nil { +func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1{} + if v := expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteria { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteria{} +func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1 { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -184,7 +185,7 @@ func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenC return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -192,13 +193,13 @@ func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenC return &request } -func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteria { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteria +func expandRequestConfigurationTemplateExportProjectExportsTheProjectsForAGivenCriteriaV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1 { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1 request = d.Get(fixKeyAccess(key)) return &request } -func flattenConfigurationTemplatesExportsTheProjectsForAGivenCriteriaItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesExportsTheProjectsForAGivenCriteriaResponse) []map[string]interface{} { +func flattenConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_configuration_template_export_template.go b/catalystcenter/resource_configuration_template_export_template.go index b86107c..5458b61 100644 --- a/catalystcenter/resource_configuration_template_export_template.go +++ b/catalystcenter/resource_configuration_template_export_template.go @@ -59,7 +59,7 @@ func resourceConfigurationTemplateExportTemplate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteria`, + Description: `Array of RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -79,20 +79,18 @@ func resourceConfigurationTemplateExportTemplateCreate(ctx context.Context, d *s client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteria(ctx, "parameters.0", d) + request1 := expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.ConfigurationTemplates.ExportsTheTemplatesForAGivenCriteria(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ConfigurationTemplates.ExportsTheTemplatesForAGivenCriteriaV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExportsTheTemplatesForAGivenCriteria", err)) + "Failure when executing ExportsTheTemplatesForAGivenCriteriaV1", err)) return diags } @@ -139,17 +137,19 @@ func resourceConfigurationTemplateExportTemplateCreate(ctx context.Context, d *s } } - vItem1 := flattenConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ExportsTheTemplatesForAGivenCriteria response", + "Failure when setting ExportsTheTemplatesForAGivenCriteriaV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceConfigurationTemplateExportTemplateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -164,16 +164,16 @@ func resourceConfigurationTemplateExportTemplateDelete(ctx context.Context, d *s return diags } -func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteria(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteria { - request := catalystcentersdkgo.RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteria{} - if v := expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaItemArray(ctx, key+".payload", d); v != nil { +func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1{} + if v := expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteria { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteria{} +func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1 { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -184,7 +184,7 @@ func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGive return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -192,13 +192,13 @@ func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGive return &request } -func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteria { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteria +func expandRequestConfigurationTemplateExportTemplateExportsTheTemplatesForAGivenCriteriaV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1 { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1 request = d.Get(fixKeyAccess(key)) return &request } -func flattenConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaResponse) []map[string]interface{} { +func flattenConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_configuration_template_import_project.go b/catalystcenter/resource_configuration_template_import_project.go index 524ce62..935282e 100644 --- a/catalystcenter/resource_configuration_template_import_project.go +++ b/catalystcenter/resource_configuration_template_import_project.go @@ -74,16 +74,18 @@ func resourceConfigurationTemplateImportProjectCreate(ctx context.Context, d *sc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - queryParams1 := catalystcentersdkgo.ImportsTheProjectsProvidedQueryParams{} + queryParams1 := catalystcentersdkgo.ImportsTheProjectsProvidedV1QueryParams{} - response1, restyResp1, err := client.ConfigurationTemplates.ImportsTheProjectsProvided(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.ConfigurationTemplates.ImportsTheProjectsProvidedV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ImportsTheProjectsProvided", err)) + "Failure when executing ImportsTheProjectsProvidedV1", err)) return diags } @@ -91,7 +93,7 @@ func resourceConfigurationTemplateImportProjectCreate(ctx context.Context, d *sc if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ImportsTheProjectsProvided", err)) + "Failure when executing ImportsTheProjectsProvidedV1", err)) return diags } taskId := response1.Response.TaskID @@ -125,15 +127,15 @@ func resourceConfigurationTemplateImportProjectCreate(ctx context.Context, d *sc } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ImportsTheProjectsProvided", err1)) + "Failure when executing ImportsTheProjectsProvidedV1", err1)) return diags } } - vItem1 := flattenConfigurationTemplatesImportsTheProjectsProvidedItem(response1.Response) + vItem1 := flattenConfigurationTemplatesImportsTheProjectsProvidedV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportsTheProjectsProvided response", + "Failure when setting ImportsTheProjectsProvidedV1 response", err)) return diags } @@ -155,7 +157,7 @@ func resourceConfigurationTemplateImportProjectDelete(ctx context.Context, d *sc return diags } -func flattenConfigurationTemplatesImportsTheProjectsProvidedItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesImportsTheProjectsProvidedResponse) []map[string]interface{} { +func flattenConfigurationTemplatesImportsTheProjectsProvidedV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesImportsTheProjectsProvidedResponse) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_configuration_template_import_template.go b/catalystcenter/resource_configuration_template_import_template.go index 2e33d23..756b170 100644 --- a/catalystcenter/resource_configuration_template_import_template.go +++ b/catalystcenter/resource_configuration_template_import_template.go @@ -74,7 +74,7 @@ func resourceConfigurationTemplateImportTemplate() *schema.Resource { ForceNew: true, }, "payload": &schema.Schema{ - Description: `Array of RequestConfigurationTemplatesImportsTheTemplatesProvided`, + Description: `Array of RequestConfigurationTemplatesImportsTheTemplatesProvidedV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -1413,21 +1413,19 @@ func resourceConfigurationTemplateImportTemplateCreate(ctx context.Context, d *s vProjectName := resourceItem["project_name"] vvProjectName := vProjectName.(string) - request1 := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.ImportsTheTemplatesProvidedQueryParams{} + request1 := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.ImportsTheTemplatesProvidedV1QueryParams{} - response1, restyResp1, err := client.ConfigurationTemplates.ImportsTheTemplatesProvided(vvProjectName, request1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ConfigurationTemplates.ImportsTheTemplatesProvidedV1(vvProjectName, request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ImportsTheTemplatesProvided", err)) + "Failure when executing ImportsTheTemplatesProvidedV1", err)) return diags } @@ -1435,7 +1433,7 @@ func resourceConfigurationTemplateImportTemplateCreate(ctx context.Context, d *s if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ImportsTheTemplatesProvided", err)) + "Failure when executing ImportsTheTemplatesProvidedV1", err)) return diags } taskId := response1.Response.TaskID @@ -1469,15 +1467,18 @@ func resourceConfigurationTemplateImportTemplateCreate(ctx context.Context, d *s } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ImportsTheTemplatesProvided", err1)) + "Failure when executing ImportsTheTemplatesProvidedV1", err1)) return diags } } - vItem1 := flattenConfigurationTemplatesImportsTheTemplatesProvidedItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenConfigurationTemplatesImportsTheTemplatesProvidedV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportsTheTemplatesProvided response", + "Failure when setting ImportsTheTemplatesProvidedV1 response", err)) return diags } @@ -1499,16 +1500,16 @@ func resourceConfigurationTemplateImportTemplateDelete(ctx context.Context, d *s return diags } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesImportsTheTemplatesProvided { - request := catalystcentersdkgo.RequestConfigurationTemplatesImportsTheTemplatesProvided{} - if v := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemArray(ctx, key+".payload", d); v != nil { +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesImportsTheTemplatesProvidedV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesImportsTheTemplatesProvidedV1{} + if v := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvided { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvided{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1 { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1519,7 +1520,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1527,10 +1528,10 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvided { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvided{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1 { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { - request.Tags = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTagsArray(ctx, key+".tags", d) + request.Tags = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTagsArray(ctx, key+".tags", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".author")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".author")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".author")))) { request.Author = interfaceToString(v) @@ -1539,7 +1540,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Composite = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".containing_templates")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".containing_templates")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".containing_templates")))) { - request.ContainingTemplates = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesArray(ctx, key+".containing_templates", d) + request.ContainingTemplates = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesArray(ctx, key+".containing_templates", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".create_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".create_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".create_time")))) { request.CreateTime = interfaceToIntPtr(v) @@ -1551,7 +1552,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_types")))) { - request.DeviceTypes = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemDeviceTypesArray(ctx, key+".device_types", d) + request.DeviceTypes = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemDeviceTypesArray(ctx, key+".device_types", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".failure_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".failure_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".failure_policy")))) { request.FailurePolicy = interfaceToString(v) @@ -1584,7 +1585,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.RollbackTemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_params")))) { - request.RollbackTemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) + request.RollbackTemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".software_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".software_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".software_type")))) { request.SoftwareType = interfaceToString(v) @@ -1599,10 +1600,10 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.TemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_params")))) { - request.TemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsArray(ctx, key+".template_params", d) + request.TemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsArray(ctx, key+".template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".validation_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".validation_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".validation_errors")))) { - request.ValidationErrors = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemValidationErrors(ctx, key+".validation_errors.0", d) + request.ValidationErrors = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemValidationErrors(ctx, key+".validation_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".version")))) { request.Version = interfaceToString(v) @@ -1610,8 +1611,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTags { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTags{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1Tags { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1Tags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1622,7 +1623,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1630,8 +1631,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTags { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTags{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1Tags { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1Tags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1641,8 +1642,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplates { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplates{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplates { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplates{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1653,7 +1654,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplates(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplates(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1661,10 +1662,10 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplates { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplates{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplates { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplates{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { - request.Tags = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTagsArray(ctx, key+".tags", d) + request.Tags = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTagsArray(ctx, key+".tags", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".composite")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".composite")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".composite")))) { request.Composite = interfaceToBoolPtr(v) @@ -1673,7 +1674,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_types")))) { - request.DeviceTypes = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesDeviceTypesArray(ctx, key+".device_types", d) + request.DeviceTypes = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesDeviceTypesArray(ctx, key+".device_types", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -1688,13 +1689,13 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.ProjectName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_params")))) { - request.RollbackTemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) + request.RollbackTemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsArray(ctx, key+".rollback_template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_content")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_content")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_content")))) { request.TemplateContent = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_params")))) { - request.TemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsArray(ctx, key+".template_params", d) + request.TemplateParams = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsArray(ctx, key+".template_params", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".version")))) { request.Version = interfaceToString(v) @@ -1702,8 +1703,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTags { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTags{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTags { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1714,7 +1715,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTags(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1722,8 +1723,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTags { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTags{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTags { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1733,8 +1734,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesDeviceTypes { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesDeviceTypes{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesDeviceTypes { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesDeviceTypes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1745,7 +1746,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1753,8 +1754,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesDeviceTypes { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesDeviceTypes{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesDeviceTypes { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesDeviceTypes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_family")))) { request.ProductFamily = interfaceToString(v) } @@ -1767,8 +1768,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParams { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParams { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1779,7 +1780,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1787,8 +1788,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParams { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParams { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -1835,19 +1836,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsSelection(ctx, key+".selection.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsRange { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsRange { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1858,7 +1859,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1866,8 +1867,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsRange { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsRange{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsRange { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -1880,8 +1881,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsSelection { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsSelection{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsSelection { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -1892,19 +1893,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesRollbackTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesRollbackTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParams { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParams { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1915,7 +1916,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1923,8 +1924,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParams { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParams { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -1971,19 +1972,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsSelection(ctx, key+".selection.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsRange { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsRange{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsRange { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1994,7 +1995,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2002,8 +2003,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsRange { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsRange{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsRange { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2016,8 +2017,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsSelection { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsSelection{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsSelection { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -2028,19 +2029,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemContainingTemplatesTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedContainingTemplatesTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemContainingTemplatesTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ContainingTemplatesTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedDeviceTypes { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedDeviceTypes{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemDeviceTypesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1DeviceTypes { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1DeviceTypes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2051,7 +2052,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemDeviceTypes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2059,8 +2060,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedDeviceTypes { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedDeviceTypes{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemDeviceTypes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1DeviceTypes { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1DeviceTypes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_family")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_family")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_family")))) { request.ProductFamily = interfaceToString(v) } @@ -2073,8 +2074,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParams { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1RollbackTemplateParams { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1RollbackTemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2085,7 +2086,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2093,8 +2094,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParams { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1RollbackTemplateParams { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1RollbackTemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -2141,18 +2142,18 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsSelection(ctx, key+".selection.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsRange { +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsRange { request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) @@ -2164,7 +2165,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2172,7 +2173,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsRange { +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsRange { request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -2186,7 +2187,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsSelection { +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsSelection { request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) @@ -2198,19 +2199,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsSelectionSelectionValues { +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemRollbackTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsSelectionSelectionValues { var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedRollbackTemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParams { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParams { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParams{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2221,7 +2222,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2229,8 +2230,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParams { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParams{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParams { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParams{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".binding")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".binding")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".binding")))) { request.Binding = interfaceToString(v) } @@ -2277,19 +2278,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.Provider = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".range")))) { - request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsRangeArray(ctx, key+".range", d) + request.Range = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsRangeArray(ctx, key+".range", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".required")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".required")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".required")))) { request.Required = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection")))) { - request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsSelection(ctx, key+".selection.0", d) + request.Selection = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsSelection(ctx, key+".selection.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsRange { - request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsRange{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsRangeArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsRange { + request := []catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsRange{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2300,7 +2301,7 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return nil } for item_no := range objs { - i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsRange(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2308,8 +2309,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsRange { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsRange{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsRange { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsRange{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2322,8 +2323,8 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsSelection { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsSelection{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsSelection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsSelection { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsSelection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_selected_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_selected_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_selected_values")))) { request.DefaultSelectedValues = interfaceToSliceString(v) } @@ -2334,24 +2335,24 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided request.SelectionType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".selection_values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selection_values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selection_values")))) { - request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) + request.SelectionValues = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsSelectionSelectionValues(ctx, key+".selection_values.0", d) } return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsSelectionSelectionValues { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedTemplateParamsSelectionSelectionValues +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemTemplateParamsSelectionSelectionValues(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsSelectionSelectionValues { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1TemplateParamsSelectionSelectionValues request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemValidationErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedValidationErrors { - request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedValidationErrors{} +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemValidationErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ValidationErrors { + request := catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ValidationErrors{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rollback_template_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rollback_template_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rollback_template_errors")))) { - request.RollbackTemplateErrors = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemValidationErrorsRollbackTemplateErrors(ctx, key+".rollback_template_errors.0", d) + request.RollbackTemplateErrors = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemValidationErrorsRollbackTemplateErrors(ctx, key+".rollback_template_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_errors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_errors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_errors")))) { - request.TemplateErrors = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemValidationErrorsTemplateErrors(ctx, key+".template_errors.0", d) + request.TemplateErrors = expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemValidationErrorsTemplateErrors(ctx, key+".template_errors.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_id")))) { request.TemplateID = interfaceToString(v) @@ -2362,19 +2363,19 @@ func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvided return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemValidationErrorsRollbackTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedValidationErrorsRollbackTemplateErrors { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedValidationErrorsRollbackTemplateErrors +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemValidationErrorsRollbackTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ValidationErrorsRollbackTemplateErrors { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ValidationErrorsRollbackTemplateErrors request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedItemValidationErrorsTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedValidationErrorsTemplateErrors { - var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedValidationErrorsTemplateErrors +func expandRequestConfigurationTemplateImportTemplateImportsTheTemplatesProvidedV1ItemValidationErrorsTemplateErrors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ValidationErrorsTemplateErrors { + var request catalystcentersdkgo.RequestItemConfigurationTemplatesImportsTheTemplatesProvidedV1ValidationErrorsTemplateErrors request = d.Get(fixKeyAccess(key)) return &request } -func flattenConfigurationTemplatesImportsTheTemplatesProvidedItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesImportsTheTemplatesProvidedResponse) []map[string]interface{} { +func flattenConfigurationTemplatesImportsTheTemplatesProvidedV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesImportsTheTemplatesProvidedV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_configuration_template_project.go b/catalystcenter/resource_configuration_template_project.go index c790e37..1211cb7 100644 --- a/catalystcenter/resource_configuration_template_project.go +++ b/catalystcenter/resource_configuration_template_project.go @@ -2388,7 +2388,7 @@ func resourceConfigurationTemplateProjectCreate(ctx context.Context, d *schema.R return resourceConfigurationTemplateProjectRead(ctx, d, m) } } else { - queryParams1 := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParams1 := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} queryParams1.Name = vvName item2, err := searchConfigurationTemplatesGetsAListOfProjects(m, queryParams1) if err == nil && item2 != nil { @@ -2463,7 +2463,7 @@ func resourceConfigurationTemplateProjectRead(ctx context.Context, d *schema.Res selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetsAListOfProjects") - queryParams1 := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParams1 := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} if okName { queryParams1.Name = vName @@ -2565,7 +2565,7 @@ func resourceConfigurationTemplateProjectUpdate(ctx context.Context, d *schema.R return diags } } else if vName != "" { - queryParams1 := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParams1 := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} queryParams1.Name = vName item2, err := searchConfigurationTemplatesGetsAListOfProjects(m, queryParams1) if err != nil || item2 == nil { @@ -2652,7 +2652,7 @@ func resourceConfigurationTemplateProjectDelete(ctx context.Context, d *schema.R // REVIEW: Add getAllItems and search function to get missing params var vvID string if selectedMethod == 1 { - queryParams1 := catalystcentersdkgo.GetsAListOfProjectsQueryParams{} + queryParams1 := catalystcentersdkgo.GetsAListOfProjectsV1QueryParams{} queryParams1.Name = vName item1, err := searchConfigurationTemplatesGetsAListOfProjects(m, queryParams1) if err != nil || item1 == nil { @@ -2694,8 +2694,8 @@ func resourceConfigurationTemplateProjectDelete(ctx context.Context, d *schema.R return diags } -func expandRequestConfigurationTemplateProjectCreateProject(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateProject { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateProject{} +func expandRequestConfigurationTemplateProjectCreateProject(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { request.Tags = expandRequestConfigurationTemplateProjectCreateProjectTagsArray(ctx, key+".tags", d) } @@ -2723,8 +2723,8 @@ func expandRequestConfigurationTemplateProjectCreateProject(ctx context.Context, return &request } -func expandRequestConfigurationTemplateProjectCreateProjectTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectTags { - request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectTags{} +func expandRequestConfigurationTemplateProjectCreateProjectTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1Tags { + request := []catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1Tags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2746,8 +2746,8 @@ func expandRequestConfigurationTemplateProjectCreateProjectTagsArray(ctx context return &request } -func expandRequestConfigurationTemplateProjectCreateProjectTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectTags { - request := catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectTags{} +func expandRequestConfigurationTemplateProjectCreateProjectTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1Tags { + request := catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1Tags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2760,8 +2760,8 @@ func expandRequestConfigurationTemplateProjectCreateProjectTags(ctx context.Cont return &request } -func expandRequestConfigurationTemplateProjectCreateProjectTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectTemplates { - var request catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectTemplates +func expandRequestConfigurationTemplateProjectCreateProjectTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1Templates { + var request catalystcentersdkgo.RequestConfigurationTemplatesCreateProjectV1Templates request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2769,8 +2769,8 @@ func expandRequestConfigurationTemplateProjectCreateProjectTemplates(ctx context return &request } -func expandRequestConfigurationTemplateProjectUpdateProject(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateProject { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateProject{} +func expandRequestConfigurationTemplateProjectUpdateProject(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { request.Tags = expandRequestConfigurationTemplateProjectUpdateProjectTagsArray(ctx, key+".tags", d) } @@ -2798,8 +2798,8 @@ func expandRequestConfigurationTemplateProjectUpdateProject(ctx context.Context, return &request } -func expandRequestConfigurationTemplateProjectUpdateProjectTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectTags { - request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectTags{} +func expandRequestConfigurationTemplateProjectUpdateProjectTagsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1Tags { + request := []catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1Tags{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2821,8 +2821,8 @@ func expandRequestConfigurationTemplateProjectUpdateProjectTagsArray(ctx context return &request } -func expandRequestConfigurationTemplateProjectUpdateProjectTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectTags { - request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectTags{} +func expandRequestConfigurationTemplateProjectUpdateProjectTags(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1Tags { + request := catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1Tags{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -2835,8 +2835,8 @@ func expandRequestConfigurationTemplateProjectUpdateProjectTags(ctx context.Cont return &request } -func expandRequestConfigurationTemplateProjectUpdateProjectTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectTemplates { - var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectTemplates +func expandRequestConfigurationTemplateProjectUpdateProjectTemplates(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1Templates { + var request catalystcentersdkgo.RequestConfigurationTemplatesUpdateProjectV1Templates request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2844,12 +2844,12 @@ func expandRequestConfigurationTemplateProjectUpdateProjectTemplates(ctx context return &request } -func searchConfigurationTemplatesGetsAListOfProjects(m interface{}, queryParams catalystcentersdkgo.GetsAListOfProjectsQueryParams) (*catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjects, error) { +func searchConfigurationTemplatesGetsAListOfProjects(m interface{}, queryParams catalystcentersdkgo.GetsAListOfProjectsV1QueryParams) (*catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjects - var ite *catalystcentersdkgo.ResponseConfigurationTemplatesGetsAListOfProjects + var foundItem *catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1 + var ite *catalystcentersdkgo.ResponseConfigurationTemplatesGetsAListOfProjectsV1 ite, _, err = client.ConfigurationTemplates.GetsAListOfProjects(&queryParams) if err != nil { return foundItem, err @@ -2864,7 +2864,7 @@ func searchConfigurationTemplatesGetsAListOfProjects(m interface{}, queryParams for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjects + var getItem *catalystcentersdkgo.ResponseItemConfigurationTemplatesGetsAListOfProjectsV1 getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_configuration_template_version.go b/catalystcenter/resource_configuration_template_version.go index 3cee4fa..91696fd 100644 --- a/catalystcenter/resource_configuration_template_version.go +++ b/catalystcenter/resource_configuration_template_version.go @@ -170,8 +170,8 @@ func resourceConfigurationTemplateVersionDelete(ctx context.Context, d *schema.R return diags } -func expandRequestConfigurationTemplateVersionVersionTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesVersionTemplate { - request := catalystcentersdkgo.RequestConfigurationTemplatesVersionTemplate{} +func expandRequestConfigurationTemplateVersionVersionTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesVersionTemplateV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesVersionTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -181,7 +181,7 @@ func expandRequestConfigurationTemplateVersionVersionTemplate(ctx context.Contex return &request } -func flattenConfigurationTemplatesVersionTemplateItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesVersionTemplateResponse) []map[string]interface{} { +func flattenConfigurationTemplatesVersionTemplateItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesVersionTemplateV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_credential_to_site_by_siteid_create_v2.go b/catalystcenter/resource_credential_to_site_by_siteid_create_v2.go index cc98095..960a482 100644 --- a/catalystcenter/resource_credential_to_site_by_siteid_create_v2.go +++ b/catalystcenter/resource_credential_to_site_by_siteid_create_v2.go @@ -133,11 +133,9 @@ func resourceCredentialToSiteBySiteidCreateV2Create(ctx context.Context, d *sche vvSiteID := vSiteID.(string) request1 := expandRequestCredentialToSiteBySiteidCreateV2AssignDeviceCredentialToSiteV2(ctx, "parameters.0", d) - response1, restyResp1, err := client.NetworkSettings.AssignDeviceCredentialToSiteV2(vvSiteID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.NetworkSettings.AssignDeviceCredentialToSiteV2(vvSiteID, request1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -191,6 +189,9 @@ func resourceCredentialToSiteBySiteidCreateV2Create(ctx context.Context, d *sche } } + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } vItem1 := flattenNetworkSettingsAssignDeviceCredentialToSiteV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -201,7 +202,6 @@ func resourceCredentialToSiteBySiteidCreateV2Create(ctx context.Context, d *sche d.SetId(getUnixTimeString()) return diags - } func resourceCredentialToSiteBySiteidCreateV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_custom_issue_definitions.go b/catalystcenter/resource_custom_issue_definitions.go index a07e704..22678b6 100644 --- a/catalystcenter/resource_custom_issue_definitions.go +++ b/catalystcenter/resource_custom_issue_definitions.go @@ -263,14 +263,14 @@ func resourceCustomIssueDefinitionsCreate(ctx context.Context, d *schema.Resourc var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitions(ctx, "parameters.0", d) + request1 := expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] vvID := interfaceToString(vID) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersQueryParams{} + queryParamImport := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1QueryParams{} queryParamImport.Name = vvName item2, err := searchIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -298,7 +298,7 @@ func resourceCustomIssueDefinitionsCreate(ctx context.Context, d *schema.Resourc vvName = resp1.Response.Name } // TODO REVIEW - queryParamValidate := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersQueryParams{} + queryParamValidate := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1QueryParams{} queryParamValidate.Name = vvName item3, err := searchIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -329,7 +329,7 @@ func resourceCustomIssueDefinitionsRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters") - queryParams1 := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersQueryParams{} + queryParams1 := catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1QueryParams{} queryParams1.ID = vID queryParams1.Name = vName item1, err := searchIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(m, queryParams1, vID) @@ -338,10 +338,10 @@ func resourceCustomIssueDefinitionsRead(ctx context.Context, d *schema.ResourceD return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersResponse{ + items := []catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Response{ *item1, } - vItem1 := flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersItems(&items) + vItem1 := flattenIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters search response", @@ -363,7 +363,7 @@ func resourceCustomIssueDefinitionsUpdate(ctx context.Context, d *schema.Resourc vvID := resourceMap["id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedID(ctx, "parameters.0", d) + request1 := expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Issues.UpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedID(vvID, request1, nil) if err != nil || response1 == nil { @@ -419,8 +419,8 @@ func resourceCustomIssueDefinitionsDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitions(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitions { - request := catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitions{} +func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsV1 { + request := catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -428,7 +428,7 @@ func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitions(c request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rules")))) { - request.Rules = expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRulesArray(ctx, key+".rules", d) + request.Rules = expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsV1RulesArray(ctx, key+".rules", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_enabled")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_enabled")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_enabled")))) { request.IsEnabled = interfaceToBoolPtr(v) @@ -445,8 +445,8 @@ func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitions(c return &request } -func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsRules { - request := []catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsRules{} +func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsV1RulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsV1Rules { + request := []catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsV1Rules{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -457,7 +457,7 @@ func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRu return nil } for item_no := range objs { - i := expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsV1Rules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -468,8 +468,8 @@ func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRu return &request } -func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsRules { - request := catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsRules{} +func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsV1Rules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsV1Rules { + request := catalystcentersdkgo.RequestIssuesCreatesANewUserDefinedIssueDefinitionsV1Rules{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".severity")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".severity")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".severity")))) { request.Severity = interfaceToIntPtr(v) } @@ -494,8 +494,8 @@ func expandRequestCustomIssueDefinitionsCreatesANewUserDefinedIssueDefinitionsRu return &request } -func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedID { - request := catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedID{} +func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1 { + request := catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -503,7 +503,7 @@ func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBa request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rules")))) { - request.Rules = expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRulesArray(ctx, key+".rules", d) + request.Rules = expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1RulesArray(ctx, key+".rules", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_enabled")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_enabled")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_enabled")))) { request.IsEnabled = interfaceToBoolPtr(v) @@ -520,8 +520,8 @@ func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBa return &request } -func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRules { - request := []catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRules{} +func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1RulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1Rules { + request := []catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1Rules{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -532,7 +532,7 @@ func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBa return nil } for item_no := range objs { - i := expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1Rules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -543,8 +543,8 @@ func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBa return &request } -func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRules { - request := catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDRules{} +func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1Rules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1Rules { + request := catalystcentersdkgo.RequestIssuesUpdatesAnExistingCustomIssueDefinitionBasedOnTheProvidedIDV1Rules{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".severity")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".severity")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".severity")))) { request.Severity = interfaceToIntPtr(v) } @@ -569,11 +569,11 @@ func expandRequestCustomIssueDefinitionsUpdatesAnExistingCustomIssueDefinitionBa return &request } -func searchIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(m interface{}, queryParams catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersQueryParams, vID string) (*catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersResponse, error) { +func searchIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(m interface{}, queryParams catalystcentersdkgo.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1QueryParams, vID string) (*catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersResponse - var ite *catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters + var foundItem *catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1Response + var ite *catalystcentersdkgo.ResponseIssuesGetAllTheCustomIssueDefinitionsBasedOnTheGivenFiltersV1 ite, _, err = client.Issues.GetAllTheCustomIssueDefinitionsBasedOnTheGivenFilters(&queryParams) if err != nil || ite == nil { diff --git a/catalystcenter/resource_deploy_template_v1.go b/catalystcenter/resource_deploy_template_v1.go index 4bb400d..0096bd1 100644 --- a/catalystcenter/resource_deploy_template_v1.go +++ b/catalystcenter/resource_deploy_template_v1.go @@ -369,8 +369,8 @@ func resourceDeployTemplateV1Delete(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics return diags } -func expandRequestConfigurationTemplateDeployDeployTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplate { - request := catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplate{} +func expandRequestConfigurationTemplateDeployDeployTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".force_push_template")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".force_push_template")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".force_push_template")))) { request.ForcePushTemplate = interfaceToBoolPtr(v) } @@ -381,7 +381,7 @@ func expandRequestConfigurationTemplateDeployDeployTemplate(ctx context.Context, request.MainTemplateID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".member_template_deployment_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_template_deployment_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_template_deployment_info")))) { - request.MemberTemplateDeploymentInfo = interfaceToString(v) + request.MemberTemplateDeploymentInfo = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".target_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".target_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".target_info")))) { request.TargetInfo = expandRequestConfigurationTemplateDeployDeployTemplateTargetInfoArray(ctx, key+".target_info", d) @@ -396,8 +396,8 @@ func expandRequestConfigurationTemplateDeployDeployTemplate(ctx context.Context, return &request } -// func expandRequestConfigurationTemplateDeployDeployTemplateMemberTemplateDeploymentInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateMemberTemplateDeploymentInfo { -// request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateMemberTemplateDeploymentInfo{} +// func expandRequestConfigurationTemplateDeployDeployTemplateMemberTemplateDeploymentInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1MemberTemplateDeploymentInfo { +// request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1MemberTemplateDeploymentInfo{} // key = fixKeyAccess(key) // o := d.Get(key) // if o == nil { @@ -420,8 +420,8 @@ func expandRequestConfigurationTemplateDeployDeployTemplate(ctx context.Context, // return &request // } -// func expandRequestConfigurationTemplateDeployDeployTemplateMemberTemplateDeploymentInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateMemberTemplateDeploymentInfo { -// var request catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateMemberTemplateDeploymentInfo +// func expandRequestConfigurationTemplateDeployDeployTemplateMemberTemplateDeploymentInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1MemberTemplateDeploymentInfo { +// var request catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1MemberTemplateDeploymentInfo // request = d.Get(fixKeyAccess(key)) // if isEmptyValue(reflect.ValueOf(request)) { // return nil @@ -430,8 +430,8 @@ func expandRequestConfigurationTemplateDeployDeployTemplate(ctx context.Context, // return &request // } -func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateTargetInfo { - request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateTargetInfo{} +func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1TargetInfo { + request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1TargetInfo{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -454,8 +454,8 @@ func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfoArray(ctx c return &request } -func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateTargetInfo { - request := catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateTargetInfo{} +func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1TargetInfo { + request := catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1TargetInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".host_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".host_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".host_name")))) { request.HostName = interfaceToString(v) } @@ -481,8 +481,8 @@ func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfo(ctx contex return &request } -func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfoParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateTargetInfoParams { - var request catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateTargetInfoParams +func expandRequestConfigurationTemplateDeployDeployTemplateTargetInfoParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1TargetInfoParams { + var request catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV1TargetInfoParams request = d.Get(fixKeyAccess(key)).(map[string]interface{}) if isEmptyValue(reflect.ValueOf(request)) { return nil diff --git a/catalystcenter/resource_deploy_template.go b/catalystcenter/resource_deploy_template_v2.go similarity index 80% rename from catalystcenter/resource_deploy_template.go rename to catalystcenter/resource_deploy_template_v2.go index d30e630..1ecce04 100644 --- a/catalystcenter/resource_deploy_template.go +++ b/catalystcenter/resource_deploy_template_v2.go @@ -19,16 +19,16 @@ import ( ) // resourceAction -func resourceDeployTemplate() *schema.Resource { +func resourceDeployTemplateV2() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Configuration Templates. - V2 API to deploy a template. `, - CreateContext: resourceDeployTemplateCreate, - ReadContext: resourceDeployTemplateRead, - DeleteContext: resourceDeployTemplateDelete, + CreateContext: resourceDeployTemplateV2Create, + ReadContext: resourceDeployTemplateV2Read, + DeleteContext: resourceDeployTemplateV2Delete, Schema: map[string]*schema.Schema{ "last_updated": &schema.Schema{ Type: schema.TypeString, @@ -173,17 +173,15 @@ func resourceDeployTemplate() *schema.Resource { } } -func resourceDeployTemplateCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceDeployTemplateV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics request1 := expandRequestDeployTemplateDeployTemplateV2(ctx, "parameters.0", d) - response1, restyResp1, err := client.ConfigurationTemplates.DeployTemplateV2(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ConfigurationTemplates.DeployTemplateV2(request1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -237,6 +235,9 @@ func resourceDeployTemplateCreate(ctx context.Context, d *schema.ResourceData, m } } + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } vItem1 := flattenConfigurationTemplatesDeployTemplateV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -247,15 +248,14 @@ func resourceDeployTemplateCreate(ctx context.Context, d *schema.ResourceData, m d.SetId(getUnixTimeString()) return diags - } -func resourceDeployTemplateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceDeployTemplateV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics return diags } -func resourceDeployTemplateDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceDeployTemplateV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -274,7 +274,7 @@ func expandRequestDeployTemplateDeployTemplateV2(ctx context.Context, key string request.MainTemplateID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".member_template_deployment_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_template_deployment_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_template_deployment_info")))) { - request.MemberTemplateDeploymentInfo = expandRequestDeployTemplateDeployTemplateV2MemberTemplateDeploymentInfoArray(ctx, key+".member_template_deployment_info", d) + request.MemberTemplateDeploymentInfo = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".target_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".target_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".target_info")))) { request.TargetInfo = expandRequestDeployTemplateDeployTemplateV2TargetInfoArray(ctx, key+".target_info", d) @@ -285,32 +285,6 @@ func expandRequestDeployTemplateDeployTemplateV2(ctx context.Context, key string return &request } -func expandRequestDeployTemplateDeployTemplateV2MemberTemplateDeploymentInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2MemberTemplateDeploymentInfo { - request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2MemberTemplateDeploymentInfo{} - key = fixKeyAccess(key) - o := d.Get(key) - if o == nil { - return nil - } - objs := o.([]interface{}) - if len(objs) == 0 { - return nil - } - for item_no := range objs { - i := expandRequestDeployTemplateDeployTemplateV2MemberTemplateDeploymentInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) - if i != nil { - request = append(request, *i) - } - } - return &request -} - -func expandRequestDeployTemplateDeployTemplateV2MemberTemplateDeploymentInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2MemberTemplateDeploymentInfo { - var request catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2MemberTemplateDeploymentInfo - request = d.Get(fixKeyAccess(key)) - return &request -} - func expandRequestDeployTemplateDeployTemplateV2TargetInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2TargetInfo { request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2TargetInfo{} key = fixKeyAccess(key) @@ -343,7 +317,7 @@ func expandRequestDeployTemplateDeployTemplateV2TargetInfo(ctx context.Context, request.Params = expandRequestDeployTemplateDeployTemplateV2TargetInfoParams(ctx, key+".params.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".resource_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".resource_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".resource_params")))) { - request.ResourceParams = expandRequestDeployTemplateDeployTemplateV2TargetInfoResourceParamsArray(ctx, key+".resource_params", d) + request.ResourceParams = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { request.Type = interfaceToString(v) @@ -360,32 +334,6 @@ func expandRequestDeployTemplateDeployTemplateV2TargetInfoParams(ctx context.Con return &request } -func expandRequestDeployTemplateDeployTemplateV2TargetInfoResourceParamsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2TargetInfoResourceParams { - request := []catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2TargetInfoResourceParams{} - key = fixKeyAccess(key) - o := d.Get(key) - if o == nil { - return nil - } - objs := o.([]interface{}) - if len(objs) == 0 { - return nil - } - for item_no := range objs { - i := expandRequestDeployTemplateDeployTemplateV2TargetInfoResourceParams(ctx, fmt.Sprintf("%s.%d", key, item_no), d) - if i != nil { - request = append(request, *i) - } - } - return &request -} - -func expandRequestDeployTemplateDeployTemplateV2TargetInfoResourceParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2TargetInfoResourceParams { - var request catalystcentersdkgo.RequestConfigurationTemplatesDeployTemplateV2TargetInfoResourceParams - request = d.Get(fixKeyAccess(key)) - return &request -} - func flattenConfigurationTemplatesDeployTemplateV2Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesDeployTemplateV2Response) []map[string]interface{} { if item == nil { return nil diff --git a/catalystcenter/resource_device_configurations_export.go b/catalystcenter/resource_device_configurations_export.go index ea52694..420bfd1 100644 --- a/catalystcenter/resource_device_configurations_export.go +++ b/catalystcenter/resource_device_configurations_export.go @@ -88,20 +88,18 @@ func resourceDeviceConfigurationsExportCreate(ctx context.Context, d *schema.Res client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestDeviceConfigurationsExportExportDeviceConfigurations(ctx, "parameters.0", d) + request1 := expandRequestDeviceConfigurationsExportExportDeviceConfigurationsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.ConfigurationArchive.ExportDeviceConfigurations(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ConfigurationArchive.ExportDeviceConfigurationsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExportDeviceConfigurations", err)) + "Failure when executing ExportDeviceConfigurationsV1", err)) return diags } @@ -109,7 +107,7 @@ func resourceDeviceConfigurationsExportCreate(ctx context.Context, d *schema.Res if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ExportDeviceConfigurations", err)) + "Failure when executing ExportDeviceConfigurationsV1", err)) return diags } taskId := response1.Response.TaskID @@ -143,22 +141,24 @@ func resourceDeviceConfigurationsExportCreate(ctx context.Context, d *schema.Res } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ExportDeviceConfigurations", err1)) + "Failure when executing ExportDeviceConfigurationsV1", err1)) return diags } } - vItem1 := flattenConfigurationArchiveExportDeviceConfigurationsItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenConfigurationArchiveExportDeviceConfigurationsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ExportDeviceConfigurations response", + "Failure when setting ExportDeviceConfigurationsV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceDeviceConfigurationsExportRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -173,8 +173,8 @@ func resourceDeviceConfigurationsExportDelete(ctx context.Context, d *schema.Res return diags } -func expandRequestDeviceConfigurationsExportExportDeviceConfigurations(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationArchiveExportDeviceConfigurations { - request := catalystcentersdkgo.RequestConfigurationArchiveExportDeviceConfigurations{} +func expandRequestDeviceConfigurationsExportExportDeviceConfigurationsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationArchiveExportDeviceConfigurationsV1 { + request := catalystcentersdkgo.RequestConfigurationArchiveExportDeviceConfigurationsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".password")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".password")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".password")))) { request.Password = interfaceToString(v) } @@ -184,7 +184,7 @@ func expandRequestDeviceConfigurationsExportExportDeviceConfigurations(ctx conte return &request } -func flattenConfigurationArchiveExportDeviceConfigurationsItem(item *catalystcentersdkgo.ResponseConfigurationArchiveExportDeviceConfigurationsResponse) []map[string]interface{} { +func flattenConfigurationArchiveExportDeviceConfigurationsV1Item(item *catalystcentersdkgo.ResponseConfigurationArchiveExportDeviceConfigurationsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_device_reboot_apreboot.go b/catalystcenter/resource_device_reboot_apreboot.go index 3814900..aff381f 100644 --- a/catalystcenter/resource_device_reboot_apreboot.go +++ b/catalystcenter/resource_device_reboot_apreboot.go @@ -98,7 +98,7 @@ func resourceDeviceRebootAprebootCreate(ctx context.Context, d *schema.ResourceD var diags diag.Diagnostics // resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestDeviceRebootAprebootRebootAccessPoints(ctx, "parameters.0", d) + request1 := expandRequestDeviceRebootAprebootRebootAccessPointsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) // vApMacAdresses := resourceItem["ap_mac_addresses"] @@ -161,7 +161,7 @@ func resourceDeviceRebootAprebootRead(ctx context.Context, d *schema.ResourceDat selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetAccessPointRebootTaskResult") - queryParams1 := catalystcentersdkgo.GetAccessPointRebootTaskResultQueryParams{} + queryParams1 := catalystcentersdkgo.GetAccessPointRebootTaskResultV1QueryParams{} queryParams1.ParentTaskID = vParentTaskID response1, _, err := client.Wireless.GetAccessPointRebootTaskResult(&queryParams1) @@ -170,7 +170,7 @@ func resourceDeviceRebootAprebootRead(ctx context.Context, d *schema.ResourceDat return diags } // Review flatten function used - vItem1 := flattenWirelessGetAccessPointRebootTaskResultItems(response1) + vItem1 := flattenWirelessGetAccessPointRebootTaskResultV1Items(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetAccessPointRebootTaskResult search response", @@ -201,8 +201,8 @@ func resourceDeviceRebootAprebootDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestDeviceRebootAprebootRebootAccessPoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessRebootAccessPoints { - request := catalystcentersdkgo.RequestWirelessRebootAccessPoints{} +func expandRequestDeviceRebootAprebootRebootAccessPointsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessRebootAccessPointsV1 { + request := catalystcentersdkgo.RequestWirelessRebootAccessPointsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ap_mac_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ap_mac_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ap_mac_addresses")))) { request.ApMacAddresses = interfaceToSliceString(v) } diff --git a/catalystcenter/resource_device_replacement.go b/catalystcenter/resource_device_replacement.go index 951b59a..a703792 100644 --- a/catalystcenter/resource_device_replacement.go +++ b/catalystcenter/resource_device_replacement.go @@ -268,7 +268,7 @@ func resourceDeviceReplacementCreate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestDeviceReplacementMarkDeviceForReplacement(ctx, "parameters.0", d) + request1 := expandRequestDeviceReplacementMarkDeviceForReplacementV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vFaultyDeviceID := resourceItem["faulty_device_id"] @@ -280,7 +280,7 @@ func resourceDeviceReplacementCreate(ctx context.Context, d *schema.ResourceData vvReplacementDeviceSerialNumber := interfaceToString(vReplacementDeviceSerialNumber) log.Printf("[DEBUG] Selected method 1: ReturnListOfReplacementDevicesWithReplacementDetails") - queryParamImport := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsQueryParams{} + queryParamImport := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsV1QueryParams{} queryParamImport.FaultyDeviceSerialNumber = vvFaultyDeviceSerialNumber @@ -334,7 +334,7 @@ func resourceDeviceReplacementCreate(ctx context.Context, d *schema.ResourceData return diags } } - queryParamValidate := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsQueryParams{} + queryParamValidate := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsV1QueryParams{} queryParamValidate.FaultyDeviceSerialNumber = vvFaultyDeviceSerialNumber queryParamValidate.ReplacementDeviceSerialNumber = vvReplacementDeviceSerialNumber item3, err := searchDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetails(m, queryParamValidate, vvFaultyDeviceID) @@ -367,7 +367,7 @@ func resourceDeviceReplacementRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: ReturnListOfReplacementDevicesWithReplacementDetails") - queryParams1 := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsQueryParams{} + queryParams1 := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsV1QueryParams{} queryParams1.ReplacementDeviceSerialNumber = vReplacementDeviceSerialNumber @@ -378,11 +378,11 @@ func resourceDeviceReplacementRead(ctx context.Context, d *schema.ResourceData, d.SetId("") return diags } - items := []catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsResponse{ + items := []catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Response{ *item1, } // Review flatten function used - vItem1 := flattenDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsItems(&items) + vItem1 := flattenDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting ReturnListOfReplacementDevicesWithReplacementDetails search response", @@ -406,7 +406,7 @@ func resourceDeviceReplacementUpdate(ctx context.Context, d *schema.ResourceData vFaultyDeviceID := resourceMap["faulty_device_id"] log.Printf("[DEBUG] Selected method 1: ReturnListOfReplacementDevicesWithReplacementDetails") - queryParams1 := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsQueryParams{} + queryParams1 := catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsV1QueryParams{} if vFaultyDeviceSerialNumber != "" { queryParams1.FaultyDeviceSerialNumber = vFaultyDeviceSerialNumber @@ -415,7 +415,7 @@ func resourceDeviceReplacementUpdate(ctx context.Context, d *schema.ResourceData queryParams1.ReplacementDeviceSerialNumber = vReplacementDeviceSerialNumber } if d.HasChange("parameters") { - request1 := expandRequestDeviceReplacementUnmarkDeviceForReplacement(ctx, "parameters.0", d) + request1 := expandRequestDeviceReplacementUnmarkDeviceForReplacementV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -473,16 +473,13 @@ func resourceDeviceReplacementUpdate(ctx context.Context, d *schema.ResourceData func resourceDeviceReplacementDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { var diags diag.Diagnostics - err := errors.New("Delete not possible in this resource") - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeviceReplacementDelete", err, "Delete method is not supported", - "Failure at DeviceReplacementDelete, unexpected response", "")) - + // NOTE: Unable to delete DeviceReplacement on Dna Center + // Returning empty diags to delete it on Terraform return diags } -func expandRequestDeviceReplacementMarkDeviceForReplacement(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceReplacementMarkDeviceForReplacement { - request := catalystcentersdkgo.RequestDeviceReplacementMarkDeviceForReplacement{} - if v := expandRequestDeviceReplacementMarkDeviceForReplacementItemArray(ctx, key+".payload", d); v != nil { +func expandRequestDeviceReplacementMarkDeviceForReplacementV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceReplacementMarkDeviceForReplacementV1 { + request := catalystcentersdkgo.RequestDeviceReplacementMarkDeviceForReplacementV1{} + if v := expandRequestDeviceReplacementMarkDeviceForReplacementV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -491,8 +488,8 @@ func expandRequestDeviceReplacementMarkDeviceForReplacement(ctx context.Context, return &request } -func expandRequestDeviceReplacementMarkDeviceForReplacementItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacement { - request := []catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacement{} +func expandRequestDeviceReplacementMarkDeviceForReplacementV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacementV1 { + request := []catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacementV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -503,7 +500,7 @@ func expandRequestDeviceReplacementMarkDeviceForReplacementItemArray(ctx context return nil } for item_no := range objs { - i := expandRequestDeviceReplacementMarkDeviceForReplacementItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestDeviceReplacementMarkDeviceForReplacementV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -514,8 +511,8 @@ func expandRequestDeviceReplacementMarkDeviceForReplacementItemArray(ctx context return &request } -func expandRequestDeviceReplacementMarkDeviceForReplacementItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacement { - request := catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacement{} +func expandRequestDeviceReplacementMarkDeviceForReplacementV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacementV1 { + request := catalystcentersdkgo.RequestItemDeviceReplacementMarkDeviceForReplacementV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".creation_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".creation_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".creation_time")))) { request.CreationTime = interfaceToIntPtr(v) } @@ -564,9 +561,9 @@ func expandRequestDeviceReplacementMarkDeviceForReplacementItem(ctx context.Cont return &request } -func expandRequestDeviceReplacementUnmarkDeviceForReplacement(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceReplacementUnmarkDeviceForReplacement { - request := catalystcentersdkgo.RequestDeviceReplacementUnmarkDeviceForReplacement{} - if v := expandRequestDeviceReplacementUnmarkDeviceForReplacementItemArray(ctx, key+".payload", d); v != nil { +func expandRequestDeviceReplacementUnmarkDeviceForReplacementV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceReplacementUnmarkDeviceForReplacementV1 { + request := catalystcentersdkgo.RequestDeviceReplacementUnmarkDeviceForReplacementV1{} + if v := expandRequestDeviceReplacementUnmarkDeviceForReplacementV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -575,8 +572,8 @@ func expandRequestDeviceReplacementUnmarkDeviceForReplacement(ctx context.Contex return &request } -func expandRequestDeviceReplacementUnmarkDeviceForReplacementItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacement { - request := []catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacement{} +func expandRequestDeviceReplacementUnmarkDeviceForReplacementV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacementV1 { + request := []catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacementV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -587,7 +584,7 @@ func expandRequestDeviceReplacementUnmarkDeviceForReplacementItemArray(ctx conte return nil } for item_no := range objs { - i := expandRequestDeviceReplacementUnmarkDeviceForReplacementItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestDeviceReplacementUnmarkDeviceForReplacementV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -598,8 +595,8 @@ func expandRequestDeviceReplacementUnmarkDeviceForReplacementItemArray(ctx conte return &request } -func expandRequestDeviceReplacementUnmarkDeviceForReplacementItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacement { - request := catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacement{} +func expandRequestDeviceReplacementUnmarkDeviceForReplacementV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacementV1 { + request := catalystcentersdkgo.RequestItemDeviceReplacementUnmarkDeviceForReplacementV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".creation_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".creation_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".creation_time")))) { request.CreationTime = interfaceToIntPtr(v) } @@ -648,11 +645,11 @@ func expandRequestDeviceReplacementUnmarkDeviceForReplacementItem(ctx context.Co return &request } -func searchDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetails(m interface{}, queryParams catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsQueryParams, vID string) (*catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsResponse, error) { +func searchDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetails(m interface{}, queryParams catalystcentersdkgo.ReturnListOfReplacementDevicesWithReplacementDetailsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsResponse - var ite *catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetails + var foundItem *catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1Response + var ite *catalystcentersdkgo.ResponseDeviceReplacementReturnListOfReplacementDevicesWithReplacementDetailsV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.DeviceReplacement.ReturnListOfReplacementDevicesWithReplacementDetails(nil) diff --git a/catalystcenter/resource_device_replacement_deploy.go b/catalystcenter/resource_device_replacement_deploy.go index 174a996..977ce17 100644 --- a/catalystcenter/resource_device_replacement_deploy.go +++ b/catalystcenter/resource_device_replacement_deploy.go @@ -85,20 +85,18 @@ func resourceDeviceReplacementDeployCreate(ctx context.Context, d *schema.Resour client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestDeviceReplacementDeployDeployDeviceReplacementWorkflow(ctx, "parameters.0", d) + request1 := expandRequestDeviceReplacementDeployDeployDeviceReplacementWorkflowV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceReplacement.DeployDeviceReplacementWorkflow(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceReplacement.DeployDeviceReplacementWorkflowV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeployDeviceReplacementWorkflow", err)) + "Failure when executing DeployDeviceReplacementWorkflowV1", err)) return diags } @@ -106,7 +104,7 @@ func resourceDeviceReplacementDeployCreate(ctx context.Context, d *schema.Resour if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing DeployDeviceReplacementWorkflow", err)) + "Failure when executing DeployDeviceReplacementWorkflowV1", err)) return diags } taskId := response1.Response.TaskID @@ -140,22 +138,24 @@ func resourceDeviceReplacementDeployCreate(ctx context.Context, d *schema.Resour } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing DeployDeviceReplacementWorkflow", err1)) + "Failure when executing DeployDeviceReplacementWorkflowV1", err1)) return diags } } - vItem1 := flattenDeviceReplacementDeployDeviceReplacementWorkflowItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDeviceReplacementDeployDeviceReplacementWorkflowV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeployDeviceReplacementWorkflow response", + "Failure when setting DeployDeviceReplacementWorkflowV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceDeviceReplacementDeployRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -170,8 +170,8 @@ func resourceDeviceReplacementDeployDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestDeviceReplacementDeployDeployDeviceReplacementWorkflow(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceReplacementDeployDeviceReplacementWorkflow { - request := catalystcentersdkgo.RequestDeviceReplacementDeployDeviceReplacementWorkflow{} +func expandRequestDeviceReplacementDeployDeployDeviceReplacementWorkflowV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceReplacementDeployDeviceReplacementWorkflowV1 { + request := catalystcentersdkgo.RequestDeviceReplacementDeployDeviceReplacementWorkflowV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".faulty_device_serial_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".faulty_device_serial_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".faulty_device_serial_number")))) { request.FaultyDeviceSerialNumber = interfaceToString(v) } @@ -181,7 +181,7 @@ func expandRequestDeviceReplacementDeployDeployDeviceReplacementWorkflow(ctx con return &request } -func flattenDeviceReplacementDeployDeviceReplacementWorkflowItem(item *catalystcentersdkgo.ResponseDeviceReplacementDeployDeviceReplacementWorkflowResponse) []map[string]interface{} { +func flattenDeviceReplacementDeployDeviceReplacementWorkflowV1Item(item *catalystcentersdkgo.ResponseDeviceReplacementDeployDeviceReplacementWorkflowV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_diagnostic_validation_workflows.go b/catalystcenter/resource_diagnostic_validation_workflows.go index 8a309f0..67a74f7 100644 --- a/catalystcenter/resource_diagnostic_validation_workflows.go +++ b/catalystcenter/resource_diagnostic_validation_workflows.go @@ -66,7 +66,7 @@ func resourceDiagnosticValidationWorkflows() *schema.Resource { Computed: true, }, "run_status": &schema.Schema{ - Description: `Execution status of the workflow. If the workflow is successfully submitted, runStatus will return 'PENDING'. If the workflow execution has started, runStatus will return 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus will return 'COMPLETED'. If the workflow execution fails while running validations, runStatus will return 'FAILED'. + Description: `Execution status of the workflow. If the workflow is successfully submitted, runStatus will return *PENDING*. If the workflow execution has started, runStatus will return *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus will return *COMPLETED*. If the workflow execution fails while running validations, runStatus will return *FAILED*. `, Type: schema.TypeString, Computed: true, @@ -144,7 +144,7 @@ func resourceDiagnosticValidationWorkflows() *schema.Resource { Computed: true, }, "validation_status": &schema.Schema{ - Description: `Overall result of the validation set execution. If any of the contained validation execution status is 'CRITICAL', this is marked as 'CRITICAL'. Else, if any of the contained validation execution status is 'WARNING', this is marked as 'WARNING'. Else, this is marked as 'INFORMATION'. This is empty when the workflow is in progress. + Description: `Overall result of the validation set execution. If any of the contained validation execution status is *CRITICAL*, this is marked as *CRITICAL*. Else, if any of the contained validation execution status is *WARNING*, this is marked as *WARNING*. Else, this is marked as *INFORMATION*. This is empty when the workflow is in progress. `, Type: schema.TypeString, Computed: true, @@ -159,7 +159,7 @@ func resourceDiagnosticValidationWorkflows() *schema.Resource { }, }, "validation_status": &schema.Schema{ - Description: `Overall result of the execution of all the validations. If any of the contained validation execution status is 'CRITICAL', this is marked as 'CRITICAL'. Else, if any of the contained validation execution status is 'WARNING', this is marked as 'WARNING'. Else, this is marked as 'INFORMATION'. + Description: `Overall result of the execution of all the validations. If any of the contained validation execution status is *CRITICAL*, this is marked as *CRITICAL*. Else, if any of the contained validation execution status is *WARNING*, this is marked as *WARNING*. Else, this is marked as *INFORMATION*. `, Type: schema.TypeString, Computed: true, @@ -217,7 +217,7 @@ func resourceDiagnosticValidationWorkflowsCreate(ctx context.Context, d *schema. var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestDiagnosticValidationWorkflowsSubmitsTheWorkflowForExecutingValidations(ctx, "parameters.0", d) + request1 := expandRequestDiagnosticValidationWorkflowsSubmitsTheWorkflowForExecutingValidationsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID, okID := resourceItem["id"] @@ -234,7 +234,7 @@ func resourceDiagnosticValidationWorkflowsCreate(ctx context.Context, d *schema. return resourceDiagnosticValidationWorkflowsRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.RetrievesTheListOfValidationWorkflowsQueryParams{} + queryParamImport := catalystcentersdkgo.RetrievesTheListOfValidationWorkflowsV1QueryParams{} response2, err := searchHealthAndPerformanceRetrievesTheListOfValidationWorkflows(m, queryParamImport, vvName) if response2 != nil && err == nil { @@ -289,7 +289,7 @@ func resourceDiagnosticValidationWorkflowsRead(ctx context.Context, d *schema.Re d.SetId("") return diags } - vItem1 := flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsItem(response1.Response) + vItem1 := flattenHealthAndPerformanceRetrievesValidationWorkflowDetailsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrievesTheListOfValidationWorkflows search response", @@ -338,8 +338,8 @@ func resourceDiagnosticValidationWorkflowsDelete(ctx context.Context, d *schema. return diags } -func expandRequestDiagnosticValidationWorkflowsSubmitsTheWorkflowForExecutingValidations(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestHealthAndPerformanceSubmitsTheWorkflowForExecutingValidations { - request := catalystcentersdkgo.RequestHealthAndPerformanceSubmitsTheWorkflowForExecutingValidations{} +func expandRequestDiagnosticValidationWorkflowsSubmitsTheWorkflowForExecutingValidationsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestHealthAndPerformanceSubmitsTheWorkflowForExecutingValidationsV1 { + request := catalystcentersdkgo.RequestHealthAndPerformanceSubmitsTheWorkflowForExecutingValidationsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -355,10 +355,10 @@ func expandRequestDiagnosticValidationWorkflowsSubmitsTheWorkflowForExecutingVal return &request } -func searchHealthAndPerformanceRetrievesTheListOfValidationWorkflows(m interface{}, queryParams catalystcentersdkgo.RetrievesTheListOfValidationWorkflowsQueryParams, vName string) (*catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflowsResponse, error) { +func searchHealthAndPerformanceRetrievesTheListOfValidationWorkflows(m interface{}, queryParams catalystcentersdkgo.RetrievesTheListOfValidationWorkflowsV1QueryParams, vName string) (*catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflowsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflowsResponse + var foundItem *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflowsV1Response // var ite *catalystcentersdkgo.ResponseHealthAndPerformanceRetrievesTheListOfValidationWorkflows if vName != "" { queryParams.Offset = 1 diff --git a/catalystcenter/resource_disassociate_site_to_network_profile.go b/catalystcenter/resource_disassociate_site_to_network_profile.go index 2c1fb63..3e9b308 100644 --- a/catalystcenter/resource_disassociate_site_to_network_profile.go +++ b/catalystcenter/resource_disassociate_site_to_network_profile.go @@ -92,14 +92,16 @@ func resourceDisassociateSiteToNetworkProfileCreate(ctx context.Context, d *sche vvNetworkProfileID := vNetworkProfileID.(string) vvSiteID := vSiteID.(string) - response1, restyResp1, err := client.SiteDesign.Disassociate(vvNetworkProfileID, vvSiteID) + // has_unknown_response: None + + response1, restyResp1, err := client.SiteDesign.DisassociateV1(vvNetworkProfileID, vvSiteID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing Disassociate", err)) + "Failure when executing DisassociateV1", err)) return diags } @@ -107,7 +109,7 @@ func resourceDisassociateSiteToNetworkProfileCreate(ctx context.Context, d *sche if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing Disassociate", err)) + "Failure when executing DisassociateV1", err)) return diags } taskId := response1.Response.TaskID @@ -141,22 +143,20 @@ func resourceDisassociateSiteToNetworkProfileCreate(ctx context.Context, d *sche } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing Disassociate", err1)) + "Failure when executing DisassociateV1", err1)) return diags } } - - vItem1 := flattenSiteDesignDisassociateItem(response1.Response) + vItem1 := flattenSiteDesignDisassociateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting Disassociate response", + "Failure when setting DisassociateV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceDisassociateSiteToNetworkProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -171,7 +171,7 @@ func resourceDisassociateSiteToNetworkProfileDelete(ctx context.Context, d *sche return diags } -func flattenSiteDesignDisassociateItem(item *catalystcentersdkgo.ResponseSiteDesignDisassociateResponse) []map[string]interface{} { +func flattenSiteDesignDisassociateV1Item(item *catalystcentersdkgo.ResponseSiteDesignDisassociateV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_discovery.go b/catalystcenter/resource_discovery.go index 194c2c2..89a87f0 100644 --- a/catalystcenter/resource_discovery.go +++ b/catalystcenter/resource_discovery.go @@ -804,7 +804,7 @@ ERROR: Different types for param passwordList schema.TypeList schema.TypeString` Computed: true, }, "snmp_rw_community_desc": &schema.Schema{ - Description: `Description for Snmp RW community + Description: `Description for SNMP RW community `, Type: schema.TypeString, Optional: true, @@ -871,7 +871,7 @@ func resourceDiscoveryCreate(ctx context.Context, d *schema.ResourceData, m inte var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestDiscoveryStartDiscovery(ctx, "parameters.0", d) + request1 := expandRequestDiscoveryStartDiscoveryV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -980,7 +980,7 @@ func resourceDiscoveryRead(ctx context.Context, d *schema.ResourceData, m interf log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDiscoveryGetDiscoveryByIDItem(response1.Response) + vItem1 := flattenDiscoveryGetDiscoveryByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDiscoveryByID response", @@ -1018,7 +1018,7 @@ func resourceDiscoveryRead(ctx context.Context, d *schema.ResourceData, m interf d.SetId("") return diags } - vItem1 := flattenDiscoveryGetDiscoveryByIDItem(response2.Response) + vItem1 := flattenDiscoveryGetDiscoveryByIDV1Item(response2.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDiscoveryByID response", @@ -1063,7 +1063,7 @@ func resourceDiscoveryUpdate(ctx context.Context, d *schema.ResourceData, m inte } if d.HasChange("parameters") { log.Printf("[DEBUG] Name used for update operation %s", vvName) - request1 := expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedID(ctx, "parameters.0", d) + request1 := expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -1198,8 +1198,8 @@ func resourceDiscoveryDelete(ctx context.Context, d *schema.ResourceData, m inte return diags } -func expandRequestDiscoveryStartDiscovery(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryStartDiscovery { - request := catalystcentersdkgo.RequestDiscoveryStartDiscovery{} +func expandRequestDiscoveryStartDiscoveryV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryStartDiscoveryV1 { + request := catalystcentersdkgo.RequestDiscoveryStartDiscoveryV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cdp_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cdp_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cdp_level")))) { request.CdpLevel = interfaceToIntPtr(v) } @@ -1213,10 +1213,10 @@ func expandRequestDiscoveryStartDiscovery(ctx context.Context, key string, d *sc request.GlobalCredentialIDList = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".http_read_credential")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".http_read_credential")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".http_read_credential")))) { - request.HTTPReadCredential = expandRequestDiscoveryStartDiscoveryHTTPReadCredential(ctx, key+".http_read_credential.0", d) + request.HTTPReadCredential = expandRequestDiscoveryStartDiscoveryV1HTTPReadCredential(ctx, key+".http_read_credential.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".http_write_credential")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".http_write_credential")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".http_write_credential")))) { - request.HTTPWriteCredential = expandRequestDiscoveryStartDiscoveryHTTPWriteCredential(ctx, key+".http_write_credential.0", d) + request.HTTPWriteCredential = expandRequestDiscoveryStartDiscoveryV1HTTPWriteCredential(ctx, key+".http_write_credential.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_address_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_address_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_address_list")))) { request.IPAddressList = interfaceToString(v) @@ -1290,8 +1290,8 @@ func expandRequestDiscoveryStartDiscovery(ctx context.Context, key string, d *sc return &request } -func expandRequestDiscoveryStartDiscoveryHTTPReadCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryStartDiscoveryHTTPReadCredential { - request := catalystcentersdkgo.RequestDiscoveryStartDiscoveryHTTPReadCredential{} +func expandRequestDiscoveryStartDiscoveryV1HTTPReadCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryStartDiscoveryV1HTTPReadCredential { + request := catalystcentersdkgo.RequestDiscoveryStartDiscoveryV1HTTPReadCredential{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".password")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".password")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".password")))) { request.Password = interfaceToString(v) } @@ -1310,8 +1310,8 @@ func expandRequestDiscoveryStartDiscoveryHTTPReadCredential(ctx context.Context, return &request } -func expandRequestDiscoveryStartDiscoveryHTTPWriteCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryStartDiscoveryHTTPWriteCredential { - request := catalystcentersdkgo.RequestDiscoveryStartDiscoveryHTTPWriteCredential{} +func expandRequestDiscoveryStartDiscoveryV1HTTPWriteCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryStartDiscoveryV1HTTPWriteCredential { + request := catalystcentersdkgo.RequestDiscoveryStartDiscoveryV1HTTPWriteCredential{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".password")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".password")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".password")))) { request.Password = interfaceToString(v) } @@ -1330,10 +1330,10 @@ func expandRequestDiscoveryStartDiscoveryHTTPWriteCredential(ctx context.Context return &request } -func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedID { - request := catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedID{} +func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_info")))) { - request.AttributeInfo = expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDAttributeInfo(ctx, key+".attribute_info.0", d) + request.AttributeInfo = expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1AttributeInfo(ctx, key+".attribute_info.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".cdp_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cdp_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cdp_level")))) { request.CdpLevel = interfaceToIntPtr(v) @@ -1357,10 +1357,10 @@ func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedID(ctx context.C request.GlobalCredentialIDList = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".http_read_credential")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".http_read_credential")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".http_read_credential")))) { - request.HTTPReadCredential = expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPReadCredential(ctx, key+".http_read_credential.0", d) + request.HTTPReadCredential = expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPReadCredential(ctx, key+".http_read_credential.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".http_write_credential")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".http_write_credential")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".http_write_credential")))) { - request.HTTPWriteCredential = expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPWriteCredential(ctx, key+".http_write_credential.0", d) + request.HTTPWriteCredential = expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPWriteCredential(ctx, key+".http_write_credential.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -1446,8 +1446,8 @@ func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedID(ctx context.C return &request } -func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDAttributeInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDAttributeInfo { - var request catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDAttributeInfo +func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1AttributeInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1AttributeInfo { + var request catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1AttributeInfo request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1455,8 +1455,8 @@ func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDAttributeInfo( return &request } -func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPReadCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPReadCredential { - request := catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPReadCredential{} +func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPReadCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPReadCredential { + request := catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPReadCredential{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -1493,8 +1493,8 @@ func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPReadCreden return &request } -func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPWriteCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPWriteCredential { - request := catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPWriteCredential{} +func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPWriteCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPWriteCredential { + request := catalystcentersdkgo.RequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDV1HTTPWriteCredential{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -1531,10 +1531,10 @@ func expandRequestDiscoveryUpdatesAnExistingDiscoveryBySpecifiedIDHTTPWriteCrede return &request } -func searchDiscovery(m interface{}, vName string) (*catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeResponse, error) { +func searchDiscovery(m interface{}, vName string) (*catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeResponse + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetDiscoveriesByRangeV1Response if vName == "" { return foundItem, err } diff --git a/catalystcenter/resource_discovery_range_delete.go b/catalystcenter/resource_discovery_range_delete.go index dac51a7..ce45cf9 100644 --- a/catalystcenter/resource_discovery_range_delete.go +++ b/catalystcenter/resource_discovery_range_delete.go @@ -90,14 +90,16 @@ func resourceDiscoveryRangeDeleteCreate(ctx context.Context, d *schema.ResourceD vvStartIndex := vStartIndex.(int) vvRecordsToDelete := vRecordsToDelete.(int) - response1, restyResp1, err := client.Discovery.DeleteDiscoveryBySpecifiedRange(vvStartIndex, vvRecordsToDelete) + // has_unknown_response: None + + response1, restyResp1, err := client.Discovery.DeleteDiscoveryBySpecifiedRangeV1(vvStartIndex, vvRecordsToDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeleteDiscoveryBySpecifiedRange", err)) + "Failure when executing DeleteDiscoveryBySpecifiedRangeV1", err)) return diags } @@ -105,7 +107,7 @@ func resourceDiscoveryRangeDeleteCreate(ctx context.Context, d *schema.ResourceD if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing DeleteDiscoveryBySpecifiedRange", err)) + "Failure when executing DeleteDiscoveryBySpecifiedRangeV1", err)) return diags } taskId := response1.Response.TaskID @@ -139,22 +141,20 @@ func resourceDiscoveryRangeDeleteCreate(ctx context.Context, d *schema.ResourceD } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing DeleteDiscoveryBySpecifiedRange", err1)) + "Failure when executing DeleteDiscoveryBySpecifiedRangeV1", err1)) return diags } } - - vItem1 := flattenDiscoveryDeleteDiscoveryBySpecifiedRangeItem(response1.Response) + vItem1 := flattenDiscoveryDeleteDiscoveryBySpecifiedRangeV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeleteDiscoveryBySpecifiedRange response", + "Failure when setting DeleteDiscoveryBySpecifiedRangeV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceDiscoveryRangeDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -169,7 +169,7 @@ func resourceDiscoveryRangeDeleteDelete(ctx context.Context, d *schema.ResourceD return diags } -func flattenDiscoveryDeleteDiscoveryBySpecifiedRangeItem(item *catalystcentersdkgo.ResponseDiscoveryDeleteDiscoveryBySpecifiedRangeResponse) []map[string]interface{} { +func flattenDiscoveryDeleteDiscoveryBySpecifiedRangeV1Item(item *catalystcentersdkgo.ResponseDiscoveryDeleteDiscoveryBySpecifiedRangeV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_endpoint_analytics_profiling_rules.go b/catalystcenter/resource_endpoint_analytics_profiling_rules.go new file mode 100644 index 0000000..184a02d --- /dev/null +++ b/catalystcenter/resource_endpoint_analytics_profiling_rules.go @@ -0,0 +1,862 @@ +package catalystcenter + +import ( + "context" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceEndpointAnalyticsProfilingRules() *schema.Resource { + return &schema.Resource{ + Description: `It manages create, read, update and delete operations on AIEndpointAnalytics. + +- Creates profiling rule from the request body. + +- Updates the profiling rule for the given 'ruleId'. + +- Deletes the profiling rule for the given 'ruleId'. +`, + + CreateContext: resourceEndpointAnalyticsProfilingRulesCreate, + ReadContext: resourceEndpointAnalyticsProfilingRulesRead, + UpdateContext: resourceEndpointAnalyticsProfilingRulesUpdate, + DeleteContext: resourceEndpointAnalyticsProfilingRulesDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Computed: true, + }, + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Computed: true, + }, + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Computed: true, + }, + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Computed: true, + }, + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + Computed: true, + }, + "result": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Computed: true, + }, + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Computed: true, + }, + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Computed: true, + }, + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "result": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceEndpointAnalyticsProfilingRulesCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1(ctx, "parameters.0", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + + vRuleID, okRuleID := resourceItem["rule_id"] + vvRuleID := interfaceToString(vRuleID) + vName, okRuleID := resourceItem["rule_name"] + vvName := interfaceToString(vName) + if okRuleID && vvRuleID != "" { + getResponse2, _, err := client.AIEndpointAnalytics.GetDetailsOfASingleProfilingRuleV1(vvRuleID) + if err == nil && getResponse2 != nil { + resourceMap := make(map[string]string) + resourceMap["rule_id"] = vvRuleID + d.SetId(joinResourceID(resourceMap)) + return resourceEndpointAnalyticsProfilingRulesRead(ctx, d, m) + } + } else { + queryParamImport := catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams{} + + response2, err := searchPolicyGetListOfProfilingRulesV1(m, queryParamImport, vvRuleID, vvName) + if response2 != nil && err == nil { + resourceMap := make(map[string]string) + resourceMap["rule_id"] = response2.RuleID + d.SetId(joinResourceID(resourceMap)) + return resourceEndpointAnalyticsProfilingRulesRead(ctx, d, m) + } + } + resp1, restyResp1, err := client.AIEndpointAnalytics.CreateAProfilingRuleV1(request1) + if err != nil || resp1 == nil { + if restyResp1 != nil { + diags = append(diags, diagErrorWithResponse( + "Failure when executing CreateAProfilingRuleV1", err, restyResp1.String())) + return diags + } + diags = append(diags, diagError( + "Failure when executing CreateAProfilingRuleV1", err)) + return diags + } + // TODO REVIEW + queryParamValidate := catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams{} + item3, err := searchPolicyGetListOfProfilingRulesV1(m, queryParamValidate, vvRuleID, vvName) + if err != nil || item3 == nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing CreateAProfilingRuleV1", err, + "Failure at CreateAProfilingRuleV1, unexpected response", "")) + return diags + } + + resourceMap := make(map[string]string) + resourceMap["rule_id"] = item3.RuleID + d.SetId(joinResourceID(resourceMap)) + return resourceEndpointAnalyticsProfilingRulesRead(ctx, d, m) +} + +func resourceEndpointAnalyticsProfilingRulesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vID := resourceMap["id"] + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetDetailsOfASingleProfilingRuleV1") + vvRuleID := vID + + // has_unknown_response: None + + response1, restyResp1, err := client.AIEndpointAnalytics.GetDetailsOfASingleProfilingRuleV1(vvRuleID) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + // Review flatten function used + vItem1 := flattenAIEndpointAnalyticsGetDetailsOfASingleProfilingRuleV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetListOfProfilingRulesV1 search response", + err)) + return diags + } + + } + return diags +} + +func resourceEndpointAnalyticsProfilingRulesUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvID := resourceMap["id"] + if d.HasChange("parameters") { + log.Printf("[DEBUG] ID used for update operation %s", vvID) + request1 := expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1(ctx, "parameters.0", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + restyResp1, err := client.AIEndpointAnalytics.UpdateAnExistingProfilingRuleV1(vvID, request1) + if err != nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing UpdateAnExistingProfilingRuleV1", err, restyResp1.String(), + "Failure at UpdateAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing UpdateAnExistingProfilingRuleV1", err, + "Failure at UpdateAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + } + + return resourceEndpointAnalyticsProfilingRulesRead(ctx, d, m) +} + +func resourceEndpointAnalyticsProfilingRulesDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvRuleID := resourceMap["id"] + + restyResp1, err := client.AIEndpointAnalytics.DeleteAnExistingProfilingRuleV1(vvRuleID) + if err != nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing DeleteAnExistingProfilingRuleV1", err, restyResp1.String(), + "Failure at DeleteAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing DeleteAnExistingProfilingRuleV1", err, + "Failure at DeleteAnExistingProfilingRuleV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + // d.SetId("") is automatically called assuming delete returns no errors, but + // it is added here for explicitness. + d.SetId("") + + return diags +} +func expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_id")))) { + request.RuleID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_name")))) { + request.RuleName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_type")))) { + request.RuleType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_version")))) { + request.RuleVersion = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_priority")))) { + request.RulePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_priority")))) { + request.SourcePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_deleted")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_deleted")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_deleted")))) { + request.IsDeleted = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_by")))) { + request.LastModifiedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_on")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_on")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_on")))) { + request.LastModifiedOn = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".plugin_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".plugin_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".plugin_id")))) { + request.PluginID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".cluster_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cluster_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cluster_id")))) { + request.ClusterID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rejected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rejected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rejected")))) { + request.Rejected = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".result")))) { + request.Result = expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1Result(ctx, key+".result.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_groups")))) { + request.ConditionGroups = expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroups(ctx, key+".condition_groups.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".used_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".used_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".used_attributes")))) { + request.UsedAttributes = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1Result(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1Result { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1Result{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operating_system")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operating_system")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operating_system")))) { + request.OperatingSystem = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroups { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroups{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition")))) { + request.Condition = expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroupsCondition(ctx, key+".condition.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_group")))) { + request.ConditionGroup = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesCreateAProfilingRuleV1ConditionGroupsCondition(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroupsCondition { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsCreateAProfilingRuleV1ConditionGroupsCondition{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute")))) { + request.Attribute = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_dictionary")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_dictionary")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_dictionary")))) { + request.AttributeDictionary = interfaceToString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_id")))) { + request.RuleID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_name")))) { + request.RuleName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_type")))) { + request.RuleType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_version")))) { + request.RuleVersion = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_priority")))) { + request.RulePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_priority")))) { + request.SourcePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_deleted")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_deleted")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_deleted")))) { + request.IsDeleted = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_by")))) { + request.LastModifiedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_on")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_on")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_on")))) { + request.LastModifiedOn = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".plugin_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".plugin_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".plugin_id")))) { + request.PluginID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".cluster_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cluster_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cluster_id")))) { + request.ClusterID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rejected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rejected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rejected")))) { + request.Rejected = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".result")))) { + request.Result = expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1Result(ctx, key+".result.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_groups")))) { + request.ConditionGroups = expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroups(ctx, key+".condition_groups.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".used_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".used_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".used_attributes")))) { + request.UsedAttributes = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1Result(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1Result { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1Result{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operating_system")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operating_system")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operating_system")))) { + request.OperatingSystem = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroups { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroups{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition")))) { + request.Condition = expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroupsCondition(ctx, key+".condition.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_group")))) { + request.ConditionGroup = interfaceToSliceString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestEndpointAnalyticsProfilingRulesUpdateAnExistingProfilingRuleV1ConditionGroupsCondition(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroupsCondition { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsUpdateAnExistingProfilingRuleV1ConditionGroupsCondition{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute")))) { + request.Attribute = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_dictionary")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_dictionary")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_dictionary")))) { + request.AttributeDictionary = interfaceToString(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func searchPolicyGetListOfProfilingRulesV1(m interface{}, queryParams catalystcentersdkgo.GetListOfProfilingRulesV1QueryParams, vID string, vName string) (*catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRules, error) { + client := m.(*catalystcentersdkgo.Client) + var err error + var foundItem *catalystcentersdkgo.ResponseAIEndpointAnalyticsGetListOfProfilingRulesV1ProfilingRules + if vID != "" || vName != "" { + queryParams.Offset = 1 + nResponse, _, err := client.AIEndpointAnalytics.GetListOfProfilingRulesV1(&queryParams) + maxPageSize := len(*nResponse.ProfilingRules) + for len(*nResponse.ProfilingRules) > 0 { + for _, item := range *nResponse.ProfilingRules { + if vID == item.RuleID || vName == item.RuleName { + foundItem = &item + return foundItem, err + } + } + queryParams.Limit = float64(maxPageSize) + queryParams.Offset += float64(maxPageSize) + nResponse, _, err = client.AIEndpointAnalytics.GetListOfProfilingRulesV1(&queryParams) + if nResponse == nil || nResponse.ProfilingRules == nil { + break + } + } + return nil, err + } + return foundItem, err +} diff --git a/catalystcenter/resource_event_email_config_create.go b/catalystcenter/resource_event_email_config_create.go index 85d6d40..57443e6 100644 --- a/catalystcenter/resource_event_email_config_create.go +++ b/catalystcenter/resource_event_email_config_create.go @@ -185,31 +185,27 @@ func resourceEventEmailConfigCreateCreate(ctx context.Context, d *schema.Resourc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestEventEmailConfigCreateCreateEmailDestination(ctx, "parameters.0", d) + request1 := expandRequestEventEmailConfigCreateCreateEmailDestinationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.EventManagement.CreateEmailDestination(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.EventManagement.CreateEmailDestinationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreateEmailDestination", err)) + "Failure when executing CreateEmailDestinationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenEventManagementCreateEmailDestinationItem(response1) + vItem1 := flattenEventManagementCreateEmailDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateEmailDestination response", + "Failure when setting CreateEmailDestinationV1 response", err)) return diags } @@ -231,16 +227,16 @@ func resourceEventEmailConfigCreateDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestEventEmailConfigCreateCreateEmailDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailDestination { - request := catalystcentersdkgo.RequestEventManagementCreateEmailDestination{} +func expandRequestEventEmailConfigCreateCreateEmailDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementCreateEmailDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".email_config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".email_config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".email_config_id")))) { request.EmailConfigID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".primary_smt_p_config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".primary_smt_p_config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".primary_smt_p_config")))) { - request.PrimarySmtpConfig = expandRequestEventEmailConfigCreateCreateEmailDestinationPrimarySmtpConfig(ctx, key+".primary_smt_p_config.0", d) + request.PrimarySmtpConfig = expandRequestEventEmailConfigCreateCreateEmailDestinationV1PrimarySmtpConfig(ctx, key+".primary_smt_p_config.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".secondary_smt_p_config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".secondary_smt_p_config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".secondary_smt_p_config")))) { - request.SecondarySmtpConfig = expandRequestEventEmailConfigCreateCreateEmailDestinationSecondarySmtpConfig(ctx, key+".secondary_smt_p_config.0", d) + request.SecondarySmtpConfig = expandRequestEventEmailConfigCreateCreateEmailDestinationV1SecondarySmtpConfig(ctx, key+".secondary_smt_p_config.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".from_email")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".from_email")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".from_email")))) { request.FromEmail = interfaceToString(v) @@ -254,8 +250,8 @@ func expandRequestEventEmailConfigCreateCreateEmailDestination(ctx context.Conte return &request } -func expandRequestEventEmailConfigCreateCreateEmailDestinationPrimarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailDestinationPrimarySmtpConfig { - request := catalystcentersdkgo.RequestEventManagementCreateEmailDestinationPrimarySmtpConfig{} +func expandRequestEventEmailConfigCreateCreateEmailDestinationV1PrimarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailDestinationV1PrimarySmtpConfig { + request := catalystcentersdkgo.RequestEventManagementCreateEmailDestinationV1PrimarySmtpConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".host_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".host_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".host_name")))) { request.HostName = interfaceToString(v) } @@ -274,8 +270,8 @@ func expandRequestEventEmailConfigCreateCreateEmailDestinationPrimarySmtpConfig( return &request } -func expandRequestEventEmailConfigCreateCreateEmailDestinationSecondarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailDestinationSecondarySmtpConfig { - request := catalystcentersdkgo.RequestEventManagementCreateEmailDestinationSecondarySmtpConfig{} +func expandRequestEventEmailConfigCreateCreateEmailDestinationV1SecondarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailDestinationV1SecondarySmtpConfig { + request := catalystcentersdkgo.RequestEventManagementCreateEmailDestinationV1SecondarySmtpConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".host_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".host_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".host_name")))) { request.HostName = interfaceToString(v) } @@ -294,7 +290,7 @@ func expandRequestEventEmailConfigCreateCreateEmailDestinationSecondarySmtpConfi return &request } -func flattenEventManagementCreateEmailDestinationItem(item *catalystcentersdkgo.ResponseEventManagementCreateEmailDestination) []map[string]interface{} { +func flattenEventManagementCreateEmailDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementCreateEmailDestinationV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_event_email_config_update.go b/catalystcenter/resource_event_email_config_update.go index 54ce2ee..aaf9458 100644 --- a/catalystcenter/resource_event_email_config_update.go +++ b/catalystcenter/resource_event_email_config_update.go @@ -185,31 +185,27 @@ func resourceEventEmailConfigUpdateCreate(ctx context.Context, d *schema.Resourc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestEventEmailConfigUpdateUpdateEmailDestination(ctx, "parameters.0", d) + request1 := expandRequestEventEmailConfigUpdateUpdateEmailDestinationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.EventManagement.UpdateEmailDestination(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.EventManagement.UpdateEmailDestinationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateEmailDestination", err)) + "Failure when executing UpdateEmailDestinationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenEventManagementUpdateEmailDestinationItem(response1) + vItem1 := flattenEventManagementUpdateEmailDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateEmailDestination response", + "Failure when setting UpdateEmailDestinationV1 response", err)) return diags } @@ -231,16 +227,16 @@ func resourceEventEmailConfigUpdateDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestEventEmailConfigUpdateUpdateEmailDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailDestination { - request := catalystcentersdkgo.RequestEventManagementUpdateEmailDestination{} +func expandRequestEventEmailConfigUpdateUpdateEmailDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".email_config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".email_config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".email_config_id")))) { request.EmailConfigID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".primary_smt_p_config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".primary_smt_p_config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".primary_smt_p_config")))) { - request.PrimarySmtpConfig = expandRequestEventEmailConfigUpdateUpdateEmailDestinationPrimarySmtpConfig(ctx, key+".primary_smt_p_config.0", d) + request.PrimarySmtpConfig = expandRequestEventEmailConfigUpdateUpdateEmailDestinationV1PrimarySmtpConfig(ctx, key+".primary_smt_p_config.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".secondary_smt_p_config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".secondary_smt_p_config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".secondary_smt_p_config")))) { - request.SecondarySmtpConfig = expandRequestEventEmailConfigUpdateUpdateEmailDestinationSecondarySmtpConfig(ctx, key+".secondary_smt_p_config.0", d) + request.SecondarySmtpConfig = expandRequestEventEmailConfigUpdateUpdateEmailDestinationV1SecondarySmtpConfig(ctx, key+".secondary_smt_p_config.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".from_email")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".from_email")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".from_email")))) { request.FromEmail = interfaceToString(v) @@ -254,8 +250,8 @@ func expandRequestEventEmailConfigUpdateUpdateEmailDestination(ctx context.Conte return &request } -func expandRequestEventEmailConfigUpdateUpdateEmailDestinationPrimarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationPrimarySmtpConfig { - request := catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationPrimarySmtpConfig{} +func expandRequestEventEmailConfigUpdateUpdateEmailDestinationV1PrimarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationV1PrimarySmtpConfig { + request := catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationV1PrimarySmtpConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".host_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".host_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".host_name")))) { request.HostName = interfaceToString(v) } @@ -274,8 +270,8 @@ func expandRequestEventEmailConfigUpdateUpdateEmailDestinationPrimarySmtpConfig( return &request } -func expandRequestEventEmailConfigUpdateUpdateEmailDestinationSecondarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationSecondarySmtpConfig { - request := catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationSecondarySmtpConfig{} +func expandRequestEventEmailConfigUpdateUpdateEmailDestinationV1SecondarySmtpConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationV1SecondarySmtpConfig { + request := catalystcentersdkgo.RequestEventManagementUpdateEmailDestinationV1SecondarySmtpConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".host_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".host_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".host_name")))) { request.HostName = interfaceToString(v) } @@ -294,7 +290,7 @@ func expandRequestEventEmailConfigUpdateUpdateEmailDestinationSecondarySmtpConfi return &request } -func flattenEventManagementUpdateEmailDestinationItem(item *catalystcentersdkgo.ResponseEventManagementUpdateEmailDestination) []map[string]interface{} { +func flattenEventManagementUpdateEmailDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementUpdateEmailDestinationV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_event_snmp_config_create.go b/catalystcenter/resource_event_snmp_config_create.go index b868d24..0a1eede 100644 --- a/catalystcenter/resource_event_snmp_config_create.go +++ b/catalystcenter/resource_event_snmp_config_create.go @@ -171,31 +171,27 @@ func resourceEventSNMPConfigCreateCreate(ctx context.Context, d *schema.Resource client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestEventSNMPConfigCreateCreateSNMPDestination(ctx, "parameters.0", d) + request1 := expandRequestEventSNMPConfigCreateCreateSNMPDestinationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.EventManagement.CreateSNMPDestination(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.EventManagement.CreateSNMPDestinationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreateSNMPDestination", err)) + "Failure when executing CreateSNMPDestinationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenEventManagementCreateSNMPDestinationItem(response1) + vItem1 := flattenEventManagementCreateSNMPDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateSNMPDestination response", + "Failure when setting CreateSNMPDestinationV1 response", err)) return diags } @@ -217,8 +213,8 @@ func resourceEventSNMPConfigCreateDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestEventSNMPConfigCreateCreateSNMPDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSNMPDestination { - request := catalystcentersdkgo.RequestEventManagementCreateSNMPDestination{} +func expandRequestEventSNMPConfigCreateCreateSNMPDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSNMPDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementCreateSNMPDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -258,12 +254,12 @@ func expandRequestEventSNMPConfigCreateCreateSNMPDestination(ctx context.Context return &request } -func flattenEventManagementCreateSNMPDestinationItem(item *catalystcentersdkgo.ResponseEventManagementCreateSNMPDestination) []map[string]interface{} { +func flattenEventManagementCreateSNMPDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementCreateSNMPDestinationV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["error_message"] = flattenEventManagementCreateSNMPDestinationItemErrorMessage(item.ErrorMessage) + respItem["error_message"] = flattenEventManagementCreateSNMPDestinationV1ItemErrorMessage(item.ErrorMessage) respItem["api_status"] = item.APIStatus respItem["status_message"] = item.StatusMessage return []map[string]interface{}{ @@ -271,12 +267,12 @@ func flattenEventManagementCreateSNMPDestinationItem(item *catalystcentersdkgo.R } } -func flattenEventManagementCreateSNMPDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementCreateSNMPDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementCreateSNMPDestinationV1ItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementCreateSNMPDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["errors"] = flattenEventManagementCreateSNMPDestinationItemErrorMessageErrors(item.Errors) + respItem["errors"] = flattenEventManagementCreateSNMPDestinationV1ItemErrorMessageErrors(item.Errors) return []map[string]interface{}{ respItem, @@ -284,7 +280,7 @@ func flattenEventManagementCreateSNMPDestinationItemErrorMessage(item *catalystc } -func flattenEventManagementCreateSNMPDestinationItemErrorMessageErrors(items *[]catalystcentersdkgo.ResponseEventManagementCreateSNMPDestinationErrorMessageErrors) []interface{} { +func flattenEventManagementCreateSNMPDestinationV1ItemErrorMessageErrors(items *[]catalystcentersdkgo.ResponseEventManagementCreateSNMPDestinationV1ErrorMessageErrors) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_event_snmp_config_update.go b/catalystcenter/resource_event_snmp_config_update.go index f8b52c0..3ce6fb5 100644 --- a/catalystcenter/resource_event_snmp_config_update.go +++ b/catalystcenter/resource_event_snmp_config_update.go @@ -177,31 +177,27 @@ func resourceEventSNMPConfigUpdateCreate(ctx context.Context, d *schema.Resource client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestEventSNMPConfigUpdateUpdateSNMPDestination(ctx, "parameters.0", d) + request1 := expandRequestEventSNMPConfigUpdateUpdateSNMPDestinationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.EventManagement.UpdateSNMPDestination(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.EventManagement.UpdateSNMPDestinationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateSNMPDestination", err)) + "Failure when executing UpdateSNMPDestinationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenEventManagementUpdateSNMPDestinationItem(response1) + vItem1 := flattenEventManagementUpdateSNMPDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateSNMPDestination response", + "Failure when setting UpdateSNMPDestinationV1 response", err)) return diags } @@ -223,8 +219,8 @@ func resourceEventSNMPConfigUpdateDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestEventSNMPConfigUpdateUpdateSNMPDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSNMPDestination { - request := catalystcentersdkgo.RequestEventManagementUpdateSNMPDestination{} +func expandRequestEventSNMPConfigUpdateUpdateSNMPDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSNMPDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateSNMPDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } @@ -267,12 +263,12 @@ func expandRequestEventSNMPConfigUpdateUpdateSNMPDestination(ctx context.Context return &request } -func flattenEventManagementUpdateSNMPDestinationItem(item *catalystcentersdkgo.ResponseEventManagementUpdateSNMPDestination) []map[string]interface{} { +func flattenEventManagementUpdateSNMPDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementUpdateSNMPDestinationV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["error_message"] = flattenEventManagementUpdateSNMPDestinationItemErrorMessage(item.ErrorMessage) + respItem["error_message"] = flattenEventManagementUpdateSNMPDestinationV1ItemErrorMessage(item.ErrorMessage) respItem["api_status"] = item.APIStatus respItem["status_message"] = item.StatusMessage return []map[string]interface{}{ @@ -280,7 +276,7 @@ func flattenEventManagementUpdateSNMPDestinationItem(item *catalystcentersdkgo.R } } -func flattenEventManagementUpdateSNMPDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementUpdateSNMPDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementUpdateSNMPDestinationV1ItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementUpdateSNMPDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_event_subscription.go b/catalystcenter/resource_event_subscription.go index 5555876..40ef876 100644 --- a/catalystcenter/resource_event_subscription.go +++ b/catalystcenter/resource_event_subscription.go @@ -298,7 +298,7 @@ func resourceEventSubscription() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestEventManagementCreateEventSubscriptions`, + Description: `Array of RequestEventManagementCreateEventSubscriptionsV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -480,13 +480,13 @@ func resourceEventSubscriptionCreate(ctx context.Context, d *schema.ResourceData } resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestEventSubscriptionCreateEventSubscriptions(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionCreateEventSubscriptionsV1(ctx, "parameters.0", d) vName := resourceItem["name"] vvName := interfaceToString(vName) vSubscriptionID := resourceItem["subscription_id"] vvSubscriptionID := interfaceToString(vSubscriptionID) - queryParams1 := catalystcentersdkgo.GetEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetEventSubscriptions(m, queryParams1, vvName, vvSubscriptionID) if err == nil && (item != nil && len(*item) > 0) { resourceMap := make(map[string]string) @@ -556,7 +556,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetEventSubscriptions(m, queryParams1, vName, vSubscriptionID) if err != nil { diags = append(diags, diagError( @@ -573,7 +573,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*item)) } - vItem1 := flattenEventManagementGetEventSubscriptionsItems(item) + vItem1 := flattenEventManagementGetEventSubscriptionsV1Items(item) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetEventSubscriptions search response", @@ -595,7 +595,7 @@ func resourceEventSubscriptionUpdate(ctx context.Context, d *schema.ResourceData vName, _ := resourceMap["name"] vSubscriptionID, _ := resourceMap["subscription_id"] - queryParams1 := catalystcentersdkgo.GetEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetEventSubscriptions(m, queryParams1, vName, vSubscriptionID) if err != nil || item == nil || len(*item) <= 0 { diags = append(diags, diagErrorWithAlt( @@ -606,7 +606,7 @@ func resourceEventSubscriptionUpdate(ctx context.Context, d *schema.ResourceData // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { - request1 := expandRequestEventSubscriptionUpdateEventSubscriptions(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionUpdateEventSubscriptionsV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -650,7 +650,7 @@ func resourceEventSubscriptionDelete(ctx context.Context, d *schema.ResourceData vName, _ := resourceMap["name"] vSubscriptionID, _ := resourceMap["subscription_id"] - queryParams1 := catalystcentersdkgo.GetEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetEventSubscriptions(m, queryParams1, vName, vSubscriptionID) if err != nil { diags = append(diags, diagErrorWithAlt( @@ -663,7 +663,7 @@ func resourceEventSubscriptionDelete(ctx context.Context, d *schema.ResourceData } // REVIEW: Add getAllItems and search function to get missing params - queryParams2 := catalystcentersdkgo.DeleteEventSubscriptionsQueryParams{} + queryParams2 := catalystcentersdkgo.DeleteEventSubscriptionsV1QueryParams{} if len(*item) > 0 { itemCopy := *item queryParams2.Subscriptions = itemCopy[0].SubscriptionID @@ -691,9 +691,9 @@ func resourceEventSubscriptionDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestEventSubscriptionCreateEventSubscriptions(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEventSubscriptions { - request := catalystcentersdkgo.RequestEventManagementCreateEventSubscriptions{} - if v := expandRequestEventSubscriptionCreateEventSubscriptionsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionCreateEventSubscriptionsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEventSubscriptionsV1 { + request := catalystcentersdkgo.RequestEventManagementCreateEventSubscriptionsV1{} + if v := expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -702,8 +702,8 @@ func expandRequestEventSubscriptionCreateEventSubscriptions(ctx context.Context, return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptions { - request := []catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptions{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1 { + request := []catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -714,7 +714,7 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemArray(ctx context return nil } for item_no := range objs { - i := expandRequestEventSubscriptionCreateEventSubscriptionsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionCreateEventSubscriptionsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -725,8 +725,8 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemArray(ctx context return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptions { - request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptions{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1 { + request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -740,10 +740,10 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItem(ctx context.Cont request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionCreateEventSubscriptionsItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -751,8 +751,8 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItem(ctx context.Cont return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsSubscriptionEndpoints{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -763,7 +763,7 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpo return nil } for item_no := range objs { - i := expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -774,13 +774,13 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpo return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsSubscriptionEndpoints{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -788,8 +788,8 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpo return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -799,13 +799,13 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemSubscriptionEndpo return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsFilter { - request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsFilter{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -828,8 +828,8 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilter(ctx contex return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsFilterDomainsSubdomains{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -840,7 +840,7 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubd return nil } for item_no := range objs { - i := expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -851,8 +851,8 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubd return &request } -func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsFilterDomainsSubdomains{} +func expandRequestEventSubscriptionCreateEventSubscriptionsV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementCreateEventSubscriptionsV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -865,9 +865,9 @@ func expandRequestEventSubscriptionCreateEventSubscriptionsItemFilterDomainsSubd return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptions(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEventSubscriptions { - request := catalystcentersdkgo.RequestEventManagementUpdateEventSubscriptions{} - if v := expandRequestEventSubscriptionUpdateEventSubscriptionsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEventSubscriptionsV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateEventSubscriptionsV1{} + if v := expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -876,8 +876,8 @@ func expandRequestEventSubscriptionUpdateEventSubscriptions(ctx context.Context, return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptions { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptions{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1 { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -888,7 +888,7 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemArray(ctx context return nil } for item_no := range objs { - i := expandRequestEventSubscriptionUpdateEventSubscriptionsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionUpdateEventSubscriptionsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -899,8 +899,8 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemArray(ctx context return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptions { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptions{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1 { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -914,10 +914,10 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItem(ctx context.Cont request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -925,8 +925,8 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItem(ctx context.Cont return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsSubscriptionEndpoints{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -937,7 +937,7 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpo return nil } for item_no := range objs { - i := expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -948,13 +948,13 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpo return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsSubscriptionEndpoints{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -962,8 +962,8 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpo return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -973,13 +973,13 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemSubscriptionEndpo return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsFilter { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsFilter{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -1002,8 +1002,8 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilter(ctx contex return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsFilterDomainsSubdomains{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1014,7 +1014,7 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubd return nil } for item_no := range objs { - i := expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1025,8 +1025,8 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubd return &request } -func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsFilterDomainsSubdomains{} +func expandRequestEventSubscriptionUpdateEventSubscriptionsV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEventSubscriptionsV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -1039,11 +1039,11 @@ func expandRequestEventSubscriptionUpdateEventSubscriptionsItemFilterDomainsSubd return &request } -func searchEventManagementGetEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetEventSubscriptionsQueryParams, name string, subscriptionID string) (*catalystcentersdkgo.ResponseEventManagementGetEventSubscriptions, error) { +func searchEventManagementGetEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetEventSubscriptionsV1QueryParams, name string, subscriptionID string) (*catalystcentersdkgo.ResponseEventManagementGetEventSubscriptionsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItems catalystcentersdkgo.ResponseEventManagementGetEventSubscriptions = []catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptions{} - var items *catalystcentersdkgo.ResponseEventManagementGetEventSubscriptions + var foundItems catalystcentersdkgo.ResponseEventManagementGetEventSubscriptionsV1 = []catalystcentersdkgo.ResponseItemEventManagementGetEventSubscriptionsV1{} + var items *catalystcentersdkgo.ResponseEventManagementGetEventSubscriptionsV1 items, _, err = client.EventManagement.GetEventSubscriptions(&queryParams) if err != nil { return nil, err diff --git a/catalystcenter/resource_event_subscription_email.go b/catalystcenter/resource_event_subscription_email.go index 47898a4..d416ef2 100644 --- a/catalystcenter/resource_event_subscription_email.go +++ b/catalystcenter/resource_event_subscription_email.go @@ -230,7 +230,7 @@ func resourceEventSubscriptionEmail() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestEventManagementCreateEmailEventSubscription`, + Description: `Array of RequestEventManagementCreateEmailEventSubscriptionV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -443,14 +443,14 @@ func resourceEventSubscriptionEmailCreate(ctx context.Context, d *schema.Resourc var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestEventSubscriptionEmailCreateEmailEventSubscription(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) vSubscriptionID := resourceItem["subscription_id"] vvSubscriptionID := interfaceToString(vSubscriptionID) - queryParamImport := catalystcentersdkgo.GetEmailEventSubscriptionsQueryParams{} + queryParamImport := catalystcentersdkgo.GetEmailEventSubscriptionsV1QueryParams{} queryParamImport.Name = vvName item2, err := searchEventManagementGetEmailEventSubscriptions(m, queryParamImport, vvSubscriptionID) if err == nil && item2 != nil { @@ -472,7 +472,7 @@ func resourceEventSubscriptionEmailCreate(ctx context.Context, d *schema.Resourc return diags } // TODO REVIEW - queryParamValidate := catalystcentersdkgo.GetEmailEventSubscriptionsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetEmailEventSubscriptionsV1QueryParams{} queryParamValidate.Name = vvName item3, err := searchEventManagementGetEmailEventSubscriptions(m, queryParamValidate, vvSubscriptionID) if err != nil || item3 == nil { @@ -501,18 +501,20 @@ func resourceEventSubscriptionEmailRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetEmailEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetEmailEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetEmailEventSubscriptionsV1QueryParams{} item1, err := searchEventManagementGetEmailEventSubscriptions(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } - items := []catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptions{ + items := []catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1{ *item1, } + var finalItem catalystcentersdkgo.ResponseEventManagementGetEmailEventSubscriptionsV1 + finalItem = items // Review flatten function used - vItem1 := flattenEventManagementGetEmailEventSubscriptionsItems2(&items) + vItem1 := flattenEventManagementGetEmailEventSubscriptionsV1Items(&finalItem) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetEmailEventSubscriptions search response", @@ -533,7 +535,7 @@ func resourceEventSubscriptionEmailUpdate(ctx context.Context, d *schema.Resourc vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestEventSubscriptionEmailUpdateEmailEventSubscription(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -575,9 +577,9 @@ func resourceEventSubscriptionEmailDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscription(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailEventSubscription { - request := catalystcentersdkgo.RequestEventManagementCreateEmailEventSubscription{} - if v := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateEmailEventSubscriptionV1 { + request := catalystcentersdkgo.RequestEventManagementCreateEmailEventSubscriptionV1{} + if v := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -586,8 +588,8 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscription(ctx context return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscription { - request := []catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscription{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1 { + request := []catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -598,7 +600,7 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemArray(ct return nil } for item_no := range objs { - i := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -609,8 +611,8 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemArray(ct return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscription { - request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscription{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1 { + request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -624,10 +626,10 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItem(ctx con request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -635,8 +637,8 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItem(ctx con return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -647,7 +649,7 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscrip return nil } for item_no := range objs { - i := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -658,13 +660,13 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscrip return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -672,8 +674,8 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscrip return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -698,13 +700,13 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemSubscrip return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionFilter { - request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionFilter{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -727,8 +729,8 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilter(c return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -739,7 +741,7 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDo return nil } for item_no := range objs { - i := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -750,8 +752,8 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDo return &request } -func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementCreateEmailEventSubscriptionV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -764,9 +766,9 @@ func expandRequestEventSubscriptionEmailCreateEmailEventSubscriptionItemFilterDo return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscription(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailEventSubscription { - request := catalystcentersdkgo.RequestEventManagementUpdateEmailEventSubscription{} - if v := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateEmailEventSubscriptionV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateEmailEventSubscriptionV1{} + if v := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -775,8 +777,8 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscription(ctx context return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscription { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscription{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1 { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -787,7 +789,7 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemArray(ct return nil } for item_no := range objs { - i := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -798,8 +800,8 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemArray(ct return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscription { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscription{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1 { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -813,10 +815,10 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItem(ctx con request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -824,8 +826,8 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItem(ctx con return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -836,7 +838,7 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscrip return nil } for item_no := range objs { - i := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -847,13 +849,13 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscrip return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -861,8 +863,8 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscrip return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -887,13 +889,13 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemSubscrip return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionFilter { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionFilter{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -916,8 +918,8 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilter(c return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -928,7 +930,7 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDo return nil } for item_no := range objs { - i := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -939,8 +941,8 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDo return &request } -func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementUpdateEmailEventSubscriptionV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -953,11 +955,11 @@ func expandRequestEventSubscriptionEmailUpdateEmailEventSubscriptionItemFilterDo return &request } -func searchEventManagementGetEmailEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetEmailEventSubscriptionsQueryParams, vID string) (*catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptions, error) { +func searchEventManagementGetEmailEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetEmailEventSubscriptionsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptions - var ite *catalystcentersdkgo.ResponseEventManagementGetEmailEventSubscriptions + var foundItem *catalystcentersdkgo.ResponseItemEventManagementGetEmailEventSubscriptionsV1 + var ite *catalystcentersdkgo.ResponseEventManagementGetEmailEventSubscriptionsV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.EventManagement.GetEmailEventSubscriptions(nil) diff --git a/catalystcenter/resource_event_subscription_rest.go b/catalystcenter/resource_event_subscription_rest.go index bf44cac..7846fc9 100644 --- a/catalystcenter/resource_event_subscription_rest.go +++ b/catalystcenter/resource_event_subscription_rest.go @@ -292,7 +292,7 @@ func resourceEventSubscriptionRest() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestEventManagementCreateRestWebhookEventSubscription`, + Description: `Array of RequestEventManagementCreateRestWebhookEventSubscriptionV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -470,13 +470,13 @@ func resourceEventSubscriptionRestCreate(ctx context.Context, d *schema.Resource var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscription(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1(ctx, "parameters.0", d) vName := resourceItem["name"] vvName := interfaceToString(vName) vSubscriptionID := resourceItem["subscription_id"] vvSubscriptionID := interfaceToString(vSubscriptionID) - queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetRestWebhookEventSubscriptions(m, queryParams1, vvName, vvSubscriptionID) if err == nil && (item != nil && len(*item) > 0) { resourceMap := make(map[string]string) @@ -519,7 +519,7 @@ func resourceEventSubscriptionRestRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetRestWebhookEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetRestWebhookEventSubscriptions(m, queryParams1, vName, vSubscriptionID) if err != nil { diags = append(diags, diagError( @@ -536,8 +536,9 @@ func resourceEventSubscriptionRestRead(ctx context.Context, d *schema.ResourceDa log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*item)) } - vItem1 := flattenEventManagementGetRestWebhookEventSubscriptionsItems(item) + vItem1 := flattenEventManagementGetRestWebhookEventSubscriptionsV1Items(item) if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( "Failure when setting GetRestWebhookEventSubscriptions search response", err)) @@ -558,7 +559,7 @@ func resourceEventSubscriptionRestUpdate(ctx context.Context, d *schema.Resource vName, _ := resourceMap["name"] vSubscriptionID, _ := resourceMap["subscription_id"] - queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetRestWebhookEventSubscriptions(m, queryParams1, vName, vSubscriptionID) if err != nil || item == nil || len(*item) <= 0 { diags = append(diags, diagErrorWithAlt( @@ -569,7 +570,7 @@ func resourceEventSubscriptionRestUpdate(ctx context.Context, d *schema.Resource // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { - request1 := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscription(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -612,7 +613,7 @@ func resourceEventSubscriptionRestDelete(ctx context.Context, d *schema.Resource vName, _ := resourceMap["name"] vSubscriptionID, _ := resourceMap["subscription_id"] - queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetRestWebhookEventSubscriptionsV1QueryParams{} item, err := searchEventManagementGetRestWebhookEventSubscriptions(m, queryParams1, vName, vSubscriptionID) if err != nil { diags = append(diags, diagErrorWithAlt( @@ -625,7 +626,7 @@ func resourceEventSubscriptionRestDelete(ctx context.Context, d *schema.Resource } // REVIEW: Add getAllItems and search function to get missing params - queryParams2 := catalystcentersdkgo.DeleteEventSubscriptionsQueryParams{} + queryParams2 := catalystcentersdkgo.DeleteEventSubscriptionsV1QueryParams{} if len(*item) > 0 { itemCopy := *item queryParams2.Subscriptions = itemCopy[0].SubscriptionID @@ -651,9 +652,9 @@ func resourceEventSubscriptionRestDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscription(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateRestWebhookEventSubscription { - request := catalystcentersdkgo.RequestEventManagementCreateRestWebhookEventSubscription{} - if v := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateRestWebhookEventSubscriptionV1 { + request := catalystcentersdkgo.RequestEventManagementCreateRestWebhookEventSubscriptionV1{} + if v := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -662,8 +663,8 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscription(ctx co return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscription { - request := []catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscription{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1 { + request := []catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -674,7 +675,7 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemArr return nil } for item_no := range objs { - i := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -685,8 +686,8 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemArr return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscription { - request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscription{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1 { + request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -700,10 +701,10 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItem(ct request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -711,8 +712,8 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItem(ct return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -723,7 +724,7 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSub return nil } for item_no := range objs { - i := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -734,13 +735,13 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSub return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -748,8 +749,8 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSub return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -759,13 +760,13 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemSub return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionFilter { - request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionFilter{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -788,8 +789,8 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFil return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -800,7 +801,7 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFil return nil } for item_no := range objs { - i := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -811,8 +812,8 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFil return &request } -func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementCreateRestWebhookEventSubscriptionV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -825,9 +826,9 @@ func expandRequestEventSubscriptionRestCreateRestWebhookEventSubscriptionItemFil return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscription(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateRestWebhookEventSubscription { - request := catalystcentersdkgo.RequestEventManagementUpdateRestWebhookEventSubscription{} - if v := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateRestWebhookEventSubscriptionV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateRestWebhookEventSubscriptionV1{} + if v := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -836,8 +837,8 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscription(ctx co return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscription { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscription{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1 { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -848,7 +849,7 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemArr return nil } for item_no := range objs { - i := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -859,8 +860,8 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemArr return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscription { - request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscription{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1 { + request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -874,10 +875,10 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItem(ct request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -885,8 +886,8 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItem(ct return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -897,7 +898,7 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSub return nil } for item_no := range objs { - i := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -908,13 +909,13 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSub return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -922,8 +923,8 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSub return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -933,13 +934,13 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemSub return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionFilter { - request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionFilter{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -962,8 +963,8 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFil return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -974,7 +975,7 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFil return nil } for item_no := range objs { - i := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -985,8 +986,8 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFil return &request } -func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementUpdateRestWebhookEventSubscriptionV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -999,11 +1000,11 @@ func expandRequestEventSubscriptionRestUpdateRestWebhookEventSubscriptionItemFil return &request } -func searchEventManagementGetRestWebhookEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetRestWebhookEventSubscriptionsQueryParams, name string, subscriptionID string) (*catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptions, error) { +func searchEventManagementGetRestWebhookEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetRestWebhookEventSubscriptionsV1QueryParams, name string, subscriptionID string) (*catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptionsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItems catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptions - var items *catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptions + var foundItems catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptionsV1 + var items *catalystcentersdkgo.ResponseEventManagementGetRestWebhookEventSubscriptionsV1 items, _, err = client.EventManagement.GetRestWebhookEventSubscriptions(&queryParams) if err != nil { return nil, err diff --git a/catalystcenter/resource_event_subscription_syslog.go b/catalystcenter/resource_event_subscription_syslog.go index 44509cd..57da853 100644 --- a/catalystcenter/resource_event_subscription_syslog.go +++ b/catalystcenter/resource_event_subscription_syslog.go @@ -256,7 +256,7 @@ func resourceEventSubscriptionSyslog() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestEventManagementCreateSyslogEventSubscription`, + Description: `Array of RequestEventManagementCreateSyslogEventSubscriptionV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -434,14 +434,14 @@ func resourceEventSubscriptionSyslogCreate(ctx context.Context, d *schema.Resour var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscription(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) vSubscriptionID := resourceItem["subscription_id"] vvSubscriptionID := interfaceToString(vSubscriptionID) - queryParamImport := catalystcentersdkgo.GetSyslogEventSubscriptionsQueryParams{} + queryParamImport := catalystcentersdkgo.GetSyslogEventSubscriptionsV1QueryParams{} queryParamImport.Name = vvName item2, err := searchEventManagementGetSyslogEventSubscriptions(m, queryParamImport, vvSubscriptionID) if err == nil && item2 != nil { @@ -463,7 +463,7 @@ func resourceEventSubscriptionSyslogCreate(ctx context.Context, d *schema.Resour return diags } // TODO REVIEW - queryParamValidate := catalystcentersdkgo.GetSyslogEventSubscriptionsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetSyslogEventSubscriptionsV1QueryParams{} queryParamValidate.Name = vvName item3, err := searchEventManagementGetSyslogEventSubscriptions(m, queryParamValidate, "") if err != nil || item3 == nil { @@ -493,18 +493,18 @@ func resourceEventSubscriptionSyslogRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetSyslogEventSubscriptions") - queryParams1 := catalystcentersdkgo.GetSyslogEventSubscriptionsQueryParams{} + queryParams1 := catalystcentersdkgo.GetSyslogEventSubscriptionsV1QueryParams{} queryParams1.Name = vName item1, err := searchEventManagementGetSyslogEventSubscriptions(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } - items := catalystcentersdkgo.ResponseEventManagementGetSyslogEventSubscriptions{ + items := catalystcentersdkgo.ResponseEventManagementGetSyslogEventSubscriptionsV1{ *item1, } // Review flatten function used - vItem1 := flattenEventManagementGetSyslogEventSubscriptionsItems(&items) + vItem1 := flattenEventManagementGetSyslogEventSubscriptionsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetSyslogEventSubscriptions search response", @@ -522,7 +522,7 @@ func resourceEventSubscriptionSyslogUpdate(ctx context.Context, d *schema.Resour var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscription(ctx, "parameters.0", d) + request1 := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.EventManagement.UpdateSyslogEventSubscription(request1) if err != nil || response1 == nil { @@ -555,9 +555,9 @@ func resourceEventSubscriptionSyslogDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscription(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSyslogEventSubscription { - request := catalystcentersdkgo.RequestEventManagementCreateSyslogEventSubscription{} - if v := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSyslogEventSubscriptionV1 { + request := catalystcentersdkgo.RequestEventManagementCreateSyslogEventSubscriptionV1{} + if v := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -566,8 +566,8 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscription(ctx conte return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscription { - request := []catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscription{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1 { + request := []catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -578,7 +578,7 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemArray( return nil } for item_no := range objs { - i := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -589,8 +589,8 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemArray( return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscription { - request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscription{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1 { + request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -604,10 +604,10 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItem(ctx c request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -615,8 +615,8 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItem(ctx c return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -627,7 +627,7 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscr return nil } for item_no := range objs { - i := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -638,13 +638,13 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscr return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -652,8 +652,8 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscr return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -663,13 +663,13 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemSubscr return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionFilter { - request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionFilter{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -692,8 +692,8 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilter return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -704,7 +704,7 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilter return nil } for item_no := range objs { - i := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -715,8 +715,8 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilter return &request } -func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementCreateSyslogEventSubscriptionV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -729,9 +729,9 @@ func expandRequestEventSubscriptionSyslogCreateSyslogEventSubscriptionItemFilter return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscription(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSyslogEventSubscription { - request := catalystcentersdkgo.RequestEventManagementUpdateSyslogEventSubscription{} - if v := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSyslogEventSubscriptionV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateSyslogEventSubscriptionV1{} + if v := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -740,8 +740,8 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscription(ctx conte return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscription { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscription{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1 { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -752,7 +752,7 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemArray( return nil } for item_no := range objs { - i := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -763,8 +763,8 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemArray( return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscription { - request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscription{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1 { + request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_id")))) { request.SubscriptionID = interfaceToString(v) } @@ -778,10 +778,10 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItem(ctx c request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_endpoints")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_endpoints")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_endpoints")))) { - request.SubscriptionEndpoints = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) + request.SubscriptionEndpoints = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx, key+".subscription_endpoints", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filter")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filter")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filter")))) { - request.Filter = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilter(ctx, key+".filter.0", d) + request.Filter = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemFilter(ctx, key+".filter.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -789,8 +789,8 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItem(ctx c return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionSubscriptionEndpoints { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemSubscriptionEndpointsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1SubscriptionEndpoints { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1SubscriptionEndpoints{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -801,7 +801,7 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscr return nil } for item_no := range objs { - i := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemSubscriptionEndpoints(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -812,13 +812,13 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscr return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionSubscriptionEndpoints { - request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionSubscriptionEndpoints{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemSubscriptionEndpoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1SubscriptionEndpoints { + request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1SubscriptionEndpoints{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".subscription_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".subscription_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".subscription_details")))) { - request.SubscriptionDetails = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) + request.SubscriptionDetails = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx, key+".subscription_details.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -826,8 +826,8 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscr return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionSubscriptionEndpointsSubscriptionDetails { - request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionSubscriptionEndpointsSubscriptionDetails{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemSubscriptionEndpointsSubscriptionDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails { + request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1SubscriptionEndpointsSubscriptionDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connector_type")))) { request.ConnectorType = interfaceToString(v) } @@ -837,13 +837,13 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemSubscr return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionFilter { - request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionFilter{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemFilter(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1Filter { + request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1Filter{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".event_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".event_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".event_ids")))) { request.EventIDs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains_subdomains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains_subdomains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains_subdomains")))) { - request.DomainsSubdomains = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) + request.DomainsSubdomains = expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx, key+".domains_subdomains", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".types")))) { request.Types = interfaceToSliceString(v) @@ -866,8 +866,8 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilter return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionFilterDomainsSubdomains { - request := []catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemFilterDomainsSubdomainsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1FilterDomainsSubdomains { + request := []catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1FilterDomainsSubdomains{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -878,7 +878,7 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilter return nil } for item_no := range objs { - i := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemFilterDomainsSubdomains(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -889,8 +889,8 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilter return &request } -func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionFilterDomainsSubdomains { - request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionFilterDomainsSubdomains{} +func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionV1ItemFilterDomainsSubdomains(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1FilterDomainsSubdomains { + request := catalystcentersdkgo.RequestItemEventManagementUpdateSyslogEventSubscriptionV1FilterDomainsSubdomains{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain")))) { request.Domain = interfaceToString(v) } @@ -903,11 +903,11 @@ func expandRequestEventSubscriptionSyslogUpdateSyslogEventSubscriptionItemFilter return &request } -func searchEventManagementGetSyslogEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetSyslogEventSubscriptionsQueryParams, vID string) (*catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptions, error) { +func searchEventManagementGetSyslogEventSubscriptions(m interface{}, queryParams catalystcentersdkgo.GetSyslogEventSubscriptionsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptions - var ite *catalystcentersdkgo.ResponseEventManagementGetSyslogEventSubscriptions + var foundItem *catalystcentersdkgo.ResponseItemEventManagementGetSyslogEventSubscriptionsV1 + var ite *catalystcentersdkgo.ResponseEventManagementGetSyslogEventSubscriptionsV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.EventManagement.GetSyslogEventSubscriptions(nil) diff --git a/catalystcenter/resource_event_syslog_config.go b/catalystcenter/resource_event_syslog_config.go index 6385647..21ac19a 100644 --- a/catalystcenter/resource_event_syslog_config.go +++ b/catalystcenter/resource_event_syslog_config.go @@ -174,12 +174,12 @@ func resourceEventSyslogConfigCreate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestEventSyslogConfigCreateSyslogDestination(ctx, "parameters.0", d) + request1 := expandRequestEventSyslogConfigCreateSyslogDestinationV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetSyslogDestinationQueryParams{} + queryParamImport := catalystcentersdkgo.GetSyslogDestinationV1QueryParams{} queryParamImport.Name = vvName item2, _, err := client.EventManagement.GetSyslogDestination(&queryParamImport) if err == nil && item2 != nil { @@ -219,7 +219,7 @@ func resourceEventSyslogConfigRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetSyslogDestination") - queryParams1 := catalystcentersdkgo.GetSyslogDestinationQueryParams{} + queryParams1 := catalystcentersdkgo.GetSyslogDestinationV1QueryParams{} queryParams1.Name = vName response1, restyResp1, err := client.EventManagement.GetSyslogDestination(&queryParams1) @@ -233,7 +233,7 @@ func resourceEventSyslogConfigRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenEventManagementGetSyslogDestinationItem(response1) + vItem1 := flattenEventManagementGetSyslogDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetSyslogDestination response", @@ -253,7 +253,7 @@ func resourceEventSyslogConfigUpdate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestEventSyslogConfigUpdateSyslogDestination(ctx, "parameters.0", d) + request1 := expandRequestEventSyslogConfigUpdateSyslogDestinationV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.EventManagement.UpdateSyslogDestination(request1) if err != nil || response1 == nil { @@ -286,8 +286,8 @@ func resourceEventSyslogConfigDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestEventSyslogConfigCreateSyslogDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSyslogDestination { - request := catalystcentersdkgo.RequestEventManagementCreateSyslogDestination{} +func expandRequestEventSyslogConfigCreateSyslogDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSyslogDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementCreateSyslogDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } @@ -312,8 +312,8 @@ func expandRequestEventSyslogConfigCreateSyslogDestination(ctx context.Context, return &request } -func expandRequestEventSyslogConfigUpdateSyslogDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSyslogDestination { - request := catalystcentersdkgo.RequestEventManagementUpdateSyslogDestination{} +func expandRequestEventSyslogConfigUpdateSyslogDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSyslogDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateSyslogDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } diff --git a/catalystcenter/resource_event_webhook_create.go b/catalystcenter/resource_event_webhook_create.go index 37ef8fd..021ba9a 100644 --- a/catalystcenter/resource_event_webhook_create.go +++ b/catalystcenter/resource_event_webhook_create.go @@ -180,31 +180,27 @@ func resourceEventWebhookCreateCreate(ctx context.Context, d *schema.ResourceDat client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestEventWebhookCreateCreateWebhookDestination(ctx, "parameters.0", d) + request1 := expandRequestEventWebhookCreateCreateWebhookDestinationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.EventManagement.CreateWebhookDestination(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.EventManagement.CreateWebhookDestinationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreateWebhookDestination", err)) + "Failure when executing CreateWebhookDestinationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenEventManagementCreateWebhookDestinationItem(response1) + vItem1 := flattenEventManagementCreateWebhookDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateWebhookDestination response", + "Failure when setting CreateWebhookDestinationV1 response", err)) return diags } @@ -226,8 +222,8 @@ func resourceEventWebhookCreateDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestEventWebhookCreateCreateWebhookDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateWebhookDestination { - request := catalystcentersdkgo.RequestEventManagementCreateWebhookDestination{} +func expandRequestEventWebhookCreateCreateWebhookDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".webhook_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".webhook_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".webhook_id")))) { request.WebhookID = interfaceToString(v) } @@ -247,7 +243,7 @@ func expandRequestEventWebhookCreateCreateWebhookDestination(ctx context.Context request.TrustCert = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".headers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".headers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".headers")))) { - request.Headers = expandRequestEventWebhookCreateCreateWebhookDestinationHeadersArray(ctx, key+".headers", d) + request.Headers = expandRequestEventWebhookCreateCreateWebhookDestinationV1HeadersArray(ctx, key+".headers", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_proxy_route")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_proxy_route")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_proxy_route")))) { request.IsProxyRoute = interfaceToBoolPtr(v) @@ -255,8 +251,8 @@ func expandRequestEventWebhookCreateCreateWebhookDestination(ctx context.Context return &request } -func expandRequestEventWebhookCreateCreateWebhookDestinationHeadersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationHeaders { - request := []catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationHeaders{} +func expandRequestEventWebhookCreateCreateWebhookDestinationV1HeadersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationV1Headers { + request := []catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationV1Headers{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -267,7 +263,7 @@ func expandRequestEventWebhookCreateCreateWebhookDestinationHeadersArray(ctx con return nil } for item_no := range objs { - i := expandRequestEventWebhookCreateCreateWebhookDestinationHeaders(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventWebhookCreateCreateWebhookDestinationV1Headers(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -275,8 +271,8 @@ func expandRequestEventWebhookCreateCreateWebhookDestinationHeadersArray(ctx con return &request } -func expandRequestEventWebhookCreateCreateWebhookDestinationHeaders(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationHeaders { - request := catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationHeaders{} +func expandRequestEventWebhookCreateCreateWebhookDestinationV1Headers(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationV1Headers { + request := catalystcentersdkgo.RequestEventManagementCreateWebhookDestinationV1Headers{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -292,12 +288,12 @@ func expandRequestEventWebhookCreateCreateWebhookDestinationHeaders(ctx context. return &request } -func flattenEventManagementCreateWebhookDestinationItem(item *catalystcentersdkgo.ResponseEventManagementCreateWebhookDestination) []map[string]interface{} { +func flattenEventManagementCreateWebhookDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementCreateWebhookDestinationV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["error_message"] = flattenEventManagementCreateWebhookDestinationItemErrorMessage(item.ErrorMessage) + respItem["error_message"] = flattenEventManagementCreateWebhookDestinationV1ItemErrorMessage(item.ErrorMessage) respItem["api_status"] = item.APIStatus respItem["status_message"] = item.StatusMessage return []map[string]interface{}{ @@ -305,7 +301,7 @@ func flattenEventManagementCreateWebhookDestinationItem(item *catalystcentersdkg } } -func flattenEventManagementCreateWebhookDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementCreateWebhookDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementCreateWebhookDestinationV1ItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementCreateWebhookDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_event_webhook_update.go b/catalystcenter/resource_event_webhook_update.go index ce2e0db..953f076 100644 --- a/catalystcenter/resource_event_webhook_update.go +++ b/catalystcenter/resource_event_webhook_update.go @@ -180,31 +180,27 @@ func resourceEventWebhookUpdateCreate(ctx context.Context, d *schema.ResourceDat client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestEventWebhookUpdateUpdateWebhookDestination(ctx, "parameters.0", d) + request1 := expandRequestEventWebhookUpdateUpdateWebhookDestinationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.EventManagement.UpdateWebhookDestination(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.EventManagement.UpdateWebhookDestinationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateWebhookDestination", err)) + "Failure when executing UpdateWebhookDestinationV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenEventManagementUpdateWebhookDestinationItem(response1) + vItem1 := flattenEventManagementUpdateWebhookDestinationV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateWebhookDestination response", + "Failure when setting UpdateWebhookDestinationV1 response", err)) return diags } @@ -226,8 +222,8 @@ func resourceEventWebhookUpdateDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestEventWebhookUpdateUpdateWebhookDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateWebhookDestination { - request := catalystcentersdkgo.RequestEventManagementUpdateWebhookDestination{} +func expandRequestEventWebhookUpdateUpdateWebhookDestinationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".webhook_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".webhook_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".webhook_id")))) { request.WebhookID = interfaceToString(v) } @@ -247,7 +243,7 @@ func expandRequestEventWebhookUpdateUpdateWebhookDestination(ctx context.Context request.TrustCert = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".headers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".headers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".headers")))) { - request.Headers = expandRequestEventWebhookUpdateUpdateWebhookDestinationHeadersArray(ctx, key+".headers", d) + request.Headers = expandRequestEventWebhookUpdateUpdateWebhookDestinationV1HeadersArray(ctx, key+".headers", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_proxy_route")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_proxy_route")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_proxy_route")))) { request.IsProxyRoute = interfaceToBoolPtr(v) @@ -255,8 +251,8 @@ func expandRequestEventWebhookUpdateUpdateWebhookDestination(ctx context.Context return &request } -func expandRequestEventWebhookUpdateUpdateWebhookDestinationHeadersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationHeaders { - request := []catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationHeaders{} +func expandRequestEventWebhookUpdateUpdateWebhookDestinationV1HeadersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationV1Headers { + request := []catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationV1Headers{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -267,7 +263,7 @@ func expandRequestEventWebhookUpdateUpdateWebhookDestinationHeadersArray(ctx con return nil } for item_no := range objs { - i := expandRequestEventWebhookUpdateUpdateWebhookDestinationHeaders(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestEventWebhookUpdateUpdateWebhookDestinationV1Headers(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -275,8 +271,8 @@ func expandRequestEventWebhookUpdateUpdateWebhookDestinationHeadersArray(ctx con return &request } -func expandRequestEventWebhookUpdateUpdateWebhookDestinationHeaders(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationHeaders { - request := catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationHeaders{} +func expandRequestEventWebhookUpdateUpdateWebhookDestinationV1Headers(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationV1Headers { + request := catalystcentersdkgo.RequestEventManagementUpdateWebhookDestinationV1Headers{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -292,12 +288,12 @@ func expandRequestEventWebhookUpdateUpdateWebhookDestinationHeaders(ctx context. return &request } -func flattenEventManagementUpdateWebhookDestinationItem(item *catalystcentersdkgo.ResponseEventManagementUpdateWebhookDestination) []map[string]interface{} { +func flattenEventManagementUpdateWebhookDestinationV1Item(item *catalystcentersdkgo.ResponseEventManagementUpdateWebhookDestinationV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["error_message"] = flattenEventManagementUpdateWebhookDestinationItemErrorMessage(item.ErrorMessage) + respItem["error_message"] = flattenEventManagementUpdateWebhookDestinationV1ItemErrorMessage(item.ErrorMessage) respItem["api_status"] = item.APIStatus respItem["status_message"] = item.StatusMessage return []map[string]interface{}{ @@ -305,7 +301,7 @@ func flattenEventManagementUpdateWebhookDestinationItem(item *catalystcentersdkg } } -func flattenEventManagementUpdateWebhookDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementUpdateWebhookDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementUpdateWebhookDestinationV1ItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementUpdateWebhookDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_execute_suggested_actions_commands.go b/catalystcenter/resource_execute_suggested_actions_commands.go index 6aafc9e..f9946bd 100644 --- a/catalystcenter/resource_execute_suggested_actions_commands.go +++ b/catalystcenter/resource_execute_suggested_actions_commands.go @@ -120,31 +120,27 @@ func resourceExecuteSuggestedActionsCommandsCreate(ctx context.Context, d *schem client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestExecuteSuggestedActionsCommandsExecuteSuggestedActionsCommands(ctx, "parameters.0", d) + request1 := expandRequestExecuteSuggestedActionsCommandsExecuteSuggestedActionsCommandsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Issues.ExecuteSuggestedActionsCommands(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Issues.ExecuteSuggestedActionsCommandsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExecuteSuggestedActionsCommands", err)) + "Failure when executing ExecuteSuggestedActionsCommandsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenIssuesExecuteSuggestedActionsCommandsItems(response1) + vItems1 := flattenIssuesExecuteSuggestedActionsCommandsV1Items(response1) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting ExecuteSuggestedActionsCommands response", + "Failure when setting ExecuteSuggestedActionsCommandsV1 response", err)) return diags } @@ -166,8 +162,8 @@ func resourceExecuteSuggestedActionsCommandsDelete(ctx context.Context, d *schem return diags } -func expandRequestExecuteSuggestedActionsCommandsExecuteSuggestedActionsCommands(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesExecuteSuggestedActionsCommands { - request := catalystcentersdkgo.RequestIssuesExecuteSuggestedActionsCommands{} +func expandRequestExecuteSuggestedActionsCommandsExecuteSuggestedActionsCommandsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesExecuteSuggestedActionsCommandsV1 { + request := catalystcentersdkgo.RequestIssuesExecuteSuggestedActionsCommandsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".entity_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".entity_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".entity_type")))) { request.EntityType = interfaceToString(v) } @@ -177,7 +173,7 @@ func expandRequestExecuteSuggestedActionsCommandsExecuteSuggestedActionsCommands return &request } -func flattenIssuesExecuteSuggestedActionsCommandsItems(items *catalystcentersdkgo.ResponseIssuesExecuteSuggestedActionsCommands) []map[string]interface{} { +func flattenIssuesExecuteSuggestedActionsCommandsV1Items(items *catalystcentersdkgo.ResponseIssuesExecuteSuggestedActionsCommandsV1) []map[string]interface{} { if items == nil { return nil } @@ -190,13 +186,13 @@ func flattenIssuesExecuteSuggestedActionsCommandsItems(items *catalystcentersdkg respItem["hostname"] = item.Hostname respItem["steps_description"] = item.StepsDescription respItem["command"] = item.Command - respItem["command_output"] = flattenIssuesExecuteSuggestedActionsCommandsItemsCommandOutput(item.CommandOutput) + respItem["command_output"] = flattenIssuesExecuteSuggestedActionsCommandsV1ItemsCommandOutput(item.CommandOutput) respItems = append(respItems, respItem) } return respItems } -func flattenIssuesExecuteSuggestedActionsCommandsItemsCommandOutput(item *catalystcentersdkgo.ResponseItemIssuesExecuteSuggestedActionsCommandsCommandOutput) interface{} { +func flattenIssuesExecuteSuggestedActionsCommandsV1ItemsCommandOutput(item *catalystcentersdkgo.ResponseItemIssuesExecuteSuggestedActionsCommandsV1CommandOutput) interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_file_import.go b/catalystcenter/resource_file_import.go index 7160df2..302e39d 100644 --- a/catalystcenter/resource_file_import.go +++ b/catalystcenter/resource_file_import.go @@ -56,6 +56,7 @@ func resourceFileImport() *schema.Resource { Description: `nameSpace path parameter.`, Type: schema.TypeString, Required: true, + ForceNew: true, }, }, }, diff --git a/catalystcenter/resource_flexible_report_execute.go b/catalystcenter/resource_flexible_report_execute.go index 6768bc8..e596b8e 100644 --- a/catalystcenter/resource_flexible_report_execute.go +++ b/catalystcenter/resource_flexible_report_execute.go @@ -52,12 +52,6 @@ func resourceFlexibleReportExecute() *schema.Resource { }, "execution_id": &schema.Schema{ Description: `Report ExecutionId (Unique UUID) -`, - Type: schema.TypeString, - Computed: true, - }, - "process_status": &schema.Schema{ - Description: `Report execution status `, Type: schema.TypeString, Computed: true, @@ -118,14 +112,16 @@ func resourceFlexibleReportExecuteCreate(ctx context.Context, d *schema.Resource vvReportID := vReportID.(string) - response1, restyResp1, err := client.Reports.ExecutingTheFlexibleReport(vvReportID) + // has_unknown_response: None + + response1, restyResp1, err := client.Reports.ExecutingTheFlexibleReportV1(vvReportID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExecutingTheFlexibleReport", err)) + "Failure when executing ExecutingTheFlexibleReportV1", err)) return diags } @@ -161,16 +157,15 @@ func resourceFlexibleReportExecuteCreate(ctx context.Context, d *schema.Resource if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing ExecutingTheFlexibleReport", err, - "Failure at ExecutingTheFlexibleReport execution", bapiError)) + "Failure when executing ExecutingTheFlexibleReportV1", err, + "Failure at ExecutingTheFlexibleReportV1 execution", bapiError)) return diags } } - - vItem1 := flattenReportsExecutingTheFlexibleReportItem(response1) + vItem1 := flattenReportsExecutingTheFlexibleReportV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ExecutingTheFlexibleReport response", + "Failure when setting ExecutingTheFlexibleReportV1 response", err)) return diags } @@ -192,7 +187,7 @@ func resourceFlexibleReportExecuteDelete(ctx context.Context, d *schema.Resource return diags } -func flattenReportsExecutingTheFlexibleReportItem(item *catalystcentersdkgo.ResponseReportsExecutingTheFlexibleReport) []map[string]interface{} { +func flattenReportsExecutingTheFlexibleReportV1Item(item *catalystcentersdkgo.ResponseReportsExecutingTheFlexibleReportV1) []map[string]interface{} { if item == nil { return nil } @@ -200,16 +195,15 @@ func flattenReportsExecutingTheFlexibleReportItem(item *catalystcentersdkgo.Resp respItem["execution_id"] = item.ExecutionID respItem["start_time"] = item.StartTime respItem["end_time"] = item.EndTime - respItem["process_status"] = item.ProcessStatus respItem["request_status"] = item.RequestStatus respItem["errors"] = item.Errors - respItem["warnings"] = flattenReportsExecutingTheFlexibleReportItemWarnings(item.Warnings) + respItem["warnings"] = flattenReportsExecutingTheFlexibleReportV1ItemWarnings(item.Warnings) return []map[string]interface{}{ respItem, } } -func flattenReportsExecutingTheFlexibleReportItemWarnings(items *[]catalystcentersdkgo.ResponseReportsExecutingTheFlexibleReportWarnings) []interface{} { +func flattenReportsExecutingTheFlexibleReportV1ItemWarnings(items *[]catalystcentersdkgo.ResponseReportsExecutingTheFlexibleReportV1Warnings) []interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_flexible_report_schedule.go b/catalystcenter/resource_flexible_report_schedule.go index 3cd46fa..ce184ff 100644 --- a/catalystcenter/resource_flexible_report_schedule.go +++ b/catalystcenter/resource_flexible_report_schedule.go @@ -126,7 +126,7 @@ func resourceFlexibleReportScheduleUpdate(ctx context.Context, d *schema.Resourc vvReportID := resourceMap["report_id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvReportID) - request1 := expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReport(ctx, "parameters.0", d) + request1 := expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReportV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Reports.UpdateScheduleOfFlexibleReport(vvReportID, request1) if err != nil || response1 == nil { @@ -158,17 +158,17 @@ func resourceFlexibleReportScheduleDelete(ctx context.Context, d *schema.Resourc "Failure at FlexibleReportScheduleDelete, unexpected response", "")) return diags } -func expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReport(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReport { - request := catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReport{} - request.Schedule = expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReportSchedule(ctx, key, d) +func expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReportV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReportV1 { + request := catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReportV1{} + request.Schedule = expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReportV1Schedule(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReportSchedule(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReportSchedule { - var request catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReportSchedule +func expandRequestFlexibleReportScheduleUpdateScheduleOfFlexibleReportV1Schedule(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReportV1Schedule { + var request catalystcentersdkgo.RequestReportsUpdateScheduleOfFlexibleReportV1Schedule request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil diff --git a/catalystcenter/resource_floor.go b/catalystcenter/resource_floor.go index eb4b617..2cee9f6 100644 --- a/catalystcenter/resource_floor.go +++ b/catalystcenter/resource_floor.go @@ -262,7 +262,7 @@ func resourceFloorCreate(ctx context.Context, d *schema.ResourceData, m interfac newPathName := []string{"Global", newName} newName = strings.Join(newPathName, "/") } - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams1.Name = newName queryParams1.SiteID = vvSiteID log.Printf("[DEBUG] newName => %s", newName) @@ -274,7 +274,7 @@ func resourceFloorCreate(ctx context.Context, d *schema.ResourceData, m interfac d.SetId(joinResourceID(resourceMap)) return resourceFloorRead(ctx, d, m) } - headers := catalystcentersdkgo.CreateSiteHeaderParams{} + headers := catalystcentersdkgo.CreateSiteV1HeaderParams{} headers.Persistbapioutput = "false" headers.Runsync = "false" /*if okTimeout { @@ -331,7 +331,7 @@ func resourceFloorCreate(ctx context.Context, d *schema.ResourceData, m interfac return diags } } - queryParams2 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams2 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams2.Name = newName // queryParams2.SiteID = vvSiteID item2, err := searchSitesGetSite(m, queryParams2) @@ -360,7 +360,7 @@ func resourceFloorRead(ctx context.Context, d *schema.ResourceData, m interface{ selectedMethod := 1 if selectedMethod == 1 { - queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} queryParams1.Name = vName // queryParams1.SiteID = vSiteID log.Printf("[DEBUG] Read name => %s", queryParams1.Name) @@ -375,7 +375,7 @@ func resourceFloorRead(ctx context.Context, d *schema.ResourceData, m interface{ return diags } parameters := d.Get("parameters").([]interface{}) - vItem1 := flattenSitesGetFloorItems(response1.Response) + vItem1 := flattenSitesGetFloorParams(response1.Response, parameters) log.Printf("[DEBUG] response flatten sent => %v", responseInterfaceToString(vItem1)) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -411,7 +411,7 @@ func resourceFloorUpdate(ctx context.Context, d *schema.ResourceData, m interfac if d.HasChange("parameters") { request1 := expandRequestSiteUpdateFloor(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - headers := catalystcentersdkgo.UpdateSiteHeaderParams{} + headers := catalystcentersdkgo.UpdateSiteV1HeaderParams{} headers.Persistbapioutput = "false" headers.Runsync = "false" /*if vTimeout != "" { @@ -447,8 +447,8 @@ func resourceFloorUpdate(ctx context.Context, d *schema.ResourceData, m interfac } // GetOkExists(fixKeyAccess(key + ".type")) now is GetOkExists(fixKeyAccess("floor.type")) -func expandRequestSiteUpdateFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSite { - request := catalystcentersdkgo.RequestSitesUpdateSite{} +func expandRequestSiteUpdateFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1 { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess("floor.type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess("floor.type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess("floor.type")))) { request.Type = interfaceToString(v) } @@ -464,8 +464,8 @@ func expandRequestSiteUpdateFloor(ctx context.Context, key string, d *schema.Res return &request } -func expandRequestSiteUpdateFloorFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteSite { - request := catalystcentersdkgo.RequestSitesUpdateSiteSite{} +func expandRequestSiteUpdateFloorFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1Site { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1Site{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".floor")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".floor")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".floor")))) { request.Floor = expandRequestSiteUpdateSiteSiteFloor(ctx, key+".floor.0", d) } @@ -476,8 +476,8 @@ func expandRequestSiteUpdateFloorFloor(ctx context.Context, key string, d *schem } // fixKeyAccess(key + ".type") now is fixKeyAccess("area.type") -func expandRequestSiteCreateFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSite { - request := catalystcentersdkgo.RequestSitesCreateSite{} +func expandRequestSiteCreateFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1 { + request := catalystcentersdkgo.RequestSitesCreateSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess("floor.type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess("floor.type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess("floor.type")))) { request.Type = interfaceToString(v) } @@ -493,8 +493,8 @@ func expandRequestSiteCreateFloor(ctx context.Context, key string, d *schema.Res return &request } -func expandRequestSiteCreateFloorFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteSite { - request := catalystcentersdkgo.RequestSitesCreateSiteSite{} +func expandRequestSiteCreateFloorFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1Site { + request := catalystcentersdkgo.RequestSitesCreateSiteV1Site{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".floor")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".floor")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".floor")))) { request.Floor = expandRequestSiteCreateSiteSiteFloor(ctx, key+".floor.0", d) } @@ -504,8 +504,8 @@ func expandRequestSiteCreateFloorFloor(ctx context.Context, key string, d *schem return &request } -func expandRequestSiteCreateSiteSiteFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteSiteFloor { - request := catalystcentersdkgo.RequestSitesCreateSiteSiteFloor{} +func expandRequestSiteCreateSiteSiteFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesCreateSiteV1SiteFloor { + request := catalystcentersdkgo.RequestSitesCreateSiteV1SiteFloor{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -533,8 +533,8 @@ func expandRequestSiteCreateSiteSiteFloor(ctx context.Context, key string, d *sc return &request } -func expandRequestSiteUpdateSiteSiteFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteSiteFloor { - request := catalystcentersdkgo.RequestSitesUpdateSiteSiteFloor{} +func expandRequestSiteUpdateSiteSiteFloor(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesUpdateSiteV1SiteFloor { + request := catalystcentersdkgo.RequestSitesUpdateSiteV1SiteFloor{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -566,7 +566,7 @@ func resourceFloorDelete(ctx context.Context, d *schema.ResourceData, m interfac resourceMap := separateResourceID(resourceID) vSiteID := resourceMap["site_id"] // time.Sleep(1 * time.Minute) - // queryParams1 := catalystcentersdkgo.GetSiteQueryParams{} + // queryParams1 := catalystcentersdkgo.GetSiteV1QueryParams{} // queryParams1.Name = vName // queryParams1.SiteID = vSiteID // item, err := searchSitesGetSite(m, queryParams1) diff --git a/catalystcenter/resource_floors_settings.go b/catalystcenter/resource_floors_settings_v2.go similarity index 82% rename from catalystcenter/resource_floors_settings.go rename to catalystcenter/resource_floors_settings_v2.go index fe4b3d5..60456fe 100644 --- a/catalystcenter/resource_floors_settings.go +++ b/catalystcenter/resource_floors_settings_v2.go @@ -14,17 +14,17 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceFloorsSettings() *schema.Resource { +func resourceFloorsSettingsV2() *schema.Resource { return &schema.Resource{ Description: `It manages create, read, update and delete operations on Site Design. - Updates UI user preference for floor unit system. Unit sytem change will effect for all floors across all sites. `, - CreateContext: resourceFloorsSettingsCreate, - ReadContext: resourceFloorsSettingsRead, - UpdateContext: resourceFloorsSettingsUpdate, - DeleteContext: resourceFloorsSettingsDelete, + CreateContext: resourceFloorsSettingsV2Create, + ReadContext: resourceFloorsSettingsV2Read, + UpdateContext: resourceFloorsSettingsV2Update, + DeleteContext: resourceFloorsSettingsV2Delete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -70,13 +70,13 @@ func resourceFloorsSettings() *schema.Resource { } } -func resourceFloorsSettingsCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsSettingsV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { var diags diag.Diagnostics return diags } -func resourceFloorsSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsSettingsV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -97,7 +97,7 @@ func resourceFloorsSettingsRead(ctx context.Context, d *schema.ResourceData, m i log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetFloorSettingsItem(response1.Response) + vItem1 := flattenSiteDesignGetFloorSettingsV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetFloorSettings response", @@ -111,13 +111,13 @@ func resourceFloorsSettingsRead(ctx context.Context, d *schema.ResourceData, m i return diags } -func resourceFloorsSettingsUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsSettingsV2Update(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestFloorsSettingsUpdatesFloorSettings(ctx, "parameters.0", d) + request1 := expandRequestFloorsSettingsUpdatesFloorSettingsV2(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.SiteDesign.UpdatesFloorSettings(request1) if err != nil || response1 == nil { @@ -165,10 +165,10 @@ func resourceFloorsSettingsUpdate(ctx context.Context, d *schema.ResourceData, m } - return resourceFloorsSettingsRead(ctx, d, m) + return resourceFloorsSettingsV2Read(ctx, d, m) } -func resourceFloorsSettingsDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsSettingsV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { var diags diag.Diagnostics err := errors.New("Delete not possible in this resource") diags = append(diags, diagErrorWithAltAndResponse( @@ -176,8 +176,8 @@ func resourceFloorsSettingsDelete(ctx context.Context, d *schema.ResourceData, m "Failure at FloorsSettingsDelete, unexpected response", "")) return diags } -func expandRequestFloorsSettingsUpdatesFloorSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignUpdatesFloorSettings { - request := catalystcentersdkgo.RequestSiteDesignUpdatesFloorSettings{} +func expandRequestFloorsSettingsUpdatesFloorSettingsV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignUpdatesFloorSettingsV2 { + request := catalystcentersdkgo.RequestSiteDesignUpdatesFloorSettingsV2{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".units_of_measure")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".units_of_measure")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".units_of_measure")))) { request.UnitsOfMeasure = interfaceToString(v) } diff --git a/catalystcenter/resource_floors_upload_image.go b/catalystcenter/resource_floors_upload_image_v2.go similarity index 64% rename from catalystcenter/resource_floors_upload_image.go rename to catalystcenter/resource_floors_upload_image_v2.go index bfc5397..852c249 100644 --- a/catalystcenter/resource_floors_upload_image.go +++ b/catalystcenter/resource_floors_upload_image_v2.go @@ -3,6 +3,8 @@ package catalystcenter import ( "context" + "log" + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -10,16 +12,16 @@ import ( ) // resourceAction -func resourceFloorsUploadImage() *schema.Resource { +func resourceFloorsUploadImageV2() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Site Design. - Uploads floor image. `, - CreateContext: resourceFloorsUploadImageCreate, - ReadContext: resourceFloorsUploadImageRead, - DeleteContext: resourceFloorsUploadImageDelete, + CreateContext: resourceFloorsUploadImageV2Create, + ReadContext: resourceFloorsUploadImageV2Read, + DeleteContext: resourceFloorsUploadImageV2Delete, Schema: map[string]*schema.Schema{ "last_updated": &schema.Schema{ Type: schema.TypeString, @@ -51,7 +53,7 @@ func resourceFloorsUploadImage() *schema.Resource { } } -func resourceFloorsUploadImageCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsUploadImageV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -61,26 +63,36 @@ func resourceFloorsUploadImageCreate(ctx context.Context, d *schema.ResourceData vvID := vID.(string) - response1, err := client.SiteDesign.UploadsFloorImage(vvID) - if err = d.Set("item", response1.String()); err != nil { + // has_unknown_response: True + + response1, err := client.SiteDesign.UploadsFloorImageV2(vvID) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { diags = append(diags, diagError( - "Failure when setting UploadsFloorImage response", + "Failure when setting UploadsFloorImageV2 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - //Analizar verificacion. - } -func resourceFloorsUploadImageRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsUploadImageV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics return diags } -func resourceFloorsUploadImageDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceFloorsUploadImageV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics diff --git a/catalystcenter/resource_global_credential_cli.go b/catalystcenter/resource_global_credential_cli.go index 709d263..3ec6da9 100644 --- a/catalystcenter/resource_global_credential_cli.go +++ b/catalystcenter/resource_global_credential_cli.go @@ -106,7 +106,7 @@ func resourceGlobalCredentialCli() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateCLICredentials`, + Description: `Array of RequestDiscoveryCreateCliCredentialsV1`, Type: schema.TypeList, MaxItems: 1, MinItems: 1, @@ -171,7 +171,7 @@ func resourceGlobalCredentialCliCreate(ctx context.Context, d *schema.ResourceDa vvUsername := interfaceToString(vUsername) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "CLI" item, err := searchDiscoveryGetGlobalCredentialsCli(m, queryParams1, vvUsername, vvID) @@ -237,7 +237,7 @@ func resourceGlobalCredentialCliRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -256,10 +256,10 @@ func resourceGlobalCredentialCliRead(ctx context.Context, d *schema.ResourceData log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -282,7 +282,7 @@ func resourceGlobalCredentialCliUpdate(ctx context.Context, d *schema.ResourceDa vUsername := resourceMap["username"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType response1, err := searchDiscoveryGetGlobalCredentialsCli(m, queryParams1, vUsername, vID) if err != nil || response1 == nil { @@ -356,7 +356,7 @@ func resourceGlobalCredentialCliDelete(ctx context.Context, d *schema.ResourceDa vID := resourceMap["id"] vUsername := resourceMap["username"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "CLI" item, err := searchDiscoveryGetGlobalCredentialsCli(m, queryParams1, vUsername, vID) @@ -380,8 +380,8 @@ func resourceGlobalCredentialCliDelete(ctx context.Context, d *schema.ResourceDa } return diags } -func expandRequestGlobalCredentialCliCreateCliCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateCliCredentials { - request := catalystcentersdkgo.RequestDiscoveryCreateCliCredentials{} +func expandRequestGlobalCredentialCliCreateCliCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateCliCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateCliCredentialsV1{} if v := expandRequestGlobalCredentialCliCreateCliCredentialsItemArray(ctx, key, d); v != nil { request = *v } @@ -392,8 +392,8 @@ func expandRequestGlobalCredentialCliCreateCliCredentials(ctx context.Context, k return &request } -func expandRequestGlobalCredentialCliCreateCliCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentials { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentials{} +func expandRequestGlobalCredentialCliCreateCliCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentialsV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentialsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -416,8 +416,8 @@ func expandRequestGlobalCredentialCliCreateCliCredentialsItemArray(ctx context.C return &request } -func expandRequestGlobalCredentialCliCreateCliCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentials { - request := catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentials{} +func expandRequestGlobalCredentialCliCreateCliCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentialsV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateCliCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -452,8 +452,8 @@ func expandRequestGlobalCredentialCliCreateCliCredentialsItem(ctx context.Contex return &request } -func expandRequestGlobalCredentialCliUpdateCliCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateCliCredentials { - request := catalystcentersdkgo.RequestDiscoveryUpdateCliCredentials{} +func expandRequestGlobalCredentialCliUpdateCliCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateCliCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateCliCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -488,11 +488,11 @@ func expandRequestGlobalCredentialCliUpdateCliCredentials(ctx context.Context, k return &request } -func searchDiscoveryGetGlobalCredentialsCli(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsCli(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "CLI" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -506,7 +506,7 @@ func searchDiscoveryGetGlobalCredentialsCli(m interface{}, queryParams catalystc for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID || item.Username == vUsername { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_delete.go b/catalystcenter/resource_global_credential_delete.go index 83cceda..c619e67 100644 --- a/catalystcenter/resource_global_credential_delete.go +++ b/catalystcenter/resource_global_credential_delete.go @@ -80,14 +80,16 @@ func resourceGlobalCredentialDeleteCreate(ctx context.Context, d *schema.Resourc vvGlobalCredentialID := vGlobalCredentialID.(string) - response1, restyResp1, err := client.Discovery.DeleteGlobalCredentialsByID(vvGlobalCredentialID) + // has_unknown_response: None + + response1, restyResp1, err := client.Discovery.DeleteGlobalCredentialsByIDV1(vvGlobalCredentialID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeleteGlobalCredentialsByID", err)) + "Failure when executing DeleteGlobalCredentialsByIDV1", err)) return diags } @@ -95,7 +97,7 @@ func resourceGlobalCredentialDeleteCreate(ctx context.Context, d *schema.Resourc if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing DeleteGlobalCredentialsById", err)) + "Failure when executing DeleteGlobalCredentialsByIdV1", err)) return diags } taskId := response1.Response.TaskID @@ -129,22 +131,20 @@ func resourceGlobalCredentialDeleteCreate(ctx context.Context, d *schema.Resourc } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing DeleteGlobalCredentialsById", err1)) + "Failure when executing DeleteGlobalCredentialsByIdV1", err1)) return diags } } - - vItem1 := flattenDiscoveryDeleteGlobalCredentialsByIDItem(response1.Response) + vItem1 := flattenDiscoveryDeleteGlobalCredentialsByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeleteGlobalCredentialsByID response", + "Failure when setting DeleteGlobalCredentialsByIDV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceGlobalCredentialDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -159,7 +159,7 @@ func resourceGlobalCredentialDeleteDelete(ctx context.Context, d *schema.Resourc return diags } -func flattenDiscoveryDeleteGlobalCredentialsByIDItem(item *catalystcentersdkgo.ResponseDiscoveryDeleteGlobalCredentialsByIDResponse) []map[string]interface{} { +func flattenDiscoveryDeleteGlobalCredentialsByIDV1Item(item *catalystcentersdkgo.ResponseDiscoveryDeleteGlobalCredentialsByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_global_credential_http_read.go b/catalystcenter/resource_global_credential_http_read.go index bbeb67f..8367bdd 100644 --- a/catalystcenter/resource_global_credential_http_read.go +++ b/catalystcenter/resource_global_credential_http_read.go @@ -100,7 +100,7 @@ func resourceGlobalCredentialHTTPRead() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateHTTPReadCredentials`, + Description: `Array of RequestDiscoveryCreateHTTPReadCredentialsV1`, Type: schema.TypeList, MaxItems: 1, MinItems: 1, @@ -171,7 +171,7 @@ func resourceGlobalCredentialHTTPReadCreate(ctx context.Context, d *schema.Resou vvUsername := interfaceToString(vUsername) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "HTTP_READ" item, err := searchDiscoveryGetGlobalCredentialsHttpRead(m, queryParams1, vvUsername, vvID) @@ -237,7 +237,7 @@ func resourceGlobalCredentialHTTPReadRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -256,10 +256,10 @@ func resourceGlobalCredentialHTTPReadRead(ctx context.Context, d *schema.Resourc log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -282,7 +282,7 @@ func resourceGlobalCredentialHTTPReadUpdate(ctx context.Context, d *schema.Resou vUsername := resourceMap["username"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType response1, err := searchDiscoveryGetGlobalCredentialsHttpRead(m, queryParams1, vUsername, vID) if err != nil || response1 == nil { @@ -354,7 +354,7 @@ func resourceGlobalCredentialHTTPReadDelete(ctx context.Context, d *schema.Resou vID := resourceMap["id"] vUsername := resourceMap["username"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "HTTP_READ" item, err := searchDiscoveryGetGlobalCredentialsHttpRead(m, queryParams1, vUsername, vID) @@ -378,8 +378,8 @@ func resourceGlobalCredentialHTTPReadDelete(ctx context.Context, d *schema.Resou } return diags } -func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateHTTPReadCredentials { - request := catalystcentersdkgo.RequestDiscoveryCreateHTTPReadCredentials{} +func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateHTTPReadCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateHTTPReadCredentialsV1{} if v := expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItemArray(ctx, key+".", d); v != nil { request = *v } @@ -390,8 +390,8 @@ func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentials(ctx context. return &request } -func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentials { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentials{} +func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentialsV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentialsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -414,8 +414,8 @@ func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItemArray(ctx return &request } -func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentials { - request := catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentials{} +func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentialsV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateHTTPReadCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -453,8 +453,8 @@ func expandRequestGlobalCredentialHTTPReadCreateHTTPReadCredentialsItem(ctx cont return &request } -func expandRequestGlobalCredentialHTTPReadUpdateHTTPReadCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateHTTPReadCredential { - request := catalystcentersdkgo.RequestDiscoveryUpdateHTTPReadCredential{} +func expandRequestGlobalCredentialHTTPReadUpdateHTTPReadCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateHTTPReadCredentialV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateHTTPReadCredentialV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -492,11 +492,11 @@ func expandRequestGlobalCredentialHTTPReadUpdateHTTPReadCredential(ctx context.C return &request } -func searchDiscoveryGetGlobalCredentialsHttpRead(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsHttpRead(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "HTTP_READ" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -510,7 +510,7 @@ func searchDiscoveryGetGlobalCredentialsHttpRead(m interface{}, queryParams cata for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID || item.Username == vUsername { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_http_write.go b/catalystcenter/resource_global_credential_http_write.go index 34b999c..211cc57 100644 --- a/catalystcenter/resource_global_credential_http_write.go +++ b/catalystcenter/resource_global_credential_http_write.go @@ -170,7 +170,7 @@ func resourceGlobalCredentialHTTPWriteCreate(ctx context.Context, d *schema.Reso vvUsername := interfaceToString(vUsername) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "HTTP_WRITE" item, err := searchDiscoveryGetGlobalCredentialsHttpWrite(m, queryParams1, vvUsername, vvID) @@ -236,7 +236,7 @@ func resourceGlobalCredentialHTTPWriteRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -256,10 +256,10 @@ func resourceGlobalCredentialHTTPWriteRead(ctx context.Context, d *schema.Resour //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -282,7 +282,7 @@ func resourceGlobalCredentialHTTPWriteUpdate(ctx context.Context, d *schema.Reso vUsername := resourceMap["username"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType response1, err := searchDiscoveryGetGlobalCredentialsHttpWrite(m, queryParams1, vUsername, vID) if err != nil || response1 == nil { @@ -354,7 +354,7 @@ func resourceGlobalCredentialHTTPWriteDelete(ctx context.Context, d *schema.Reso vID := resourceMap["id"] vUsername := resourceMap["username"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "HTTP_WRITE" item, err := searchDiscoveryGetGlobalCredentialsHttpWrite(m, queryParams1, vUsername, vID) @@ -379,8 +379,8 @@ func resourceGlobalCredentialHTTPWriteDelete(ctx context.Context, d *schema.Reso return diags } -func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateHTTPWriteCredentials { - request := catalystcentersdkgo.RequestDiscoveryCreateHTTPWriteCredentials{} +func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateHTTPWriteCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateHTTPWriteCredentialsV1{} if v := expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItemArray(ctx, key, d); v != nil { request = *v } @@ -391,8 +391,8 @@ func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentials(ctx contex return &request } -func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentials { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentials{} +func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentialsV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentialsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -415,8 +415,8 @@ func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItemArray(c return &request } -func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentials { - request := catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentials{} +func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentialsV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateHTTPWriteCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -454,8 +454,8 @@ func expandRequestHTTPWriteCredentialCreateCreateHTTPWriteCredentialsItem(ctx co return &request } -func expandRequestHTTPWriteCredentialUpdateUpdateHTTPWriteCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateHTTPWriteCredentials { - request := catalystcentersdkgo.RequestDiscoveryUpdateHTTPWriteCredentials{} +func expandRequestHTTPWriteCredentialUpdateUpdateHTTPWriteCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateHTTPWriteCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateHTTPWriteCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -493,11 +493,11 @@ func expandRequestHTTPWriteCredentialUpdateUpdateHTTPWriteCredentials(ctx contex return &request } -func searchDiscoveryGetGlobalCredentialsHttpWrite(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsHttpWrite(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "HTTP_WRITE" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -511,7 +511,7 @@ func searchDiscoveryGetGlobalCredentialsHttpWrite(m interface{}, queryParams cat for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID || item.Username == vUsername { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_netconf.go b/catalystcenter/resource_global_credential_netconf.go index a6d1b02..856489a 100644 --- a/catalystcenter/resource_global_credential_netconf.go +++ b/catalystcenter/resource_global_credential_netconf.go @@ -113,7 +113,7 @@ func resourceGlobalCredentialNetconf() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateNetconfCredentials`, + Description: `Array of RequestDiscoveryCreateNetconfCredentialsV1`, Type: schema.TypeList, MaxItems: 1, MinItems: 1, @@ -169,7 +169,7 @@ func resourceGlobalCredentialNetconfCreate(ctx context.Context, d *schema.Resour vvNetconfPort := interfaceToString(vNetconfPort) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "NETCONF" item, err := searchDiscoveryGetGlobalCredentialsNetConf(m, queryParams1, vvNetconfPort, vvID) @@ -235,7 +235,7 @@ func resourceGlobalCredentialNetconfRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -255,10 +255,10 @@ func resourceGlobalCredentialNetconfRead(ctx context.Context, d *schema.Resource //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -280,7 +280,7 @@ func resourceGlobalCredentialNetconfUpdate(ctx context.Context, d *schema.Resour vNetconfPort := resourceMap["netconf_port"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "NETCONF" item, err := searchDiscoveryGetGlobalCredentialsNetConf(m, queryParams1, vNetconfPort, vID) @@ -354,7 +354,7 @@ func resourceGlobalCredentialNetconfDelete(ctx context.Context, d *schema.Resour vID := resourceMap["id"] vNetconfPort := resourceMap["netconf_port"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "NETCONF" item, err := searchDiscoveryGetGlobalCredentialsNetConf(m, queryParams1, vNetconfPort, vID) @@ -376,8 +376,8 @@ func resourceGlobalCredentialNetconfDelete(ctx context.Context, d *schema.Resour } return diags } -func expandRequestGlobalCredentialNetconfCreateNetconfCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateNetconfCredentials { - request := catalystcentersdkgo.RequestDiscoveryCreateNetconfCredentials{} +func expandRequestGlobalCredentialNetconfCreateNetconfCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateNetconfCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateNetconfCredentialsV1{} if v := expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItemArray(ctx, key, d); v != nil { request = *v } @@ -388,8 +388,8 @@ func expandRequestGlobalCredentialNetconfCreateNetconfCredentials(ctx context.Co return &request } -func expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentials { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentials{} +func expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentialsV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentialsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -412,8 +412,8 @@ func expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItemArray(ctx c return &request } -func expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentials { - request := catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentials{} +func expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentialsV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateNetconfCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -442,8 +442,8 @@ func expandRequestGlobalCredentialNetconfCreateNetconfCredentialsItem(ctx contex return &request } -func expandRequestGlobalCredentialNetconfUpdateNetconfCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateNetconfCredentials { - request := catalystcentersdkgo.RequestDiscoveryUpdateNetconfCredentials{} +func expandRequestGlobalCredentialNetconfUpdateNetconfCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateNetconfCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateNetconfCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -472,11 +472,11 @@ func expandRequestGlobalCredentialNetconfUpdateNetconfCredentials(ctx context.Co return &request } -func searchDiscoveryGetGlobalCredentialsNetConf(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vNetconfPort string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsNetConf(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vNetconfPort string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "NETCONF" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -490,7 +490,7 @@ func searchDiscoveryGetGlobalCredentialsNetConf(m interface{}, queryParams catal for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID || item.NetconfPort == vNetconfPort { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_snmpv2_read_community.go b/catalystcenter/resource_global_credential_snmpv2_read_community.go index c34bed9..e9de481 100644 --- a/catalystcenter/resource_global_credential_snmpv2_read_community.go +++ b/catalystcenter/resource_global_credential_snmpv2_read_community.go @@ -115,7 +115,7 @@ func resourceGlobalCredentialSNMPv2ReadCommunity() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateSNMPReadCommunity`, + Description: `Array of RequestDiscoveryCreateSNMPReadCommunityV1`, Type: schema.TypeList, Required: true, MaxItems: 1, @@ -176,7 +176,7 @@ func resourceGlobalCredentialSNMPv2ReadCommunityCreate(ctx context.Context, d *s vvReadCommunity := interfaceToString(vReadCommunity) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} // resourceID := d.Id() // if resourceID != "" { // log.Printf("[DEBUG] ResourceID => %s", resourceID) @@ -249,7 +249,7 @@ func resourceGlobalCredentialSNMPv2ReadCommunityRead(ctx context.Context, d *sch selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -269,10 +269,10 @@ func resourceGlobalCredentialSNMPv2ReadCommunityRead(ctx context.Context, d *sch //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -294,7 +294,7 @@ func resourceGlobalCredentialSNMPv2ReadCommunityUpdate(ctx context.Context, d *s vCredentialSubType := "SNMPV2_READ_COMMUNITY" vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType item, err := searchDiscoveryGetGlobalCredentialsSmpv2Read(m, queryParams1, vID) if err != nil || item == nil { @@ -366,7 +366,7 @@ func resourceGlobalCredentialSNMPv2ReadCommunityDelete(ctx context.Context, d *s resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "SNMPV2_READ_COMMUNITY" item, err := searchDiscoveryGetGlobalCredentialsSmpv2Write(m, queryParams1, vID) @@ -388,8 +388,8 @@ func resourceGlobalCredentialSNMPv2ReadCommunityDelete(ctx context.Context, d *s } return diags } -func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateSNMPReadCommunity { - request := catalystcentersdkgo.RequestDiscoveryCreateSNMPReadCommunity{} +func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateSNMPReadCommunityV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateSNMPReadCommunityV1{} if v := expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItemArray(ctx, key+".", d); v != nil { request = *v } @@ -400,8 +400,8 @@ func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunity(ctx return &request } -func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunity { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunity{} +func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunityV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunityV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -424,8 +424,8 @@ func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItem return &request } -func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunity { - request := catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunity{} +func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunityV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateSNMPReadCommunityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -445,8 +445,8 @@ func expandRequestGlobalCredentialSNMPv2ReadCommunityCreateSNMPReadCommunityItem return &request } -func expandRequestGlobalCredentialSNMPv2ReadCommunityUpdateSNMPReadCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateSNMPReadCommunity { - request := catalystcentersdkgo.RequestDiscoveryUpdateSNMPReadCommunity{} +func expandRequestGlobalCredentialSNMPv2ReadCommunityUpdateSNMPReadCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateSNMPReadCommunityV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateSNMPReadCommunityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -469,11 +469,11 @@ func expandRequestGlobalCredentialSNMPv2ReadCommunityUpdateSNMPReadCommunity(ctx return &request } -func searchDiscoveryGetGlobalCredentialsSmpv2Read(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsSmpv2Read(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "SNMPV2_READ_COMMUNITY" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -487,7 +487,7 @@ func searchDiscoveryGetGlobalCredentialsSmpv2Read(m interface{}, queryParams cat for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_snmpv2_write_community.go b/catalystcenter/resource_global_credential_snmpv2_write_community.go index b877ce0..b0af65a 100644 --- a/catalystcenter/resource_global_credential_snmpv2_write_community.go +++ b/catalystcenter/resource_global_credential_snmpv2_write_community.go @@ -115,7 +115,7 @@ func resourceGlobalCredentialSNMPv2WriteCommunity() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateSNMPWriteCommunity`, + Description: `Array of RequestDiscoveryCreateSNMPWriteCommunityV1`, Type: schema.TypeList, Required: true, MaxItems: 1, @@ -179,7 +179,7 @@ func resourceGlobalCredentialSNMPv2WriteCommunityCreate(ctx context.Context, d * vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "SNMPV2_WRITE_COMMUNITY" item, err := searchDiscoveryGetGlobalCredentialsSmpv2Write(m, queryParams1, vvID) @@ -247,7 +247,7 @@ func resourceGlobalCredentialSNMPv2WriteCommunityRead(ctx context.Context, d *sc selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -266,10 +266,10 @@ func resourceGlobalCredentialSNMPv2WriteCommunityRead(ctx context.Context, d *sc log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -291,7 +291,7 @@ func resourceGlobalCredentialSNMPv2WriteCommunityUpdate(ctx context.Context, d * vCredentialSubType := "SNMPV2_WRITE_COMMUNITY" vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType item, err := searchDiscoveryGetGlobalCredentialsSmpv2Write(m, queryParams1, vID) if err != nil || item == nil { @@ -361,7 +361,7 @@ func resourceGlobalCredentialSNMPv2WriteCommunityDelete(ctx context.Context, d * resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "SNMPV2_WRITE_COMMUNITY" item, err := searchDiscoveryGetGlobalCredentialsSmpv2Write(m, queryParams1, vID) @@ -383,8 +383,8 @@ func resourceGlobalCredentialSNMPv2WriteCommunityDelete(ctx context.Context, d * } return diags } -func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateSNMPWriteCommunity { - request := catalystcentersdkgo.RequestDiscoveryCreateSNMPWriteCommunity{} +func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateSNMPWriteCommunityV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateSNMPWriteCommunityV1{} if v := expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityItemArray(ctx, key+".", d); v != nil { request = *v } @@ -395,8 +395,8 @@ func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunity(c return &request } -func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunity { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunity{} +func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunityV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunityV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -419,8 +419,8 @@ func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityIt return &request } -func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunity { - request := catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunity{} +func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunityV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateSNMPWriteCommunityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -440,8 +440,8 @@ func expandRequestGlobalCredentialSNMPv2WriteCommunityCreateSNMPWriteCommunityIt return &request } -func expandRequestGlobalCredentialSNMPv2WriteCommunityUpdateSNMPWriteCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateSNMPWriteCommunity { - request := catalystcentersdkgo.RequestDiscoveryUpdateSNMPWriteCommunity{} +func expandRequestGlobalCredentialSNMPv2WriteCommunityUpdateSNMPWriteCommunity(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateSNMPWriteCommunityV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateSNMPWriteCommunityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".comments")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".comments")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".comments")))) { request.Comments = interfaceToString(v) } @@ -464,11 +464,11 @@ func expandRequestGlobalCredentialSNMPv2WriteCommunityUpdateSNMPWriteCommunity(c return &request } -func searchDiscoveryGetGlobalCredentialsSmpv2Write(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsSmpv2Write(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "SNMPV2_WRITE_COMMUNITY" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -482,7 +482,7 @@ func searchDiscoveryGetGlobalCredentialsSmpv2Write(m interface{}, queryParams ca for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_snmpv3.go b/catalystcenter/resource_global_credential_snmpv3.go index 989e9b6..908649d 100644 --- a/catalystcenter/resource_global_credential_snmpv3.go +++ b/catalystcenter/resource_global_credential_snmpv3.go @@ -115,7 +115,7 @@ func resourceGlobalCredentialSNMPv3() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateSNMPv3Credentials`, + Description: `Array of RequestDiscoveryCreateSNMPv3CredentialsV1`, Type: schema.TypeList, MinItems: 1, MaxItems: 1, @@ -191,7 +191,7 @@ func resourceGlobalCredentialSNMPv3Create(ctx context.Context, d *schema.Resourc vvUsername := interfaceToString(vUsername) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "SNMPV3" item, err := searchDiscoveryGetGlobalCredentialsSmpv3(m, queryParams1, vvUsername, vvID) @@ -257,7 +257,7 @@ func resourceGlobalCredentialSNMPv3Read(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalCredentials") - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType @@ -276,10 +276,10 @@ func resourceGlobalCredentialSNMPv3Read(ctx context.Context, d *schema.ResourceD log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response{ *response1, } - vItem1 := flattenDiscoveryGetGlobalCredentialsItems(&items) + vItem1 := flattenDiscoveryGetGlobalCredentialsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalCredentials search response", @@ -302,7 +302,7 @@ func resourceGlobalCredentialSNMPv3Update(ctx context.Context, d *schema.Resourc vUsername := resourceMap["username"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = vCredentialSubType response1, err := searchDiscoveryGetGlobalCredentialsSmpv3(m, queryParams1, vUsername, vID) if err != nil || response1 == nil { @@ -374,7 +374,7 @@ func resourceGlobalCredentialSNMPv3Delete(ctx context.Context, d *schema.Resourc vID := resourceMap["id"] vUsername := resourceMap["username"] - queryParams1 := catalystcentersdkgo.GetGlobalCredentialsQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalCredentialsV1QueryParams{} queryParams1.CredentialSubType = "SNMPV3" item, err := searchDiscoveryGetGlobalCredentialsSmpv3(m, queryParams1, vUsername, vID) @@ -399,8 +399,8 @@ func resourceGlobalCredentialSNMPv3Delete(ctx context.Context, d *schema.Resourc } return diags } -func expandRequestGlobalCredentialSNMPv3CreateSNMPv3Credentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateSNMPv3Credentials { - request := catalystcentersdkgo.RequestDiscoveryCreateSNMPv3Credentials{} +func expandRequestGlobalCredentialSNMPv3CreateSNMPv3Credentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateSNMPv3CredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateSNMPv3CredentialsV1{} if v := expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItemArray(ctx, key, d); v != nil { request = *v } @@ -411,8 +411,8 @@ func expandRequestGlobalCredentialSNMPv3CreateSNMPv3Credentials(ctx context.Cont return &request } -func expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3Credentials { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3Credentials{} +func expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3CredentialsV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3CredentialsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -435,8 +435,8 @@ func expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItemArray(ctx con return &request } -func expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3Credentials { - request := catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3Credentials{} +func expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3CredentialsV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateSNMPv3CredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auth_password")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auth_password")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auth_password")))) { request.AuthPassword = interfaceToString(v) } @@ -480,8 +480,8 @@ func expandRequestGlobalCredentialSNMPv3CreateSNMPv3CredentialsItem(ctx context. return &request } -func expandRequestGlobalCredentialSNMPv3UpdateSNMPv3Credentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateSNMPv3Credentials { - request := catalystcentersdkgo.RequestDiscoveryUpdateSNMPv3Credentials{} +func expandRequestGlobalCredentialSNMPv3UpdateSNMPv3Credentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateSNMPv3CredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateSNMPv3CredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auth_password")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auth_password")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auth_password")))) { request.AuthPassword = interfaceToString(v) } @@ -525,11 +525,11 @@ func expandRequestGlobalCredentialSNMPv3UpdateSNMPv3Credentials(ctx context.Cont return &request } -func searchDiscoveryGetGlobalCredentialsSmpv3(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsQueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse, error) { +func searchDiscoveryGetGlobalCredentialsSmpv3(m interface{}, queryParams catalystcentersdkgo.GetGlobalCredentialsV1QueryParams, vUsername string, vID string) (*catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentials + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1 queryParams.CredentialSubType = "SNMPV3" ite, _, err = client.Discovery.GetGlobalCredentials(&queryParams) if err != nil { @@ -543,7 +543,7 @@ func searchDiscoveryGetGlobalCredentialsSmpv3(m interface{}, queryParams catalys for _, item := range *itemsCopy.Response { // Call get by _ method and set value to foundItem and return if item.ID == vID || item.Username == vUsername { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetGlobalCredentialsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_global_credential_update.go b/catalystcenter/resource_global_credential_update.go index 0471724..7f07cb8 100644 --- a/catalystcenter/resource_global_credential_update.go +++ b/catalystcenter/resource_global_credential_update.go @@ -92,20 +92,18 @@ func resourceGlobalCredentialUpdateCreate(ctx context.Context, d *schema.Resourc vGlobalCredentialID := resourceItem["global_credential_id"] vvGlobalCredentialID := vGlobalCredentialID.(string) - request1 := expandRequestGlobalCredentialUpdateUpdateGlobalCredentials(ctx, "parameters.0", d) + request1 := expandRequestGlobalCredentialUpdateUpdateGlobalCredentialsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Discovery.UpdateGlobalCredentials(vvGlobalCredentialID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Discovery.UpdateGlobalCredentialsV1(vvGlobalCredentialID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateGlobalCredentials", err)) + "Failure when executing UpdateGlobalCredentialsV1", err)) return diags } @@ -113,7 +111,7 @@ func resourceGlobalCredentialUpdateCreate(ctx context.Context, d *schema.Resourc if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateGlobalCredentials", err)) + "Failure when executing UpdateGlobalCredentialsV1", err)) return diags } taskId := response1.Response.TaskID @@ -147,22 +145,24 @@ func resourceGlobalCredentialUpdateCreate(ctx context.Context, d *schema.Resourc } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateGlobalCredentials", err1)) + "Failure when executing UpdateGlobalCredentialsV1", err1)) return diags } } - vItem1 := flattenDiscoveryUpdateGlobalCredentialsItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDiscoveryUpdateGlobalCredentialsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateGlobalCredentials response", + "Failure when setting UpdateGlobalCredentialsV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceGlobalCredentialUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -177,15 +177,15 @@ func resourceGlobalCredentialUpdateDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestGlobalCredentialUpdateUpdateGlobalCredentials(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentials { - request := catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentials{} +func expandRequestGlobalCredentialUpdateUpdateGlobalCredentialsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentialsV1 { + request := catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentialsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_uuids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_uuids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_uuids")))) { request.SiteUUIDs = interfaceToSliceString(v) } return &request } -func flattenDiscoveryUpdateGlobalCredentialsItem(item *catalystcentersdkgo.ResponseDiscoveryUpdateGlobalCredentialsResponse) []map[string]interface{} { +func flattenDiscoveryUpdateGlobalCredentialsV1Item(item *catalystcentersdkgo.ResponseDiscoveryUpdateGlobalCredentialsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_global_credential_v2.go b/catalystcenter/resource_global_credential_v2.go index 2bb724d..0c3316a 100644 --- a/catalystcenter/resource_global_credential_v2.go +++ b/catalystcenter/resource_global_credential_v2.go @@ -1170,6 +1170,9 @@ func expandRequestGlobalCredentialV2CreateGlobalCredentialsV2HTTPSReadArray(ctx func expandRequestGlobalCredentialV2CreateGlobalCredentialsV2HTTPSRead(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateGlobalCredentialsV2HTTPSRead { request := catalystcentersdkgo.RequestDiscoveryCreateGlobalCredentialsV2HTTPSRead{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { + request.Description = interfaceToString(v) + } if v, ok := d.GetOkExists(fixKeyAccess(key + ".username")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".username")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".username")))) { request.Username = interfaceToString(v) } @@ -1210,6 +1213,9 @@ func expandRequestGlobalCredentialV2CreateGlobalCredentialsV2HTTPSWriteArray(ctx func expandRequestGlobalCredentialV2CreateGlobalCredentialsV2HTTPSWrite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateGlobalCredentialsV2HTTPSWrite { request := catalystcentersdkgo.RequestDiscoveryCreateGlobalCredentialsV2HTTPSWrite{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { + request.Description = interfaceToString(v) + } if v, ok := d.GetOkExists(fixKeyAccess(key + ".username")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".username")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".username")))) { request.Username = interfaceToString(v) } @@ -1342,6 +1348,9 @@ func expandRequestGlobalCredentialV2UpdateGlobalCredentialsV2SNMPV3(ctx context. func expandRequestGlobalCredentialV2UpdateGlobalCredentialsV2HTTPSRead(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentialsV2HTTPSRead { request := catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentialsV2HTTPSRead{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { + request.Description = interfaceToString(v) + } if v, ok := d.GetOkExists(fixKeyAccess(key + ".username")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".username")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".username")))) { request.Username = interfaceToString(v) } @@ -1362,6 +1371,9 @@ func expandRequestGlobalCredentialV2UpdateGlobalCredentialsV2HTTPSRead(ctx conte func expandRequestGlobalCredentialV2UpdateGlobalCredentialsV2HTTPSWrite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentialsV2HTTPSWrite { request := catalystcentersdkgo.RequestDiscoveryUpdateGlobalCredentialsV2HTTPSWrite{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { + request.Description = interfaceToString(v) + } if v, ok := d.GetOkExists(fixKeyAccess(key + ".username")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".username")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".username")))) { request.Username = interfaceToString(v) } diff --git a/catalystcenter/resource_global_pool.go b/catalystcenter/resource_global_pool.go index 69f9b28..84df9c5 100644 --- a/catalystcenter/resource_global_pool.go +++ b/catalystcenter/resource_global_pool.go @@ -302,7 +302,7 @@ func resourceGlobalPoolCreate(ctx context.Context, d *schema.ResourceData, m int var diags diag.Diagnostics - request1 := expandRequestGlobalPoolCreateGlobalPool(ctx, "parameters.0", d) + request1 := expandRequestGlobalPoolCreateGlobalPoolV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -323,7 +323,7 @@ func resourceGlobalPoolCreate(ctx context.Context, d *schema.ResourceData, m int } } } - queryParams1 := catalystcentersdkgo.GetGlobalPoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalPoolV1QueryParams{} response1, err := searchNetworkSettingsGetGlobalPool(m, queryParams1, vvID, vvIpPoolName) if response1 != nil { @@ -403,7 +403,7 @@ func resourceGlobalPoolRead(ctx context.Context, d *schema.ResourceData, m inter selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetGlobalPool") - queryParams1 := catalystcentersdkgo.GetGlobalPoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalPoolV1QueryParams{} response1, err := searchNetworkSettingsGetGlobalPool(m, queryParams1, vID, vIpPoolName) if err != nil || response1 == nil || len(*response1) <= 0 { @@ -413,7 +413,7 @@ func resourceGlobalPoolRead(ctx context.Context, d *schema.ResourceData, m inter log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsGetGlobalPoolItems(response1) + vItem1 := flattenNetworkSettingsGetGlobalPoolV1Items(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGlobalPool search response", @@ -436,7 +436,7 @@ func resourceGlobalPoolUpdate(ctx context.Context, d *schema.ResourceData, m int vIpPoolName := resourceMap["ip_pool_name"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalPoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalPoolV1QueryParams{} item, err := searchNetworkSettingsGetGlobalPool(m, queryParams1, vID, vIpPoolName) if err != nil || item == nil || len(*item) <= 0 { diags = append(diags, diagErrorWithAlt( @@ -447,7 +447,7 @@ func resourceGlobalPoolUpdate(ctx context.Context, d *schema.ResourceData, m int // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { - request1 := expandRequestGlobalPoolUpdateGlobalPool(ctx, "parameters.0", d) + request1 := expandRequestGlobalPoolUpdateGlobalPoolV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -525,7 +525,7 @@ func resourceGlobalPoolDelete(ctx context.Context, d *schema.ResourceData, m int vIpPoolName := resourceMap["ip_pool_name"] vID := resourceMap["id"] - queryParams1 := catalystcentersdkgo.GetGlobalPoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetGlobalPoolV1QueryParams{} item, err := searchNetworkSettingsGetGlobalPool(m, queryParams1, vID, vIpPoolName) if err != nil { return diags @@ -593,35 +593,30 @@ func resourceGlobalPoolDelete(ctx context.Context, d *schema.ResourceData, m int return diags } -func expandRequestGlobalPoolCreateGlobalPool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPool { - log.Println("[DEBUG] call expandRequestGlobalPoolCreateGlobalPool") - request := catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPool{} +func expandRequestGlobalPoolCreateGlobalPoolV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1 { + request := catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".settings")))) { - request.Settings = expandRequestGlobalPoolCreateGlobalPoolSettings(ctx, key+".settings.0", d) + request.Settings = expandRequestGlobalPoolCreateGlobalPoolV1Settings(ctx, key+".settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil } - return &request } -func expandRequestGlobalPoolCreateGlobalPoolSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolSettings { - log.Println("[DEBUG] call expandRequestGlobalPoolCreateGlobalPoolSettings") - request := catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolSettings{} +func expandRequestGlobalPoolCreateGlobalPoolV1Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1Settings { + request := catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ippool")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ippool")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ippool")))) { - request.IPpool = expandRequestGlobalPoolCreateGlobalPoolSettingsIPpoolArray(ctx, key+".ippool", d) + request.IPpool = expandRequestGlobalPoolCreateGlobalPoolV1SettingsIPpoolArray(ctx, key+".ippool", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil } - return &request } -func expandRequestGlobalPoolCreateGlobalPoolSettingsIPpoolArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolSettingsIPpool { - log.Println("[DEBUG] call expandRequestGlobalPoolCreateGlobalPoolSettingsIPpoolArray") - request := []catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolSettingsIPpool{} +func expandRequestGlobalPoolCreateGlobalPoolV1SettingsIPpoolArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1SettingsIPpool { + request := []catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1SettingsIPpool{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -632,7 +627,7 @@ func expandRequestGlobalPoolCreateGlobalPoolSettingsIPpoolArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestGlobalPoolCreateGlobalPoolSettingsIPpool(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestGlobalPoolCreateGlobalPoolV1SettingsIPpool(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -640,13 +635,11 @@ func expandRequestGlobalPoolCreateGlobalPoolSettingsIPpoolArray(ctx context.Cont if isEmptyValue(reflect.ValueOf(request)) { return nil } - return &request } -func expandRequestGlobalPoolCreateGlobalPoolSettingsIPpool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolSettingsIPpool { - log.Println("[DEBUG] call expandRequestGlobalPoolCreateGlobalPoolSettingsIPpool") - request := catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolSettingsIPpool{} +func expandRequestGlobalPoolCreateGlobalPoolV1SettingsIPpool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1SettingsIPpool { + request := catalystcentersdkgo.RequestNetworkSettingsCreateGlobalPoolV1SettingsIPpool{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_pool_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_pool_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_pool_name")))) { request.IPPoolName = interfaceToString(v) } @@ -674,22 +667,19 @@ func expandRequestGlobalPoolCreateGlobalPoolSettingsIPpool(ctx context.Context, return &request } -func expandRequestGlobalPoolUpdateGlobalPool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPool { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPool{} - if v, ok := d.GetOkExists(fixKeyAccess(key + ".settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".settings")))) { - request.Settings = expandRequestGlobalPoolUpdateGlobalPoolSettings(ctx, key+".settings.0", d) - } +func expandRequestGlobalPoolUpdateGlobalPoolV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1 { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1{} + request.Settings = expandRequestGlobalPoolUpdateGlobalPoolV1Settings(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } - return &request } -func expandRequestGlobalPoolUpdateGlobalPoolSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolSettings { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolSettings{} +func expandRequestGlobalPoolUpdateGlobalPoolV1Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1Settings { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ippool")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ippool")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ippool")))) { - request.IPpool = expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpoolArray(ctx, key+".ippool", d) + request.IPpool = expandRequestGlobalPoolUpdateGlobalPoolV1SettingsIPpoolArray(ctx, key+".ippool", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -697,8 +687,8 @@ func expandRequestGlobalPoolUpdateGlobalPoolSettings(ctx context.Context, key st return &request } -func expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpoolArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolSettingsIPpool { - request := []catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolSettingsIPpool{} +func expandRequestGlobalPoolUpdateGlobalPoolV1SettingsIPpoolArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1SettingsIPpool { + request := []catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1SettingsIPpool{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -709,7 +699,7 @@ func expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpoolArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpool(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestGlobalPoolUpdateGlobalPoolV1SettingsIPpool(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -720,8 +710,8 @@ func expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpoolArray(ctx context.Cont return &request } -func expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolSettingsIPpool { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolSettingsIPpool{} +func expandRequestGlobalPoolUpdateGlobalPoolV1SettingsIPpool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1SettingsIPpool { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateGlobalPoolV1SettingsIPpool{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_pool_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_pool_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_pool_name")))) { request.IPPoolName = interfaceToString(v) } @@ -743,10 +733,10 @@ func expandRequestGlobalPoolUpdateGlobalPoolSettingsIPpool(ctx context.Context, return &request } -func searchNetworkSettingsGetGlobalPool(m interface{}, queryParams catalystcentersdkgo.GetGlobalPoolQueryParams, vID string, vIPPoolName string) (*[]catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolResponse, error) { +func searchNetworkSettingsGetGlobalPool(m interface{}, queryParams catalystcentersdkgo.GetGlobalPoolV1QueryParams, vID string, vIPPoolName string) (*[]catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItems []catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolResponse + var foundItems []catalystcentersdkgo.ResponseNetworkSettingsGetGlobalPoolV1Response offset := 1 queryParams.Offset = float64(offset) diff --git a/catalystcenter/resource_golden_image.go b/catalystcenter/resource_golden_image.go index 633eda0..37b0f1f 100644 --- a/catalystcenter/resource_golden_image.go +++ b/catalystcenter/resource_golden_image.go @@ -232,7 +232,7 @@ func resourceGoldenImageRead(ctx context.Context, d *schema.ResourceData, m inte log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGoldenTagStatusOfAnImage response", @@ -334,8 +334,8 @@ func resourceGoldenImageDelete(ctx context.Context, d *schema.ResourceData, m in return diags } -func expandRequestGoldenImageTagAsGoldenImage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImage { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImage{} +func expandRequestGoldenImageTagAsGoldenImage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImageV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImageV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".image_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".image_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".image_id")))) { request.ImageID = interfaceToString(v) } diff --git a/catalystcenter/resource_golden_tag_image.go b/catalystcenter/resource_golden_tag_image.go index ecb9117..032c601 100644 --- a/catalystcenter/resource_golden_tag_image.go +++ b/catalystcenter/resource_golden_tag_image.go @@ -118,7 +118,7 @@ func resourceGoldenTagImageCreate(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestGoldenTagImageTagAsGoldenImage(ctx, "parameters.0", d) + request1 := expandRequestGoldenTagImageTagAsGoldenImageV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSiteID, okSiteID := resourceItem["site_id"] @@ -212,7 +212,7 @@ func resourceGoldenTagImageRead(ctx context.Context, d *schema.ResourceData, m i log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimGetGoldenTagStatusOfAnImageV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetGoldenTagStatusOfAnImage response", @@ -301,8 +301,8 @@ func resourceGoldenTagImageDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestGoldenTagImageTagAsGoldenImage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImage { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImage{} +func expandRequestGoldenTagImageTagAsGoldenImageV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImageV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTagAsGoldenImageV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".image_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".image_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".image_id")))) { request.ImageID = interfaceToString(v) } diff --git a/catalystcenter/resource_health_score_definitions.go b/catalystcenter/resource_health_score_definitions.go index 8a830c3..aa3a069 100644 --- a/catalystcenter/resource_health_score_definitions.go +++ b/catalystcenter/resource_health_score_definitions.go @@ -192,7 +192,7 @@ func resourceHealthScoreDefinitionsUpdate(ctx context.Context, d *schema.Resourc vvID := resourceMap["id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestHealthScoreDefinitionsUpdateHealthScoreDefinitionForTheGivenID(ctx, "parameters.0", d) + request1 := expandRequestHealthScoreDefinitionsUpdateHealthScoreDefinitionForTheGivenIDV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Devices.UpdateHealthScoreDefinitionForTheGivenID(vvID, request1) if err != nil || response1 == nil { @@ -224,8 +224,8 @@ func resourceHealthScoreDefinitionsDelete(ctx context.Context, d *schema.Resourc "Failure at HealthScoreDefinitionsDelete, unexpected response", "")) return diags } -func expandRequestHealthScoreDefinitionsUpdateHealthScoreDefinitionForTheGivenID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateHealthScoreDefinitionForTheGivenID { - request := catalystcentersdkgo.RequestDevicesUpdateHealthScoreDefinitionForTheGivenID{} +func expandRequestHealthScoreDefinitionsUpdateHealthScoreDefinitionForTheGivenIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateHealthScoreDefinitionForTheGivenIDV1 { + request := catalystcentersdkgo.RequestDevicesUpdateHealthScoreDefinitionForTheGivenIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".include_for_overall_health")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".include_for_overall_health")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".include_for_overall_health")))) { request.IncludeForOverallHealth = interfaceToBoolPtr(v) } diff --git a/catalystcenter/resource_image_device_activation.go b/catalystcenter/resource_image_device_activation.go index c4898d5..1b3e8ab 100644 --- a/catalystcenter/resource_image_device_activation.go +++ b/catalystcenter/resource_image_device_activation.go @@ -81,7 +81,7 @@ func resourceImageDeviceActivation() *schema.Resource { ForceNew: true, }, "payload": &schema.Schema{ - Description: `Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageActivation`, + Description: `Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageActivationV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -155,27 +155,25 @@ func resourceImageDeviceActivationCreate(ctx context.Context, d *schema.Resource vClientURL := resourceItem["client_url"] - request1 := expandRequestImageDeviceActivationTriggerSoftwareImageActivation(ctx, "parameters.0", d) + request1 := expandRequestImageDeviceActivationTriggerSoftwareImageActivationV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.TriggerSoftwareImageActivationHeaderParams{} - queryParams1 := catalystcentersdkgo.TriggerSoftwareImageActivationQueryParams{} + headerParams1 := catalystcentersdkgo.TriggerSoftwareImageActivationV1HeaderParams{} + queryParams1 := catalystcentersdkgo.TriggerSoftwareImageActivationV1QueryParams{} headerParams1.ClientType = vClientType.(string) headerParams1.ClientURL = vClientURL.(string) - response1, restyResp1, err := client.SoftwareImageManagementSwim.TriggerSoftwareImageActivation(request1, &headerParams1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.SoftwareImageManagementSwim.TriggerSoftwareImageActivationV1(request1, &headerParams1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing TriggerSoftwareImageActivation", err)) + "Failure when executing TriggerSoftwareImageActivationV1", err)) return diags } @@ -183,7 +181,7 @@ func resourceImageDeviceActivationCreate(ctx context.Context, d *schema.Resource if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing TriggerSoftwareImageActivation", err)) + "Failure when executing TriggerSoftwareImageActivationV1", err)) return diags } taskId := response1.Response.TaskID @@ -217,22 +215,24 @@ func resourceImageDeviceActivationCreate(ctx context.Context, d *schema.Resource } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing TriggerSoftwareImageActivation", err1)) + "Failure when executing TriggerSoftwareImageActivationV1", err1)) return diags } } - vItem1 := flattenSoftwareImageManagementSwimTriggerSoftwareImageActivationItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSoftwareImageManagementSwimTriggerSoftwareImageActivationV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting TriggerSoftwareImageActivation response", + "Failure when setting TriggerSoftwareImageActivationV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceImageDeviceActivationRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -247,16 +247,16 @@ func resourceImageDeviceActivationDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestImageDeviceActivationTriggerSoftwareImageActivation(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageActivation { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageActivation{} - if v := expandRequestImageDeviceActivationTriggerSoftwareImageActivationItemArray(ctx, key+".payload", d); v != nil { +func expandRequestImageDeviceActivationTriggerSoftwareImageActivationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageActivationV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageActivationV1{} + if v := expandRequestImageDeviceActivationTriggerSoftwareImageActivationV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestImageDeviceActivationTriggerSoftwareImageActivationItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivation { - request := []catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivation{} +func expandRequestImageDeviceActivationTriggerSoftwareImageActivationV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivationV1 { + request := []catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivationV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -267,7 +267,7 @@ func expandRequestImageDeviceActivationTriggerSoftwareImageActivationItemArray(c return nil } for item_no := range objs { - i := expandRequestImageDeviceActivationTriggerSoftwareImageActivationItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestImageDeviceActivationTriggerSoftwareImageActivationV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -275,8 +275,8 @@ func expandRequestImageDeviceActivationTriggerSoftwareImageActivationItemArray(c return &request } -func expandRequestImageDeviceActivationTriggerSoftwareImageActivationItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivation { - request := catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivation{} +func expandRequestImageDeviceActivationTriggerSoftwareImageActivationV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivationV1 { + request := catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageActivationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".activate_lower_image_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".activate_lower_image_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".activate_lower_image_version")))) { request.ActivateLowerImageVersion = interfaceToBoolPtr(v) } @@ -298,7 +298,7 @@ func expandRequestImageDeviceActivationTriggerSoftwareImageActivationItem(ctx co return &request } -func flattenSoftwareImageManagementSwimTriggerSoftwareImageActivationItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimTriggerSoftwareImageActivationResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimTriggerSoftwareImageActivationV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimTriggerSoftwareImageActivationV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_image_distribution.go b/catalystcenter/resource_image_distribution.go index 5384fdb..578cb6b 100644 --- a/catalystcenter/resource_image_distribution.go +++ b/catalystcenter/resource_image_distribution.go @@ -23,7 +23,7 @@ func resourceImageDistribution() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Software Image Management (SWIM). -- Distributes a software image on a given device. Software image must be imported successfully into Catalyst Center before it +- Distributes a software image on a given device. Software image must be imported successfully into DNA Center before it can be distributed `, @@ -61,7 +61,7 @@ can be distributed Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageDistribution`, + Description: `Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -95,20 +95,18 @@ func resourceImageDistributionCreate(ctx context.Context, d *schema.ResourceData client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestImageDistributionTriggerSoftwareImageDistribution(ctx, "parameters.0", d) + request1 := expandRequestImageDistributionTriggerSoftwareImageDistributionV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.SoftwareImageManagementSwim.TriggerSoftwareImageDistribution(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.SoftwareImageManagementSwim.TriggerSoftwareImageDistributionV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing TriggerSoftwareImageDistribution", err)) + "Failure when executing TriggerSoftwareImageDistributionV1", err)) return diags } @@ -116,7 +114,7 @@ func resourceImageDistributionCreate(ctx context.Context, d *schema.ResourceData if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing TriggerSoftwareImageDistribution", err)) + "Failure when executing TriggerSoftwareImageDistributionV1", err)) return diags } taskId := response1.Response.TaskID @@ -150,22 +148,24 @@ func resourceImageDistributionCreate(ctx context.Context, d *schema.ResourceData } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing TriggerSoftwareImageDistribution", err1)) + "Failure when executing TriggerSoftwareImageDistributionV1", err1)) return diags } } - vItem1 := flattenSoftwareImageManagementSwimTriggerSoftwareImageDistributionItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting TriggerSoftwareImageDistribution response", + "Failure when setting TriggerSoftwareImageDistributionV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceImageDistributionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -180,16 +180,16 @@ func resourceImageDistributionDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestImageDistributionTriggerSoftwareImageDistribution(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageDistribution { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageDistribution{} - if v := expandRequestImageDistributionTriggerSoftwareImageDistributionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestImageDistributionTriggerSoftwareImageDistributionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1{} + if v := expandRequestImageDistributionTriggerSoftwareImageDistributionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestImageDistributionTriggerSoftwareImageDistributionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistribution { - request := []catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistribution{} +func expandRequestImageDistributionTriggerSoftwareImageDistributionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1 { + request := []catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -200,7 +200,7 @@ func expandRequestImageDistributionTriggerSoftwareImageDistributionItemArray(ctx return nil } for item_no := range objs { - i := expandRequestImageDistributionTriggerSoftwareImageDistributionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestImageDistributionTriggerSoftwareImageDistributionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -208,8 +208,8 @@ func expandRequestImageDistributionTriggerSoftwareImageDistributionItemArray(ctx return &request } -func expandRequestImageDistributionTriggerSoftwareImageDistributionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistribution { - request := catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistribution{} +func expandRequestImageDistributionTriggerSoftwareImageDistributionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1 { + request := catalystcentersdkgo.RequestItemSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_uuid")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_uuid")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_uuid")))) { request.DeviceUUID = interfaceToString(v) } @@ -219,7 +219,7 @@ func expandRequestImageDistributionTriggerSoftwareImageDistributionItem(ctx cont return &request } -func flattenSoftwareImageManagementSwimTriggerSoftwareImageDistributionItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimTriggerSoftwareImageDistributionResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_images_distribution_server_settings.go b/catalystcenter/resource_images_distribution_server_settings.go index 3af2d4c..ad1641a 100644 --- a/catalystcenter/resource_images_distribution_server_settings.go +++ b/catalystcenter/resource_images_distribution_server_settings.go @@ -129,7 +129,7 @@ func resourceImagesDistributionServerSettingsCreate(ctx context.Context, d *sche var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestImagesDistributionServerSettingsAddImageDistributionServer(ctx, "parameters.0", d) + request1 := expandRequestImagesDistributionServerSettingsAddImageDistributionServerV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vServer := resourceItem["server_address"] vvServer := interfaceToString(vServer) @@ -213,12 +213,12 @@ func resourceImagesDistributionServerSettingsRead(ctx context.Context, d *schema log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - items := []catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersResponse{ + items := []catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersV1Response{ *response1, } // Review flatten function used - vItem1 := flattenSoftwareImageManagementSwimRetrieveImageDistributionServersItems(&items) + vItem1 := flattenSoftwareImageManagementSwimRetrieveImageDistributionServersV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveImageDistributionServers search response", @@ -242,8 +242,8 @@ func resourceImagesDistributionServerSettingsDelete(ctx context.Context, d *sche "Failure at ImagesDistributionServerSettingsDelete, unexpected response", "")) return diags } -func expandRequestImagesDistributionServerSettingsAddImageDistributionServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimAddImageDistributionServer { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimAddImageDistributionServer{} +func expandRequestImagesDistributionServerSettingsAddImageDistributionServerV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimAddImageDistributionServerV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimAddImageDistributionServerV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".server_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".server_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".server_address")))) { request.ServerAddress = interfaceToString(v) } @@ -265,11 +265,11 @@ func expandRequestImagesDistributionServerSettingsAddImageDistributionServer(ctx return &request } -func searchSoftwareImageManagementSwimRetrieveImageDistributionServers(m interface{}, vServerAddress string) (*catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersResponse, error) { +func searchSoftwareImageManagementSwimRetrieveImageDistributionServers(m interface{}, vServerAddress string) (*catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersResponse - var ite *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServers + var foundItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersV1Response + var ite *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersV1 ite, _, err = client.SoftwareImageManagementSwim.RetrieveImageDistributionServers() if err != nil || ite == nil { return foundItem, err @@ -280,7 +280,7 @@ func searchSoftwareImageManagementSwimRetrieveImageDistributionServers(m interfa for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.ServerAddress == vServerAddress { - var getItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersResponse + var getItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrieveImageDistributionServersV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_images_download.go b/catalystcenter/resource_images_download.go index 9875ced..1ab0787 100644 --- a/catalystcenter/resource_images_download.go +++ b/catalystcenter/resource_images_download.go @@ -20,8 +20,8 @@ func resourceImagesDownload() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Software Image Management (SWIM). -- Initiates download of the software image from Cisco.com on the disk for the given 'id'. Refer to -'/dna/intent/api/v1/images' for obtaining 'id'. +- Initiates download of the software image from Cisco.com on the disk for the given *id*. Refer to +*/dna/intent/api/v1/images* for obtaining *id*. `, CreateContext: resourceImagesDownloadCreate, @@ -62,7 +62,7 @@ func resourceImagesDownload() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. Software image identifier. Check API '/dna/intent/api/v1/images' for 'id' from response. + Description: `id path parameter. Software image identifier. Check API */dna/intent/api/v1/images* for *id* from response. `, Type: schema.TypeString, Required: true, @@ -85,14 +85,16 @@ func resourceImagesDownloadCreate(ctx context.Context, d *schema.ResourceData, m vvID := vID.(string) - response1, restyResp1, err := client.SoftwareImageManagementSwim.DownloadTheSoftwareImage(vvID) + // has_unknown_response: None + + response1, restyResp1, err := client.SoftwareImageManagementSwim.DownloadTheSoftwareImageV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DownloadTheSoftwareImage", err)) + "Failure when executing DownloadTheSoftwareImageV1", err)) return diags } @@ -100,7 +102,7 @@ func resourceImagesDownloadCreate(ctx context.Context, d *schema.ResourceData, m if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing DownloadTheSoftwareImage", err)) + "Failure when executing DownloadTheSoftwareImageV1", err)) return diags } taskId := response1.Response.TaskID @@ -134,22 +136,20 @@ func resourceImagesDownloadCreate(ctx context.Context, d *schema.ResourceData, m } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing DownloadTheSoftwareImage", err1)) + "Failure when executing DownloadTheSoftwareImageV1", err1)) return diags } } - - vItem1 := flattenSoftwareImageManagementSwimDownloadTheSoftwareImageItem(response1.Response) + vItem1 := flattenSoftwareImageManagementSwimDownloadTheSoftwareImageV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DownloadTheSoftwareImage response", + "Failure when setting DownloadTheSoftwareImageV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceImagesDownloadRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -164,7 +164,7 @@ func resourceImagesDownloadDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func flattenSoftwareImageManagementSwimDownloadTheSoftwareImageItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimDownloadTheSoftwareImageResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimDownloadTheSoftwareImageV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimDownloadTheSoftwareImageV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_images_site_wise_product_names.go b/catalystcenter/resource_images_site_wise_product_names.go index bb26a96..77b8a3a 100644 --- a/catalystcenter/resource_images_site_wise_product_names.go +++ b/catalystcenter/resource_images_site_wise_product_names.go @@ -20,16 +20,16 @@ func resourceImagesSiteWiseProductNames() *schema.Resource { return &schema.Resource{ Description: `It manages create, read, update and delete operations on Software Image Management (SWIM). -- Assign network device product name and sites for the given image identifier. Refer '/dna/intent/api/v1/images' API for +- Assign network device product name and sites for the given image identifier. Refer */dna/intent/api/v1/images* API for obtaining imageId - This resource unassigns the network device product name from all the sites for the given software image. - Refer to '/dna/intent/api/v1/images' and '/dna/intent/api/v1/images/{imageId}/siteWiseProductNames' GET APIs for -obtaining 'imageId' and 'productNameOrdinal' respectively. + Refer to */dna/intent/api/v1/images* and */dna/intent/api/v1/images/{imageId}/siteWiseProductNames* GET APIs for +obtaining *imageId* and *productNameOrdinal* respectively. - Update the list of sites for the network device product name assigned to the software image. Refer to -'/dna/intent/api/v1/images' and '/dna/intent/api/v1/images/{imageId}/siteWiseProductNames' GET APIs for obtaining -'imageId' and 'productNameOrdinal' respectively. +*/dna/intent/api/v1/images* and */dna/intent/api/v1/images/{imageId}/siteWiseProductNames* GET APIs for obtaining +*imageId* and *productNameOrdinal* respectively. `, CreateContext: resourceImagesSiteWiseProductNamesCreate, @@ -104,7 +104,7 @@ obtaining 'imageId' and 'productNameOrdinal' respectively. Schema: map[string]*schema.Schema{ "image_id": &schema.Schema{ - Description: `imageId path parameter. Software image identifier. Refer '/dna/intent/api/v1/images' API for obtaining 'imageId' + Description: `imageId path parameter. Software image identifier. Refer */dna/intent/api/v1/images* API for obtaining *imageId* `, Type: schema.TypeString, Required: true, @@ -139,7 +139,7 @@ func resourceImagesSiteWiseProductNamesCreate(ctx context.Context, d *schema.Res var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestImagesSiteWiseProductNamesAssignNetworkDeviceProductNameToTheGivenSoftwareImage(ctx, "parameters.0", d) + request1 := expandRequestImagesSiteWiseProductNamesAssignNetworkDeviceProductNameToTheGivenSoftwareImageV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vProductNameOrdinal := resourceItem["product_name_ordinal"] @@ -149,7 +149,7 @@ func resourceImagesSiteWiseProductNamesCreate(ctx context.Context, d *schema.Res vImageID := resourceItem["image_id"] vvImageID := interfaceToString(vImageID) - queryParamImport := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageQueryParams{} + queryParamImport := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1QueryParams{} item2, err := searchSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImage(m, queryParamImport, vvImageID, vvProductNameOrdinal) if err == nil && item2 != nil { @@ -198,7 +198,7 @@ func resourceImagesSiteWiseProductNamesCreate(ctx context.Context, d *schema.Res return diags } } - queryParamValidate := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageQueryParams{} + queryParamValidate := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1QueryParams{} item3, err := searchSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImage(m, queryParamValidate, vvImageID, vvProductNameOrdinal) if err != nil || item3 == nil { @@ -229,18 +229,18 @@ func resourceImagesSiteWiseProductNamesRead(ctx context.Context, d *schema.Resou if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage") vvImageID := vImageID - queryParams1 := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageQueryParams{} + queryParams1 := catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1QueryParams{} item1, err := searchSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImage(m, queryParams1, vvImageID, vvProductNameOrdinal) if err != nil || item1 == nil { d.SetId("") return diags } - items := []catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageResponse{ + items := []catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Response{ *item1, } // Review flatten function used - vItem1 := flattenSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageItems(&items) + vItem1 := flattenSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrievesNetworkDeviceProductNamesAssignedToASoftwareImage search response", @@ -261,7 +261,7 @@ func resourceImagesSiteWiseProductNamesUpdate(ctx context.Context, d *schema.Res vvImageID := resourceMap["image_id"] vvProductNameOrdinal, _ := strconv.ParseFloat(resourceMap["product_name_ordinal"], 64) if d.HasChange("parameters") { - request1 := expandRequestImagesSiteWiseProductNamesUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImage(ctx, "parameters.0", d) + request1 := expandRequestImagesSiteWiseProductNamesUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImageV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.SoftwareImageManagementSwim.UpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImage(vvImageID, vvProductNameOrdinal, request1) if err != nil || response1 == nil { @@ -372,8 +372,9 @@ func resourceImagesSiteWiseProductNamesDelete(ctx context.Context, d *schema.Res return diags } -func expandRequestImagesSiteWiseProductNamesAssignNetworkDeviceProductNameToTheGivenSoftwareImage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimAssignNetworkDeviceProductNameToTheGivenSoftwareImage { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimAssignNetworkDeviceProductNameToTheGivenSoftwareImage{} + +func expandRequestImagesSiteWiseProductNamesAssignNetworkDeviceProductNameToTheGivenSoftwareImageV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimAssignNetworkDeviceProductNameToTheGivenSoftwareImageV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimAssignNetworkDeviceProductNameToTheGivenSoftwareImageV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".product_name_ordinal")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".product_name_ordinal")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".product_name_ordinal")))) { request.ProductNameOrdinal = interfaceToFloat64Ptr(v) } @@ -386,8 +387,8 @@ func expandRequestImagesSiteWiseProductNamesAssignNetworkDeviceProductNameToTheG return &request } -func expandRequestImagesSiteWiseProductNamesUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImage { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImage{} +func expandRequestImagesSiteWiseProductNamesUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImageV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImageV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimUpdateTheListOfSitesForTheNetworkDeviceProductNameAssignedToTheSoftwareImageV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_ids")))) { request.SiteIDs = interfaceToSliceString(v) } @@ -397,10 +398,10 @@ func expandRequestImagesSiteWiseProductNamesUpdateTheListOfSitesForTheNetworkDev return &request } -func searchSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImage(m interface{}, queryParams catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageQueryParams, vImageID string, vProductNameOrdinal string) (*catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageResponse, error) { +func searchSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImage(m interface{}, queryParams catalystcentersdkgo.RetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1QueryParams, vImageID string, vProductNameOrdinal string) (*catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageResponse + var foundItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImageV1Response // var ite *catalystcentersdkgo.ResponseSoftwareImageManagementSwimRetrievesNetworkDeviceProductNamesAssignedToASoftwareImage if vProductNameOrdinal != "" { diff --git a/catalystcenter/resource_integrate_ise.go b/catalystcenter/resource_integrate_ise.go index 1785979..1efd127 100644 --- a/catalystcenter/resource_integrate_ise.go +++ b/catalystcenter/resource_integrate_ise.go @@ -85,28 +85,22 @@ func resourceIntegrateIseCreate(ctx context.Context, d *schema.ResourceData, m i vID := resourceItem["id"] vvID := vID.(string) - request1 := expandRequestIntegrateIseAcceptCiscoIseServerCertificateForCiscoIseServerIntegration(ctx, "parameters.0", d) + request1 := expandRequestIntegrateIseAcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1(ctx, "parameters.0", d) - response1, err := client.SystemSettings.AcceptCiscoIseServerCertificateForCiscoIseServerIntegration(vvID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, err := client.SystemSettings.AcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1(vvID, request1) - if err != nil || response1 == nil { + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + if err != nil { diags = append(diags, diagError( - "Failure when executing AcceptCiscoIseServerCertificateForCiscoIseServerIntegration", err)) + "Failure when setting AcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1 response", + err)) return diags } - - log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - - //Analizar verificacion. - - vItem1 := response1.String() - if err := d.Set("item", vItem1); err != nil { + if err := d.Set("item", response1); err != nil { diags = append(diags, diagError( - "Failure when setting AcceptCiscoIseServerCertificateForCiscoIseServerIntegration response", + "Failure when setting AcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1 response", err)) return diags } @@ -128,8 +122,8 @@ func resourceIntegrateIseDelete(ctx context.Context, d *schema.ResourceData, m i return diags } -func expandRequestIntegrateIseAcceptCiscoIseServerCertificateForCiscoIseServerIntegration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsAcceptCiscoIseServerCertificateForCiscoIseServerIntegration { - request := catalystcentersdkgo.RequestSystemSettingsAcceptCiscoIseServerCertificateForCiscoIseServerIntegration{} +func expandRequestIntegrateIseAcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsAcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1 { + request := catalystcentersdkgo.RequestSystemSettingsAcceptCiscoIseServerCertificateForCiscoIseServerIntegrationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_cert_accepted_by_user")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_cert_accepted_by_user")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_cert_accepted_by_user")))) { request.IsCertAcceptedByUser = interfaceToBoolPtr(v) } diff --git a/catalystcenter/resource_integration_settings_instances_itsm.go b/catalystcenter/resource_integration_settings_instances_itsm.go index d65bc8b..8b72599 100644 --- a/catalystcenter/resource_integration_settings_instances_itsm.go +++ b/catalystcenter/resource_integration_settings_instances_itsm.go @@ -213,7 +213,7 @@ func resourceIntegrationSettingsInstancesItsmCreate(ctx context.Context, d *sche var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSetting(ctx, "parameters.0", d) + request1 := expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vInstanceID, okInstanceID := resourceItem["instance_id"] @@ -286,7 +286,7 @@ func resourceIntegrationSettingsInstancesItsmRead(ctx context.Context, d *schema log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenItsmIntegrationGetItsmIntegrationSettingByIDItem(response1) + vItem1 := flattenItsmIntegrationGetItsmIntegrationSettingByIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetItsmIntegrationSettingByID response", @@ -309,7 +309,7 @@ func resourceIntegrationSettingsInstancesItsmUpdate(ctx context.Context, d *sche vvID := resourceMap["instance_id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSetting(ctx, "parameters.0", d) + request1 := expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.ItsmIntegration.UpdateItsmIntegrationSetting(vvID, request1) if err != nil || response1 == nil { @@ -366,8 +366,8 @@ func resourceIntegrationSettingsInstancesItsmDelete(ctx context.Context, d *sche return diags } -func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSetting(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSetting { - request := catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSetting{} +func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingV1 { + request := catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -375,7 +375,7 @@ func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSetting(c request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".data")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".data")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".data")))) { - request.Data = expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingData(ctx, key+".data.0", d) + request.Data = expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingV1Data(ctx, key+".data.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dyp_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dyp_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dyp_name")))) { request.DypName = interfaceToString(v) @@ -386,10 +386,10 @@ func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSetting(c return &request } -func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingData(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingData { - request := catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingData{} +func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingV1Data(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingV1Data { + request := catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingV1Data{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connection_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connection_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connection_settings")))) { - request.ConnectionSettings = expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingDataConnectionSettings(ctx, key+".connection_settings.0", d) + request.ConnectionSettings = expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingV1DataConnectionSettings(ctx, key+".connection_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -397,8 +397,8 @@ func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingDa return &request } -func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingDataConnectionSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingDataConnectionSettings { - request := catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingDataConnectionSettings{} +func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingV1DataConnectionSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingV1DataConnectionSettings { + request := catalystcentersdkgo.RequestItsmIntegrationCreateItsmIntegrationSettingV1DataConnectionSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".url")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".url")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".url")))) { request.URL = interfaceToString(v) } @@ -414,8 +414,8 @@ func expandRequestIntegrationSettingsInstancesItsmCreateItsmIntegrationSettingDa return &request } -func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSetting(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSetting { - request := catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSetting{} +func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingV1 { + request := catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -423,7 +423,7 @@ func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSetting(c request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".data")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".data")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".data")))) { - request.Data = expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingData(ctx, key+".data.0", d) + request.Data = expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingV1Data(ctx, key+".data.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dyp_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dyp_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dyp_name")))) { request.DypName = interfaceToString(v) @@ -434,10 +434,10 @@ func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSetting(c return &request } -func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingData(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingData { - request := catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingData{} +func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingV1Data(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingV1Data { + request := catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingV1Data{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".connection_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".connection_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".connection_settings")))) { - request.ConnectionSettings = expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingDataConnectionSettings(ctx, key+".connection_settings.0", d) + request.ConnectionSettings = expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingV1DataConnectionSettings(ctx, key+".connection_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -445,8 +445,8 @@ func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingDa return &request } -func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingDataConnectionSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingDataConnectionSettings { - request := catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingDataConnectionSettings{} +func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingV1DataConnectionSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingV1DataConnectionSettings { + request := catalystcentersdkgo.RequestItsmIntegrationUpdateItsmIntegrationSettingV1DataConnectionSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".url")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".url")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".url")))) { request.URL = interfaceToString(v) } @@ -462,7 +462,7 @@ func expandRequestIntegrationSettingsInstancesItsmUpdateItsmIntegrationSettingDa return &request } -func searchITSM(m interface{}, vName string) (foundItem *catalystcentersdkgo.ResponseItemItsmIntegrationGetAllItsmIntegrationSettings, err error) { +func searchITSM(m interface{}, vName string) (foundItem *catalystcentersdkgo.ResponseItemItsmIntegrationGetAllItsmIntegrationSettingsV1, err error) { client := m.(*catalystcentersdkgo.Client) nResponse, _, err := client.ItsmIntegration.GetAllItsmIntegrationSettings() diff --git a/catalystcenter/resource_interface_operation_create.go b/catalystcenter/resource_interface_operation_create.go index 67d9fb0..413e9e6 100644 --- a/catalystcenter/resource_interface_operation_create.go +++ b/catalystcenter/resource_interface_operation_create.go @@ -107,21 +107,19 @@ func resourceInterfaceOperationCreateCreate(ctx context.Context, d *schema.Resou vInterfaceUUID := resourceItem["interface_uuid"] vvInterfaceUUID := vInterfaceUUID.(string) - request1 := expandRequestInterfaceOperationCreateClearMacAddressTable(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.ClearMacAddressTableQueryParams{} + request1 := expandRequestInterfaceOperationCreateClearMacAddressTableV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.ClearMacAddressTableV1QueryParams{} - response1, restyResp1, err := client.Devices.ClearMacAddressTable(vvInterfaceUUID, request1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.ClearMacAddressTableV1(vvInterfaceUUID, request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ClearMacAddressTable", err)) + "Failure when executing ClearMacAddressTableV1", err)) return diags } @@ -129,7 +127,7 @@ func resourceInterfaceOperationCreateCreate(ctx context.Context, d *schema.Resou if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ClearMacAddressTable", err)) + "Failure when executing ClearMacAddressTableV1", err)) return diags } taskId := response1.Response.TaskID @@ -163,22 +161,24 @@ func resourceInterfaceOperationCreateCreate(ctx context.Context, d *schema.Resou } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ClearMacAddressTable", err1)) + "Failure when executing ClearMacAddressTableV1", err1)) return diags } } - vItem1 := flattenDevicesClearMacAddressTableItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesClearMacAddressTableV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ClearMacAddressTable response", + "Failure when setting ClearMacAddressTableV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceInterfaceOperationCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -193,24 +193,24 @@ func resourceInterfaceOperationCreateDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestInterfaceOperationCreateClearMacAddressTable(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesClearMacAddressTable { - request := catalystcentersdkgo.RequestDevicesClearMacAddressTable{} +func expandRequestInterfaceOperationCreateClearMacAddressTableV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesClearMacAddressTableV1 { + request := catalystcentersdkgo.RequestDevicesClearMacAddressTableV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".operation")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operation")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operation")))) { request.Operation = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".payload")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".payload")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".payload")))) { - request.Payload = expandRequestInterfaceOperationCreateClearMacAddressTablePayload(ctx, key+".payload.0", d) + request.Payload = expandRequestInterfaceOperationCreateClearMacAddressTableV1Payload(ctx, key+".payload.0", d) } return &request } -func expandRequestInterfaceOperationCreateClearMacAddressTablePayload(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesClearMacAddressTablePayload { - var request catalystcentersdkgo.RequestDevicesClearMacAddressTablePayload +func expandRequestInterfaceOperationCreateClearMacAddressTableV1Payload(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesClearMacAddressTableV1Payload { + var request catalystcentersdkgo.RequestDevicesClearMacAddressTableV1Payload request = d.Get(fixKeyAccess(key)) return &request } -func flattenDevicesClearMacAddressTableItem(item *catalystcentersdkgo.ResponseDevicesClearMacAddressTableResponse) []map[string]interface{} { +func flattenDevicesClearMacAddressTableV1Item(item *catalystcentersdkgo.ResponseDevicesClearMacAddressTableV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_interface_update.go b/catalystcenter/resource_interface_update.go index 8f593db..3498bfa 100644 --- a/catalystcenter/resource_interface_update.go +++ b/catalystcenter/resource_interface_update.go @@ -159,32 +159,28 @@ func resourceInterfaceUpdateCreate(ctx context.Context, d *schema.ResourceData, vInterfaceUUID := resourceItem["interface_uuid"] vvInterfaceUUID := vInterfaceUUID.(string) - request1 := expandRequestInterfaceUpdateUpdateInterfaceDetails(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.UpdateInterfaceDetailsQueryParams{} + request1 := expandRequestInterfaceUpdateUpdateInterfaceDetailsV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.UpdateInterfaceDetailsV1QueryParams{} - response1, restyResp1, err := client.Devices.UpdateInterfaceDetails(vvInterfaceUUID, request1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.UpdateInterfaceDetailsV1(vvInterfaceUUID, request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateInterfaceDetails", err)) + "Failure when executing UpdateInterfaceDetailsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDevicesUpdateInterfaceDetailsItem(response1.Response) + vItem1 := flattenDevicesUpdateInterfaceDetailsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateInterfaceDetails response", + "Failure when setting UpdateInterfaceDetailsV1 response", err)) return diags } @@ -206,8 +202,8 @@ func resourceInterfaceUpdateDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestInterfaceUpdateUpdateInterfaceDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateInterfaceDetails { - request := catalystcentersdkgo.RequestDevicesUpdateInterfaceDetails{} +func expandRequestInterfaceUpdateUpdateInterfaceDetailsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateInterfaceDetailsV1 { + request := catalystcentersdkgo.RequestDevicesUpdateInterfaceDetailsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { request.Description = interfaceToString(v) } @@ -223,26 +219,26 @@ func expandRequestInterfaceUpdateUpdateInterfaceDetails(ctx context.Context, key return &request } -func flattenDevicesUpdateInterfaceDetailsItem(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsResponse) []map[string]interface{} { +func flattenDevicesUpdateInterfaceDetailsV1Item(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["type"] = item.Type - respItem["properties"] = flattenDevicesUpdateInterfaceDetailsItemProperties(item.Properties) + respItem["properties"] = flattenDevicesUpdateInterfaceDetailsV1ItemProperties(item.Properties) respItem["required"] = item.Required return []map[string]interface{}{ respItem, } } -func flattenDevicesUpdateInterfaceDetailsItemProperties(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsResponseProperties) []map[string]interface{} { +func flattenDevicesUpdateInterfaceDetailsV1ItemProperties(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1ResponseProperties) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["task_id"] = flattenDevicesUpdateInterfaceDetailsItemPropertiesTaskID(item.TaskID) - respItem["url"] = flattenDevicesUpdateInterfaceDetailsItemPropertiesURL(item.URL) + respItem["task_id"] = flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesTaskID(item.TaskID) + respItem["url"] = flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesURL(item.URL) return []map[string]interface{}{ respItem, @@ -250,7 +246,7 @@ func flattenDevicesUpdateInterfaceDetailsItemProperties(item *catalystcentersdkg } -func flattenDevicesUpdateInterfaceDetailsItemPropertiesTaskID(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsResponsePropertiesTaskID) []map[string]interface{} { +func flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesTaskID(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1ResponsePropertiesTaskID) []map[string]interface{} { if item == nil { return nil } @@ -263,7 +259,7 @@ func flattenDevicesUpdateInterfaceDetailsItemPropertiesTaskID(item *catalystcent } -func flattenDevicesUpdateInterfaceDetailsItemPropertiesURL(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsResponsePropertiesURL) []map[string]interface{} { +func flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesURL(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1ResponsePropertiesURL) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_interfaces_members_associations_query.go b/catalystcenter/resource_interfaces_members_associations_query.go index 87b9dff..932eb47 100644 --- a/catalystcenter/resource_interfaces_members_associations_query.go +++ b/catalystcenter/resource_interfaces_members_associations_query.go @@ -148,15 +148,15 @@ func resourceInterfacesMembersAssociationsQueryDelete(ctx context.Context, d *sc return diags } -func expandRequestInterfacesMembersAssociationsQueryQueryTheTagsAssociatedWithInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithInterfaces { - request := catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithInterfaces{} +func expandRequestInterfacesMembersAssociationsQueryQueryTheTagsAssociatedWithInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithInterfacesV1 { + request := catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithInterfacesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ids")))) { request.IDs = interfaceToSliceString(v) } return &request } -func flattenTagQueryTheTagsAssociatedWithInterfacesItems(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithInterfacesResponse) []map[string]interface{} { +func flattenTagQueryTheTagsAssociatedWithInterfacesItems(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithInterfacesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -170,7 +170,7 @@ func flattenTagQueryTheTagsAssociatedWithInterfacesItems(items *[]catalystcenter return respItems } -func flattenTagQueryTheTagsAssociatedWithInterfacesItemsTags(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithInterfacesResponseTags) []map[string]interface{} { +func flattenTagQueryTheTagsAssociatedWithInterfacesItemsTags(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithInterfacesV1ResponseTags) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_interfaces_query.go b/catalystcenter/resource_interfaces_query.go index b89783b..e9f1f31 100644 --- a/catalystcenter/resource_interfaces_query.go +++ b/catalystcenter/resource_interfaces_query.go @@ -534,31 +534,27 @@ func resourceInterfacesQueryCreate(ctx context.Context, d *schema.ResourceData, client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(ctx, "parameters.0", d) + request1 := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.GetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.GetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions", err)) + "Failure when executing GetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItems(response1.Response) + vItems1 := flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions response", + "Failure when setting GetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1 response", err)) return diags } @@ -580,8 +576,8 @@ func resourceInterfacesQueryDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1 { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -595,19 +591,19 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage(ctx, key+".page.0", d) + request.Page = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters { - request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters { + request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -618,7 +614,7 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return nil } for item_no := range objs { - i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -626,8 +622,8 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -638,22 +634,22 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { - request.Value = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersValue(ctx, key+".value.0", d) + request.Value = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersValue(ctx, key+".value.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFiltersArray(ctx, key+".filters", d) } return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersValue { - var request catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersValue +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersValue { + var request catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersValue request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFilters { - request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFilters{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFilters { + request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -664,7 +660,7 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return nil } for item_no := range objs { - i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -672,8 +668,8 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFilters { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFilters{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFilters { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -684,7 +680,7 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { - request.Value = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFiltersValue(ctx, key+".value.0", d) + request.Value = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFiltersValue(ctx, key+".value.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { request.Filters = interfaceToSliceString(v) @@ -692,14 +688,14 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFiltersValue { - var request catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersFiltersValue +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFiltersValue { + var request catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersFiltersValue request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -710,7 +706,7 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return nil } for item_no := range objs { - i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -718,8 +714,8 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -729,8 +725,8 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -738,13 +734,13 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy { - request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy { + request := []catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -755,7 +751,7 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return nil } for item_no := range objs { - i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -763,8 +759,8 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy{} +func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -774,7 +770,7 @@ func expandRequestInterfacesQueryGetsTheListOfInterfacesAcrossTheNetworkDevicesB return &request } -func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItems(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponse) []map[string]interface{} { +func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -819,13 +815,13 @@ func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvi respItem["site_name"] = item.SiteName respItem["site_hierarchy"] = item.SiteHierarchy respItem["site_hierarchy_id"] = item.SiteHierarchyID - respItem["aggregate_attributes"] = flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsAggregateAttributes(item.AggregateAttributes) + respItem["aggregate_attributes"] = flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } @@ -833,13 +829,13 @@ func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvi for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["values"] = flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsAggregateAttributesValues(item.Values) + respItem["values"] = flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsAggregateAttributesValues(item.Values) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsAggregateAttributesValues(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseAggregateAttributesValues) []map[string]interface{} { +func flattenDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsAggregateAttributesValues(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfInterfacesAcrossTheNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseAggregateAttributesValues) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_interfaces_query_count.go b/catalystcenter/resource_interfaces_query_count.go index 90c4c4b..c32923d 100644 --- a/catalystcenter/resource_interfaces_query_count.go +++ b/catalystcenter/resource_interfaces_query_count.go @@ -224,31 +224,27 @@ func resourceInterfacesQueryCountCreate(ctx context.Context, d *schema.ResourceD client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevices(ctx, "parameters.0", d) + request1 := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.TheTotalInterfacesCountAcrossTheNetworkDevices(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.TheTotalInterfacesCountAcrossTheNetworkDevicesV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing TheTotalInterfacesCountAcrossTheNetworkDevices", err)) + "Failure when executing TheTotalInterfacesCountAcrossTheNetworkDevicesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesItem(response1.Response) + vItem1 := flattenDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting TheTotalInterfacesCountAcrossTheNetworkDevices response", + "Failure when setting TheTotalInterfacesCountAcrossTheNetworkDevicesV1 response", err)) return diags } @@ -270,8 +266,8 @@ func resourceInterfacesQueryCountDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevices { - request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevices{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1 { + request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -285,19 +281,19 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesPage(ctx, key+".page.0", d) + request.Page = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesFilters { - request := []catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesFilters{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Filters { + request := []catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -308,7 +304,7 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return nil } for item_no := range objs { - i := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -316,8 +312,8 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesFilters { - request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesFilters{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Filters { + request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -328,7 +324,7 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { - request.Value = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesFiltersValue(ctx, key+".value.0", d) + request.Value = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1FiltersValue(ctx, key+".value.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { request.Filters = interfaceToSliceString(v) @@ -336,14 +332,14 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesFiltersValue { - var request catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesFiltersValue +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1FiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1FiltersValue { + var request catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1FiltersValue request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributes{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -354,7 +350,7 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return nil } for item_no := range objs { - i := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -362,8 +358,8 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributes { - request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesAggregateAttributes{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributes { + request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -373,8 +369,8 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesPage { - request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesPage{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Page { + request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -382,13 +378,13 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortBy { - request := []catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortBy{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortBy { + request := []catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -399,7 +395,7 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return nil } for item_no := range objs { - i := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -407,8 +403,8 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return &request } -func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortBy { - request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesPageSortBy{} +func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortBy { + request := catalystcentersdkgo.RequestDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -418,7 +414,7 @@ func expandRequestInterfacesQueryCountTheTotalInterfacesCountAcrossTheNetworkDev return &request } -func flattenDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesItem(item *catalystcentersdkgo.ResponseDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesResponse) []map[string]interface{} { +func flattenDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Item(item *catalystcentersdkgo.ResponseDevicesTheTotalInterfacesCountAcrossTheNetworkDevicesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_ipam_server_setting.go b/catalystcenter/resource_ipam_server_setting.go index ac84492..f4a69df 100644 --- a/catalystcenter/resource_ipam_server_setting.go +++ b/catalystcenter/resource_ipam_server_setting.go @@ -349,8 +349,8 @@ func resourceIPamServerSettingDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestIPamServerSettingCreatesConfigurationDetailsOfTheExternalIPAMServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsCreatesConfigurationDetailsOfTheExternalIPAMServer { - request := catalystcentersdkgo.RequestSystemSettingsCreatesConfigurationDetailsOfTheExternalIPAMServer{} +func expandRequestIPamServerSettingCreatesConfigurationDetailsOfTheExternalIPAMServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsCreatesConfigurationDetailsOfTheExternalIPAMServerV1 { + request := catalystcentersdkgo.RequestSystemSettingsCreatesConfigurationDetailsOfTheExternalIPAMServerV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".server_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".server_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".server_name")))) { request.ServerName = interfaceToString(v) } @@ -378,8 +378,8 @@ func expandRequestIPamServerSettingCreatesConfigurationDetailsOfTheExternalIPAMS return &request } -func expandRequestIPamServerSettingUpdatesConfigurationDetailsOfTheExternalIPAMServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsUpdatesConfigurationDetailsOfTheExternalIPAMServer { - request := catalystcentersdkgo.RequestSystemSettingsUpdatesConfigurationDetailsOfTheExternalIPAMServer{} +func expandRequestIPamServerSettingUpdatesConfigurationDetailsOfTheExternalIPAMServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsUpdatesConfigurationDetailsOfTheExternalIPAMServerV1 { + request := catalystcentersdkgo.RequestSystemSettingsUpdatesConfigurationDetailsOfTheExternalIPAMServerV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".server_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".server_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".server_name")))) { request.ServerName = interfaceToString(v) } diff --git a/catalystcenter/resource_itsm_integration_events_retry.go b/catalystcenter/resource_itsm_integration_events_retry.go index 355207e..3219fba 100644 --- a/catalystcenter/resource_itsm_integration_events_retry.go +++ b/catalystcenter/resource_itsm_integration_events_retry.go @@ -65,7 +65,7 @@ Ids can be retrieved using the 'Get Failed ITSM Events' API in the 'instanceId' Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestItsmRetryIntegrationEvents`, + Description: `Array of RequestItsmRetryIntegrationEventsV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -85,20 +85,18 @@ func resourceItsmIntegrationEventsRetryCreate(ctx context.Context, d *schema.Res client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestItsmIntegrationEventsRetryRetryIntegrationEvents(ctx, "parameters.0", d) + request1 := expandRequestItsmIntegrationEventsRetryRetryIntegrationEventsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Itsm.RetryIntegrationEvents(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Itsm.RetryIntegrationEventsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing RetryIntegrationEvents", err)) + "Failure when executing RetryIntegrationEventsV1", err)) return diags } @@ -134,23 +132,25 @@ func resourceItsmIntegrationEventsRetryCreate(ctx context.Context, d *schema.Res if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing RetryIntegrationEvents", err, - "Failure at RetryIntegrationEvents execution", bapiError)) + "Failure when executing RetryIntegrationEventsV1", err, + "Failure at RetryIntegrationEventsV1 execution", bapiError)) return diags } } - vItem1 := flattenItsmRetryIntegrationEventsItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenItsmRetryIntegrationEventsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting RetryIntegrationEvents response", + "Failure when setting RetryIntegrationEventsV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceItsmIntegrationEventsRetryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -165,15 +165,15 @@ func resourceItsmIntegrationEventsRetryDelete(ctx context.Context, d *schema.Res return diags } -func expandRequestItsmIntegrationEventsRetryRetryIntegrationEvents(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmRetryIntegrationEvents { - request := catalystcentersdkgo.RequestItsmRetryIntegrationEvents{} +func expandRequestItsmIntegrationEventsRetryRetryIntegrationEventsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItsmRetryIntegrationEventsV1 { + request := catalystcentersdkgo.RequestItsmRetryIntegrationEventsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".payload")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".payload")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".payload")))) { request = interfaceToSliceString(v) } return &request } -func flattenItsmRetryIntegrationEventsItem(item *catalystcentersdkgo.ResponseItsmRetryIntegrationEvents) []map[string]interface{} { +func flattenItsmRetryIntegrationEventsV1Item(item *catalystcentersdkgo.ResponseItsmRetryIntegrationEventsV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_lan_automation_create.go b/catalystcenter/resource_lan_automation_create.go index 405728a..f992d89 100644 --- a/catalystcenter/resource_lan_automation_create.go +++ b/catalystcenter/resource_lan_automation_create.go @@ -60,7 +60,7 @@ func resourceLanAutomationCreate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestLanAutomationLANAutomationStart`, + Description: `Array of RequestLanAutomationLANAutomationStartV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -188,31 +188,27 @@ func resourceLanAutomationCreateCreate(ctx context.Context, d *schema.ResourceDa client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestLanAutomationCreateLanAutomationStart(ctx, "parameters.0", d) + request1 := expandRequestLanAutomationCreateLanAutomationStartV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.LanAutomation.LanAutomationStart(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.LanAutomation.LanAutomationStartV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing LanAutomationStart", err)) + "Failure when executing LanAutomationStartV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenLanAutomationLanAutomationStartItem(response1.Response) + vItem1 := flattenLanAutomationLanAutomationStartV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationStart response", + "Failure when setting LanAutomationStartV1 response", err)) return diags } @@ -234,16 +230,16 @@ func resourceLanAutomationCreateDelete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestLanAutomationCreateLanAutomationStart(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationStart { - request := catalystcentersdkgo.RequestLanAutomationLanAutomationStart{} - if v := expandRequestLanAutomationCreateLanAutomationStartItemArray(ctx, key+".payload", d); v != nil { +func expandRequestLanAutomationCreateLanAutomationStartV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationStartV1 { + request := catalystcentersdkgo.RequestLanAutomationLanAutomationStartV1{} + if v := expandRequestLanAutomationCreateLanAutomationStartV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestLanAutomationCreateLanAutomationStartItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemLanAutomationLanAutomationStart { - request := []catalystcentersdkgo.RequestItemLanAutomationLanAutomationStart{} +func expandRequestLanAutomationCreateLanAutomationStartV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1 { + request := []catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -254,7 +250,7 @@ func expandRequestLanAutomationCreateLanAutomationStartItemArray(ctx context.Con return nil } for item_no := range objs { - i := expandRequestLanAutomationCreateLanAutomationStartItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestLanAutomationCreateLanAutomationStartV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -262,8 +258,8 @@ func expandRequestLanAutomationCreateLanAutomationStartItemArray(ctx context.Con return &request } -func expandRequestLanAutomationCreateLanAutomationStartItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemLanAutomationLanAutomationStart { - request := catalystcentersdkgo.RequestItemLanAutomationLanAutomationStart{} +func expandRequestLanAutomationCreateLanAutomationStartV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1 { + request := catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".discovered_device_site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".discovered_device_site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".discovered_device_site_name_hierarchy")))) { request.DiscoveredDeviceSiteNameHierarchy = interfaceToString(v) } @@ -277,7 +273,7 @@ func expandRequestLanAutomationCreateLanAutomationStartItem(ctx context.Context, request.PrimaryDeviceInterfaceNames = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_pools")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_pools")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_pools")))) { - request.IPPools = expandRequestLanAutomationCreateLanAutomationStartItemIPPoolsArray(ctx, key+".ip_pools", d) + request.IPPools = expandRequestLanAutomationCreateLanAutomationStartV1ItemIPPoolsArray(ctx, key+".ip_pools", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".mulitcast_enabled")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mulitcast_enabled")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mulitcast_enabled")))) { request.MulitcastEnabled = interfaceToBoolPtr(v) @@ -297,8 +293,8 @@ func expandRequestLanAutomationCreateLanAutomationStartItem(ctx context.Context, return &request } -func expandRequestLanAutomationCreateLanAutomationStartItemIPPoolsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartIPPools { - request := []catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartIPPools{} +func expandRequestLanAutomationCreateLanAutomationStartV1ItemIPPoolsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1IPPools { + request := []catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1IPPools{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -309,7 +305,7 @@ func expandRequestLanAutomationCreateLanAutomationStartItemIPPoolsArray(ctx cont return nil } for item_no := range objs { - i := expandRequestLanAutomationCreateLanAutomationStartItemIPPools(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestLanAutomationCreateLanAutomationStartV1ItemIPPools(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -317,8 +313,8 @@ func expandRequestLanAutomationCreateLanAutomationStartItemIPPoolsArray(ctx cont return &request } -func expandRequestLanAutomationCreateLanAutomationStartItemIPPools(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartIPPools { - request := catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartIPPools{} +func expandRequestLanAutomationCreateLanAutomationStartV1ItemIPPools(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1IPPools { + request := catalystcentersdkgo.RequestItemLanAutomationLanAutomationStartV1IPPools{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_pool_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_pool_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_pool_name")))) { request.IPPoolName = interfaceToString(v) } @@ -328,7 +324,7 @@ func expandRequestLanAutomationCreateLanAutomationStartItemIPPools(ctx context.C return &request } -func flattenLanAutomationLanAutomationStartItem(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationStartResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationStartV1Item(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationStartV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_lan_automation_delete.go b/catalystcenter/resource_lan_automation_delete.go index 37c4520..96a5fea 100644 --- a/catalystcenter/resource_lan_automation_delete.go +++ b/catalystcenter/resource_lan_automation_delete.go @@ -86,25 +86,25 @@ func resourceLanAutomationDeleteCreate(ctx context.Context, d *schema.ResourceDa vvID := vID.(string) - response1, restyResp1, err := client.LanAutomation.LanAutomationStop(vvID) + // has_unknown_response: None + + response1, restyResp1, err := client.LanAutomation.LanAutomationStopV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing LanAutomationStop", err)) + "Failure when executing LanAutomationStopV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenLanAutomationLanAutomationStopItem(response1.Response) + vItem1 := flattenLanAutomationLanAutomationStopV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationStop response", + "Failure when setting LanAutomationStopV1 response", err)) return diags } @@ -112,6 +112,8 @@ func resourceLanAutomationDeleteCreate(ctx context.Context, d *schema.ResourceDa d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceLanAutomationDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -126,7 +128,7 @@ func resourceLanAutomationDeleteDelete(ctx context.Context, d *schema.ResourceDa return diags } -func flattenLanAutomationLanAutomationStopItem(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationStopResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationStopV1Item(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationStopV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_lan_automation_update_device.go b/catalystcenter/resource_lan_automation_update_device.go index b27b711..2c6b24a 100644 --- a/catalystcenter/resource_lan_automation_update_device.go +++ b/catalystcenter/resource_lan_automation_update_device.go @@ -65,7 +65,7 @@ update, hostname update, link addition, and link deletion. Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "feature": &schema.Schema{ - Description: `feature query parameter. Feature ID for the update. Supported feature IDs include: LOOPBACK0_IPADDRESS_UPDATE, HOSTNAME_UPDATE, LINK_Add and LINK_DELETE. + Description: `feature query parameter. Feature ID for the update. Supported feature IDs include: LOOPBACK0_IPADDRESS_UPDATE, HOSTNAME_UPDATE, LINK_ADD, and LINK_DELETE. `, Type: schema.TypeString, Required: true, @@ -191,23 +191,21 @@ func resourceLanAutomationUpdateDeviceCreate(ctx context.Context, d *schema.Reso vFeature := resourceItem["feature"] - request1 := expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdate(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.LanAutomationDeviceUpdateQueryParams{} + request1 := expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.LanAutomationDeviceUpdateV1QueryParams{} queryParams1.Feature = vFeature.(string) - response1, restyResp1, err := client.LanAutomation.LanAutomationDeviceUpdate(request1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.LanAutomation.LanAutomationDeviceUpdateV1(request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing LanAutomationDeviceUpdate", err)) + "Failure when executing LanAutomationDeviceUpdateV1", err)) return diags } @@ -215,7 +213,7 @@ func resourceLanAutomationUpdateDeviceCreate(ctx context.Context, d *schema.Reso if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing LANAutomationDeviceUpdate", err)) + "Failure when executing LANAutomationDeviceUpdateV1", err)) return diags } taskId := response1.Response.TaskID @@ -249,22 +247,24 @@ func resourceLanAutomationUpdateDeviceCreate(ctx context.Context, d *schema.Reso } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing LANAutomationDeviceUpdate", err1)) + "Failure when executing LANAutomationDeviceUpdateV1", err1)) return diags } } - vItem1 := flattenLanAutomationLanAutomationDeviceUpdateItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenLanAutomationLanAutomationDeviceUpdateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting LanAutomationDeviceUpdate response", + "Failure when setting LanAutomationDeviceUpdateV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceLanAutomationUpdateDeviceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -279,22 +279,22 @@ func resourceLanAutomationUpdateDeviceDelete(ctx context.Context, d *schema.Reso return diags } -func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdate { - request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdate{} +func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1 { + request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".loopback_update_device_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".loopback_update_device_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".loopback_update_device_list")))) { - request.LoopbackUpdateDeviceList = expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpdateDeviceListArray(ctx, key+".loopback_update_device_list", d) + request.LoopbackUpdateDeviceList = expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1LoopbackUpdateDeviceListArray(ctx, key+".loopback_update_device_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".link_update")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".link_update")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".link_update")))) { - request.LinkUpdate = expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLinkUpdate(ctx, key+".link_update.0", d) + request.LinkUpdate = expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1LinkUpdate(ctx, key+".link_update.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".hostname_update_devices")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hostname_update_devices")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hostname_update_devices")))) { - request.HostnameUpdateDevices = expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpdateDevicesArray(ctx, key+".hostname_update_devices", d) + request.HostnameUpdateDevices = expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1HostnameUpdateDevicesArray(ctx, key+".hostname_update_devices", d) } return &request } -func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpdateDeviceListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateLoopbackUpdateDeviceList { - request := []catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateLoopbackUpdateDeviceList{} +func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1LoopbackUpdateDeviceListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1LoopbackUpdateDeviceList { + request := []catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1LoopbackUpdateDeviceList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -305,7 +305,7 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpda return nil } for item_no := range objs { - i := expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpdateDeviceList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1LoopbackUpdateDeviceList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -313,8 +313,8 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpda return &request } -func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpdateDeviceList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateLoopbackUpdateDeviceList { - request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateLoopbackUpdateDeviceList{} +func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1LoopbackUpdateDeviceList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1LoopbackUpdateDeviceList { + request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1LoopbackUpdateDeviceList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ipaddress")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ipaddress")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ipaddress")))) { request.DeviceManagementIPAddress = interfaceToString(v) } @@ -324,8 +324,8 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLoopbackUpda return &request } -func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLinkUpdate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateLinkUpdate { - request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateLinkUpdate{} +func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1LinkUpdate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1LinkUpdate { + request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1LinkUpdate{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_device_management_ipaddress")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_device_management_ipaddress")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_device_management_ipaddress")))) { request.SourceDeviceManagementIPAddress = interfaceToString(v) } @@ -344,8 +344,8 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateLinkUpdate(c return &request } -func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpdateDevicesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateHostnameUpdateDevices { - request := []catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateHostnameUpdateDevices{} +func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1HostnameUpdateDevicesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1HostnameUpdateDevices { + request := []catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1HostnameUpdateDevices{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -356,7 +356,7 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpda return nil } for item_no := range objs { - i := expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpdateDevices(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1HostnameUpdateDevices(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -364,8 +364,8 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpda return &request } -func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpdateDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateHostnameUpdateDevices { - request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateHostnameUpdateDevices{} +func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateV1HostnameUpdateDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1HostnameUpdateDevices { + request := catalystcentersdkgo.RequestLanAutomationLanAutomationDeviceUpdateV1HostnameUpdateDevices{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ipaddress")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ipaddress")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ipaddress")))) { request.DeviceManagementIPAddress = interfaceToString(v) } @@ -375,7 +375,7 @@ func expandRequestLanAutomationUpdateDeviceLanAutomationDeviceUpdateHostnameUpda return &request } -func flattenLanAutomationLanAutomationDeviceUpdateItem(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationDeviceUpdateResponse) []map[string]interface{} { +func flattenLanAutomationLanAutomationDeviceUpdateV1Item(item *catalystcentersdkgo.ResponseLanAutomationLanAutomationDeviceUpdateV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_lan_automation_update_v2.go b/catalystcenter/resource_lan_automation_update_v2.go index 9d8ec34..10db676 100644 --- a/catalystcenter/resource_lan_automation_update_v2.go +++ b/catalystcenter/resource_lan_automation_update_v2.go @@ -125,11 +125,9 @@ func resourceLanAutomationUpdateV2Create(ctx context.Context, d *schema.Resource vvID := vID.(string) request1 := expandRequestLanAutomationUpdateV2LanAutomationStopAndUpdateDevicesV2(ctx, "parameters.0", d) - response1, restyResp1, err := client.LanAutomation.LanAutomationStopAndUpdateDevicesV2(vvID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.LanAutomation.LanAutomationStopAndUpdateDevicesV2(vvID, request1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -183,6 +181,9 @@ func resourceLanAutomationUpdateV2Create(ctx context.Context, d *schema.Resource } } + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } vItem1 := flattenLanAutomationLanAutomationStopAndUpdateDevicesV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -193,7 +194,6 @@ func resourceLanAutomationUpdateV2Create(ctx context.Context, d *schema.Resource d.SetId(getUnixTimeString()) return diags - } func resourceLanAutomationUpdateV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_lan_automation_v2.go b/catalystcenter/resource_lan_automation_v2.go index 0a23f00..2476cd7 100644 --- a/catalystcenter/resource_lan_automation_v2.go +++ b/catalystcenter/resource_lan_automation_v2.go @@ -257,11 +257,9 @@ func resourceLanAutomationV2Create(ctx context.Context, d *schema.ResourceData, request1 := expandRequestLanAutomationV2LanAutomationStartV2(ctx, "parameters.0", d) - response1, restyResp1, err := client.LanAutomation.LanAutomationStartV2(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.LanAutomation.LanAutomationStartV2(request1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -315,6 +313,9 @@ func resourceLanAutomationV2Create(ctx context.Context, d *schema.ResourceData, } } + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } vItem1 := flattenLanAutomationLanAutomationStartV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -325,7 +326,6 @@ func resourceLanAutomationV2Create(ctx context.Context, d *schema.ResourceData, d.SetId(getUnixTimeString()) return diags - } func resourceLanAutomationV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_license_device.go b/catalystcenter/resource_license_device.go index 235919a..31d8c52 100644 --- a/catalystcenter/resource_license_device.go +++ b/catalystcenter/resource_license_device.go @@ -116,7 +116,7 @@ func resourceLicenseDeviceCreate(ctx context.Context, d *schema.ResourceData, m vvSmartAccountID := interfaceToString(vSmartAccountID) vVirtualAccountName := resourceItem["virtual_account_name"] vvVirtualAccountName := interfaceToString(vVirtualAccountName) - request1 := expandRequestLicenseDeviceChangeVirtualAccount(ctx, "parameters.0", d) + request1 := expandRequestLicenseDeviceChangeVirtualAccountV1(ctx, "parameters.0", d) response1, err := searchLicensesSmartAccountDetails(m, vvVirtualAccountName, vvSmartAccountID) if err != nil || response1 != nil { @@ -235,7 +235,7 @@ func resourceLicenseDeviceUpdate(ctx context.Context, d *schema.ResourceData, m } if d.HasChange("parameters") { - request1 := expandRequestLicenseDeviceDeviceRegistration(ctx, "parameters.0", d) + request1 := expandRequestLicenseDeviceDeviceRegistrationV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Licenses.DeviceRegistration(vVirtualAccountName, request1) @@ -331,8 +331,8 @@ func resourceLicenseDeviceDelete(ctx context.Context, d *schema.ResourceData, m d.SetId("") return diags } -func expandRequestLicenseDeviceChangeVirtualAccount(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesChangeVirtualAccount { - request := catalystcentersdkgo.RequestLicensesChangeVirtualAccount{} +func expandRequestLicenseDeviceChangeVirtualAccountV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesChangeVirtualAccountV1 { + request := catalystcentersdkgo.RequestLicensesChangeVirtualAccountV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_uuids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_uuids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_uuids")))) { request.DeviceUUIDs = interfaceToSliceString(v) } @@ -342,8 +342,8 @@ func expandRequestLicenseDeviceChangeVirtualAccount(ctx context.Context, key str return &request } -func expandRequestLicenseDeviceDeviceRegistration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesDeviceRegistration { - request := catalystcentersdkgo.RequestLicensesDeviceRegistration{} +func expandRequestLicenseDeviceDeviceRegistrationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesDeviceRegistrationV1 { + request := catalystcentersdkgo.RequestLicensesDeviceRegistrationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_uuids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_uuids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_uuids")))) { request.DeviceUUIDs = interfaceToSliceString(v) } @@ -353,19 +353,8 @@ func expandRequestLicenseDeviceDeviceRegistration(ctx context.Context, key strin return &request } -func expandRequestLicenseDeviceRegistration2DeviceRegistration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesDeviceRegistration { - request := catalystcentersdkgo.RequestLicensesDeviceRegistration{} - if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_uuids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_uuids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_uuids")))) { - request.DeviceUUIDs = interfaceToSliceString(v) - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - - return &request -} -func expandRequestLicenseDeviceDeregistrationDeviceDeregistration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesDeviceDeregistration { - request := catalystcentersdkgo.RequestLicensesDeviceDeregistration{} +func expandRequestLicenseDeviceDeregistrationDeviceDeregistration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesDeviceDeregistrationV1 { + request := catalystcentersdkgo.RequestLicensesDeviceDeregistrationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_uuids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_uuids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_uuids")))) { request.DeviceUUIDs = interfaceToSliceString(v) } @@ -376,11 +365,11 @@ func expandRequestLicenseDeviceDeregistrationDeviceDeregistration(ctx context.Co return &request } -func searchLicensesSmartAccountDetails(m interface{}, vName string, vID string) (*catalystcentersdkgo.ResponseLicensesSmartAccountDetailsResponse, error) { +func searchLicensesSmartAccountDetails(m interface{}, vName string, vID string) (*catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsResponse - var ite *catalystcentersdkgo.ResponseLicensesSmartAccountDetails + var foundItem *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1Response + var ite *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1 ite, _, err = client.Licenses.SmartAccountDetails() if err != nil { return foundItem, err @@ -393,7 +382,7 @@ func searchLicensesSmartAccountDetails(m interface{}, vName string, vID string) for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == vName && item.ID == vID { - var getItem *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsResponse + var getItem *catalystcentersdkgo.ResponseLicensesSmartAccountDetailsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_license_setting.go b/catalystcenter/resource_license_setting.go index c5c79c2..8089ada 100644 --- a/catalystcenter/resource_license_setting.go +++ b/catalystcenter/resource_license_setting.go @@ -114,7 +114,7 @@ func resourceLicenseSettingRead(ctx context.Context, d *schema.ResourceData, m i log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenLicensesRetrieveLicenseSettingItem(response1.Response) + vItem1 := flattenLicensesRetrieveLicenseSettingV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveLicenseSetting response", @@ -134,7 +134,7 @@ func resourceLicenseSettingUpdate(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestLicenseSettingUpdateLicenseSetting(ctx, "parameters.0", d) + request1 := expandRequestLicenseSettingUpdateLicenseSettingV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Licenses.UpdateLicenseSetting(request1) if err != nil || response1 == nil { @@ -167,8 +167,8 @@ func resourceLicenseSettingDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestLicenseSettingUpdateLicenseSetting(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesUpdateLicenseSetting { - request := catalystcentersdkgo.RequestLicensesUpdateLicenseSetting{} +func expandRequestLicenseSettingUpdateLicenseSettingV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestLicensesUpdateLicenseSettingV1 { + request := catalystcentersdkgo.RequestLicensesUpdateLicenseSettingV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_smart_account_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_smart_account_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_smart_account_id")))) { request.DefaultSmartAccountID = interfaceToString(v) } diff --git a/catalystcenter/resource_maps_export.go b/catalystcenter/resource_maps_export.go index fe9c7b3..5f67f01 100644 --- a/catalystcenter/resource_maps_export.go +++ b/catalystcenter/resource_maps_export.go @@ -80,14 +80,16 @@ func resourceMapsExportCreate(ctx context.Context, d *schema.ResourceData, m int vvSiteHierarchyUUID := vSiteHierarchyUUID.(string) - response1, restyResp1, err := client.Sites.ExportMapArchive(vvSiteHierarchyUUID) + // has_unknown_response: None + + response1, restyResp1, err := client.Sites.ExportMapArchiveV1(vvSiteHierarchyUUID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExportMapArchive", err)) + "Failure when executing ExportMapArchiveV1", err)) return diags } @@ -95,7 +97,7 @@ func resourceMapsExportCreate(ctx context.Context, d *schema.ResourceData, m int if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ExportMapArchive", err)) + "Failure when executing ExportMapArchiveV1", err)) return diags } taskId := response1.Response.TaskID @@ -129,22 +131,21 @@ func resourceMapsExportCreate(ctx context.Context, d *schema.ResourceData, m int } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ExportMapArchive", err1)) + "Failure when executing ExportMapArchiveV1", err1)) return diags } } - vItem1 := flattenSitesExportMapArchiveItem(response1.Response) + vItem1 := flattenSitesExportMapArchiveV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ExportMapArchive response", + "Failure when setting ExportMapArchiveV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceMapsExportRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -159,7 +160,7 @@ func resourceMapsExportDelete(ctx context.Context, d *schema.ResourceData, m int return diags } -func flattenSitesExportMapArchiveItem(item *catalystcentersdkgo.ResponseSitesExportMapArchiveResponse) []map[string]interface{} { +func flattenSitesExportMapArchiveV1Item(item *catalystcentersdkgo.ResponseSitesExportMapArchiveV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_maps_import.go b/catalystcenter/resource_maps_import.go index 66ba221..14aba29 100644 --- a/catalystcenter/resource_maps_import.go +++ b/catalystcenter/resource_maps_import.go @@ -29,8 +29,11 @@ ensures the import cannot accidentally be performed / approved at a later time. Computed: true, }, "item": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeList, Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, }, "parameters": &schema.Schema{ Type: schema.TypeList, @@ -64,22 +67,24 @@ func resourceMapsImportCreate(ctx context.Context, d *schema.ResourceData, m int vvImportContextUUID := vImportContextUUID.(string) - _, response1, err := client.Sites.ImportMapArchiveCancelAnImport(vvImportContextUUID) + // has_unknown_response: None + + response1, restyResp1, err := client.Sites.ImportMapArchiveCancelAnImportV1(vvImportContextUUID) if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } diags = append(diags, diagError( - "Failure when executing ImportMapArchiveCancelAnImport", err)) + "Failure when executing ImportMapArchiveCancelAnImportV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := response1.String() - if err := d.Set("item", vItem1); err != nil { + if err := d.Set("item", response1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportMapArchiveCancelAnImport response", + "Failure when setting ImportMapArchiveCancelAnImportV1 response", err)) return diags } @@ -87,6 +92,8 @@ func resourceMapsImportCreate(ctx context.Context, d *schema.ResourceData, m int d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceMapsImportRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_maps_import_perform.go b/catalystcenter/resource_maps_import_perform.go index 6d203fc..d1a2601 100644 --- a/catalystcenter/resource_maps_import_perform.go +++ b/catalystcenter/resource_maps_import_perform.go @@ -31,8 +31,11 @@ performing the import. Computed: true, }, "item": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeList, Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, }, "parameters": &schema.Schema{ Type: schema.TypeList, @@ -66,22 +69,24 @@ func resourceMapsImportPerformCreate(ctx context.Context, d *schema.ResourceData vvImportContextUUID := vImportContextUUID.(string) - _, response1, err := client.Sites.ImportMapArchivePerformImport(vvImportContextUUID) + // has_unknown_response: None + + response1, restyResp1, err := client.Sites.ImportMapArchivePerformImportV1(vvImportContextUUID) if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } diags = append(diags, diagError( - "Failure when executing ImportMapArchivePerformImport", err)) + "Failure when executing ImportMapArchivePerformImportV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := response1.String() - if err := d.Set("item", vItem1); err != nil { + if err := d.Set("item", response1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportMapArchivePerformImport response", + "Failure when setting ImportMapArchivePerformImportV1 response", err)) return diags } @@ -89,6 +94,8 @@ func resourceMapsImportPerformCreate(ctx context.Context, d *schema.ResourceData d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourceMapsImportPerformRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_maps_import_start.go b/catalystcenter/resource_maps_import_start.go index 340e39f..29f63b3 100644 --- a/catalystcenter/resource_maps_import_start.go +++ b/catalystcenter/resource_maps_import_start.go @@ -3,6 +3,8 @@ package catalystcenter import ( "context" + "log" + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,18 +49,29 @@ descriptor file, and 1 or more images for the map areas nested under /images fol func resourceMapsImportStartCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - response1, err := client.Sites.ImportMapArchiveStartImport() - if err = d.Set("item", response1.String()); err != nil { + + // has_unknown_response: True + + response1, err := client.Sites.ImportMapArchiveStartImportV1() + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { diags = append(diags, diagError( - "Failure when setting ImportMapArchiveStartImport response", + "Failure when setting ImportMapArchiveStartImportV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - //Analizar verificacion. - } func resourceMapsImportStartRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_network_create.go b/catalystcenter/resource_network_create.go index 79b6e40..1eff03c 100644 --- a/catalystcenter/resource_network_create.go +++ b/catalystcenter/resource_network_create.go @@ -385,24 +385,22 @@ func resourceNetworkCreateCreate(ctx context.Context, d *schema.ResourceData, m vPersistbapioutput := resourceItem["persistbapioutput"] vvSiteID := vSiteID.(string) - request1 := expandRequestNetworkCreateCreateNetwork(ctx, "parameters.0", d) + request1 := expandRequestNetworkCreateCreateNetworkV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.CreateNetworkHeaderParams{} + headerParams1 := catalystcentersdkgo.CreateNetworkV1HeaderParams{} headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.NetworkSettings.CreateNetwork(vvSiteID, request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.NetworkSettings.CreateNetworkV1(vvSiteID, request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreateNetwork", err)) + "Failure when executing CreateNetworkV1", err)) return diags } @@ -438,23 +436,25 @@ func resourceNetworkCreateCreate(ctx context.Context, d *schema.ResourceData, m if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing CreateNetwork", err, - "Failure at CreateNetwork execution", bapiError)) + "Failure when executing CreateNetworkV1", err, + "Failure at CreateNetworkV1 execution", bapiError)) return diags } } - vItem1 := flattenNetworkSettingsCreateNetworkItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenNetworkSettingsCreateNetworkV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateNetwork response", + "Failure when setting CreateNetworkV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -469,28 +469,28 @@ func resourceNetworkCreateDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestNetworkCreateCreateNetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetwork { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetwork{} - request.Settings = expandRequestNetworkCreateCreateNetworkSettings(ctx, key, d) +func expandRequestNetworkCreateCreateNetworkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1 { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1{} + request.Settings = expandRequestNetworkCreateCreateNetworkV1Settings(ctx, key, d) return &request } -func expandRequestNetworkCreateCreateNetworkSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettings { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettings{} +func expandRequestNetworkCreateCreateNetworkV1Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1Settings { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".dhcp_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dhcp_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dhcp_server")))) { request.DhcpServer = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dns_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dns_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dns_server")))) { - request.DNSServer = expandRequestNetworkCreateCreateNetworkSettingsDNSServer(ctx, key+".dns_server.0", d) + request.DNSServer = expandRequestNetworkCreateCreateNetworkV1SettingsDNSServer(ctx, key+".dns_server.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".syslog_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".syslog_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".syslog_server")))) { - request.SyslogServer = expandRequestNetworkCreateCreateNetworkSettingsSyslogServer(ctx, key+".syslog_server.0", d) + request.SyslogServer = expandRequestNetworkCreateCreateNetworkV1SettingsSyslogServer(ctx, key+".syslog_server.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".snmp_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".snmp_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".snmp_server")))) { - request.SNMPServer = expandRequestNetworkCreateCreateNetworkSettingsSNMPServer(ctx, key+".snmp_server.0", d) + request.SNMPServer = expandRequestNetworkCreateCreateNetworkV1SettingsSNMPServer(ctx, key+".snmp_server.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".netflowcollector")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".netflowcollector")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".netflowcollector")))) { - request.Netflowcollector = expandRequestNetworkCreateCreateNetworkSettingsNetflowcollector(ctx, key+".netflowcollector.0", d) + request.Netflowcollector = expandRequestNetworkCreateCreateNetworkV1SettingsNetflowcollector(ctx, key+".netflowcollector.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ntp_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ntp_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ntp_server")))) { request.NtpServer = interfaceToSliceString(v) @@ -499,19 +499,19 @@ func expandRequestNetworkCreateCreateNetworkSettings(ctx context.Context, key st request.Timezone = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".message_of_theday")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".message_of_theday")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".message_of_theday")))) { - request.MessageOfTheday = expandRequestNetworkCreateCreateNetworkSettingsMessageOfTheday(ctx, key+".message_of_theday.0", d) + request.MessageOfTheday = expandRequestNetworkCreateCreateNetworkV1SettingsMessageOfTheday(ctx, key+".message_of_theday.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_aaa")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_aaa")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_aaa")))) { - request.NetworkAAA = expandRequestNetworkCreateCreateNetworkSettingsNetworkAAA(ctx, key+".network_aaa.0", d) + request.NetworkAAA = expandRequestNetworkCreateCreateNetworkV1SettingsNetworkAAA(ctx, key+".network_aaa.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".client_and_endpoint_aaa")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".client_and_endpoint_aaa")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".client_and_endpoint_aaa")))) { - request.ClientAndEndpointAAA = expandRequestNetworkCreateCreateNetworkSettingsClientAndEndpointAAA(ctx, key+".client_and_endpoint_aaa.0", d) + request.ClientAndEndpointAAA = expandRequestNetworkCreateCreateNetworkV1SettingsClientAndEndpointAAA(ctx, key+".client_and_endpoint_aaa.0", d) } return &request } -func expandRequestNetworkCreateCreateNetworkSettingsDNSServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsDNSServer { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsDNSServer{} +func expandRequestNetworkCreateCreateNetworkV1SettingsDNSServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsDNSServer { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsDNSServer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain_name")))) { request.DomainName = interfaceToString(v) } @@ -524,8 +524,8 @@ func expandRequestNetworkCreateCreateNetworkSettingsDNSServer(ctx context.Contex return &request } -func expandRequestNetworkCreateCreateNetworkSettingsSyslogServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsSyslogServer { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsSyslogServer{} +func expandRequestNetworkCreateCreateNetworkV1SettingsSyslogServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsSyslogServer { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsSyslogServer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_addresses")))) { request.IPAddresses = interfaceToSliceString(v) } @@ -535,8 +535,8 @@ func expandRequestNetworkCreateCreateNetworkSettingsSyslogServer(ctx context.Con return &request } -func expandRequestNetworkCreateCreateNetworkSettingsSNMPServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsSNMPServer { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsSNMPServer{} +func expandRequestNetworkCreateCreateNetworkV1SettingsSNMPServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsSNMPServer { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsSNMPServer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_addresses")))) { request.IPAddresses = interfaceToSliceString(v) } @@ -546,8 +546,8 @@ func expandRequestNetworkCreateCreateNetworkSettingsSNMPServer(ctx context.Conte return &request } -func expandRequestNetworkCreateCreateNetworkSettingsNetflowcollector(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsNetflowcollector { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsNetflowcollector{} +func expandRequestNetworkCreateCreateNetworkV1SettingsNetflowcollector(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsNetflowcollector { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsNetflowcollector{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_address")))) { request.IPAddress = interfaceToString(v) } @@ -557,8 +557,8 @@ func expandRequestNetworkCreateCreateNetworkSettingsNetflowcollector(ctx context return &request } -func expandRequestNetworkCreateCreateNetworkSettingsMessageOfTheday(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsMessageOfTheday { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsMessageOfTheday{} +func expandRequestNetworkCreateCreateNetworkV1SettingsMessageOfTheday(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsMessageOfTheday { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsMessageOfTheday{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".banner_message")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".banner_message")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".banner_message")))) { request.BannerMessage = interfaceToString(v) } @@ -568,8 +568,8 @@ func expandRequestNetworkCreateCreateNetworkSettingsMessageOfTheday(ctx context. return &request } -func expandRequestNetworkCreateCreateNetworkSettingsNetworkAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsNetworkAAA { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsNetworkAAA{} +func expandRequestNetworkCreateCreateNetworkV1SettingsNetworkAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsNetworkAAA { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsNetworkAAA{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToString(v) } @@ -588,8 +588,8 @@ func expandRequestNetworkCreateCreateNetworkSettingsNetworkAAA(ctx context.Conte return &request } -func expandRequestNetworkCreateCreateNetworkSettingsClientAndEndpointAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsClientAndEndpointAAA { - request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkSettingsClientAndEndpointAAA{} +func expandRequestNetworkCreateCreateNetworkV1SettingsClientAndEndpointAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsClientAndEndpointAAA { + request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV1SettingsClientAndEndpointAAA{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToString(v) } @@ -608,7 +608,7 @@ func expandRequestNetworkCreateCreateNetworkSettingsClientAndEndpointAAA(ctx con return &request } -func flattenNetworkSettingsCreateNetworkItem(item *catalystcentersdkgo.ResponseNetworkSettingsCreateNetwork) []map[string]interface{} { +func flattenNetworkSettingsCreateNetworkV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsCreateNetworkV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_device.go b/catalystcenter/resource_network_device.go index 28ba94e..d15d6a5 100644 --- a/catalystcenter/resource_network_device.go +++ b/catalystcenter/resource_network_device.go @@ -410,7 +410,7 @@ func resourceNetworkDeviceRead(ctx context.Context, d *schema.ResourceData, m in log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceByIDItem(response1.Response) + vItem1 := flattenDevicesGetDeviceByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDeviceByID response", diff --git a/catalystcenter/resource_network_device_config_write_memory.go b/catalystcenter/resource_network_device_config_write_memory.go index 40b7760..341d659 100644 --- a/catalystcenter/resource_network_device_config_write_memory.go +++ b/catalystcenter/resource_network_device_config_write_memory.go @@ -84,20 +84,18 @@ func resourceNetworkDeviceConfigWriteMemoryCreate(ctx context.Context, d *schema client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDeviceConfigWriteMemoryCommitDeviceConfiguration(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceConfigWriteMemoryCommitDeviceConfigurationV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Compliance.CommitDeviceConfiguration(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Compliance.CommitDeviceConfigurationV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CommitDeviceConfiguration", err)) + "Failure when executing CommitDeviceConfigurationV1", err)) return diags } @@ -105,7 +103,7 @@ func resourceNetworkDeviceConfigWriteMemoryCreate(ctx context.Context, d *schema if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing CommitDeviceConfiguration", err)) + "Failure when executing CommitDeviceConfigurationV1", err)) return diags } taskId := response1.Response.TaskID @@ -139,22 +137,24 @@ func resourceNetworkDeviceConfigWriteMemoryCreate(ctx context.Context, d *schema } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing CommitDeviceConfiguration", err1)) + "Failure when executing CommitDeviceConfigurationV1", err1)) return diags } } - vItem1 := flattenComplianceCommitDeviceConfigurationItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenComplianceCommitDeviceConfigurationV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CommitDeviceConfiguration response", + "Failure when setting CommitDeviceConfigurationV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDeviceConfigWriteMemoryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -169,15 +169,15 @@ func resourceNetworkDeviceConfigWriteMemoryDelete(ctx context.Context, d *schema return diags } -func expandRequestNetworkDeviceConfigWriteMemoryCommitDeviceConfiguration(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestComplianceCommitDeviceConfiguration { - request := catalystcentersdkgo.RequestComplianceCommitDeviceConfiguration{} +func expandRequestNetworkDeviceConfigWriteMemoryCommitDeviceConfigurationV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestComplianceCommitDeviceConfigurationV1 { + request := catalystcentersdkgo.RequestComplianceCommitDeviceConfigurationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToSliceString(v) } return &request } -func flattenComplianceCommitDeviceConfigurationItem(item *catalystcentersdkgo.ResponseComplianceCommitDeviceConfigurationResponse) []map[string]interface{} { +func flattenComplianceCommitDeviceConfigurationV1Item(item *catalystcentersdkgo.ResponseComplianceCommitDeviceConfigurationV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_device_custom_prompt.go b/catalystcenter/resource_network_device_custom_prompt.go index 35c63e1..e2cdea7 100644 --- a/catalystcenter/resource_network_device_custom_prompt.go +++ b/catalystcenter/resource_network_device_custom_prompt.go @@ -76,11 +76,12 @@ provide all the custom prompt in case of any update Schema: map[string]*schema.Schema{ "password_prompt": &schema.Schema{ - Description: `Password Prompt`, - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Default: "", + Description: `Password for Custom Prompt +`, + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Default: "", }, "username_prompt": &schema.Schema{ Description: `Username for Custom Prompt @@ -102,7 +103,7 @@ func resourceNetworkDeviceCustomPromptCreate(ctx context.Context, d *schema.Reso var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestNetworkDeviceCustomPromptCustomPromptPOSTAPI(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceCustomPromptCustomPromptPOSTAPIV1(ctx, "parameters.0", d) vPasswordPrompt := resourceItem["password_prompt"] vvPasswordPrompt := interfaceToString(vPasswordPrompt) @@ -184,7 +185,7 @@ func resourceNetworkDeviceCustomPromptRead(ctx context.Context, d *schema.Resour log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSystemSettingsCustomPromptSupportGETAPIItem(response1.Response) + vItem1 := flattenSystemSettingsCustomPromptSupportGETAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting CustomPromptSupportGETAPI response", @@ -217,8 +218,8 @@ func resourceNetworkDeviceCustomPromptDelete(ctx context.Context, d *schema.Reso return diags } -func expandRequestNetworkDeviceCustomPromptCustomPromptPOSTAPI(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsCustomPromptPOSTAPI { - request := catalystcentersdkgo.RequestSystemSettingsCustomPromptPOSTAPI{} +func expandRequestNetworkDeviceCustomPromptCustomPromptPOSTAPIV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsCustomPromptPOSTAPIV1 { + request := catalystcentersdkgo.RequestSystemSettingsCustomPromptPOSTAPIV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".username_prompt")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".username_prompt")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".username_prompt")))) { request.UsernamePrompt = interfaceToString(v) } diff --git a/catalystcenter/resource_network_device_export.go b/catalystcenter/resource_network_device_export.go index 4909569..5108445 100644 --- a/catalystcenter/resource_network_device_export.go +++ b/catalystcenter/resource_network_device_export.go @@ -108,20 +108,18 @@ func resourceNetworkDeviceExportCreate(ctx context.Context, d *schema.ResourceDa client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDeviceExportExportDeviceList(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceExportExportDeviceListV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.ExportDeviceList(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.ExportDeviceListV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ExportDeviceList", err)) + "Failure when executing ExportDeviceListV1", err)) return diags } @@ -129,7 +127,7 @@ func resourceNetworkDeviceExportCreate(ctx context.Context, d *schema.ResourceDa if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ExportDeviceList", err)) + "Failure when executing ExportDeviceListV1", err)) return diags } taskId := response1.Response.TaskID @@ -163,22 +161,24 @@ func resourceNetworkDeviceExportCreate(ctx context.Context, d *schema.ResourceDa } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ExportDeviceList", err1)) + "Failure when executing ExportDeviceListV1", err1)) return diags } } - vItem1 := flattenDevicesExportDeviceListItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesExportDeviceListV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ExportDeviceList response", + "Failure when setting ExportDeviceListV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDeviceExportRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -193,8 +193,8 @@ func resourceNetworkDeviceExportDelete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestNetworkDeviceExportExportDeviceList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesExportDeviceList { - request := catalystcentersdkgo.RequestDevicesExportDeviceList{} +func expandRequestNetworkDeviceExportExportDeviceListV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesExportDeviceListV1 { + request := catalystcentersdkgo.RequestDevicesExportDeviceListV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_uuids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_uuids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_uuids")))) { request.DeviceUUIDs = interfaceToSliceString(v) } @@ -210,7 +210,7 @@ func expandRequestNetworkDeviceExportExportDeviceList(ctx context.Context, key s return &request } -func flattenDevicesExportDeviceListItem(item *catalystcentersdkgo.ResponseDevicesExportDeviceListResponse) []map[string]interface{} { +func flattenDevicesExportDeviceListV1Item(item *catalystcentersdkgo.ResponseDevicesExportDeviceListV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_device_list.go b/catalystcenter/resource_network_device_list.go index 6f49cf6..764f628 100644 --- a/catalystcenter/resource_network_device_list.go +++ b/catalystcenter/resource_network_device_list.go @@ -598,7 +598,7 @@ func resourceNetworkDeviceListCreate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestNetworkDeviceListAddDevice2(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceListAddDeviceKnowYourNetworkV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -619,7 +619,7 @@ func resourceNetworkDeviceListCreate(ctx context.Context, d *schema.ResourceData } vvIPAddress = strings.Join(vIPAddress, ",") - queryParams1 := catalystcentersdkgo.GetDeviceListQueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceListV1QueryParams{} if vSerialNumber != "" { queryParams1.SerialNumber = []string{vvSerialNumber} } @@ -635,7 +635,7 @@ func resourceNetworkDeviceListCreate(ctx context.Context, d *schema.ResourceData d.SetId(joinResourceID(resourceMap)) return resourceNetworkDeviceListRead(ctx, d, m) } - resp1, restyResp1, err := client.Devices.AddDevice2(request1) + resp1, restyResp1, err := client.Devices.AddDeviceKnowYourNetwork(request1) log.Printf("ADDDEVICE ERROR %v", restyResp1) if err != nil || resp1 == nil { if restyResp1 != nil { @@ -697,7 +697,7 @@ func resourceNetworkDeviceListRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetDeviceList") - queryParams1 := catalystcentersdkgo.GetDeviceListQueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceListV1QueryParams{} if vSerialNumber != "" { queryParams1.SerialNumber = []string{vSerialNumber} } @@ -721,7 +721,7 @@ func resourceNetworkDeviceListRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetDeviceListItems(response1.Response) + vItem1 := flattenDevicesGetDeviceListV1Items(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDeviceList search response", @@ -744,7 +744,7 @@ func resourceNetworkDeviceListUpdate(ctx context.Context, d *schema.ResourceData vvIPAddress := resourceMap["ip_address"] vIPAddress := strings.Split(vvIPAddress, ",") - queryParams1 := catalystcentersdkgo.GetDeviceListQueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceListV1QueryParams{} if vSerialNumber != "" { queryParams1.SerialNumber = []string{vSerialNumber} } @@ -760,7 +760,7 @@ func resourceNetworkDeviceListUpdate(ctx context.Context, d *schema.ResourceData // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { log.Printf("[DEBUG] Name used for update operation %s", vSerialNumber) - request1 := expandRequestNetworkDeviceListSyncDevices2(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceListUpdateDeviceDetailsV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -821,8 +821,8 @@ func resourceNetworkDeviceListDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestNetworkDeviceListAddDevice2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesAddDevice2 { - request := catalystcentersdkgo.RequestDevicesAddDevice2{} +func expandRequestNetworkDeviceListAddDeviceKnowYourNetworkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesAddDeviceKnowYourNetworkV1 { + request := catalystcentersdkgo.RequestDevicesAddDeviceKnowYourNetworkV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cli_transport")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cli_transport")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cli_transport")))) { request.CliTransport = interfaceToString(v) } @@ -898,9 +898,6 @@ func expandRequestNetworkDeviceListAddDevice2(ctx context.Context, key string, d if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { request.Type = interfaceToString(v) } - if v, ok := d.GetOkExists(fixKeyAccess(key + ".update_mgmt_ipaddress_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".update_mgmt_ipaddress_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".update_mgmt_ipaddress_list")))) { - request.UpdateMgmtIPaddressList = expandRequestNetworkDeviceListAddDevice2UpdateMgmtIPaddressListArray(ctx, key+".update_mgmt_ipaddress_list", d) - } if v, ok := d.GetOkExists(fixKeyAccess(key + ".user_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".user_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".user_name")))) { request.UserName = interfaceToString(v) } @@ -910,45 +907,8 @@ func expandRequestNetworkDeviceListAddDevice2(ctx context.Context, key string, d return &request } -func expandRequestNetworkDeviceListAddDevice2UpdateMgmtIPaddressListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesAddDevice2UpdateMgmtIPaddressList { - request := []catalystcentersdkgo.RequestDevicesAddDevice2UpdateMgmtIPaddressList{} - key = fixKeyAccess(key) - o := d.Get(key) - if o == nil { - return nil - } - objs := o.([]interface{}) - if len(objs) == 0 { - return nil - } - for item_no := range objs { - i := expandRequestNetworkDeviceListAddDevice2UpdateMgmtIPaddressList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) - if i != nil { - request = append(request, *i) - } - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func expandRequestNetworkDeviceListAddDevice2UpdateMgmtIPaddressList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesAddDevice2UpdateMgmtIPaddressList { - request := catalystcentersdkgo.RequestDevicesAddDevice2UpdateMgmtIPaddressList{} - if v, ok := d.GetOkExists(fixKeyAccess(key + ".exist_mgmt_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".exist_mgmt_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".exist_mgmt_ip_address")))) { - request.ExistMgmtIPAddress = interfaceToString(v) - } - if v, ok := d.GetOkExists(fixKeyAccess(key + ".new_mgmt_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".new_mgmt_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".new_mgmt_ip_address")))) { - request.NewMgmtIPAddress = interfaceToString(v) - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func expandRequestNetworkDeviceListSyncDevices2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceDetails { - request := catalystcentersdkgo.RequestDevicesUpdateDeviceDetails{} +func expandRequestNetworkDeviceListUpdateDeviceDetailsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsV1 { + request := catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cli_transport")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cli_transport")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cli_transport")))) { request.CliTransport = interfaceToString(v) } @@ -1025,7 +985,7 @@ func expandRequestNetworkDeviceListSyncDevices2(ctx context.Context, key string, request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".update_mgmt_ipaddress_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".update_mgmt_ipaddress_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".update_mgmt_ipaddress_list")))) { - request.UpdateMgmtIPaddressList = expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressListArray(ctx, key+".update_mgmt_ipaddress_list", d) + request.UpdateMgmtIPaddressList = expandRequestNetworkDeviceListUpdateDeviceDetailsV1UpdateMgmtIPaddressListArray(ctx, key+".update_mgmt_ipaddress_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".user_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".user_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".user_name")))) { request.UserName = interfaceToString(v) @@ -1036,8 +996,8 @@ func expandRequestNetworkDeviceListSyncDevices2(ctx context.Context, key string, return &request } -func expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsUpdateMgmtIPaddressList { - request := []catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsUpdateMgmtIPaddressList{} +func expandRequestNetworkDeviceListUpdateDeviceDetailsV1UpdateMgmtIPaddressListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsV1UpdateMgmtIPaddressList { + request := []catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsV1UpdateMgmtIPaddressList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1048,7 +1008,7 @@ func expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressListArray(ctx return nil } for item_no := range objs { - i := expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDeviceListUpdateDeviceDetailsV1UpdateMgmtIPaddressList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1059,8 +1019,8 @@ func expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressListArray(ctx return &request } -func expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsUpdateMgmtIPaddressList { - request := catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsUpdateMgmtIPaddressList{} +func expandRequestNetworkDeviceListUpdateDeviceDetailsV1UpdateMgmtIPaddressList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsV1UpdateMgmtIPaddressList { + request := catalystcentersdkgo.RequestDevicesUpdateDeviceDetailsV1UpdateMgmtIPaddressList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".exist_mgmt_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".exist_mgmt_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".exist_mgmt_ip_address")))) { request.ExistMgmtIPAddress = interfaceToString(v) } @@ -1072,11 +1032,12 @@ func expandRequestNetworkDeviceListSyncDevices2UpdateMgmtIPaddressList(ctx conte } return &request } -func searchDevicesGetDeviceList(m interface{}, queryParams catalystcentersdkgo.GetDeviceListQueryParams) (*catalystcentersdkgo.ResponseDevicesGetDeviceListResponse, error) { + +func searchDevicesGetDeviceList(m interface{}, queryParams catalystcentersdkgo.GetDeviceListV1QueryParams) (*catalystcentersdkgo.ResponseDevicesGetDeviceListV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDevicesGetDeviceListResponse - var ite *catalystcentersdkgo.ResponseDevicesGetDeviceList + var foundItem *catalystcentersdkgo.ResponseDevicesGetDeviceListV1Response + var ite *catalystcentersdkgo.ResponseDevicesGetDeviceListV1 ite, _, err = client.Devices.GetDeviceList(&queryParams) if err != nil { return nil, err @@ -1093,12 +1054,12 @@ func searchDevicesGetDeviceList(m interface{}, queryParams catalystcentersdkgo.G for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if strings.Contains(strings.Join(queryParams.SerialNumber, ","), item.SerialNumber) { - var getItem *catalystcentersdkgo.ResponseDevicesGetDeviceListResponse + var getItem *catalystcentersdkgo.ResponseDevicesGetDeviceListV1Response getItem = &item foundItem = getItem return foundItem, err } else if strings.Contains(strings.Join(queryParams.ManagementIPAddress, ","), item.ManagementIPAddress) { - var getItem *catalystcentersdkgo.ResponseDevicesGetDeviceListResponse + var getItem *catalystcentersdkgo.ResponseDevicesGetDeviceListV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_network_device_management_address_update.go b/catalystcenter/resource_network_device_management_address_update.go index 94796bf..76eb851 100644 --- a/catalystcenter/resource_network_device_management_address_update.go +++ b/catalystcenter/resource_network_device_management_address_update.go @@ -91,20 +91,18 @@ func resourceNetworkDeviceManagementAddressUpdateCreate(ctx context.Context, d * vDeviceid := resourceItem["deviceid"] vvDeviceid := vDeviceid.(string) - request1 := expandRequestNetworkDeviceManagementAddressUpdateUpdateDeviceManagementAddress(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceManagementAddressUpdateUpdateDeviceManagementAddressV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.UpdateDeviceManagementAddress(vvDeviceid, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.UpdateDeviceManagementAddressV1(vvDeviceid, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateDeviceManagementAddress", err)) + "Failure when executing UpdateDeviceManagementAddressV1", err)) return diags } @@ -112,7 +110,7 @@ func resourceNetworkDeviceManagementAddressUpdateCreate(ctx context.Context, d * if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateDeviceManagementAddress", err)) + "Failure when executing UpdateDeviceManagementAddressV1", err)) return diags } taskId := response1.Response.TaskID @@ -146,22 +144,24 @@ func resourceNetworkDeviceManagementAddressUpdateCreate(ctx context.Context, d * } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateDeviceManagementAddress", err1)) + "Failure when executing UpdateDeviceManagementAddressV1", err1)) return diags } } - vItem1 := flattenDevicesUpdateDeviceManagementAddressItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesUpdateDeviceManagementAddressV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateDeviceManagementAddress response", + "Failure when setting UpdateDeviceManagementAddressV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDeviceManagementAddressUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -176,15 +176,15 @@ func resourceNetworkDeviceManagementAddressUpdateDelete(ctx context.Context, d * return diags } -func expandRequestNetworkDeviceManagementAddressUpdateUpdateDeviceManagementAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceManagementAddress { - request := catalystcentersdkgo.RequestDevicesUpdateDeviceManagementAddress{} +func expandRequestNetworkDeviceManagementAddressUpdateUpdateDeviceManagementAddressV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceManagementAddressV1 { + request := catalystcentersdkgo.RequestDevicesUpdateDeviceManagementAddressV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".new_ip")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".new_ip")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".new_ip")))) { request.NewIP = interfaceToString(v) } return &request } -func flattenDevicesUpdateDeviceManagementAddressItem(item *catalystcentersdkgo.ResponseDevicesUpdateDeviceManagementAddressResponse) []map[string]interface{} { +func flattenDevicesUpdateDeviceManagementAddressV1Item(item *catalystcentersdkgo.ResponseDevicesUpdateDeviceManagementAddressV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_device_sync.go b/catalystcenter/resource_network_device_sync.go index d97a9cd..ba6f20c 100644 --- a/catalystcenter/resource_network_device_sync.go +++ b/catalystcenter/resource_network_device_sync.go @@ -67,7 +67,7 @@ can be seen in the child task of each device ForceNew: true, }, "payload": &schema.Schema{ - Description: `Array of RequestDevicesSyncDevices`, + Description: `Array of RequestDevicesSyncDevicesV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -87,21 +87,19 @@ func resourceNetworkDeviceSyncCreate(ctx context.Context, d *schema.ResourceData client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDeviceSyncSyncDevices(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.SyncDevicesQueryParams{} + request1 := expandRequestNetworkDeviceSyncSyncDevicesV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.SyncDevicesV1QueryParams{} - response1, restyResp1, err := client.Devices.SyncDevices(request1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.SyncDevicesV1(request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing SyncDevices", err)) + "Failure when executing SyncDevicesV1", err)) return diags } @@ -148,10 +146,13 @@ func resourceNetworkDeviceSyncCreate(ctx context.Context, d *schema.ResourceData } } - vItem1 := flattenDevicesSyncDevicesItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesSyncDevicesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SyncDevices response", + "Failure when setting SyncDevicesV1 response", err)) return diags } @@ -173,15 +174,15 @@ func resourceNetworkDeviceSyncDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestNetworkDeviceSyncSyncDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesSyncDevices { - request := catalystcentersdkgo.RequestDevicesSyncDevices{} +func expandRequestNetworkDeviceSyncSyncDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesSyncDevicesV1 { + request := catalystcentersdkgo.RequestDevicesSyncDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".payload")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".payload")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".payload")))) { request = interfaceToSliceString(v) } return &request } -func flattenDevicesSyncDevicesItem(item *catalystcentersdkgo.ResponseDevicesSyncDevicesResponse) []map[string]interface{} { +func flattenDevicesSyncDevicesV1Item(item *catalystcentersdkgo.ResponseDevicesSyncDevicesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_device_update_role.go b/catalystcenter/resource_network_device_update_role.go index 45a9957..deef0fe 100644 --- a/catalystcenter/resource_network_device_update_role.go +++ b/catalystcenter/resource_network_device_update_role.go @@ -93,20 +93,18 @@ func resourceNetworkDeviceUpdateRoleCreate(ctx context.Context, d *schema.Resour client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDeviceUpdateRoleUpdateDeviceRole(ctx, "parameters.0", d) + request1 := expandRequestNetworkDeviceUpdateRoleUpdateDeviceRoleV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.UpdateDeviceRole(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.UpdateDeviceRoleV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateDeviceRole", err)) + "Failure when executing UpdateDeviceRoleV1", err)) return diags } @@ -114,7 +112,7 @@ func resourceNetworkDeviceUpdateRoleCreate(ctx context.Context, d *schema.Resour if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateDeviceRole", err)) + "Failure when executing UpdateDeviceRoleV1", err)) return diags } taskId := response1.Response.TaskID @@ -148,22 +146,24 @@ func resourceNetworkDeviceUpdateRoleCreate(ctx context.Context, d *schema.Resour } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateDeviceRole", err1)) + "Failure when executing UpdateDeviceRoleV1", err1)) return diags } } - vItem1 := flattenDevicesUpdateDeviceRoleItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesUpdateDeviceRoleV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateDeviceRole response", + "Failure when setting UpdateDeviceRoleV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDeviceUpdateRoleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -178,8 +178,8 @@ func resourceNetworkDeviceUpdateRoleDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestNetworkDeviceUpdateRoleUpdateDeviceRole(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceRole { - request := catalystcentersdkgo.RequestDevicesUpdateDeviceRole{} +func expandRequestNetworkDeviceUpdateRoleUpdateDeviceRoleV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateDeviceRoleV1 { + request := catalystcentersdkgo.RequestDevicesUpdateDeviceRoleV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -192,7 +192,7 @@ func expandRequestNetworkDeviceUpdateRoleUpdateDeviceRole(ctx context.Context, k return &request } -func flattenDevicesUpdateDeviceRoleItem(item *catalystcentersdkgo.ResponseDevicesUpdateDeviceRoleResponse) []map[string]interface{} { +func flattenDevicesUpdateDeviceRoleV1Item(item *catalystcentersdkgo.ResponseDevicesUpdateDeviceRoleV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_device_user_defined_field.go b/catalystcenter/resource_network_device_user_defined_field.go deleted file mode 100644 index 517efc8..0000000 --- a/catalystcenter/resource_network_device_user_defined_field.go +++ /dev/null @@ -1,391 +0,0 @@ -package catalystcenter - -import ( - "context" - "errors" - "reflect" - "time" - - "log" - - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceNetworkDeviceUserDefinedField() *schema.Resource { - return &schema.Resource{ - Description: `It manages create, read, update and delete operations on Devices. - -- Creates a new global User Defined Field, which can be assigned to devices - -- Updates an existing global User Defined Field, using it's id. - -- Deletes an existing Global User-Defined-Field using it's id. -`, - - CreateContext: resourceNetworkDeviceUserDefinedFieldCreate, - ReadContext: resourceNetworkDeviceUserDefinedFieldRead, - UpdateContext: resourceNetworkDeviceUserDefinedFieldUpdate, - DeleteContext: resourceNetworkDeviceUserDefinedFieldDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - - Schema: map[string]*schema.Schema{ - "last_updated": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "item": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "description": &schema.Schema{ - Description: `Description for UDF -`, - Type: schema.TypeString, - Computed: true, - }, - "id": &schema.Schema{ - Description: `DeviceId of the Device -`, - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Description: `UDF name -`, - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "parameters": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "description": &schema.Schema{ - Description: `Description of UDF -`, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "id": &schema.Schema{ - Description: `id path parameter. UDF id -`, - Type: schema.TypeString, - Optional: true, - Default: "", - }, - "name": &schema.Schema{ - Description: `Name of UDF -`, - Type: schema.TypeString, - Optional: true, - Default: "", - }, - }, - }, - }, - }, - } -} - -func resourceNetworkDeviceUserDefinedFieldCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - client := m.(*catalystcentersdkgo.Client) - - var diags diag.Diagnostics - - resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestNetworkDeviceUserDefinedFieldCreateUserDefinedField(ctx, "parameters.0", d) - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - - vID := resourceItem["id"] - vvID := interfaceToString(vID) - vName := resourceItem["name"] - vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetAllUserDefinedFieldsQueryParams{} - queryParamImport.Name = vvName - item2, err := searchDevicesGetAllUserDefinedFields(m, queryParamImport, vvID) - if err == nil && item2 != nil { - resourceMap := make(map[string]string) - resourceMap["id"] = item2.ID - resourceMap["name"] = item2.Name - d.SetId(joinResourceID(resourceMap)) - return resourceNetworkDeviceUserDefinedFieldRead(ctx, d, m) - } - resp1, restyResp1, err := client.Devices.CreateUserDefinedField(request1) - if err != nil || resp1 == nil { - if restyResp1 != nil { - diags = append(diags, diagErrorWithResponse( - "Failure when executing CreateUserDefinedField", err, restyResp1.String())) - return diags - } - diags = append(diags, diagError( - "Failure when executing CreateUserDefinedField", err)) - return diags - } - if resp1.Response == nil { - diags = append(diags, diagError( - "Failure when executing CreateUserDefinedField", err)) - return diags - } - taskId := resp1.Response.TaskID - log.Printf("[DEBUG] TASKID => %s", taskId) - if taskId != "" { - time.Sleep(5 * time.Second) - response2, restyResp2, err := client.Task.GetTaskByID(taskId) - if err != nil || response2 == nil { - if restyResp2 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing GetTaskByID", err, - "Failure at GetTaskByID, unexpected response", "")) - return diags - } - if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { - log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) - errorMsg := response2.Response.Progress + "Failure Reason: " + response2.Response.FailureReason - err1 := errors.New(errorMsg) - diags = append(diags, diagError( - "Failure when executing CreateUserDefinedField", err1)) - return diags - } - } - queryParamValidate := catalystcentersdkgo.GetAllUserDefinedFieldsQueryParams{} - queryParamValidate.Name = vvName - item3, err := searchDevicesGetAllUserDefinedFields(m, queryParamValidate, vvID) - if err != nil || item3 == nil { - diags = append(diags, diagErrorWithAlt( - "Failure when executing CreateUserDefinedField", err, - "Failure at CreateUserDefinedField, unexpected response", "")) - return diags - } - - resourceMap := make(map[string]string) - resourceMap["id"] = item3.ID - resourceMap["name"] = item3.Name - d.SetId(joinResourceID(resourceMap)) - return resourceNetworkDeviceUserDefinedFieldRead(ctx, d, m) -} - -func resourceNetworkDeviceUserDefinedFieldRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - // client := m.(*catalystcentersdkgo.Client) - - var diags diag.Diagnostics - - resourceID := d.Id() - resourceMap := separateResourceID(resourceID) - - vvID := resourceMap["id"] - - vvName := resourceMap["name"] - - selectedMethod := 1 - if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetAllUserDefinedFields") - queryParams1 := catalystcentersdkgo.GetAllUserDefinedFieldsQueryParams{} - queryParams1.Name = vvName - item1, err := searchDevicesGetAllUserDefinedFields(m, queryParams1, vvID) - if err != nil || item1 == nil { - d.SetId("") - return diags - } - // Review flatten function used - items := []catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFieldsResponse{ - *item1, - } - vItem1 := flattenDevicesGetAllUserDefinedFieldsItems(&items) - if err := d.Set("item", vItem1); err != nil { - diags = append(diags, diagError( - "Failure when setting GetAllUserDefinedFields search response", - err)) - return diags - } - - } - return diags -} - -func resourceNetworkDeviceUserDefinedFieldUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - client := m.(*catalystcentersdkgo.Client) - - var diags diag.Diagnostics - resourceID := d.Id() - resourceMap := separateResourceID(resourceID) - - vvID := resourceMap["id"] - if d.HasChange("parameters") { - log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestNetworkDeviceUserDefinedFieldUpdateUserDefinedField(ctx, "parameters.0", d) - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - response1, restyResp1, err := client.Devices.UpdateUserDefinedField(vvID, request1) - if err != nil || response1 == nil { - if restyResp1 != nil { - log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing UpdateUserDefinedField", err, restyResp1.String(), - "Failure at UpdateUserDefinedField, unexpected response", "")) - return diags - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing UpdateUserDefinedField", err, - "Failure at UpdateUserDefinedField, unexpected response", "")) - return diags - } - - if response1.Response == nil { - diags = append(diags, diagError( - "Failure when executing UpdateUserDefinedField", err)) - return diags - } - taskId := response1.Response.TaskID - log.Printf("[DEBUG] TASKID => %s", taskId) - if taskId != "" { - time.Sleep(5 * time.Second) - response2, restyResp2, err := client.Task.GetTaskByID(taskId) - if err != nil || response2 == nil { - if restyResp2 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing GetTaskByID", err, - "Failure at GetTaskByID, unexpected response", "")) - return diags - } - if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { - log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) - errorMsg := response2.Response.Progress + "Failure Reason: " + response2.Response.FailureReason - err1 := errors.New(errorMsg) - diags = append(diags, diagError( - "Failure when executing UpdateUserDefinedField", err1)) - return diags - } - } - - } - - return resourceNetworkDeviceUserDefinedFieldRead(ctx, d, m) -} - -func resourceNetworkDeviceUserDefinedFieldDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - - client := m.(*catalystcentersdkgo.Client) - - var diags diag.Diagnostics - - resourceID := d.Id() - resourceMap := separateResourceID(resourceID) - - vvID := resourceMap["id"] - response1, restyResp1, err := client.Devices.DeleteUserDefinedField(vvID) - if err != nil || response1 == nil { - if restyResp1 != nil { - log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteUserDefinedField", err, restyResp1.String(), - "Failure at DeleteUserDefinedField, unexpected response", "")) - return diags - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteUserDefinedField", err, - "Failure at DeleteUserDefinedField, unexpected response", "")) - return diags - } - - if response1.Response == nil { - diags = append(diags, diagError( - "Failure when executing DeleteUserDefinedField", err)) - return diags - } - taskId := response1.Response.TaskID - log.Printf("[DEBUG] TASKID => %s", taskId) - if taskId != "" { - time.Sleep(5 * time.Second) - response2, restyResp2, err := client.Task.GetTaskByID(taskId) - if err != nil || response2 == nil { - if restyResp2 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) - } - diags = append(diags, diagErrorWithAlt( - "Failure when executing GetTaskByID", err, - "Failure at GetTaskByID, unexpected response", "")) - return diags - } - if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { - log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) - errorMsg := response2.Response.Progress + "Failure Reason: " + response2.Response.FailureReason - err1 := errors.New(errorMsg) - diags = append(diags, diagError( - "Failure when executing DeleteUserDefinedField", err1)) - return diags - } - } - - // d.SetId("") is automatically called assuming delete returns no errors, but - // it is added here for explicitness. - d.SetId("") - - return diags -} -func expandRequestNetworkDeviceUserDefinedFieldCreateUserDefinedField(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesCreateUserDefinedField { - request := catalystcentersdkgo.RequestDevicesCreateUserDefinedField{} - if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { - request.Name = interfaceToString(v) - } - if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { - request.Description = interfaceToString(v) - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func expandRequestNetworkDeviceUserDefinedFieldUpdateUserDefinedField(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateUserDefinedField { - request := catalystcentersdkgo.RequestDevicesUpdateUserDefinedField{} - if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { - request.Name = interfaceToString(v) - } - if v, ok := d.GetOkExists(fixKeyAccess(key + ".description")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".description")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".description")))) { - request.Description = interfaceToString(v) - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func searchDevicesGetAllUserDefinedFields(m interface{}, queryParams catalystcentersdkgo.GetAllUserDefinedFieldsQueryParams, vID string) (*catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFieldsResponse, error) { - client := m.(*catalystcentersdkgo.Client) - var err error - var foundItem *catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFieldsResponse - var ite *catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFields - ite, _, err = client.Devices.GetAllUserDefinedFields(&queryParams) - if err != nil || ite == nil { - return foundItem, err - - } - items := ite - itemsCopy := *items.Response - for _, item := range itemsCopy { - // Call get by _ method and set value to foundItem and return - if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseDevicesGetAllUserDefinedFieldsResponse - getItem = &item - foundItem = getItem - return foundItem, err - } - } - return foundItem, err -} diff --git a/catalystcenter/resource_network_device_user_defined_field_delete.go b/catalystcenter/resource_network_device_user_defined_field_delete.go new file mode 100644 index 0000000..b0b4ca9 --- /dev/null +++ b/catalystcenter/resource_network_device_user_defined_field_delete.go @@ -0,0 +1,187 @@ +package catalystcenter + +import ( + "context" + + "errors" + + "time" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceNetworkDeviceUserDefinedFieldDelete() *schema.Resource { + return &schema.Resource{ + Description: `It performs delete operation on Devices. + +- Remove a User-Defined-Field from device. Name of UDF has to be passed as the query parameter. Please note that Global +UDF will not be deleted by this operation. +`, + + CreateContext: resourceNetworkDeviceUserDefinedFieldDeleteCreate, + ReadContext: resourceNetworkDeviceUserDefinedFieldDeleteRead, + DeleteContext: resourceNetworkDeviceUserDefinedFieldDeleteDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "task_id": &schema.Schema{ + Description: `Task Id`, + Type: schema.TypeString, + Computed: true, + }, + "url": &schema.Schema{ + Description: `Url`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "device_id": &schema.Schema{ + Description: `deviceId path parameter. UUID of device from which UDF has to be removed +`, + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "name": &schema.Schema{ + Description: `name query parameter. Name of UDF to be removed +`, + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + }, + }, + }, + } +} + +func resourceNetworkDeviceUserDefinedFieldDeleteCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + + vDeviceID := resourceItem["device_id"] + + vName := resourceItem["name"] + + vvDeviceID := vDeviceID.(string) + queryParams1 := catalystcentersdkgo.RemoveUserDefinedFieldFromDeviceV1QueryParams{} + + queryParams1.Name = vName.(string) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.RemoveUserDefinedFieldFromDeviceV1(vvDeviceID, &queryParams1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing RemoveUserDefinedFieldFromDeviceV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + if response1.Response == nil { + diags = append(diags, diagError( + "Failure when executing RemoveUserDefinedFieldFromDeviceV1", err)) + return diags + } + taskId := response1.Response.TaskID + log.Printf("[DEBUG] TASKID => %s", taskId) + if taskId != "" { + time.Sleep(5 * time.Second) + response2, restyResp2, err := client.Task.GetTaskByID(taskId) + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetTaskByID", err, + "Failure at GetTaskByID, unexpected response", "")) + return diags + } + if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { + log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) + restyResp3, err := client.CustomCall.GetCustomCall(response2.Response.AdditionalStatusURL, nil) + if err != nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetCustomCall", err, + "Failure at GetCustomCall, unexpected response", "")) + return diags + } + var errorMsg string + if restyResp3 == nil { + errorMsg = response2.Response.Progress + "\nFailure Reason: " + response2.Response.FailureReason + } else { + errorMsg = restyResp3.String() + } + err1 := errors.New(errorMsg) + diags = append(diags, diagError( + "Failure when executing RemoveUserDefinedFieldFromDeviceV1", err1)) + return diags + } + } + vItem1 := flattenDevicesRemoveUserDefinedFieldFromDeviceV1Item(response1.Response) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting RemoveUserDefinedFieldFromDeviceV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags +} +func resourceNetworkDeviceUserDefinedFieldDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceNetworkDeviceUserDefinedFieldDeleteDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func flattenDevicesRemoveUserDefinedFieldFromDeviceV1Item(item *catalystcentersdkgo.ResponseDevicesRemoveUserDefinedFieldFromDeviceV1Response) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["task_id"] = item.TaskID + respItem["url"] = item.URL + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/resource_network_device_user_defined_field_update.go b/catalystcenter/resource_network_device_user_defined_field_update.go new file mode 100644 index 0000000..3fcbd52 --- /dev/null +++ b/catalystcenter/resource_network_device_user_defined_field_update.go @@ -0,0 +1,251 @@ +package catalystcenter + +import ( + "context" + + "errors" + + "time" + + "fmt" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceNetworkDeviceUserDefinedFieldUpdate() *schema.Resource { + return &schema.Resource{ + Description: `It performs update operation on Devices. + +- Assigns an existing Global User-Defined-Field to a device. If the UDF is already assigned to the specific device, then +it updates the device UDF value accordingly. Please note that the assigning UDF 'name' must be an existing global UDF. +Otherwise error shall be shown. +`, + + CreateContext: resourceNetworkDeviceUserDefinedFieldUpdateCreate, + ReadContext: resourceNetworkDeviceUserDefinedFieldUpdateRead, + DeleteContext: resourceNetworkDeviceUserDefinedFieldUpdateDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "task_id": &schema.Schema{ + Description: `Task Id`, + Type: schema.TypeString, + Computed: true, + }, + "url": &schema.Schema{ + Description: `Url`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "device_id": &schema.Schema{ + Description: `deviceId path parameter. UUID of device to which UDF has to be added +`, + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "payload": &schema.Schema{ + Description: `Array of RequestDevicesAddUserDefinedFieldToDeviceV1`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "name": &schema.Schema{ + Description: `Name of the User Defined Field +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "value": &schema.Schema{ + Description: `Value of the User Defined Field that will be assigned to the device +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceNetworkDeviceUserDefinedFieldUpdateCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + + vDeviceID := resourceItem["device_id"] + + vvDeviceID := vDeviceID.(string) + request1 := expandRequestNetworkDeviceUserDefinedFieldUpdateAddUserDefinedFieldToDeviceV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.AddUserDefinedFieldToDeviceV1(vvDeviceID, request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing AddUserDefinedFieldToDeviceV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + if response1.Response == nil { + diags = append(diags, diagError( + "Failure when executing AddUserDefinedFieldToDeviceV1", err)) + return diags + } + taskId := response1.Response.TaskID + log.Printf("[DEBUG] TASKID => %s", taskId) + if taskId != "" { + time.Sleep(5 * time.Second) + response2, restyResp2, err := client.Task.GetTaskByID(taskId) + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetTaskByID", err, + "Failure at GetTaskByID, unexpected response", "")) + return diags + } + if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { + log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) + restyResp3, err := client.CustomCall.GetCustomCall(response2.Response.AdditionalStatusURL, nil) + if err != nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetCustomCall", err, + "Failure at GetCustomCall, unexpected response", "")) + return diags + } + var errorMsg string + if restyResp3 == nil { + errorMsg = response2.Response.Progress + "\nFailure Reason: " + response2.Response.FailureReason + } else { + errorMsg = restyResp3.String() + } + err1 := errors.New(errorMsg) + diags = append(diags, diagError( + "Failure when executing AddUserDefinedFieldToDeviceV1", err1)) + return diags + } + } + + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesAddUserDefinedFieldToDeviceV1Item(response1.Response) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting AddUserDefinedFieldToDeviceV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags +} +func resourceNetworkDeviceUserDefinedFieldUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceNetworkDeviceUserDefinedFieldUpdateDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestNetworkDeviceUserDefinedFieldUpdateAddUserDefinedFieldToDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesAddUserDefinedFieldToDeviceV1 { + request := catalystcentersdkgo.RequestDevicesAddUserDefinedFieldToDeviceV1{} + if v := expandRequestNetworkDeviceUserDefinedFieldUpdateAddUserDefinedFieldToDeviceV1ItemArray(ctx, key+".payload", d); v != nil { + request = *v + } + return &request +} + +func expandRequestNetworkDeviceUserDefinedFieldUpdateAddUserDefinedFieldToDeviceV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDevicesAddUserDefinedFieldToDeviceV1 { + request := []catalystcentersdkgo.RequestItemDevicesAddUserDefinedFieldToDeviceV1{} + key = fixKeyAccess(key) + o := d.Get(key) + if o == nil { + return nil + } + objs := o.([]interface{}) + if len(objs) == 0 { + return nil + } + for item_no := range objs { + i := expandRequestNetworkDeviceUserDefinedFieldUpdateAddUserDefinedFieldToDeviceV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + if i != nil { + request = append(request, *i) + } + } + return &request +} + +func expandRequestNetworkDeviceUserDefinedFieldUpdateAddUserDefinedFieldToDeviceV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDevicesAddUserDefinedFieldToDeviceV1 { + request := catalystcentersdkgo.RequestItemDevicesAddUserDefinedFieldToDeviceV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { + request.Name = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + return &request +} + +func flattenDevicesAddUserDefinedFieldToDeviceV1Item(item *catalystcentersdkgo.ResponseDevicesAddUserDefinedFieldToDeviceV1Response) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["task_id"] = item.TaskID + respItem["url"] = item.URL + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/resource_network_devices_device_controllability_settings.go b/catalystcenter/resource_network_devices_device_controllability_settings.go index 16910a5..09bf6db 100644 --- a/catalystcenter/resource_network_devices_device_controllability_settings.go +++ b/catalystcenter/resource_network_devices_device_controllability_settings.go @@ -162,7 +162,7 @@ func resourceNetworkDevicesDeviceControllabilitySettingsRead(ctx context.Context log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSiteDesignGetDeviceControllabilitySettingsItem(response1.Response) + vItem1 := flattenSiteDesignGetDeviceControllabilitySettingsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDeviceControllabilitySettings response", @@ -182,7 +182,7 @@ func resourceNetworkDevicesDeviceControllabilitySettingsUpdate(ctx context.Conte var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestNetworkDevicesDeviceControllabilitySettingsUpdateDeviceControllabilitySettings(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesDeviceControllabilitySettingsUpdateDeviceControllabilitySettingsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.SiteDesign.UpdateDeviceControllabilitySettings(request1) if err != nil || response1 == nil { @@ -241,8 +241,8 @@ func resourceNetworkDevicesDeviceControllabilitySettingsDelete(ctx context.Conte "Failure at NetworkDevicesDeviceControllabilitySettingsDelete, unexpected response", "")) return diags } -func expandRequestNetworkDevicesDeviceControllabilitySettingsUpdateDeviceControllabilitySettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignUpdateDeviceControllabilitySettings { - request := catalystcentersdkgo.RequestSiteDesignUpdateDeviceControllabilitySettings{} +func expandRequestNetworkDevicesDeviceControllabilitySettingsUpdateDeviceControllabilitySettingsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignUpdateDeviceControllabilitySettingsV1 { + request := catalystcentersdkgo.RequestSiteDesignUpdateDeviceControllabilitySettingsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".autocorrect_telemetry_config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".autocorrect_telemetry_config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".autocorrect_telemetry_config")))) { request.AutocorrectTelemetryConfig = interfaceToBoolPtr(v) } diff --git a/catalystcenter/resource_network_devices_interfaces_query.go b/catalystcenter/resource_network_devices_interfaces_query_v2.go similarity index 86% rename from catalystcenter/resource_network_devices_interfaces_query.go rename to catalystcenter/resource_network_devices_interfaces_query_v2.go index 536e53a..ffc2891 100644 --- a/catalystcenter/resource_network_devices_interfaces_query.go +++ b/catalystcenter/resource_network_devices_interfaces_query_v2.go @@ -15,7 +15,7 @@ import ( ) // resourceAction -func resourceNetworkDevicesInterfacesQuery() *schema.Resource { +func resourceNetworkDevicesInterfacesQueryV2() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Devices. @@ -23,9 +23,9 @@ func resourceNetworkDevicesInterfacesQuery() *schema.Resource { Request Body usage and the API filtering support. `, - CreateContext: resourceNetworkDevicesInterfacesQueryCreate, - ReadContext: resourceNetworkDevicesInterfacesQueryRead, - DeleteContext: resourceNetworkDevicesInterfacesQueryDelete, + CreateContext: resourceNetworkDevicesInterfacesQueryV2Create, + ReadContext: resourceNetworkDevicesInterfacesQueryV2Read, + DeleteContext: resourceNetworkDevicesInterfacesQueryV2Delete, Schema: map[string]*schema.Schema{ "last_updated": &schema.Schema{ Type: schema.TypeString, @@ -441,7 +441,7 @@ Request Body usage and the API filtering support. } } -func resourceNetworkDevicesInterfacesQueryCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceNetworkDevicesInterfacesQueryV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -450,31 +450,27 @@ func resourceNetworkDevicesInterfacesQueryCreate(ctx context.Context, d *schema. vDeviceID := resourceItem["device_id"] vvDeviceID := vDeviceID.(string) - request1 := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfo(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.GetDeviceInterfaceStatsInfo(vvDeviceID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.GetDeviceInterfaceStatsInfoV2(vvDeviceID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetDeviceInterfaceStatsInfo", err)) + "Failure when executing GetDeviceInterfaceStatsInfoV2", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenDevicesGetDeviceInterfaceStatsInfoItems(response1.Response) + vItems1 := flattenDevicesGetDeviceInterfaceStatsInfoV2Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDeviceInterfaceStatsInfo response", + "Failure when setting GetDeviceInterfaceStatsInfoV2 response", err)) return diags } @@ -483,21 +479,21 @@ func resourceNetworkDevicesInterfacesQueryCreate(ctx context.Context, d *schema. return diags } -func resourceNetworkDevicesInterfacesQueryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceNetworkDevicesInterfacesQueryV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics return diags } -func resourceNetworkDevicesInterfacesQueryDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceNetworkDevicesInterfacesQueryV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics return diags } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfo { - request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfo{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2 { + request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -505,27 +501,27 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfo(ctx c request.EndTime = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".query")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".query")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".query")))) { - request.Query = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQuery(ctx, key+".query.0", d) + request.Query = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2Query(ctx, key+".query.0", d) } return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQuery(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQuery { - request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQuery{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2Query(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2Query { + request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2Query{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fields")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fields")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fields")))) { - request.Fields = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFieldsArray(ctx, key+".fields", d) + request.Fields = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFieldsArray(ctx, key+".fields", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryPage(ctx, key+".page.0", d) + request.Page = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryPage(ctx, key+".page.0", d) } return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFieldsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFields { - request := []catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFields{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFieldsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFields { + request := []catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFields{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -536,7 +532,7 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryF return nil } for item_no := range objs { - i := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFields(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFields(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -544,14 +540,14 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryF return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFields(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFields { - var request catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFields +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFields(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFields { + var request catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFields request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFilters { - request := []catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFilters{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFilters { + request := []catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -562,7 +558,7 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryF return nil } for item_no := range objs { - i := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -570,8 +566,8 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryF return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFilters { - request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryFilters{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFilters { + request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -584,8 +580,8 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryF return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryPage { - request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryPage{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryPage { + request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryPage{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -593,13 +589,13 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryP request.Offset = interfaceToFloat64Ptr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".order_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".order_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".order_by")))) { - request.OrderBy = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryPageOrderByArray(ctx, key+".order_by", d) + request.OrderBy = expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryPageOrderByArray(ctx, key+".order_by", d) } return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryPageOrderByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryPageOrderBy { - request := []catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryPageOrderBy{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryPageOrderByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryPageOrderBy { + request := []catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryPageOrderBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -610,7 +606,7 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryP return nil } for item_no := range objs { - i := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryPageOrderBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryPageOrderBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -618,8 +614,8 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryP return &request } -func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryPageOrderBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryPageOrderBy { - request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoQueryPageOrderBy{} +func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoV2QueryPageOrderBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryPageOrderBy { + request := catalystcentersdkgo.RequestDevicesGetDeviceInterfaceStatsInfoV2QueryPageOrderBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -629,7 +625,7 @@ func expandRequestNetworkDevicesInterfacesQueryGetDeviceInterfaceStatsInfoQueryP return &request } -func flattenDevicesGetDeviceInterfaceStatsInfoItems(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceStatsInfoResponse) []map[string]interface{} { +func flattenDevicesGetDeviceInterfaceStatsInfoV2Items(items *[]catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceStatsInfoV2Response) []map[string]interface{} { if items == nil { return nil } @@ -637,13 +633,13 @@ func flattenDevicesGetDeviceInterfaceStatsInfoItems(items *[]catalystcentersdkgo for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["values"] = flattenDevicesGetDeviceInterfaceStatsInfoItemsValues(item.Values) + respItem["values"] = flattenDevicesGetDeviceInterfaceStatsInfoV2ItemsValues(item.Values) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetDeviceInterfaceStatsInfoItemsValues(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceStatsInfoResponseValues) []map[string]interface{} { +func flattenDevicesGetDeviceInterfaceStatsInfoV2ItemsValues(item *catalystcentersdkgo.ResponseDevicesGetDeviceInterfaceStatsInfoV2ResponseValues) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_devices_issues_remediation_provision.go b/catalystcenter/resource_network_devices_issues_remediation_provision.go index b073e24..2250692 100644 --- a/catalystcenter/resource_network_devices_issues_remediation_provision.go +++ b/catalystcenter/resource_network_devices_issues_remediation_provision.go @@ -87,14 +87,16 @@ func resourceNetworkDevicesIssuesRemediationProvisionCreate(ctx context.Context, vvID := vID.(string) - response1, restyResp1, err := client.Compliance.ComplianceRemediation(vvID) + // has_unknown_response: None + + response1, restyResp1, err := client.Compliance.ComplianceRemediationV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ComplianceRemediation", err)) + "Failure when executing ComplianceRemediationV1", err)) return diags } @@ -102,7 +104,7 @@ func resourceNetworkDevicesIssuesRemediationProvisionCreate(ctx context.Context, if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ComplianceRemediation", err)) + "Failure when executing ComplianceRemediationV1", err)) return diags } taskId := response1.Response.TaskID @@ -136,15 +138,14 @@ func resourceNetworkDevicesIssuesRemediationProvisionCreate(ctx context.Context, } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ComplianceRemediation", err1)) + "Failure when executing ComplianceRemediationV1", err1)) return diags } } - - vItem1 := flattenComplianceComplianceRemediationItem(response1.Response) + vItem1 := flattenComplianceComplianceRemediationV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ComplianceRemediation response", + "Failure when setting ComplianceRemediationV1 response", err)) return diags } @@ -166,7 +167,7 @@ func resourceNetworkDevicesIssuesRemediationProvisionDelete(ctx context.Context, return diags } -func flattenComplianceComplianceRemediationItem(item *catalystcentersdkgo.ResponseComplianceComplianceRemediationResponse) []map[string]interface{} { +func flattenComplianceComplianceRemediationV1Item(item *catalystcentersdkgo.ResponseComplianceComplianceRemediationV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_devices_members_associations_query.go b/catalystcenter/resource_network_devices_members_associations_query.go index c01e69a..cca13f9 100644 --- a/catalystcenter/resource_network_devices_members_associations_query.go +++ b/catalystcenter/resource_network_devices_members_associations_query.go @@ -148,15 +148,15 @@ func resourceNetworkDevicesMembersAssociationsQueryDelete(ctx context.Context, d return diags } -func expandRequestNetworkDevicesMembersAssociationsQueryQueryTheTagsAssociatedWithNetworkDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithNetworkDevices { - request := catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithNetworkDevices{} +func expandRequestNetworkDevicesMembersAssociationsQueryQueryTheTagsAssociatedWithNetworkDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithNetworkDevicesV1 { + request := catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithNetworkDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ids")))) { request.IDs = interfaceToSliceString(v) } return &request } -func flattenTagQueryTheTagsAssociatedWithNetworkDevicesItems(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithNetworkDevicesResponse) []map[string]interface{} { +func flattenTagQueryTheTagsAssociatedWithNetworkDevicesItems(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithNetworkDevicesV1Response) []map[string]interface{} { if items == nil { return nil } @@ -170,7 +170,7 @@ func flattenTagQueryTheTagsAssociatedWithNetworkDevicesItems(items *[]catalystce return respItems } -func flattenTagQueryTheTagsAssociatedWithNetworkDevicesItemsTags(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithNetworkDevicesResponseTags) []map[string]interface{} { +func flattenTagQueryTheTagsAssociatedWithNetworkDevicesItemsTags(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithNetworkDevicesV1ResponseTags) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_network_devices_network_profiles_for_sites.go b/catalystcenter/resource_network_devices_network_profiles_for_sites.go index dd43c47..38f638d 100644 --- a/catalystcenter/resource_network_devices_network_profiles_for_sites.go +++ b/catalystcenter/resource_network_devices_network_profiles_for_sites.go @@ -67,7 +67,7 @@ func resourceNetworkDevicesNetworkProfilesForSites() *schema.Resource { Schema: map[string]*schema.Schema{ "id": &schema.Schema{ - Description: `id path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `id path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Required: true, @@ -115,7 +115,7 @@ func resourceNetworkDevicesNetworkProfilesForSitesRead(ctx context.Context, d *s return diags } // Review flatten function used - vItem1 := flattenSiteDesignRetrieveANetworkProfileForSitesByIDItem(response1.Response) + vItem1 := flattenSiteDesignRetrieveANetworkProfileForSitesByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrievesTheListOfNetworkProfilesForSites search response", diff --git a/catalystcenter/resource_network_devices_query.go b/catalystcenter/resource_network_devices_query.go index 616c4c3..463e2f6 100644 --- a/catalystcenter/resource_network_devices_query.go +++ b/catalystcenter/resource_network_devices_query.go @@ -918,31 +918,27 @@ func resourceNetworkDevicesQueryCreate(ctx context.Context, d *schema.ResourceDa client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.GetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.GetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions", err)) + "Failure when executing GetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItems(response1.Response) + vItems1 := flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions response", + "Failure when setting GetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1 response", err)) return diags } @@ -964,8 +960,8 @@ func resourceNetworkDevicesQueryDelete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions{} +func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1 { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -979,19 +975,19 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage(ctx, key+".page.0", d) + request.Page = expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters { - request := []catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters{} +func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters { + request := []catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1002,7 +998,7 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return nil } for item_no := range objs { - i := expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1010,8 +1006,8 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return &request } -func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters{} +func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -1024,8 +1020,8 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return &request } -func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes{} +func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1036,7 +1032,7 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return nil } for item_no := range objs { - i := expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1044,8 +1040,8 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return &request } -func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes{} +func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -1055,8 +1051,8 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return &request } -func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage { - request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage{} +func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page { + request := catalystcentersdkgo.RequestDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -1072,7 +1068,7 @@ func expandRequestNetworkDevicesQueryGetsTheListOfNetworkDevicesBasedOnTheProvid return &request } -func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItems(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponse) []map[string]interface{} { +func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Response) []map[string]interface{} { if items == nil { return nil } @@ -1118,16 +1114,16 @@ func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAn respItem["wireless_client_count"] = item.WirelessClientCount respItem["port_count"] = item.PortCount respItem["client_count"] = item.ClientCount - respItem["ap_details"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsApDetails(item.ApDetails) - respItem["metrics_details"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsMetricsDetails(item.MetricsDetails) - respItem["fabric_details"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsFabricDetails(item.FabricDetails) - respItem["aggregate_attributes"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsAggregateAttributes(item.AggregateAttributes) + respItem["ap_details"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsApDetails(item.ApDetails) + respItem["metrics_details"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsMetricsDetails(item.MetricsDetails) + respItem["fabric_details"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsFabricDetails(item.FabricDetails) + respItem["aggregate_attributes"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsApDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseApDetails) []map[string]interface{} { +func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsApDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseApDetails) []map[string]interface{} { if item == nil { return nil } @@ -1158,7 +1154,7 @@ func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAn respItem["flex_group"] = item.FlexGroup respItem["power_calendar_profile"] = item.PowerCalendarProfile respItem["ap_group"] = item.ApGroup - respItem["radios"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsApDetailsRadios(item.Radios) + respItem["radios"] = flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsApDetailsRadios(item.Radios) return []map[string]interface{}{ respItem, @@ -1166,7 +1162,7 @@ func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAn } -func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsApDetailsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseApDetailsRadios) []map[string]interface{} { +func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsApDetailsRadios(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseApDetailsRadios) []map[string]interface{} { if items == nil { return nil } @@ -1186,7 +1182,7 @@ func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAn return respItems } -func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsMetricsDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseMetricsDetails) []map[string]interface{} { +func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsMetricsDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseMetricsDetails) []map[string]interface{} { if item == nil { return nil } @@ -1227,7 +1223,7 @@ func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAn } -func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsFabricDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseFabricDetails) []map[string]interface{} { +func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsFabricDetails(item *catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseFabricDetails) []map[string]interface{} { if item == nil { return nil } @@ -1242,7 +1238,7 @@ func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAn } -func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponseAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheListOfNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_network_devices_query_count.go b/catalystcenter/resource_network_devices_query_count.go index d609b97..f844cd9 100644 --- a/catalystcenter/resource_network_devices_query_count.go +++ b/catalystcenter/resource_network_devices_query_count.go @@ -207,31 +207,27 @@ func resourceNetworkDevicesQueryCountCreate(ctx context.Context, d *schema.Resou client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.GetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.GetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions", err)) + "Failure when executing GetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItem(response1.Response) + vItem1 := flattenDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions response", + "Failure when setting GetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1 response", err)) return diags } @@ -253,8 +249,8 @@ func resourceNetworkDevicesQueryCountDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions { - request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctions{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1 { + request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -268,19 +264,19 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage(ctx, key+".page.0", d) + request.Page = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters { - request := []catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters { + request := []catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -291,7 +287,7 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return nil } for item_no := range objs { - i := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -299,8 +295,8 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters { - request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsFilters{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters { + request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -313,8 +309,8 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -325,7 +321,7 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return nil } for item_no := range objs { - i := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -333,8 +329,8 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes { - request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsAggregateAttributes{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes { + request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -344,8 +340,8 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage { - request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPage{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page { + request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -353,13 +349,13 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy { - request := []catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy { + request := []catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -370,7 +366,7 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return nil } for item_no := range objs { - i := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -378,8 +374,8 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return &request } -func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy { - request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsPageSortBy{} +func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy { + request := catalystcentersdkgo.RequestDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -389,7 +385,7 @@ func expandRequestNetworkDevicesQueryCountGetsTheTotalNumberNetworkDevicesBasedO return &request } -func flattenDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsItem(item *catalystcentersdkgo.ResponseDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsResponse) []map[string]interface{} { +func flattenDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Item(item *catalystcentersdkgo.ResponseDevicesGetsTheTotalNumberNetworkDevicesBasedOnTheProvidedComplexFiltersAndAggregationFunctionsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_devices_resync_interval_settings.go b/catalystcenter/resource_network_devices_resync_interval_settings.go index b2e6009..65d5f79 100644 --- a/catalystcenter/resource_network_devices_resync_interval_settings.go +++ b/catalystcenter/resource_network_devices_resync_interval_settings.go @@ -82,20 +82,18 @@ func resourceNetworkDevicesResyncIntervalSettingsCreate(ctx context.Context, d * client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDevicesResyncIntervalSettingsUpdateGlobalResyncInterval(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesResyncIntervalSettingsUpdateGlobalResyncIntervalV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.UpdateGlobalResyncInterval(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.UpdateGlobalResyncIntervalV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateGlobalResyncInterval", err)) + "Failure when executing UpdateGlobalResyncIntervalV1", err)) return diags } @@ -103,7 +101,7 @@ func resourceNetworkDevicesResyncIntervalSettingsCreate(ctx context.Context, d * if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateGlobalResyncInterval", err)) + "Failure when executing UpdateGlobalResyncIntervalV1", err)) return diags } taskId := response1.Response.TaskID @@ -137,22 +135,24 @@ func resourceNetworkDevicesResyncIntervalSettingsCreate(ctx context.Context, d * } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateGlobalResyncInterval", err1)) + "Failure when executing UpdateGlobalResyncIntervalV1", err1)) return diags } } - vItem1 := flattenDevicesUpdateGlobalResyncIntervalItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesUpdateGlobalResyncIntervalV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateGlobalResyncInterval response", + "Failure when setting UpdateGlobalResyncIntervalV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDevicesResyncIntervalSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -167,15 +167,15 @@ func resourceNetworkDevicesResyncIntervalSettingsDelete(ctx context.Context, d * return diags } -func expandRequestNetworkDevicesResyncIntervalSettingsUpdateGlobalResyncInterval(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateGlobalResyncInterval { - request := catalystcentersdkgo.RequestDevicesUpdateGlobalResyncInterval{} +func expandRequestNetworkDevicesResyncIntervalSettingsUpdateGlobalResyncIntervalV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateGlobalResyncIntervalV1 { + request := catalystcentersdkgo.RequestDevicesUpdateGlobalResyncIntervalV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interval")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interval")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interval")))) { request.Interval = interfaceToIntPtr(v) } return &request } -func flattenDevicesUpdateGlobalResyncIntervalItem(item *catalystcentersdkgo.ResponseDevicesUpdateGlobalResyncIntervalResponse) []map[string]interface{} { +func flattenDevicesUpdateGlobalResyncIntervalV1Item(item *catalystcentersdkgo.ResponseDevicesUpdateGlobalResyncIntervalV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_devices_resync_interval_settings_id.go b/catalystcenter/resource_network_devices_resync_interval_settings_id.go index eac2951..c29eab5 100644 --- a/catalystcenter/resource_network_devices_resync_interval_settings_id.go +++ b/catalystcenter/resource_network_devices_resync_interval_settings_id.go @@ -19,8 +19,8 @@ func resourceNetworkDevicesResyncIntervalSettingsID() *schema.Resource { Description: `It manages read and update operations on Devices. - Update the resync interval (in minutes) for the given network device id. -To disable periodic resync, set interval as '0'. -To use global settings, set interval as 'null'. +To disable periodic resync, set interval as *0*. +To use global settings, set interval as *null*. `, CreateContext: resourceNetworkDevicesResyncIntervalSettingsIDCreate, @@ -65,7 +65,7 @@ To use global settings, set interval as 'null'. Required: true, }, "interval": &schema.Schema{ - Description: `Resync interval in minutes. To disable periodic resync, set interval as '0'. To use global settings, set interval as 'null'. + Description: `Resync interval in minutes. To disable periodic resync, set interval as *0*. To use global settings, set interval as *null*. `, Type: schema.TypeInt, Optional: true, @@ -116,7 +116,7 @@ func resourceNetworkDevicesResyncIntervalSettingsIDRead(ctx context.Context, d * log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDevicesGetResyncIntervalForTheNetworkDeviceItem(response1.Response) + vItem1 := flattenDevicesGetResyncIntervalForTheNetworkDeviceV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetResyncIntervalForTheNetworkDevice response", @@ -139,7 +139,7 @@ func resourceNetworkDevicesResyncIntervalSettingsIDUpdate(ctx context.Context, d vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestNetworkDevicesResyncIntervalSettingsIDUpdateResyncIntervalForTheNetworkDevice(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesResyncIntervalSettingsIDUpdateResyncIntervalForTheNetworkDeviceV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Devices.UpdateResyncIntervalForTheNetworkDevice(vvID, request1) if err != nil || response1 == nil { @@ -198,8 +198,8 @@ func resourceNetworkDevicesResyncIntervalSettingsIDDelete(ctx context.Context, d "Failure at NetworkDevicesResyncIntervalSettingsIDDelete, unexpected response", "")) return diags } -func expandRequestNetworkDevicesResyncIntervalSettingsIDUpdateResyncIntervalForTheNetworkDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateResyncIntervalForTheNetworkDevice { - request := catalystcentersdkgo.RequestDevicesUpdateResyncIntervalForTheNetworkDevice{} +func expandRequestNetworkDevicesResyncIntervalSettingsIDUpdateResyncIntervalForTheNetworkDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesUpdateResyncIntervalForTheNetworkDeviceV1 { + request := catalystcentersdkgo.RequestDevicesUpdateResyncIntervalForTheNetworkDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interval")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interval")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interval")))) { request.Interval = interfaceToIntPtr(v) } diff --git a/catalystcenter/resource_network_devices_resync_interval_settings_override.go b/catalystcenter/resource_network_devices_resync_interval_settings_override.go index 47b520f..fd6e75a 100644 --- a/catalystcenter/resource_network_devices_resync_interval_settings_override.go +++ b/catalystcenter/resource_network_devices_resync_interval_settings_override.go @@ -71,14 +71,16 @@ func resourceNetworkDevicesResyncIntervalSettingsOverrideCreate(ctx context.Cont client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - response1, restyResp1, err := client.Devices.OverrideResyncInterval() + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.OverrideResyncIntervalV1() if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing OverrideResyncInterval", err)) + "Failure when executing OverrideResyncIntervalV1", err)) return diags } @@ -86,7 +88,7 @@ func resourceNetworkDevicesResyncIntervalSettingsOverrideCreate(ctx context.Cont if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing OverrideResyncInterval", err)) + "Failure when executing OverrideResyncIntervalV1", err)) return diags } taskId := response1.Response.TaskID @@ -120,22 +122,20 @@ func resourceNetworkDevicesResyncIntervalSettingsOverrideCreate(ctx context.Cont } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing OverrideResyncInterval", err1)) + "Failure when executing OverrideResyncIntervalV1", err1)) return diags } } - - vItem1 := flattenDevicesOverrideResyncIntervalItem(response1.Response) + vItem1 := flattenDevicesOverrideResyncIntervalV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting OverrideResyncInterval response", + "Failure when setting OverrideResyncIntervalV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDevicesResyncIntervalSettingsOverrideRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -150,7 +150,7 @@ func resourceNetworkDevicesResyncIntervalSettingsOverrideDelete(ctx context.Cont return diags } -func flattenDevicesOverrideResyncIntervalItem(item *catalystcentersdkgo.ResponseDevicesOverrideResyncIntervalResponse) []map[string]interface{} { +func flattenDevicesOverrideResyncIntervalV1Item(item *catalystcentersdkgo.ResponseDevicesOverrideResyncIntervalV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_devices_summary_analytics.go b/catalystcenter/resource_network_devices_summary_analytics.go index 770889c..8373a66 100644 --- a/catalystcenter/resource_network_devices_summary_analytics.go +++ b/catalystcenter/resource_network_devices_summary_analytics.go @@ -276,31 +276,27 @@ func resourceNetworkDevicesSummaryAnalyticsCreate(ctx context.Context, d *schema client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevices(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.GetsTheSummaryAnalyticsDataRelatedToNetworkDevices(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.GetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetsTheSummaryAnalyticsDataRelatedToNetworkDevices", err)) + "Failure when executing GetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItem(response1.Response) + vItem1 := flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheSummaryAnalyticsDataRelatedToNetworkDevices response", + "Failure when setting GetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1 response", err)) return diags } @@ -322,8 +318,8 @@ func resourceNetworkDevicesSummaryAnalyticsDelete(ctx context.Context, d *schema return diags } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevices { - request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevices{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1 { + request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -337,19 +333,19 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPage(ctx, key+".page.0", d) + request.Page = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFilters { - request := []catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFilters{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Filters { + request := []catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -360,7 +356,7 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return nil } for item_no := range objs { - i := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -368,8 +364,8 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFilters { - request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesFilters{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Filters { + request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -382,8 +378,8 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributes{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -394,7 +390,7 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return nil } for item_no := range objs { - i := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -402,8 +398,8 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributes { - request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesAggregateAttributes{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributes { + request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -413,8 +409,8 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPage { - request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPage{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Page { + request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -422,13 +418,13 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat request.Offset = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sort_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sort_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sort_by")))) { - request.SortBy = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortByArray(ctx, key+".sort_by", d) + request.SortBy = expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortByArray(ctx, key+".sort_by", d) } return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortBy { - request := []catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortBy{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortBy { + request := []catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -439,7 +435,7 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return nil } for item_no := range objs { - i := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -447,8 +443,8 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return &request } -func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortBy { - request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesPageSortBy{} +func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortBy { + request := catalystcentersdkgo.RequestDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1PageSortBy{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -458,20 +454,20 @@ func expandRequestNetworkDevicesSummaryAnalyticsGetsTheSummaryAnalyticsDataRelat return &request } -func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItem(item *catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesResponse) []map[string]interface{} { +func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Item(item *catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1Response) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemAggregateAttributes(item.AggregateAttributes) - respItem["groups"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroups(item.Groups) + respItem["attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemAggregateAttributes(item.AggregateAttributes) + respItem["groups"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemGroups(item.Groups) return []map[string]interface{}{ respItem, } } -func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesResponseAttributes) []interface{} { +func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ResponseAttributes) []interface{} { if items == nil { return nil } @@ -483,7 +479,7 @@ func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemAttribu return respItems } -func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesResponseAggregateAttributes) []interface{} { +func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ResponseAggregateAttributes) []interface{} { if items == nil { return nil } @@ -495,7 +491,7 @@ func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemAggrega return respItems } -func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroups(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesResponseGroups) []map[string]interface{} { +func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemGroups(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -503,14 +499,14 @@ func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroups( for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroupsAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesResponseGroupsAttributes) []map[string]interface{} { +func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemGroupsAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -524,7 +520,7 @@ func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroupsA return respItems } -func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesItemGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ItemGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheSummaryAnalyticsDataRelatedToNetworkDevicesV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_network_devices_trend_analytics.go b/catalystcenter/resource_network_devices_trend_analytics.go index baab5e6..a275742 100644 --- a/catalystcenter/resource_network_devices_trend_analytics.go +++ b/catalystcenter/resource_network_devices_trend_analytics.go @@ -20,7 +20,7 @@ func resourceNetworkDevicesTrendAnalytics() *schema.Resource { Description: `It performs create operation on Devices. - Gets the Trend analytics Network device data for the given time range. The data will be grouped based on the given -trend time Interval. The required property for this API is 'trendInterval'. For detailed information about the usage of +trend time Interval. The required property for this API is *trendInterval*. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst- center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceNetworkDevices-1.0.2-resolved.yaml `, @@ -299,31 +299,27 @@ func resourceNetworkDevicesTrendAnalyticsCreate(ctx context.Context, d *schema.R client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsData(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.GetsTheTrendAnalyticsData(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.GetsTheTrendAnalyticsDataV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing GetsTheTrendAnalyticsData", err)) + "Failure when executing GetsTheTrendAnalyticsDataV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenDevicesGetsTheTrendAnalyticsDataItems(response1.Response) + vItems1 := flattenDevicesGetsTheTrendAnalyticsDataV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting GetsTheTrendAnalyticsData response", + "Failure when setting GetsTheTrendAnalyticsDataV1 response", err)) return diags } @@ -345,8 +341,8 @@ func resourceNetworkDevicesTrendAnalyticsDelete(ctx context.Context, d *schema.R return diags } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsData(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsData { - request := catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsData{} +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1 { + request := catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -357,25 +353,25 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsData(ctx cont request.TrendInterval = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".group_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".group_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".group_by")))) { - request.GroupBy = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataGroupByArray(ctx, key+".group_by", d) + request.GroupBy = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1GroupByArray(ctx, key+".group_by", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attributes")))) { request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataPage(ctx, key+".page.0", d) + request.Page = expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataGroupByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataGroupBy { - request := []catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataGroupBy{} +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1GroupByArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1GroupBy { + request := []catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1GroupBy{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -386,7 +382,7 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataGroupByAr return nil } for item_no := range objs { - i := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataGroupBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1GroupBy(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -394,14 +390,14 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataGroupByAr return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataGroupBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataGroupBy { - var request catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataGroupBy +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1GroupBy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1GroupBy { + var request catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1GroupBy request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataFilters { - request := []catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataFilters{} +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1Filters { + request := []catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -412,7 +408,7 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFiltersAr return nil } for item_no := range objs { - i := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -420,8 +416,8 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFiltersAr return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataFilters { - request := catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataFilters{} +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1Filters { + request := catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -434,8 +430,8 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataFilters(c return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataAggregateAttributes{} +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -446,7 +442,7 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataAggregate return nil } for item_no := range objs { - i := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -454,14 +450,14 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataAggregate return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataAggregateAttributes { - var request catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataAggregateAttributes +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1AggregateAttributes { + var request catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1AggregateAttributes request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataPage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataPage { - request := catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataPage{} +func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1Page { + request := catalystcentersdkgo.RequestDevicesGetsTheTrendAnalyticsDataV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -474,7 +470,7 @@ func expandRequestNetworkDevicesTrendAnalyticsGetsTheTrendAnalyticsDataPage(ctx return &request } -func flattenDevicesGetsTheTrendAnalyticsDataItems(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataResponse) []map[string]interface{} { +func flattenDevicesGetsTheTrendAnalyticsDataV1Items(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataV1Response) []map[string]interface{} { if items == nil { return nil } @@ -482,15 +478,15 @@ func flattenDevicesGetsTheTrendAnalyticsDataItems(items *[]catalystcentersdkgo.R for _, item := range *items { respItem := make(map[string]interface{}) respItem["timestamp"] = item.Timestamp - respItem["attributes"] = flattenDevicesGetsTheTrendAnalyticsDataItemsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenDevicesGetsTheTrendAnalyticsDataItemsAggregateAttributes(item.AggregateAttributes) - respItem["groups"] = flattenDevicesGetsTheTrendAnalyticsDataItemsGroups(item.Groups) + respItem["attributes"] = flattenDevicesGetsTheTrendAnalyticsDataV1ItemsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenDevicesGetsTheTrendAnalyticsDataV1ItemsAggregateAttributes(item.AggregateAttributes) + respItem["groups"] = flattenDevicesGetsTheTrendAnalyticsDataV1ItemsGroups(item.Groups) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheTrendAnalyticsDataItemsAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataResponseAttributes) []map[string]interface{} { +func flattenDevicesGetsTheTrendAnalyticsDataV1ItemsAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataV1ResponseAttributes) []map[string]interface{} { if items == nil { return nil } @@ -504,7 +500,7 @@ func flattenDevicesGetsTheTrendAnalyticsDataItemsAttributes(items *[]catalystcen return respItems } -func flattenDevicesGetsTheTrendAnalyticsDataItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataResponseAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetsTheTrendAnalyticsDataV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } @@ -519,7 +515,7 @@ func flattenDevicesGetsTheTrendAnalyticsDataItemsAggregateAttributes(items *[]ca return respItems } -func flattenDevicesGetsTheTrendAnalyticsDataItemsGroups(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataResponseGroups) []map[string]interface{} { +func flattenDevicesGetsTheTrendAnalyticsDataV1ItemsGroups(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -527,14 +523,14 @@ func flattenDevicesGetsTheTrendAnalyticsDataItemsGroups(items *[]catalystcenters for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenDevicesGetsTheTrendAnalyticsDataItemsGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenDevicesGetsTheTrendAnalyticsDataItemsGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenDevicesGetsTheTrendAnalyticsDataV1ItemsGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenDevicesGetsTheTrendAnalyticsDataV1ItemsGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesGetsTheTrendAnalyticsDataItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataResponseGroupsAttributes) []map[string]interface{} { +func flattenDevicesGetsTheTrendAnalyticsDataV1ItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -548,7 +544,7 @@ func flattenDevicesGetsTheTrendAnalyticsDataItemsGroupsAttributes(items *[]catal return respItems } -func flattenDevicesGetsTheTrendAnalyticsDataItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenDevicesGetsTheTrendAnalyticsDataV1ItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesGetsTheTrendAnalyticsDataV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_network_devices_trend_analytics_id.go b/catalystcenter/resource_network_devices_trend_analytics_id.go index bf68c64..8cc9eba 100644 --- a/catalystcenter/resource_network_devices_trend_analytics_id.go +++ b/catalystcenter/resource_network_devices_trend_analytics_id.go @@ -343,31 +343,27 @@ func resourceNetworkDevicesTrendAnalyticsIDCreate(ctx context.Context, d *schema vID := resourceItem["id"] vvID := vID.(string) - request1 := expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Devices.TheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange(vvID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Devices.TheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1(vvID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing TheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange", err)) + "Failure when executing TheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItems1 := flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItems(response1.Response) + vItems1 := flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Items(response1.Response) if err := d.Set("items", vItems1); err != nil { diags = append(diags, diagError( - "Failure when setting TheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange response", + "Failure when setting TheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1 response", err)) return diags } @@ -389,8 +385,8 @@ func resourceNetworkDevicesTrendAnalyticsIDDelete(ctx context.Context, d *schema return diags } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange { - request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRange{} +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1 { + request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -404,22 +400,22 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo request.GroupBy = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1FiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attributes")))) { request.Attributes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aggregate_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aggregate_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aggregate_attributes")))) { - request.AggregateAttributes = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributesArray(ctx, key+".aggregate_attributes", d) + request.AggregateAttributes = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributesArray(ctx, key+".aggregate_attributes", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".page")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".page")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".page")))) { - request.Page = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangePage(ctx, key+".page.0", d) + request.Page = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Page(ctx, key+".page.0", d) } return &request } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFilters { - request := []catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFilters{} +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1FiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Filters { + request := []catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Filters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -430,7 +426,7 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return nil } for item_no := range objs { - i := expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Filters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -438,8 +434,8 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return &request } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFilters { - request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFilters{} +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Filters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Filters { + request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Filters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -450,7 +446,7 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo request.LogicalOperator = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { - request.Value = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFiltersValue(ctx, key+".value.0", d) + request.Value = expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1FiltersValue(ctx, key+".value.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { request.Filters = interfaceToSliceString(v) @@ -458,14 +454,14 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return &request } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFiltersValue { - var request catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeFiltersValue +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1FiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1FiltersValue { + var request catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1FiltersValue request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributes { - request := []catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributes{} +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributes { + request := []catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributes{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -476,7 +472,7 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return nil } for item_no := range objs { - i := expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributes(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -484,8 +480,8 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return &request } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributes { - request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeAggregateAttributes{} +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributes(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributes { + request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1AggregateAttributes{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -495,8 +491,8 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return &request } -func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangePage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangePage { - request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangePage{} +func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Page(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Page { + request := catalystcentersdkgo.RequestDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Page{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { request.Limit = interfaceToIntPtr(v) } @@ -509,7 +505,7 @@ func expandRequestNetworkDevicesTrendAnalyticsIDTheTrendAnalyticsDataForTheNetwo return &request } -func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItems(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeResponse) []map[string]interface{} { +func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Items(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1Response) []map[string]interface{} { if items == nil { return nil } @@ -517,15 +513,15 @@ func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRan for _, item := range *items { respItem := make(map[string]interface{}) respItem["timestamp"] = item.Timestamp - respItem["attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsAggregateAttributes(item.AggregateAttributes) - respItem["groups"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsGroups(item.Groups) + respItem["attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsAggregateAttributes(item.AggregateAttributes) + respItem["groups"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsGroups(item.Groups) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeResponseAttributes) []map[string]interface{} { +func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ResponseAttributes) []map[string]interface{} { if items == nil { return nil } @@ -539,7 +535,7 @@ func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRan return respItems } -func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeResponseAggregateAttributes) []map[string]interface{} { +func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ResponseAggregateAttributes) []map[string]interface{} { if items == nil { return nil } @@ -554,7 +550,7 @@ func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRan return respItems } -func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsGroups(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeResponseGroups) []map[string]interface{} { +func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsGroups(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ResponseGroups) []map[string]interface{} { if items == nil { return nil } @@ -562,14 +558,14 @@ func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRan for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsGroupsAttributes(item.Attributes) - respItem["aggregate_attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsGroupsAggregateAttributes(item.AggregateAttributes) + respItem["attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsGroupsAttributes(item.Attributes) + respItem["aggregate_attributes"] = flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsGroupsAggregateAttributes(item.AggregateAttributes) respItems = append(respItems, respItem) } return respItems } -func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeResponseGroupsAttributes) []map[string]interface{} { +func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsGroupsAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ResponseGroupsAttributes) []map[string]interface{} { if items == nil { return nil } @@ -583,7 +579,7 @@ func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRan return respItems } -func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeResponseGroupsAggregateAttributes) []map[string]interface{} { +func flattenDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ItemsGroupsAggregateAttributes(items *[]catalystcentersdkgo.ResponseDevicesTheTrendAnalyticsDataForTheNetworkDeviceInTheSpecifiedTimeRangeV1ResponseGroupsAggregateAttributes) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_network_devices_unassign_from_site_apply.go b/catalystcenter/resource_network_devices_unassign_from_site_apply.go index 82e8c14..fc2f75b 100644 --- a/catalystcenter/resource_network_devices_unassign_from_site_apply.go +++ b/catalystcenter/resource_network_devices_unassign_from_site_apply.go @@ -24,7 +24,7 @@ func resourceNetworkDevicesUnassignFromSiteApply() *schema.Resource { - Unassign unprovisioned network devices from their site. If device controllability is enabled, it will be triggered once device unassigned from site successfully. Device Controllability can be enabled/disabled using -'/dna/intent/api/v1/networkDevices/deviceControllability/settings'. +*/dna/intent/api/v1/networkDevices/deviceControllability/settings*. `, CreateContext: resourceNetworkDevicesUnassignFromSiteApplyCreate, @@ -86,20 +86,18 @@ func resourceNetworkDevicesUnassignFromSiteApplyCreate(ctx context.Context, d *s client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestNetworkDevicesUnassignFromSiteApplyUnassignNetworkDevicesFromSites(ctx, "parameters.0", d) + request1 := expandRequestNetworkDevicesUnassignFromSiteApplyUnassignNetworkDevicesFromSitesV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.SiteDesign.UnassignNetworkDevicesFromSites(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.SiteDesign.UnassignNetworkDevicesFromSitesV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UnassignNetworkDevicesFromSites", err)) + "Failure when executing UnassignNetworkDevicesFromSitesV1", err)) return diags } @@ -107,7 +105,7 @@ func resourceNetworkDevicesUnassignFromSiteApplyCreate(ctx context.Context, d *s if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UnassignNetworkDevicesFromSites", err)) + "Failure when executing UnassignNetworkDevicesFromSitesV1", err)) return diags } taskId := response1.Response.TaskID @@ -141,22 +139,24 @@ func resourceNetworkDevicesUnassignFromSiteApplyCreate(ctx context.Context, d *s } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UnassignNetworkDevicesFromSites", err1)) + "Failure when executing UnassignNetworkDevicesFromSitesV1", err1)) return diags } } - vItem1 := flattenSiteDesignUnassignNetworkDevicesFromSitesItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSiteDesignUnassignNetworkDevicesFromSitesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UnassignNetworkDevicesFromSites response", + "Failure when setting UnassignNetworkDevicesFromSitesV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkDevicesUnassignFromSiteApplyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -171,15 +171,15 @@ func resourceNetworkDevicesUnassignFromSiteApplyDelete(ctx context.Context, d *s return diags } -func expandRequestNetworkDevicesUnassignFromSiteApplyUnassignNetworkDevicesFromSites(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignUnassignNetworkDevicesFromSites { - request := catalystcentersdkgo.RequestSiteDesignUnassignNetworkDevicesFromSites{} +func expandRequestNetworkDevicesUnassignFromSiteApplyUnassignNetworkDevicesFromSitesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignUnassignNetworkDevicesFromSitesV1 { + request := catalystcentersdkgo.RequestSiteDesignUnassignNetworkDevicesFromSitesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_ids")))) { request.DeviceIDs = interfaceToSliceString(v) } return &request } -func flattenSiteDesignUnassignNetworkDevicesFromSitesItem(item *catalystcentersdkgo.ResponseSiteDesignUnassignNetworkDevicesFromSitesResponse) []map[string]interface{} { +func flattenSiteDesignUnassignNetworkDevicesFromSitesV1Item(item *catalystcentersdkgo.ResponseSiteDesignUnassignNetworkDevicesFromSitesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_profiles_for_sites_site_assignments.go b/catalystcenter/resource_network_profiles_for_sites_site_assignments.go index 41c2c48..72cbbb8 100644 --- a/catalystcenter/resource_network_profiles_for_sites_site_assignments.go +++ b/catalystcenter/resource_network_profiles_for_sites_site_assignments.go @@ -65,7 +65,7 @@ otherwise this operation will not ulimately unassign the profile. Computed: true, }, "profile_id": &schema.Schema{ - Description: `profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Required: true, @@ -83,14 +83,14 @@ func resourceNetworkProfilesForSitesSiteAssignmentsCreate(ctx context.Context, d var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestNetworkProfilesForSitesSiteAssignmentsAssignANetworkProfileForSitesToTheGivenSite(ctx, "parameters.0", d) + request1 := expandRequestNetworkProfilesForSitesSiteAssignmentsAssignANetworkProfileForSitesToTheGivenSiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vProfileID := resourceItem["profile_id"] vvProfileID := interfaceToString(vProfileID) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParamImport := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToQueryParams{} + queryParamImport := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1QueryParams{} item2, err := searchSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(m, queryParamImport, vvProfileID, vvID) if err == nil && item2 != nil { resourceMap := make(map[string]string) @@ -138,7 +138,7 @@ func resourceNetworkProfilesForSitesSiteAssignmentsCreate(ctx context.Context, d return diags } } - queryParamValidate := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToQueryParams{} + queryParamValidate := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1QueryParams{} item3, err := searchSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(m, queryParamValidate, vvProfileID, vvID) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( @@ -168,7 +168,7 @@ func resourceNetworkProfilesForSitesSiteAssignmentsRead(ctx context.Context, d * if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo") vvProfileID := vProfileID - queryParams1 := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToQueryParams{} + queryParams1 := catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1QueryParams{} item1, err := searchSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(m, queryParams1, vvProfileID, vvID) if err != nil || item1 == nil { @@ -176,12 +176,12 @@ func resourceNetworkProfilesForSitesSiteAssignmentsRead(ctx context.Context, d * return diags } - items := []catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToResponse{ + items := []catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Response{ *item1, } // Review flatten function used - vItem1 := flattenSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToItems(&items) + vItem1 := flattenSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo search response", @@ -258,8 +258,8 @@ func resourceNetworkProfilesForSitesSiteAssignmentsDelete(ctx context.Context, d return diags } -func expandRequestNetworkProfilesForSitesSiteAssignmentsAssignANetworkProfileForSitesToTheGivenSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToTheGivenSite { - request := catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToTheGivenSite{} +func expandRequestNetworkProfilesForSitesSiteAssignmentsAssignANetworkProfileForSitesToTheGivenSiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToTheGivenSiteV1 { + request := catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToTheGivenSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -269,10 +269,10 @@ func expandRequestNetworkProfilesForSitesSiteAssignmentsAssignANetworkProfileFor return &request } -func searchSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(m interface{}, queryParams catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToQueryParams, vProfileID string, vID string) (*catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToResponse, error) { +func searchSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo(m interface{}, queryParams catalystcentersdkgo.RetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1QueryParams, vProfileID string, vID string) (*catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToResponse + var foundItem *catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedToV1Response // var ite *catalystcentersdkgo.ResponseSiteDesignRetrievesTheListOfSitesThatTheGivenNetworkProfileForSitesIsAssignedTo if vID != "" { queryParams.Offset = 1 diff --git a/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_create.go b/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_create.go index df68b84..734f9c5 100644 --- a/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_create.go +++ b/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_create.go @@ -7,8 +7,6 @@ import ( "time" - "reflect" - "log" catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" @@ -63,19 +61,17 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkCreate() *schema.Resource Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "profile_id": &schema.Schema{ - Description: `profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Required: true, ForceNew: true, }, - "items": &schema.Schema{ - Description: `Items`, - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Computed: true, - Elem: schema.TypeString, + "type": &schema.Schema{ + Type: schema.TypeString, //TEST, + Optional: true, + ForceNew: true, + Computed: true, }, }, }, @@ -93,20 +89,18 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkCreateCreate(ctx context. vProfileID := resourceItem["profile_id"] vvProfileID := vProfileID.(string) - request1 := expandRequestNetworkProfilesForSitesSiteAssignmentsBulkCreateAssignANetworkProfileForSitesToAListOfSites(ctx, "parameters.0", d) + request1 := expandRequestNetworkProfilesForSitesSiteAssignmentsBulkCreateAssignANetworkProfileForSitesToAListOfSitesV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.SiteDesign.AssignANetworkProfileForSitesToAListOfSites(vvProfileID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.SiteDesign.AssignANetworkProfileForSitesToAListOfSitesV1(vvProfileID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AssignANetworkProfileForSitesToAListOfSites", err)) + "Failure when executing AssignANetworkProfileForSitesToAListOfSitesV1", err)) return diags } @@ -114,7 +108,7 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkCreateCreate(ctx context. if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing AssignANetworkProfileForSitesToAListOfSites", err)) + "Failure when executing AssignANetworkProfileForSitesToAListOfSitesV1", err)) return diags } taskId := response1.Response.TaskID @@ -148,22 +142,24 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkCreateCreate(ctx context. } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing AssignANetworkProfileForSitesToAListOfSites", err1)) + "Failure when executing AssignANetworkProfileForSitesToAListOfSitesV1", err1)) return diags } } - vItem1 := flattenSiteDesignAssignANetworkProfileForSitesToAListOfSitesItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AssignANetworkProfileForSitesToAListOfSites response", + "Failure when setting AssignANetworkProfileForSitesToAListOfSitesV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkProfilesForSitesSiteAssignmentsBulkCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -178,15 +174,19 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkCreateDelete(ctx context. return diags } -func expandRequestNetworkProfilesForSitesSiteAssignmentsBulkCreateAssignANetworkProfileForSitesToAListOfSites(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToAListOfSites { - request := catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToAListOfSites{} - if v, ok := d.GetOkExists(fixKeyAccess(key + ".items")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".items")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".items")))) { - request.Items = v.(*[][]string) - } +func expandRequestNetworkProfilesForSitesSiteAssignmentsBulkCreateAssignANetworkProfileForSitesToAListOfSitesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1 { + request := catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1{} + request.Type = expandRequestNetworkProfilesForSitesSiteAssignmentsBulkCreateAssignANetworkProfileForSitesToAListOfSitesV1Type(ctx, key, d) + return &request +} + +func expandRequestNetworkProfilesForSitesSiteAssignmentsBulkCreateAssignANetworkProfileForSitesToAListOfSitesV1Type(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1Type { + var request catalystcentersdkgo.RequestSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1Type + request = d.Get(fixKeyAccess(key)) return &request } -func flattenSiteDesignAssignANetworkProfileForSitesToAListOfSitesItem(item *catalystcentersdkgo.ResponseSiteDesignAssignANetworkProfileForSitesToAListOfSitesResponse) []map[string]interface{} { +func flattenSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1Item(item *catalystcentersdkgo.ResponseSiteDesignAssignANetworkProfileForSitesToAListOfSitesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_delete.go b/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_delete.go index ffc01cd..bbf4a5f 100644 --- a/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_delete.go +++ b/catalystcenter/resource_network_profiles_for_sites_site_assignments_bulk_delete.go @@ -62,14 +62,14 @@ building first if this site is a floor. Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "profile_id": &schema.Schema{ - Description: `profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' + Description: `profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* `, Type: schema.TypeString, Required: true, ForceNew: true, }, "site_id": &schema.Schema{ - Description: `siteId query parameter. The 'id' of the site, retrievable from 'GET /intent/api/v1/sites' + Description: `siteId query parameter. The *id* of the site, retrievable from *GET /intent/api/v1/sites* `, Type: schema.TypeString, Required: true, @@ -93,18 +93,20 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkDeleteCreate(ctx context. vSiteID := resourceItem["site_id"] vvProfileID := vProfileID.(string) - queryParams1 := catalystcentersdkgo.UnassignsANetworkProfileForSitesFromMultipleSitesQueryParams{} + queryParams1 := catalystcentersdkgo.UnassignsANetworkProfileForSitesFromMultipleSitesV1QueryParams{} queryParams1.SiteID = vSiteID.(string) - response1, restyResp1, err := client.SiteDesign.UnassignsANetworkProfileForSitesFromMultipleSites(vvProfileID, &queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.SiteDesign.UnassignsANetworkProfileForSitesFromMultipleSitesV1(vvProfileID, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UnassignsANetworkProfileForSitesFromMultipleSites", err)) + "Failure when executing UnassignsANetworkProfileForSitesFromMultipleSitesV1", err)) return diags } @@ -112,7 +114,7 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkDeleteCreate(ctx context. if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UnassignsANetworkProfileForSitesFromMultipleSites", err)) + "Failure when executing UnassignsANetworkProfileForSitesFromMultipleSitesV1", err)) return diags } taskId := response1.Response.TaskID @@ -146,22 +148,20 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkDeleteCreate(ctx context. } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UnassignsANetworkProfileForSitesFromMultipleSites", err1)) + "Failure when executing UnassignsANetworkProfileForSitesFromMultipleSitesV1", err1)) return diags } } - - vItem1 := flattenSiteDesignUnassignsANetworkProfileForSitesFromMultipleSitesItem(response1.Response) + vItem1 := flattenSiteDesignUnassignsANetworkProfileForSitesFromMultipleSitesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UnassignsANetworkProfileForSitesFromMultipleSites response", + "Failure when setting UnassignsANetworkProfileForSitesFromMultipleSitesV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkProfilesForSitesSiteAssignmentsBulkDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -176,7 +176,7 @@ func resourceNetworkProfilesForSitesSiteAssignmentsBulkDeleteDelete(ctx context. return diags } -func flattenSiteDesignUnassignsANetworkProfileForSitesFromMultipleSitesItem(item *catalystcentersdkgo.ResponseSiteDesignUnassignsANetworkProfileForSitesFromMultipleSitesResponse) []map[string]interface{} { +func flattenSiteDesignUnassignsANetworkProfileForSitesFromMultipleSitesV1Item(item *catalystcentersdkgo.ResponseSiteDesignUnassignsANetworkProfileForSitesFromMultipleSitesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_update.go b/catalystcenter/resource_network_update.go index a57f848..3dd972c 100644 --- a/catalystcenter/resource_network_update.go +++ b/catalystcenter/resource_network_update.go @@ -383,20 +383,18 @@ func resourceNetworkUpdateCreate(ctx context.Context, d *schema.ResourceData, m vSiteID := resourceItem["site_id"] vvSiteID := vSiteID.(string) - request1 := expandRequestNetworkUpdateUpdateNetwork(ctx, "parameters.0", d) + request1 := expandRequestNetworkUpdateUpdateNetworkV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.NetworkSettings.UpdateNetwork(vvSiteID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.NetworkSettings.UpdateNetworkV1(vvSiteID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateNetwork", err)) + "Failure when executing UpdateNetworkV1", err)) return diags } @@ -432,23 +430,25 @@ func resourceNetworkUpdateCreate(ctx context.Context, d *schema.ResourceData, m if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing UpdateNetwork", err, - "Failure at UpdateNetwork execution", bapiError)) + "Failure when executing UpdateNetworkV1", err, + "Failure at UpdateNetworkV1 execution", bapiError)) return diags } } - vItem1 := flattenNetworkSettingsUpdateNetworkItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenNetworkSettingsUpdateNetworkV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateNetwork response", + "Failure when setting UpdateNetworkV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceNetworkUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -463,28 +463,28 @@ func resourceNetworkUpdateDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestNetworkUpdateUpdateNetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetwork { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetwork{} - request.Settings = expandRequestNetworkUpdateUpdateNetworkSettings(ctx, key, d) +func expandRequestNetworkUpdateUpdateNetworkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1 { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1{} + request.Settings = expandRequestNetworkUpdateUpdateNetworkV1Settings(ctx, key, d) return &request } -func expandRequestNetworkUpdateUpdateNetworkSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettings { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettings{} +func expandRequestNetworkUpdateUpdateNetworkV1Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1Settings { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".dhcp_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dhcp_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dhcp_server")))) { request.DhcpServer = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dns_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dns_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dns_server")))) { - request.DNSServer = expandRequestNetworkUpdateUpdateNetworkSettingsDNSServer(ctx, key+".dns_server.0", d) + request.DNSServer = expandRequestNetworkUpdateUpdateNetworkV1SettingsDNSServer(ctx, key+".dns_server.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".syslog_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".syslog_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".syslog_server")))) { - request.SyslogServer = expandRequestNetworkUpdateUpdateNetworkSettingsSyslogServer(ctx, key+".syslog_server.0", d) + request.SyslogServer = expandRequestNetworkUpdateUpdateNetworkV1SettingsSyslogServer(ctx, key+".syslog_server.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".snmp_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".snmp_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".snmp_server")))) { - request.SNMPServer = expandRequestNetworkUpdateUpdateNetworkSettingsSNMPServer(ctx, key+".snmp_server.0", d) + request.SNMPServer = expandRequestNetworkUpdateUpdateNetworkV1SettingsSNMPServer(ctx, key+".snmp_server.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".netflowcollector")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".netflowcollector")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".netflowcollector")))) { - request.Netflowcollector = expandRequestNetworkUpdateUpdateNetworkSettingsNetflowcollector(ctx, key+".netflowcollector.0", d) + request.Netflowcollector = expandRequestNetworkUpdateUpdateNetworkV1SettingsNetflowcollector(ctx, key+".netflowcollector.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ntp_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ntp_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ntp_server")))) { request.NtpServer = interfaceToSliceString(v) @@ -493,19 +493,19 @@ func expandRequestNetworkUpdateUpdateNetworkSettings(ctx context.Context, key st request.Timezone = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".message_of_theday")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".message_of_theday")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".message_of_theday")))) { - request.MessageOfTheday = expandRequestNetworkUpdateUpdateNetworkSettingsMessageOfTheday(ctx, key+".message_of_theday.0", d) + request.MessageOfTheday = expandRequestNetworkUpdateUpdateNetworkV1SettingsMessageOfTheday(ctx, key+".message_of_theday.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_aaa")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_aaa")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_aaa")))) { - request.NetworkAAA = expandRequestNetworkUpdateUpdateNetworkSettingsNetworkAAA(ctx, key+".network_aaa.0", d) + request.NetworkAAA = expandRequestNetworkUpdateUpdateNetworkV1SettingsNetworkAAA(ctx, key+".network_aaa.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".client_and_endpoint_aaa")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".client_and_endpoint_aaa")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".client_and_endpoint_aaa")))) { - request.ClientAndEndpointAAA = expandRequestNetworkUpdateUpdateNetworkSettingsClientAndEndpointAAA(ctx, key+".client_and_endpoint_aaa.0", d) + request.ClientAndEndpointAAA = expandRequestNetworkUpdateUpdateNetworkV1SettingsClientAndEndpointAAA(ctx, key+".client_and_endpoint_aaa.0", d) } return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsDNSServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsDNSServer { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsDNSServer{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsDNSServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsDNSServer { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsDNSServer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain_name")))) { request.DomainName = interfaceToString(v) } @@ -518,8 +518,8 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsDNSServer(ctx context.Contex return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsSyslogServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsSyslogServer { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsSyslogServer{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsSyslogServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsSyslogServer { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsSyslogServer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_addresses")))) { request.IPAddresses = interfaceToSliceString(v) } @@ -529,8 +529,8 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsSyslogServer(ctx context.Con return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsSNMPServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsSNMPServer { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsSNMPServer{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsSNMPServer(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsSNMPServer { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsSNMPServer{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_addresses")))) { request.IPAddresses = interfaceToSliceString(v) } @@ -540,8 +540,8 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsSNMPServer(ctx context.Conte return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsNetflowcollector(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsNetflowcollector { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsNetflowcollector{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsNetflowcollector(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsNetflowcollector { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsNetflowcollector{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_address")))) { request.IPAddress = interfaceToString(v) } @@ -551,8 +551,8 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsNetflowcollector(ctx context return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsMessageOfTheday(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsMessageOfTheday { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsMessageOfTheday{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsMessageOfTheday(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsMessageOfTheday { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsMessageOfTheday{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".banner_message")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".banner_message")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".banner_message")))) { request.BannerMessage = interfaceToString(v) } @@ -562,8 +562,8 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsMessageOfTheday(ctx context. return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsNetworkAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsNetworkAAA { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsNetworkAAA{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsNetworkAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsNetworkAAA { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsNetworkAAA{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToString(v) } @@ -582,8 +582,8 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsNetworkAAA(ctx context.Conte return &request } -func expandRequestNetworkUpdateUpdateNetworkSettingsClientAndEndpointAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsClientAndEndpointAAA { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkSettingsClientAndEndpointAAA{} +func expandRequestNetworkUpdateUpdateNetworkV1SettingsClientAndEndpointAAA(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsClientAndEndpointAAA { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV1SettingsClientAndEndpointAAA{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToString(v) } @@ -602,7 +602,7 @@ func expandRequestNetworkUpdateUpdateNetworkSettingsClientAndEndpointAAA(ctx con return &request } -func flattenNetworkSettingsUpdateNetworkItem(item *catalystcentersdkgo.ResponseNetworkSettingsUpdateNetwork) []map[string]interface{} { +func flattenNetworkSettingsUpdateNetworkV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsUpdateNetworkV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_network_v2.go b/catalystcenter/resource_network_v2.go index 706a3ff..bf1d789 100644 --- a/catalystcenter/resource_network_v2.go +++ b/catalystcenter/resource_network_v2.go @@ -562,7 +562,7 @@ func resourceNetworkV2Delete(ctx context.Context, d *schema.ResourceData, m inte } func expandRequestNetworkV2CreateNetworkV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV2 { request := catalystcentersdkgo.RequestNetworkSettingsCreateNetworkV2{} - request.Settings = expandRequestNetworkV2CreateNetworkV2Settings(ctx, fixKeyAccess(key+".settings.0"), d) + request.Settings = expandRequestNetworkV2CreateNetworkV2Settings(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } @@ -728,7 +728,7 @@ func expandRequestNetworkV2CreateNetworkV2SettingsClientAndEndpointAAA(ctx conte func expandRequestNetworkV2UpdateNetworkV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV2 { request := catalystcentersdkgo.RequestNetworkSettingsUpdateNetworkV2{} - request.Settings = expandRequestNetworkV2UpdateNetworkV2Settings(ctx, fixKeyAccess(key+".settings.0"), d) + request.Settings = expandRequestNetworkV2UpdateNetworkV2Settings(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } diff --git a/catalystcenter/resource_path_trace.go b/catalystcenter/resource_path_trace.go index 8a40a0e..eb8b88e 100644 --- a/catalystcenter/resource_path_trace.go +++ b/catalystcenter/resource_path_trace.go @@ -3309,7 +3309,7 @@ func resourcePathTraceCreate(ctx context.Context, d *schema.ResourceData, m inte var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestPathTraceInitiateANewPathtrace(ctx, "parameters.0", d) + request1 := expandRequestPathTraceInitiateANewPathtraceV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vFlowAnalysisID := resourceItem["flow_analysis_id"] @@ -3402,7 +3402,7 @@ func resourcePathTraceRead(ctx context.Context, d *schema.ResourceData, m interf log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenPathTraceRetrievesPreviousPathtraceItem(response2.Response) + vItem2 := flattenPathTraceRetrievesPreviousPathtraceV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( "Failure when setting RetrievesPreviousPathtrace response", @@ -3493,8 +3493,8 @@ func resourcePathTraceDelete(ctx context.Context, d *schema.ResourceData, m inte return diags } -func expandRequestPathTraceInitiateANewPathtrace(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestPathTraceInitiateANewPathtrace { - request := catalystcentersdkgo.RequestPathTraceInitiateANewPathtrace{} +func expandRequestPathTraceInitiateANewPathtraceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestPathTraceInitiateANewPathtraceV1 { + request := catalystcentersdkgo.RequestPathTraceInitiateANewPathtraceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".control_path")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".control_path")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".control_path")))) { request.ControlPath = interfaceToBoolPtr(v) } diff --git a/catalystcenter/resource_pnp_device.go b/catalystcenter/resource_pnp_device.go index 58ed234..3da060f 100644 --- a/catalystcenter/resource_pnp_device.go +++ b/catalystcenter/resource_pnp_device.go @@ -1744,7 +1744,7 @@ func resourcePnpDeviceCreate(ctx context.Context, d *schema.ResourceData, m inte var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestPnpDeviceAddDevice(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceAddDeviceV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -1776,7 +1776,7 @@ func resourcePnpDeviceCreate(ctx context.Context, d *schema.ResourceData, m inte return resourcePnpDeviceRead(ctx, d, m) } } else if vName != "" { - queryParams1 := catalystcentersdkgo.GetDeviceList2QueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceListSiteManagementV1QueryParams{} response1, err := searchDeviceOnboardingPnpGetDeviceList2(m, queryParams1, vvName) if err == nil && response1 != nil { resourceMap := make(map[string]string) @@ -1800,7 +1800,7 @@ func resourcePnpDeviceCreate(ctx context.Context, d *schema.ResourceData, m inte return diags } - queryParams3 := catalystcentersdkgo.GetDeviceList2QueryParams{} + queryParams3 := catalystcentersdkgo.GetDeviceListSiteManagementV1QueryParams{} response2, err := searchDeviceOnboardingPnpGetDeviceList2(m, queryParams3, vvName) if err != nil { diags = append(diags, diagError( @@ -1844,7 +1844,7 @@ func resourcePnpDeviceRead(ctx context.Context, d *schema.ResourceData, m interf log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItemID2 := flattenDeviceOnboardingPnpGetDeviceByIDItem(response2) + vItemID2 := flattenDeviceOnboardingPnpGetDeviceByIDV1Item(response2) if err := d.Set("item", vItemID2); err != nil { diags = append(diags, diagError( "Failure when setting GetDeviceByID response", @@ -1869,7 +1869,7 @@ func resourcePnpDeviceUpdate(ctx context.Context, d *schema.ResourceData, m inte if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestPnpDeviceUpdateDevice(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceUpdateDeviceV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -1925,17 +1925,17 @@ func resourcePnpDeviceDelete(ctx context.Context, d *schema.ResourceData, m inte return diags } -func expandRequestPnpDeviceAddDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDevice { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDevice{} - request.DeviceInfo = expandRequestPnpDeviceAddDeviceDeviceInfo(ctx, fixKeyAccess(key+".device_info.0"), d) +func expandRequestPnpDeviceAddDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1{} + request.DeviceInfo = expandRequestPnpDeviceAddDeviceV1DeviceInfo(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestPnpDeviceAddDeviceDeviceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfo { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfo{} +func expandRequestPnpDeviceAddDeviceV1DeviceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfo { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".serial_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".serial_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".serial_number")))) { request.SerialNumber = interfaceToString(v) } @@ -1976,7 +1976,7 @@ func expandRequestPnpDeviceAddDeviceDeviceInfo(ctx context.Context, key string, request.Hostname = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".stack_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".stack_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".stack_info")))) { - request.StackInfo = expandRequestPnpDeviceAddDeviceDeviceInfoStackInfo(ctx, key+".stack_info.0", d) + request.StackInfo = expandRequestPnpDeviceAddDeviceV1DeviceInfoStackInfo(ctx, key+".stack_info.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1984,8 +1984,8 @@ func expandRequestPnpDeviceAddDeviceDeviceInfo(ctx context.Context, key string, return &request } -func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfoStackInfo { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfoStackInfo{} +func expandRequestPnpDeviceAddDeviceV1DeviceInfoStackInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfoStackInfo { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfoStackInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".supports_stack_workflows")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".supports_stack_workflows")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".supports_stack_workflows")))) { request.SupportsStackWorkflows = interfaceToBoolPtr(v) } @@ -1993,7 +1993,7 @@ func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfo(ctx context.Context, key request.IsFullRing = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".stack_member_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".stack_member_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".stack_member_list")))) { - request.StackMemberList = expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberListArray(ctx, key+".stack_member_list", d) + request.StackMemberList = expandRequestPnpDeviceAddDeviceV1DeviceInfoStackInfoStackMemberListArray(ctx, key+".stack_member_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".stack_ring_protocol")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".stack_ring_protocol")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".stack_ring_protocol")))) { request.StackRingProtocol = interfaceToString(v) @@ -2010,8 +2010,8 @@ func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfo(ctx context.Context, key return &request } -func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfoStackInfoStackMemberList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfoStackInfoStackMemberList{} +func expandRequestPnpDeviceAddDeviceV1DeviceInfoStackInfoStackMemberListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfoStackInfoStackMemberList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfoStackInfoStackMemberList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2022,7 +2022,7 @@ func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberListArray(ctx return nil } for item_no := range objs { - i := expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceAddDeviceV1DeviceInfoStackInfoStackMemberList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2033,8 +2033,8 @@ func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberListArray(ctx return &request } -func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfoStackInfoStackMemberList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceDeviceInfoStackInfoStackMemberList{} +func expandRequestPnpDeviceAddDeviceV1DeviceInfoStackInfoStackMemberList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfoStackInfoStackMemberList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddDeviceV1DeviceInfoStackInfoStackMemberList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".serial_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".serial_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".serial_number")))) { request.SerialNumber = interfaceToString(v) } @@ -2077,13 +2077,13 @@ func expandRequestPnpDeviceAddDeviceDeviceInfoStackInfoStackMemberList(ctx conte return &request } -func expandRequestPnpDeviceUpdateDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDevice { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDevice{} +func expandRequestPnpDeviceUpdateDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDeviceV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_info")))) { - request.DeviceInfo = expandRequestPnpDeviceUpdateDeviceDeviceInfo(ctx, key+".device_info.0", d) + request.DeviceInfo = expandRequestPnpDeviceUpdateDeviceV1DeviceInfo(ctx, key+".device_info.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2091,8 +2091,8 @@ func expandRequestPnpDeviceUpdateDevice(ctx context.Context, key string, d *sche return &request } -func expandRequestPnpDeviceUpdateDeviceDeviceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDeviceDeviceInfo { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDeviceDeviceInfo{} +func expandRequestPnpDeviceUpdateDeviceV1DeviceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDeviceV1DeviceInfo { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateDeviceV1DeviceInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".hostname")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hostname")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hostname")))) { request.Hostname = interfaceToString(v) } @@ -2117,14 +2117,14 @@ func expandRequestPnpDeviceUpdateDeviceDeviceInfo(ctx context.Context, key strin return &request } -func searchDeviceOnboardingPnpGetDeviceList2(m interface{}, queryParams catalystcentersdkgo.GetDeviceList2QueryParams, vName string) (*catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2, error) { +func searchDeviceOnboardingPnpGetDeviceList2(m interface{}, queryParams catalystcentersdkgo.GetDeviceListSiteManagementV1QueryParams, vName string) (*catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceList2 + var foundItem *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetDeviceListSiteManagementV1 queryParams.Offset = 0 for { log.Println("[DEBUG] INSIDE THE LOOP") - nResponse, _, err := client.DeviceOnboardingPnp.GetDeviceList2(&queryParams) + nResponse, _, err := client.DeviceOnboardingPnp.GetDeviceListSiteManagementV1(&queryParams) if err != nil { return foundItem, err } diff --git a/catalystcenter/resource_pnp_device_authorize.go b/catalystcenter/resource_pnp_device_authorize.go index 4cf314a..84b16ec 100644 --- a/catalystcenter/resource_pnp_device_authorize.go +++ b/catalystcenter/resource_pnp_device_authorize.go @@ -16,7 +16,7 @@ import ( // resourceAction func resourcePnpDeviceAuthorize() *schema.Resource { return &schema.Resource{ - Description: `It performs create operation on Cisco Catalyst Center System. + Description: `It performs create operation on Cisco DNA Center System. - Authorizes one of more devices. A device can only be authorized if Authorization is set in Device Settings. `, @@ -100,32 +100,27 @@ func resourcePnpDeviceAuthorizeCreate(ctx context.Context, d *schema.ResourceDat client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceAuthorizeAuthorizeDevice(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceAuthorizeAuthorizeDeviceV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.AuthorizeDevice(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.AuthorizeDeviceV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AuthorizeDevice", err)) + "Failure when executing AuthorizeDeviceV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //REVIEW: '- Analizar como se puede comprobar la ejecucion.' - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpAuthorizeDeviceItem(response1) + vItem1 := flattenDeviceOnboardingPnpAuthorizeDeviceV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AuthorizeDevice response", + "Failure when setting AuthorizeDeviceV1 response", err)) return diags } @@ -133,6 +128,8 @@ func resourcePnpDeviceAuthorizeCreate(ctx context.Context, d *schema.ResourceDat d.SetId(getUnixTimeString()) return diags + //REVIEW: '- Analizar como se puede comprobar la ejecucion.' + } func resourcePnpDeviceAuthorizeRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -147,20 +144,20 @@ func resourcePnpDeviceAuthorizeDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestPnpDeviceAuthorizeAuthorizeDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAuthorizeDevice { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAuthorizeDevice{} +func expandRequestPnpDeviceAuthorizeAuthorizeDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAuthorizeDeviceV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAuthorizeDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id_list")))) { request.DeviceIDList = interfaceToSliceString(v) } return &request } -func flattenDeviceOnboardingPnpAuthorizeDeviceItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAuthorizeDevice) []map[string]interface{} { +func flattenDeviceOnboardingPnpAuthorizeDeviceV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAuthorizeDeviceV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["json_response"] = flattenDeviceOnboardingPnpAuthorizeDeviceItemJSONResponse(item.JSONResponse) + respItem["json_response"] = flattenDeviceOnboardingPnpAuthorizeDeviceV1ItemJSONResponse(item.JSONResponse) respItem["message"] = item.Message respItem["status_code"] = item.StatusCode respItem["json_array_response"] = item.JSONArrayResponse @@ -169,7 +166,7 @@ func flattenDeviceOnboardingPnpAuthorizeDeviceItem(item *catalystcentersdkgo.Res } } -func flattenDeviceOnboardingPnpAuthorizeDeviceItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAuthorizeDeviceJSONResponse) []map[string]interface{} { +func flattenDeviceOnboardingPnpAuthorizeDeviceV1ItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAuthorizeDeviceV1JSONResponse) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_device_claim.go b/catalystcenter/resource_pnp_device_claim.go index 483a3bf..43b1740 100644 --- a/catalystcenter/resource_pnp_device_claim.go +++ b/catalystcenter/resource_pnp_device_claim.go @@ -216,32 +216,27 @@ func resourcePnpDeviceClaimCreate(ctx context.Context, d *schema.ResourceData, m client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceClaimClaimDevice(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceClaimClaimDeviceV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.ClaimDevice(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.ClaimDeviceV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ClaimDevice", err)) + "Failure when executing ClaimDeviceV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //REVIEW: '- Analizar como se puede comprobar la ejecucion.' - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpClaimDeviceItem(response1) + vItem1 := flattenDeviceOnboardingPnpClaimDeviceV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ClaimDevice response", + "Failure when setting ClaimDeviceV1 response", err)) return diags } @@ -249,6 +244,8 @@ func resourcePnpDeviceClaimCreate(ctx context.Context, d *schema.ResourceData, m d.SetId(getUnixTimeString()) return diags + //REVIEW: '- Analizar como se puede comprobar la ejecucion.' + } func resourcePnpDeviceClaimRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -263,8 +260,8 @@ func resourcePnpDeviceClaimDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestPnpDeviceClaimClaimDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDevice { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDevice{} +func expandRequestPnpDeviceClaimClaimDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_file_url")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_file_url")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_file_url")))) { request.ConfigFileURL = interfaceToString(v) } @@ -272,7 +269,7 @@ func expandRequestPnpDeviceClaimClaimDevice(ctx context.Context, key string, d * request.ConfigID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_claim_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_claim_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_claim_list")))) { - request.DeviceClaimList = expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListArray(ctx, key+".device_claim_list", d) + request.DeviceClaimList = expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListArray(ctx, key+".device_claim_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".file_service_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".file_service_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".file_service_id")))) { request.FileServiceID = interfaceToString(v) @@ -298,8 +295,8 @@ func expandRequestPnpDeviceClaimClaimDevice(ctx context.Context, key string, d * return &request } -func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimList{} +func expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -310,7 +307,7 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestPnpDeviceClaimClaimDeviceDeviceClaimList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -318,10 +315,10 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListArray(ctx context.Cont return &request } -func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimList{} +func expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_list")))) { - request.ConfigList = expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListArray(ctx, key+".config_list", d) + request.ConfigList = expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigListArray(ctx, key+".config_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToString(v) @@ -338,8 +335,8 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimList(ctx context.Context, return &request } -func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigList{} +func expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -350,7 +347,7 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListArray(ctx co return nil } for item_no := range objs { - i := expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -358,19 +355,19 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListArray(ctx co return &request } -func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigList{} +func expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_parameters")))) { - request.ConfigParameters = expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParametersArray(ctx, key+".config_parameters", d) + request.ConfigParameters = expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigListConfigParametersArray(ctx, key+".config_parameters", d) } return &request } -func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParametersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigListConfigParameters { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigListConfigParameters{} +func expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigListConfigParametersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigListConfigParameters { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigListConfigParameters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -381,7 +378,7 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParame return nil } for item_no := range objs { - i := expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParameters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigListConfigParameters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -389,8 +386,8 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParame return &request } -func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigListConfigParameters { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceDeviceClaimListConfigListConfigParameters{} +func expandRequestPnpDeviceClaimClaimDeviceV1DeviceClaimListConfigListConfigParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigListConfigParameters { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimDeviceV1DeviceClaimListConfigListConfigParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -400,13 +397,13 @@ func expandRequestPnpDeviceClaimClaimDeviceDeviceClaimListConfigListConfigParame return &request } -func flattenDeviceOnboardingPnpClaimDeviceItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimDevice) []map[string]interface{} { +func flattenDeviceOnboardingPnpClaimDeviceV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimDeviceV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["json_array_response"] = flattenDeviceOnboardingPnpClaimDeviceItemJSONArrayResponse(item.JSONArrayResponse) - respItem["json_response"] = flattenDeviceOnboardingPnpClaimDeviceItemJSONResponse(item.JSONResponse) + respItem["json_array_response"] = flattenDeviceOnboardingPnpClaimDeviceV1ItemJSONArrayResponse(item.JSONArrayResponse) + respItem["json_response"] = flattenDeviceOnboardingPnpClaimDeviceV1ItemJSONResponse(item.JSONResponse) respItem["message"] = item.Message respItem["status_code"] = item.StatusCode return []map[string]interface{}{ @@ -414,7 +411,7 @@ func flattenDeviceOnboardingPnpClaimDeviceItem(item *catalystcentersdkgo.Respons } } -func flattenDeviceOnboardingPnpClaimDeviceItemJSONArrayResponse(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimDeviceJSONArrayResponse) []interface{} { +func flattenDeviceOnboardingPnpClaimDeviceV1ItemJSONArrayResponse(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimDeviceV1JSONArrayResponse) []interface{} { if items == nil { return nil } @@ -426,7 +423,7 @@ func flattenDeviceOnboardingPnpClaimDeviceItemJSONArrayResponse(items *[]catalys return respItems } -func flattenDeviceOnboardingPnpClaimDeviceItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimDeviceJSONResponse) interface{} { +func flattenDeviceOnboardingPnpClaimDeviceV1ItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimDeviceV1JSONResponse) interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_device_config_preview.go b/catalystcenter/resource_pnp_device_config_preview.go index fc09b15..d8292a7 100644 --- a/catalystcenter/resource_pnp_device_config_preview.go +++ b/catalystcenter/resource_pnp_device_config_preview.go @@ -121,20 +121,18 @@ func resourcePnpDeviceConfigPreviewCreate(ctx context.Context, d *schema.Resourc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceConfigPreviewPreviewConfig(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceConfigPreviewPreviewConfigV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.PreviewConfig(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.PreviewConfigV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing PreviewConfig", err)) + "Failure when executing PreviewConfigV1", err)) return diags } @@ -142,7 +140,7 @@ func resourcePnpDeviceConfigPreviewCreate(ctx context.Context, d *schema.Resourc if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing PreviewConfig", err)) + "Failure when executing PreviewConfigV1", err)) return diags } taskId := response1.Response.TaskID @@ -176,22 +174,24 @@ func resourcePnpDeviceConfigPreviewCreate(ctx context.Context, d *schema.Resourc } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing PreviewConfig", err1)) + "Failure when executing PreviewConfigV1", err1)) return diags } } - vItem1 := flattenDeviceOnboardingPnpPreviewConfigItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDeviceOnboardingPnpPreviewConfigV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting PreviewConfig response", + "Failure when setting PreviewConfigV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourcePnpDeviceConfigPreviewRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -206,8 +206,8 @@ func resourcePnpDeviceConfigPreviewDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestPnpDeviceConfigPreviewPreviewConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpPreviewConfig { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpPreviewConfig{} +func expandRequestPnpDeviceConfigPreviewPreviewConfigV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpPreviewConfigV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpPreviewConfigV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToString(v) } @@ -220,7 +220,7 @@ func expandRequestPnpDeviceConfigPreviewPreviewConfig(ctx context.Context, key s return &request } -func flattenDeviceOnboardingPnpPreviewConfigItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpPreviewConfigResponse) []map[string]interface{} { +func flattenDeviceOnboardingPnpPreviewConfigV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpPreviewConfigV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_device_import.go b/catalystcenter/resource_pnp_device_import.go index e316807..9d094ef 100644 --- a/catalystcenter/resource_pnp_device_import.go +++ b/catalystcenter/resource_pnp_device_import.go @@ -1524,7 +1524,7 @@ func resourcePnpDeviceImport() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestDeviceOnboardingPnpImportDevicesInBulk`, + Description: `Array of RequestDeviceOnboardingPnpImportDevicesInBulkV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -1816,31 +1816,27 @@ func resourcePnpDeviceImportCreate(ctx context.Context, d *schema.ResourceData, client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceImportImportDevicesInBulk(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceImportImportDevicesInBulkV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.ImportDevicesInBulk(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.ImportDevicesInBulkV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ImportDevicesInBulk", err)) + "Failure when executing ImportDevicesInBulkV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpImportDevicesInBulkItem(response1) + vItem1 := flattenDeviceOnboardingPnpImportDevicesInBulkV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportDevicesInBulk response", + "Failure when setting ImportDevicesInBulkV1 response", err)) return diags } @@ -1862,16 +1858,16 @@ func resourcePnpDeviceImportDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestPnpDeviceImportImportDevicesInBulk(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpImportDevicesInBulk { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpImportDevicesInBulk{} - if v := expandRequestPnpDeviceImportImportDevicesInBulkItemArray(ctx, key+".payload", d); v != nil { +func expandRequestPnpDeviceImportImportDevicesInBulkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpImportDevicesInBulkV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpImportDevicesInBulkV1{} + if v := expandRequestPnpDeviceImportImportDevicesInBulkV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestPnpDeviceImportImportDevicesInBulkItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulk { - request := []catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulk{} +func expandRequestPnpDeviceImportImportDevicesInBulkV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1 { + request := []catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1882,7 +1878,7 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemArray(ctx context.Contex return nil } for item_no := range objs { - i := expandRequestPnpDeviceImportImportDevicesInBulkItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceImportImportDevicesInBulkV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1890,19 +1886,19 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemArray(ctx context.Contex return &request } -func expandRequestPnpDeviceImportImportDevicesInBulkItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulk { - request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulk{} +func expandRequestPnpDeviceImportImportDevicesInBulkV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1 { + request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.TypeID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_info")))) { - request.DeviceInfo = expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfo(ctx, key+".device_info.0", d) + request.DeviceInfo = expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfo(ctx, key+".device_info.0", d) } return &request } -func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfo { - request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfo{} +func expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfo { + request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".serial_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".serial_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".serial_number")))) { request.SerialNumber = interfaceToString(v) } @@ -1943,13 +1939,13 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfo(ctx context.C request.Hostname = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".stack_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".stack_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".stack_info")))) { - request.StackInfo = expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfo(ctx, key+".stack_info.0", d) + request.StackInfo = expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfoStackInfo(ctx, key+".stack_info.0", d) } return &request } -func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfoStackInfo { - request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfoStackInfo{} +func expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfoStackInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfoStackInfo { + request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfoStackInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".supports_stack_workflows")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".supports_stack_workflows")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".supports_stack_workflows")))) { request.SupportsStackWorkflows = interfaceToBoolPtr(v) } @@ -1957,7 +1953,7 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfo(ctx request.IsFullRing = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".stack_member_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".stack_member_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".stack_member_list")))) { - request.StackMemberList = expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStackMemberListArray(ctx, key+".stack_member_list", d) + request.StackMemberList = expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfoStackInfoStackMemberListArray(ctx, key+".stack_member_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".stack_ring_protocol")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".stack_ring_protocol")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".stack_ring_protocol")))) { request.StackRingProtocol = interfaceToString(v) @@ -1971,8 +1967,8 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfo(ctx return &request } -func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStackMemberListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfoStackInfoStackMemberList { - request := []catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfoStackInfoStackMemberList{} +func expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfoStackInfoStackMemberListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfoStackInfoStackMemberList { + request := []catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfoStackInfoStackMemberList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1983,7 +1979,7 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStack return nil } for item_no := range objs { - i := expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStackMemberList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfoStackInfoStackMemberList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1991,8 +1987,8 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStack return &request } -func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStackMemberList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfoStackInfoStackMemberList { - request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkDeviceInfoStackInfoStackMemberList{} +func expandRequestPnpDeviceImportImportDevicesInBulkV1ItemDeviceInfoStackInfoStackMemberList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfoStackInfoStackMemberList { + request := catalystcentersdkgo.RequestItemDeviceOnboardingPnpImportDevicesInBulkV1DeviceInfoStackInfoStackMemberList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".serial_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".serial_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".serial_number")))) { request.SerialNumber = interfaceToString(v) } @@ -2032,19 +2028,19 @@ func expandRequestPnpDeviceImportImportDevicesInBulkItemDeviceInfoStackInfoStack return &request } -func flattenDeviceOnboardingPnpImportDevicesInBulkItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulk) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["success_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessList(item.SuccessList) - respItem["failure_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemFailureList(item.FailureList) + respItem["success_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessList(item.SuccessList) + respItem["failure_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemFailureList(item.FailureList) return []map[string]interface{}{ respItem, } } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessList) []map[string]interface{} { if items == nil { return nil } @@ -2052,14 +2048,14 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessList(items *[]catal for _, item := range *items { respItem := make(map[string]interface{}) respItem["id"] = item.ID - respItem["device_info"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfo(item.DeviceInfo) - respItem["system_reset_workflow"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWorkflow(item.SystemResetWorkflow) - respItem["system_workflow"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflow(item.SystemWorkflow) - respItem["workflow"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflow(item.Workflow) - respItem["run_summary_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryList(item.RunSummaryList) - respItem["workflow_parameters"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParameters(item.WorkflowParameters) - respItem["day_zero_config"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDayZeroConfig(item.DayZeroConfig) - respItem["day_zero_config_preview"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDayZeroConfigPreview(item.DayZeroConfigPreview) + respItem["device_info"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfo(item.DeviceInfo) + respItem["system_reset_workflow"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemResetWorkflow(item.SystemResetWorkflow) + respItem["system_workflow"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemWorkflow(item.SystemWorkflow) + respItem["workflow"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflow(item.Workflow) + respItem["run_summary_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryList(item.RunSummaryList) + respItem["workflow_parameters"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowParameters(item.WorkflowParameters) + respItem["day_zero_config"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDayZeroConfig(item.DayZeroConfig) + respItem["day_zero_config_preview"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDayZeroConfigPreview(item.DayZeroConfigPreview) respItem["version"] = item.Version respItem["tenant_id"] = item.TenantID respItems = append(respItems, respItem) @@ -2067,7 +2063,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessList(items *[]catal return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfo) []map[string]interface{} { if item == nil { return nil } @@ -2077,7 +2073,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfo(item respItem["stack"] = boolPtrToString(item.Stack) respItem["mode"] = item.Mode respItem["state"] = item.State - respItem["location"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoLocation(item.Location) + respItem["location"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoLocation(item.Location) respItem["description"] = item.Description respItem["onb_state"] = item.OnbState respItem["authenticated_mic_number"] = item.AuthenticatedMicNumber @@ -2098,25 +2094,25 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfo(item respItem["device_type"] = item.DeviceType respItem["agent_type"] = item.AgentType respItem["image_version"] = item.ImageVersion - respItem["file_system_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoFileSystemList(item.FileSystemList) - respItem["pnp_profile_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileList(item.PnpProfileList) + respItem["file_system_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoFileSystemList(item.FileSystemList) + respItem["pnp_profile_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileList(item.PnpProfileList) respItem["image_file"] = item.ImageFile - respItem["http_headers"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoHTTPHeaders(item.HTTPHeaders) - respItem["neighbor_links"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoNeighborLinks(item.NeighborLinks) + respItem["http_headers"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoHTTPHeaders(item.HTTPHeaders) + respItem["neighbor_links"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoNeighborLinks(item.NeighborLinks) respItem["last_sync_time"] = item.LastSyncTime - respItem["ip_interfaces"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInterfaces(item.IPInterfaces) + respItem["ip_interfaces"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoIPInterfaces(item.IPInterfaces) respItem["hostname"] = item.Hostname respItem["auth_status"] = item.AuthStatus - respItem["stack_info"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoStackInfo(item.StackInfo) + respItem["stack_info"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoStackInfo(item.StackInfo) respItem["reload_requested"] = boolPtrToString(item.ReloadRequested) respItem["added_on"] = item.AddedOn respItem["site_id"] = item.SiteID - respItem["aaa_credentials"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoAAACredentials(item.AAACredentials) + respItem["aaa_credentials"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoAAACredentials(item.AAACredentials) respItem["user_mic_numbers"] = item.UserMicNumbers respItem["user_sudi_serial_nos"] = item.UserSudiSerialNos respItem["addn_mac_addrs"] = item.AddnMacAddrs - respItem["pre_workflow_cli_ouputs"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPreWorkflowCliOuputs(item.PreWorkflowCliOuputs) - respItem["tags"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoTags(item.Tags) + respItem["pre_workflow_cli_ouputs"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPreWorkflowCliOuputs(item.PreWorkflowCliOuputs) + respItem["tags"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoTags(item.Tags) respItem["sudi_required"] = boolPtrToString(item.SudiRequired) respItem["smart_account_id"] = item.SmartAccountID respItem["virtual_account_id"] = item.VirtualAccountID @@ -2130,7 +2126,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfo(item } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoLocation(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoLocation) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoLocation(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoLocation) []map[string]interface{} { if item == nil { return nil } @@ -2147,7 +2143,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoLocat } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoFileSystemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoFileSystemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoFileSystemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoFileSystemList) []map[string]interface{} { if items == nil { return nil } @@ -2165,7 +2161,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoFileS return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileList) []map[string]interface{} { if items == nil { return nil } @@ -2175,22 +2171,22 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr respItem["profile_name"] = item.ProfileName respItem["discovery_created"] = boolPtrToString(item.DiscoveryCreated) respItem["created_by"] = item.CreatedBy - respItem["primary_endpoint"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListPrimaryEndpoint(item.PrimaryEndpoint) - respItem["secondary_endpoint"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListSecondaryEndpoint(item.SecondaryEndpoint) + respItem["primary_endpoint"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListPrimaryEndpoint(item.PrimaryEndpoint) + respItem["secondary_endpoint"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListSecondaryEndpoint(item.SecondaryEndpoint) respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListPrimaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileListPrimaryEndpoint) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListPrimaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileListPrimaryEndpoint) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["port"] = item.Port respItem["protocol"] = item.Protocol - respItem["ipv4_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item.IPv4Address) - respItem["ipv6_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item.IPv6Address) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item.IPv4Address) + respItem["ipv6_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item.IPv6Address) respItem["fqdn"] = item.Fqdn respItem["certificate"] = item.Certificate @@ -2200,7 +2196,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv4Address) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv4Address) interface{} { if item == nil { return nil } @@ -2210,7 +2206,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv6Address) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileListPrimaryEndpointIPv6Address) interface{} { if item == nil { return nil } @@ -2220,15 +2216,15 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListSecondaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileListSecondaryEndpoint) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListSecondaryEndpoint(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileListSecondaryEndpoint) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["port"] = item.Port respItem["protocol"] = item.Protocol - respItem["ipv4_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item.IPv4Address) - respItem["ipv6_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item.IPv6Address) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item.IPv4Address) + respItem["ipv6_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item.IPv6Address) respItem["fqdn"] = item.Fqdn respItem["certificate"] = item.Certificate @@ -2238,7 +2234,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv4Address) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv4Address) interface{} { if item == nil { return nil } @@ -2248,7 +2244,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv6Address) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv6Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPnpProfileListSecondaryEndpointIPv6Address) interface{} { if item == nil { return nil } @@ -2258,7 +2254,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPnpPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoHTTPHeaders(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoHTTPHeaders) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoHTTPHeaders(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoHTTPHeaders) []map[string]interface{} { if items == nil { return nil } @@ -2272,7 +2268,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoHTTPH return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoNeighborLinks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoNeighborLinks) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoNeighborLinks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoNeighborLinks) []map[string]interface{} { if items == nil { return nil } @@ -2293,7 +2289,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoNeigh return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInterfaces(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoIPInterfaces) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoIPInterfaces(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoIPInterfaces) []map[string]interface{} { if items == nil { return nil } @@ -2302,15 +2298,15 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInt respItem := make(map[string]interface{}) respItem["status"] = item.Status respItem["mac_address"] = item.MacAddress - respItem["ipv4_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInterfacesIPv4Address(item.IPv4Address) - respItem["ipv6_address_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInterfacesIPv6AddressList(item.IPv6AddressList) + respItem["ipv4_address"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoIPInterfacesIPv4Address(item.IPv4Address) + respItem["ipv6_address_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoIPInterfacesIPv6AddressList(item.IPv6AddressList) respItem["name"] = item.Name respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInterfacesIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoIPInterfacesIPv4Address) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoIPInterfacesIPv4Address(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoIPInterfacesIPv4Address) interface{} { if item == nil { return nil } @@ -2320,7 +2316,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInt } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInterfacesIPv6AddressList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoIPInterfacesIPv6AddressList) []interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoIPInterfacesIPv6AddressList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoIPInterfacesIPv6AddressList) []interface{} { if items == nil { return nil } @@ -2332,14 +2328,14 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoIPInt return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoStackInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoStackInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoStackInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoStackInfo) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["supports_stack_workflows"] = boolPtrToString(item.SupportsStackWorkflows) respItem["is_full_ring"] = boolPtrToString(item.IsFullRing) - respItem["stack_member_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoStackInfoStackMemberList(item.StackMemberList) + respItem["stack_member_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoStackInfoStackMemberList(item.StackMemberList) respItem["stack_ring_protocol"] = item.StackRingProtocol respItem["valid_license_levels"] = item.ValidLicenseLevels respItem["total_member_count"] = item.TotalMemberCount @@ -2350,7 +2346,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoStack } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoStackInfoStackMemberList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoStackInfoStackMemberList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoStackInfoStackMemberList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoStackInfoStackMemberList) []map[string]interface{} { if items == nil { return nil } @@ -2374,7 +2370,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoStack return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoAAACredentials(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoAAACredentials) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoAAACredentials(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoAAACredentials) []map[string]interface{} { if item == nil { return nil } @@ -2388,7 +2384,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoAAACr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPreWorkflowCliOuputs(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoPreWorkflowCliOuputs) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoPreWorkflowCliOuputs(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoPreWorkflowCliOuputs) []map[string]interface{} { if items == nil { return nil } @@ -2402,7 +2398,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoPreWo return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoTags(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDeviceInfoTags) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDeviceInfoTags(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDeviceInfoTags) interface{} { if item == nil { return nil } @@ -2412,7 +2408,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDeviceInfoTags( } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListSystemResetWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemResetWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListSystemResetWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -2425,7 +2421,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWork respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemResetWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -2443,7 +2439,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWork } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListSystemResetWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemResetWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListSystemResetWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -2456,7 +2452,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWork respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemResetWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -2464,7 +2460,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWork return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListSystemResetWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemResetWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListSystemResetWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -2482,7 +2478,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemResetWork return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListSystemWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListSystemWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -2495,7 +2491,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflow( respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -2513,7 +2509,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflow( } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListSystemWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListSystemWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -2526,7 +2522,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowT respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -2534,7 +2530,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowT return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListSystemWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListSystemWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListSystemWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -2552,7 +2548,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListSystemWorkflowT return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListWorkflow) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflow(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListWorkflow) []map[string]interface{} { if item == nil { return nil } @@ -2565,7 +2561,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflow(item * respItem["image_id"] = item.ImageID respItem["curr_task_idx"] = item.CurrTaskIDx respItem["added_on"] = item.AddedOn - respItem["tasks"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasks(item.Tasks) + respItem["tasks"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowTasks(item.Tasks) respItem["add_to_inventory"] = boolPtrToString(item.AddToInventory) respItem["instance_type"] = item.InstanceType respItem["end_time"] = item.EndTime @@ -2583,7 +2579,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflow(item * } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListWorkflowTasks) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowTasks(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListWorkflowTasks) []map[string]interface{} { if items == nil { return nil } @@ -2596,7 +2592,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasks(i respItem["task_seq_no"] = item.TaskSeqNo respItem["end_time"] = item.EndTime respItem["start_time"] = item.StartTime - respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasksWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowTasksWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken respItem["name"] = item.Name respItems = append(respItems, respItem) @@ -2604,7 +2600,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasks(i return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListWorkflowTasksWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowTasksWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListWorkflowTasksWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -2622,7 +2618,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowTasksWo return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListRunSummaryList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListRunSummaryList) []map[string]interface{} { if items == nil { return nil } @@ -2630,7 +2626,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryList( for _, item := range *items { respItem := make(map[string]interface{}) respItem["details"] = item.Details - respItem["history_task_info"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListHistoryTaskInfo(item.HistoryTaskInfo) + respItem["history_task_info"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryListHistoryTaskInfo(item.HistoryTaskInfo) respItem["error_flag"] = boolPtrToString(item.ErrorFlag) respItem["timestamp"] = item.Timestamp respItems = append(respItems, respItem) @@ -2638,15 +2634,15 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryList( return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListHistoryTaskInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListRunSummaryListHistoryTaskInfo) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryListHistoryTaskInfo(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListRunSummaryListHistoryTaskInfo) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["type"] = item.Type - respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListHistoryTaskInfoWorkItemList(item.WorkItemList) + respItem["work_item_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryListHistoryTaskInfoWorkItemList(item.WorkItemList) respItem["time_taken"] = item.TimeTaken - respItem["addn_details"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListHistoryTaskInfoAddnDetails(item.AddnDetails) + respItem["addn_details"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryListHistoryTaskInfoAddnDetails(item.AddnDetails) respItem["name"] = item.Name return []map[string]interface{}{ @@ -2655,7 +2651,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListH } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListRunSummaryListHistoryTaskInfoWorkItemList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryListHistoryTaskInfoWorkItemList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListRunSummaryListHistoryTaskInfoWorkItemList) []map[string]interface{} { if items == nil { return nil } @@ -2673,7 +2669,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListH return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListRunSummaryListHistoryTaskInfoAddnDetails) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListRunSummaryListHistoryTaskInfoAddnDetails(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListRunSummaryListHistoryTaskInfoAddnDetails) []map[string]interface{} { if items == nil { return nil } @@ -2687,7 +2683,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListRunSummaryListH return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParameters(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListWorkflowParameters) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowParameters(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListWorkflowParameters) []map[string]interface{} { if item == nil { return nil } @@ -2695,7 +2691,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParamet respItem["top_of_stack_serial_number"] = item.TopOfStackSerialNumber respItem["license_level"] = item.LicenseLevel respItem["license_type"] = item.LicenseType - respItem["config_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParametersConfigList(item.ConfigList) + respItem["config_list"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowParametersConfigList(item.ConfigList) return []map[string]interface{}{ respItem, @@ -2703,21 +2699,21 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParamet } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParametersConfigList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListWorkflowParametersConfigList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowParametersConfigList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListWorkflowParametersConfigList) []map[string]interface{} { if items == nil { return nil } var respItems []map[string]interface{} for _, item := range *items { respItem := make(map[string]interface{}) - respItem["config_parameters"] = flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParametersConfigListConfigParameters(item.ConfigParameters) + respItem["config_parameters"] = flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowParametersConfigListConfigParameters(item.ConfigParameters) respItem["config_id"] = item.ConfigID respItems = append(respItems, respItem) } return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParametersConfigListConfigParameters(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListWorkflowParametersConfigListConfigParameters) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListWorkflowParametersConfigListConfigParameters(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListWorkflowParametersConfigListConfigParameters) []map[string]interface{} { if items == nil { return nil } @@ -2731,7 +2727,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListWorkflowParamet return respItems } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDayZeroConfig(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDayZeroConfig) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDayZeroConfig(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDayZeroConfig) []map[string]interface{} { if item == nil { return nil } @@ -2744,7 +2740,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDayZeroConfig(i } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDayZeroConfigPreview(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkSuccessListDayZeroConfigPreview) interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemSuccessListDayZeroConfigPreview(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1SuccessListDayZeroConfigPreview) interface{} { if item == nil { return nil } @@ -2754,7 +2750,7 @@ func flattenDeviceOnboardingPnpImportDevicesInBulkItemSuccessListDayZeroConfigPr } -func flattenDeviceOnboardingPnpImportDevicesInBulkItemFailureList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkFailureList) []map[string]interface{} { +func flattenDeviceOnboardingPnpImportDevicesInBulkV1ItemFailureList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpImportDevicesInBulkV1FailureList) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_pnp_device_reset.go b/catalystcenter/resource_pnp_device_reset.go index e87c602..da6a2ae 100644 --- a/catalystcenter/resource_pnp_device_reset.go +++ b/catalystcenter/resource_pnp_device_reset.go @@ -168,32 +168,27 @@ func resourcePnpDeviceResetCreate(ctx context.Context, d *schema.ResourceData, m client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceResetResetDevice(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceResetResetDeviceV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.ResetDevice(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.ResetDeviceV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ResetDevice", err)) + "Failure when executing ResetDeviceV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //REVIEW: '- Analizar como se puede comprobar la ejecucion.' - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpResetDeviceItem(response1) + vItem1 := flattenDeviceOnboardingPnpResetDeviceV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ResetDevice response", + "Failure when setting ResetDeviceV1 response", err)) return diags } @@ -201,6 +196,8 @@ func resourcePnpDeviceResetCreate(ctx context.Context, d *schema.ResourceData, m d.SetId(getUnixTimeString()) return diags + //REVIEW: '- Analizar como se puede comprobar la ejecucion.' + } func resourcePnpDeviceResetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -215,10 +212,10 @@ func resourcePnpDeviceResetDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestPnpDeviceResetResetDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDevice { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDevice{} +func expandRequestPnpDeviceResetResetDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_reset_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_reset_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_reset_list")))) { - request.DeviceResetList = expandRequestPnpDeviceResetResetDeviceDeviceResetListArray(ctx, key+".device_reset_list", d) + request.DeviceResetList = expandRequestPnpDeviceResetResetDeviceV1DeviceResetListArray(ctx, key+".device_reset_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".project_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".project_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".project_id")))) { request.ProjectID = interfaceToString(v) @@ -229,8 +226,8 @@ func expandRequestPnpDeviceResetResetDevice(ctx context.Context, key string, d * return &request } -func expandRequestPnpDeviceResetResetDeviceDeviceResetListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetList{} +func expandRequestPnpDeviceResetResetDeviceV1DeviceResetListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -241,7 +238,7 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestPnpDeviceResetResetDeviceDeviceResetList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceResetResetDeviceV1DeviceResetList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -249,10 +246,10 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListArray(ctx context.Cont return &request } -func expandRequestPnpDeviceResetResetDeviceDeviceResetList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetList{} +func expandRequestPnpDeviceResetResetDeviceV1DeviceResetList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_list")))) { - request.ConfigList = expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListArray(ctx, key+".config_list", d) + request.ConfigList = expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigListArray(ctx, key+".config_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToString(v) @@ -269,8 +266,8 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetList(ctx context.Context, return &request } -func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigList{} +func expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -281,7 +278,7 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListArray(ctx co return nil } for item_no := range objs { - i := expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -289,19 +286,19 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListArray(ctx co return &request } -func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigList{} +func expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_parameters")))) { - request.ConfigParameters = expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParametersArray(ctx, key+".config_parameters", d) + request.ConfigParameters = expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigListConfigParametersArray(ctx, key+".config_parameters", d) } return &request } -func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParametersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigListConfigParameters { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigListConfigParameters{} +func expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigListConfigParametersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigListConfigParameters { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigListConfigParameters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -312,7 +309,7 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParame return nil } for item_no := range objs { - i := expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParameters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigListConfigParameters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -320,8 +317,8 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParame return &request } -func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigListConfigParameters { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceDeviceResetListConfigListConfigParameters{} +func expandRequestPnpDeviceResetResetDeviceV1DeviceResetListConfigListConfigParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigListConfigParameters { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpResetDeviceV1DeviceResetListConfigListConfigParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -331,13 +328,13 @@ func expandRequestPnpDeviceResetResetDeviceDeviceResetListConfigListConfigParame return &request } -func flattenDeviceOnboardingPnpResetDeviceItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpResetDevice) []map[string]interface{} { +func flattenDeviceOnboardingPnpResetDeviceV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpResetDeviceV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["json_array_response"] = flattenDeviceOnboardingPnpResetDeviceItemJSONArrayResponse(item.JSONArrayResponse) - respItem["json_response"] = flattenDeviceOnboardingPnpResetDeviceItemJSONResponse(item.JSONResponse) + respItem["json_array_response"] = flattenDeviceOnboardingPnpResetDeviceV1ItemJSONArrayResponse(item.JSONArrayResponse) + respItem["json_response"] = flattenDeviceOnboardingPnpResetDeviceV1ItemJSONResponse(item.JSONResponse) respItem["message"] = item.Message respItem["status_code"] = item.StatusCode return []map[string]interface{}{ @@ -345,7 +342,7 @@ func flattenDeviceOnboardingPnpResetDeviceItem(item *catalystcentersdkgo.Respons } } -func flattenDeviceOnboardingPnpResetDeviceItemJSONArrayResponse(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpResetDeviceJSONArrayResponse) []interface{} { +func flattenDeviceOnboardingPnpResetDeviceV1ItemJSONArrayResponse(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpResetDeviceV1JSONArrayResponse) []interface{} { if items == nil { return nil } @@ -357,7 +354,7 @@ func flattenDeviceOnboardingPnpResetDeviceItemJSONArrayResponse(items *[]catalys return respItems } -func flattenDeviceOnboardingPnpResetDeviceItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpResetDeviceJSONResponse) interface{} { +func flattenDeviceOnboardingPnpResetDeviceV1ItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpResetDeviceV1JSONResponse) interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_device_site_claim.go b/catalystcenter/resource_pnp_device_site_claim.go index 86e689d..bbf6d20 100644 --- a/catalystcenter/resource_pnp_device_site_claim.go +++ b/catalystcenter/resource_pnp_device_site_claim.go @@ -227,31 +227,27 @@ func resourcePnpDeviceSiteClaimCreate(ctx context.Context, d *schema.ResourceDat client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceSiteClaimClaimADeviceToASite(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.ClaimADeviceToASite(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.ClaimADeviceToASiteV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ClaimADeviceToASite", err)) + "Failure when executing ClaimADeviceToASiteV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpClaimADeviceToASiteItem(response1) + vItem1 := flattenDeviceOnboardingPnpClaimADeviceToASiteV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ClaimADeviceToASite response", + "Failure when setting ClaimADeviceToASiteV1 response", err)) return diags } @@ -273,8 +269,8 @@ func resourcePnpDeviceSiteClaimDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestPnpDeviceSiteClaimClaimADeviceToASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASite { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASite{} +func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToString(v) } @@ -285,10 +281,10 @@ func expandRequestPnpDeviceSiteClaimClaimADeviceToASite(ctx context.Context, key request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".image_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".image_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".image_info")))) { - request.ImageInfo = expandRequestPnpDeviceSiteClaimClaimADeviceToASiteImageInfo(ctx, key+".image_info.0", d) + request.ImageInfo = expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ImageInfo(ctx, key+".image_info.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_info")))) { - request.ConfigInfo = expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfo(ctx, key+".config_info.0", d) + request.ConfigInfo = expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ConfigInfo(ctx, key+".config_info.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rf_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rf_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rf_profile")))) { request.RfProfile = interfaceToString(v) @@ -317,30 +313,30 @@ func expandRequestPnpDeviceSiteClaimClaimADeviceToASite(ctx context.Context, key return &request } -func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteImageInfo(ctx context.Context, key string, d *schema.ResourceData) catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteImageInfo { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteImageInfo{} +func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ImageInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ImageInfo { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ImageInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".image_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".image_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".image_id")))) { request.ImageID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".skip")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".skip")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".skip")))) { - request.Skip = *interfaceToBoolPtr(v) + request.Skip = interfaceToBoolPtr(v) } - return request + return &request } -func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfo(ctx context.Context, key string, d *schema.ResourceData) catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteConfigInfo { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteConfigInfo{} +func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ConfigInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ConfigInfo { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ConfigInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_parameters")))) { - request.ConfigParameters = expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfoConfigParametersArray(ctx, key+".config_parameters", d) + request.ConfigParameters = expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ConfigInfoConfigParametersArray(ctx, key+".config_parameters", d) } - return request + return &request } -func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfoConfigParametersArray(ctx context.Context, key string, d *schema.ResourceData) []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteConfigInfoConfigParameters { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteConfigInfoConfigParameters{} +func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ConfigInfoConfigParametersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ConfigInfoConfigParameters { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ConfigInfoConfigParameters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -351,16 +347,16 @@ func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfoConfigParameter return nil } for item_no := range objs { - i := expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfoConfigParameters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ConfigInfoConfigParameters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } } - return request + return &request } -func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfoConfigParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteConfigInfoConfigParameters { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteConfigInfoConfigParameters{} +func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteV1ConfigInfoConfigParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ConfigInfoConfigParameters { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpClaimADeviceToASiteV1ConfigInfoConfigParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".key")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".key")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".key")))) { request.Key = interfaceToString(v) } @@ -370,7 +366,7 @@ func expandRequestPnpDeviceSiteClaimClaimADeviceToASiteConfigInfoConfigParameter return &request } -func flattenDeviceOnboardingPnpClaimADeviceToASiteItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimADeviceToASite) []map[string]interface{} { +func flattenDeviceOnboardingPnpClaimADeviceToASiteV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpClaimADeviceToASiteV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_device_unclaim.go b/catalystcenter/resource_pnp_device_unclaim.go index 1117fa5..1e4bf68 100644 --- a/catalystcenter/resource_pnp_device_unclaim.go +++ b/catalystcenter/resource_pnp_device_unclaim.go @@ -89,32 +89,27 @@ func resourcePnpDeviceUnclaimCreate(ctx context.Context, d *schema.ResourceData, client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpDeviceUnclaimUnClaimDevice(ctx, "parameters.0", d) + request1 := expandRequestPnpDeviceUnclaimUnClaimDeviceV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.UnClaimDevice(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.UnClaimDeviceV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UnClaimDevice", err)) + "Failure when executing UnClaimDeviceV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //REVIEW: '- Analizar como se puede comprobar la ejecucion.' - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpUnClaimDeviceItem(response1) + vItem1 := flattenDeviceOnboardingPnpUnClaimDeviceV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UnClaimDevice response", + "Failure when setting UnClaimDeviceV1 response", err)) return diags } @@ -122,6 +117,8 @@ func resourcePnpDeviceUnclaimCreate(ctx context.Context, d *schema.ResourceData, d.SetId(getUnixTimeString()) return diags + //REVIEW: '- Analizar como se puede comprobar la ejecucion.' + } func resourcePnpDeviceUnclaimRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -136,21 +133,21 @@ func resourcePnpDeviceUnclaimDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestPnpDeviceUnclaimUnClaimDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUnClaimDevice { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUnClaimDevice{} +func expandRequestPnpDeviceUnclaimUnClaimDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUnClaimDeviceV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUnClaimDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id_list")))) { request.DeviceIDList = interfaceToSliceString(v) } return &request } -func flattenDeviceOnboardingPnpUnClaimDeviceItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUnClaimDevice) []map[string]interface{} { +func flattenDeviceOnboardingPnpUnClaimDeviceV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUnClaimDeviceV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["json_array_response"] = flattenDeviceOnboardingPnpUnClaimDeviceItemJSONArrayResponse(item.JSONArrayResponse) - respItem["json_response"] = flattenDeviceOnboardingPnpUnClaimDeviceItemJSONResponse(item.JSONResponse) + respItem["json_array_response"] = flattenDeviceOnboardingPnpUnClaimDeviceV1ItemJSONArrayResponse(item.JSONArrayResponse) + respItem["json_response"] = flattenDeviceOnboardingPnpUnClaimDeviceV1ItemJSONResponse(item.JSONResponse) respItem["message"] = item.Message respItem["status_code"] = item.StatusCode return []map[string]interface{}{ @@ -158,7 +155,7 @@ func flattenDeviceOnboardingPnpUnClaimDeviceItem(item *catalystcentersdkgo.Respo } } -func flattenDeviceOnboardingPnpUnClaimDeviceItemJSONArrayResponse(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpUnClaimDeviceJSONArrayResponse) []interface{} { +func flattenDeviceOnboardingPnpUnClaimDeviceV1ItemJSONArrayResponse(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpUnClaimDeviceV1JSONArrayResponse) []interface{} { if items == nil { return nil } @@ -170,7 +167,7 @@ func flattenDeviceOnboardingPnpUnClaimDeviceItemJSONArrayResponse(items *[]catal return respItems } -func flattenDeviceOnboardingPnpUnClaimDeviceItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUnClaimDeviceJSONResponse) interface{} { +func flattenDeviceOnboardingPnpUnClaimDeviceV1ItemJSONResponse(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUnClaimDeviceV1JSONResponse) interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_global_settings.go b/catalystcenter/resource_pnp_global_settings.go index 8f6cc0f..c4b6513 100644 --- a/catalystcenter/resource_pnp_global_settings.go +++ b/catalystcenter/resource_pnp_global_settings.go @@ -325,11 +325,13 @@ func resourcePnpGlobalSettings() *schema.Resource { Description: `Cert`, Type: schema.TypeString, Optional: true, + Computed: true, }, "fqdn_addresses": &schema.Schema{ Description: `Fqdn Addresses`, Type: schema.TypeList, Optional: true, + Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -338,6 +340,7 @@ func resourcePnpGlobalSettings() *schema.Resource { Description: `Ip Addresses`, Type: schema.TypeList, Optional: true, + Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -346,11 +349,13 @@ func resourcePnpGlobalSettings() *schema.Resource { Description: `Port`, Type: schema.TypeString, Optional: true, + Computed: true, }, "proxy": &schema.Schema{ Description: `Proxy`, Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, @@ -364,6 +369,7 @@ func resourcePnpGlobalSettings() *schema.Resource { "sava_mapping_list": &schema.Schema{ Type: schema.TypeList, Optional: true, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -371,11 +377,13 @@ func resourcePnpGlobalSettings() *schema.Resource { Description: `Cco User`, Type: schema.TypeString, Optional: true, + Computed: true, }, "expiry": &schema.Schema{ Description: `Expiry`, Type: schema.TypeString, Optional: true, + Computed: true, }, "profile": &schema.Schema{ Type: schema.TypeList, @@ -388,41 +396,49 @@ func resourcePnpGlobalSettings() *schema.Resource { Description: `Address Fqdn`, Type: schema.TypeString, Optional: true, + Computed: true, }, "address_ip_v4": &schema.Schema{ Description: `Address Ip V4`, Type: schema.TypeString, Optional: true, + Computed: true, }, "cert": &schema.Schema{ Description: `Cert`, Type: schema.TypeString, Optional: true, + Computed: true, }, "make_default": &schema.Schema{ Description: `Make Default`, Type: schema.TypeString, Optional: true, + Computed: true, }, "name": &schema.Schema{ Description: `Name`, Type: schema.TypeString, Optional: true, + Computed: true, }, "port": &schema.Schema{ Description: `Port`, Type: schema.TypeString, Optional: true, + Computed: true, }, "profile_id": &schema.Schema{ Description: `Profile Id`, Type: schema.TypeString, Optional: true, + Computed: true, }, "proxy": &schema.Schema{ Description: `Proxy`, Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, @@ -489,7 +505,7 @@ func resourcePnpGlobalSettingsRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenDeviceOnboardingPnpGetPnpGlobalSettingsItem(response1) + vItem1 := flattenDeviceOnboardingPnpGetPnpGlobalSettingsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetPnpGlobalSettings response", @@ -509,7 +525,7 @@ func resourcePnpGlobalSettingsUpdate(ctx context.Context, d *schema.ResourceData // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { - request1 := expandRequestPnpGlobalSettingsUpdatePnpGlobalSettings(ctx, "parameters.0", d) + request1 := expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -541,8 +557,8 @@ func resourcePnpGlobalSettingsDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettings { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettings{} +func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -550,10 +566,10 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettings(ctx context.Context, request.AcceptEula = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".default_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".default_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".default_profile")))) { - request.DefaultProfile = expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsDefaultProfile(ctx, key+".default_profile.0", d) + request.DefaultProfile = expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1DefaultProfile(ctx, key+".default_profile.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sava_mapping_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sava_mapping_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sava_mapping_list")))) { - request.SavaMappingList = expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingListArray(ctx, key+".sava_mapping_list", d) + request.SavaMappingList = expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1SavaMappingListArray(ctx, key+".sava_mapping_list", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -561,8 +577,8 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettings(ctx context.Context, return &request } -func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsDefaultProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsDefaultProfile { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsDefaultProfile{} +func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1DefaultProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1DefaultProfile { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1DefaultProfile{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cert")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cert")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cert")))) { request.Cert = interfaceToString(v) } @@ -584,8 +600,8 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsDefaultProfile(ctx con return &request } -func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsSavaMappingList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsSavaMappingList{} +func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1SavaMappingListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1SavaMappingList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1SavaMappingList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -596,7 +612,7 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingListArray(c return nil } for item_no := range objs { - i := expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1SavaMappingList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -607,8 +623,8 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingListArray(c return &request } -func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsSavaMappingList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsSavaMappingList{} +func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1SavaMappingList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1SavaMappingList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1SavaMappingList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cco_user")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cco_user")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cco_user")))) { request.CcoUser = interfaceToString(v) } @@ -616,7 +632,7 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingList(ctx co request.Expiry = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile")))) { - request.Profile = expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingListProfile(ctx, key+".profile.0", d) + request.Profile = expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1SavaMappingListProfile(ctx, key+".profile.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".smart_account_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".smart_account_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".smart_account_id")))) { request.SmartAccountID = interfaceToString(v) @@ -630,8 +646,8 @@ func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingList(ctx co return &request } -func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsSavaMappingListProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsSavaMappingListProfile { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsSavaMappingListProfile{} +func expandRequestPnpGlobalSettingsUpdatePnpGlobalSettingsV1SavaMappingListProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1SavaMappingListProfile { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpGlobalSettingsV1SavaMappingListProfile{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".address_fqdn")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".address_fqdn")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".address_fqdn")))) { request.AddressFqdn = interfaceToString(v) } diff --git a/catalystcenter/resource_pnp_server_profile_update.go b/catalystcenter/resource_pnp_server_profile_update.go index c5ef938..9ea49da 100644 --- a/catalystcenter/resource_pnp_server_profile_update.go +++ b/catalystcenter/resource_pnp_server_profile_update.go @@ -302,31 +302,27 @@ func resourcePnpServerProfileUpdateCreate(ctx context.Context, d *schema.Resourc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpServerProfileUpdateUpdatePnpServerProfile(ctx, "parameters.0", d) + request1 := expandRequestPnpServerProfileUpdateUpdatePnpServerProfileV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.UpdatePnpServerProfile(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.UpdatePnpServerProfileV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdatePnpServerProfile", err)) + "Failure when executing UpdatePnpServerProfileV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpUpdatePnpServerProfileItem(response1) + vItem1 := flattenDeviceOnboardingPnpUpdatePnpServerProfileV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdatePnpServerProfile response", + "Failure when setting UpdatePnpServerProfileV1 response", err)) return diags } @@ -348,8 +344,8 @@ func resourcePnpServerProfileUpdateDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestPnpServerProfileUpdateUpdatePnpServerProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfile { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfile{} +func expandRequestPnpServerProfileUpdateUpdatePnpServerProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfileV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".smart_account_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".smart_account_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".smart_account_id")))) { request.SmartAccountID = interfaceToString(v) } @@ -357,7 +353,7 @@ func expandRequestPnpServerProfileUpdateUpdatePnpServerProfile(ctx context.Conte request.VirtualAccountID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile")))) { - request.Profile = expandRequestPnpServerProfileUpdateUpdatePnpServerProfileProfile(ctx, key+".profile.0", d) + request.Profile = expandRequestPnpServerProfileUpdateUpdatePnpServerProfileV1Profile(ctx, key+".profile.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".cco_user")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cco_user")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cco_user")))) { request.CcoUser = interfaceToString(v) @@ -365,8 +361,8 @@ func expandRequestPnpServerProfileUpdateUpdatePnpServerProfile(ctx context.Conte return &request } -func expandRequestPnpServerProfileUpdateUpdatePnpServerProfileProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfileProfile { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfileProfile{} +func expandRequestPnpServerProfileUpdateUpdatePnpServerProfileV1Profile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfileV1Profile { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdatePnpServerProfileV1Profile{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".proxy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".proxy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".proxy")))) { request.Proxy = interfaceToBoolPtr(v) } @@ -397,7 +393,7 @@ func expandRequestPnpServerProfileUpdateUpdatePnpServerProfileProfile(ctx contex return &request } -func flattenDeviceOnboardingPnpUpdatePnpServerProfileItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpUpdatePnpServerProfileV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileV1) []map[string]interface{} { if item == nil { return nil } @@ -405,9 +401,9 @@ func flattenDeviceOnboardingPnpUpdatePnpServerProfileItem(item *catalystcentersd respItem["virtual_account_id"] = item.VirtualAccountID respItem["auto_sync_period"] = item.AutoSyncPeriod respItem["sync_result_str"] = item.SyncResultStr - respItem["profile"] = flattenDeviceOnboardingPnpUpdatePnpServerProfileItemProfile(item.Profile) + respItem["profile"] = flattenDeviceOnboardingPnpUpdatePnpServerProfileV1ItemProfile(item.Profile) respItem["cco_user"] = item.CcoUser - respItem["sync_result"] = flattenDeviceOnboardingPnpUpdatePnpServerProfileItemSyncResult(item.SyncResult) + respItem["sync_result"] = flattenDeviceOnboardingPnpUpdatePnpServerProfileV1ItemSyncResult(item.SyncResult) respItem["token"] = item.Token respItem["sync_start_time"] = item.SyncStartTime respItem["last_sync"] = item.LastSync @@ -420,7 +416,7 @@ func flattenDeviceOnboardingPnpUpdatePnpServerProfileItem(item *catalystcentersd } } -func flattenDeviceOnboardingPnpUpdatePnpServerProfileItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpUpdatePnpServerProfileV1ItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileV1Profile) []map[string]interface{} { if item == nil { return nil } @@ -440,12 +436,12 @@ func flattenDeviceOnboardingPnpUpdatePnpServerProfileItemProfile(item *catalystc } -func flattenDeviceOnboardingPnpUpdatePnpServerProfileItemSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileSyncResult) []map[string]interface{} { +func flattenDeviceOnboardingPnpUpdatePnpServerProfileV1ItemSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileV1SyncResult) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["sync_list"] = flattenDeviceOnboardingPnpUpdatePnpServerProfileItemSyncResultSyncList(item.SyncList) + respItem["sync_list"] = flattenDeviceOnboardingPnpUpdatePnpServerProfileV1ItemSyncResultSyncList(item.SyncList) respItem["sync_msg"] = item.SyncMsg return []map[string]interface{}{ @@ -454,7 +450,7 @@ func flattenDeviceOnboardingPnpUpdatePnpServerProfileItemSyncResult(item *cataly } -func flattenDeviceOnboardingPnpUpdatePnpServerProfileItemSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileSyncResultSyncList) []map[string]interface{} { +func flattenDeviceOnboardingPnpUpdatePnpServerProfileV1ItemSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpUpdatePnpServerProfileV1SyncResultSyncList) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_pnp_virtual_account_add.go b/catalystcenter/resource_pnp_virtual_account_add.go index ff6fc34..310d2e2 100644 --- a/catalystcenter/resource_pnp_virtual_account_add.go +++ b/catalystcenter/resource_pnp_virtual_account_add.go @@ -348,31 +348,27 @@ func resourcePnpVirtualAccountAddCreate(ctx context.Context, d *schema.ResourceD client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpVirtualAccountAddAddVirtualAccount(ctx, "parameters.0", d) + request1 := expandRequestPnpVirtualAccountAddAddVirtualAccountV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.AddVirtualAccount(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.AddVirtualAccountV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AddVirtualAccount", err)) + "Failure when executing AddVirtualAccountV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpAddVirtualAccountItem(response1) + vItem1 := flattenDeviceOnboardingPnpAddVirtualAccountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AddVirtualAccount response", + "Failure when setting AddVirtualAccountV1 response", err)) return diags } @@ -394,8 +390,8 @@ func resourcePnpVirtualAccountAddDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestPnpVirtualAccountAddAddVirtualAccount(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccount { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccount{} +func expandRequestPnpVirtualAccountAddAddVirtualAccountV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auto_sync_period")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auto_sync_period")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auto_sync_period")))) { request.AutoSyncPeriod = interfaceToIntPtr(v) } @@ -409,13 +405,13 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccount(ctx context.Context, key request.LastSync = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile")))) { - request.Profile = expandRequestPnpVirtualAccountAddAddVirtualAccountProfile(ctx, key+".profile.0", d) + request.Profile = expandRequestPnpVirtualAccountAddAddVirtualAccountV1Profile(ctx, key+".profile.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".smart_account_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".smart_account_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".smart_account_id")))) { request.SmartAccountID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_result")))) { - request.SyncResult = expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResult(ctx, key+".sync_result.0", d) + request.SyncResult = expandRequestPnpVirtualAccountAddAddVirtualAccountV1SyncResult(ctx, key+".sync_result.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_result_str")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_result_str")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_result_str")))) { request.SyncResultStr = interfaceToString(v) @@ -438,8 +434,8 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccount(ctx context.Context, key return &request } -func expandRequestPnpVirtualAccountAddAddVirtualAccountProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountProfile { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountProfile{} +func expandRequestPnpVirtualAccountAddAddVirtualAccountV1Profile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1Profile { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1Profile{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".address_fqdn")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".address_fqdn")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".address_fqdn")))) { request.AddressFqdn = interfaceToString(v) } @@ -470,10 +466,10 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccountProfile(ctx context.Conte return &request } -func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResult(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountSyncResult { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountSyncResult{} +func expandRequestPnpVirtualAccountAddAddVirtualAccountV1SyncResult(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1SyncResult { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1SyncResult{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_list")))) { - request.SyncList = expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncListArray(ctx, key+".sync_list", d) + request.SyncList = expandRequestPnpVirtualAccountAddAddVirtualAccountV1SyncResultSyncListArray(ctx, key+".sync_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_msg")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_msg")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_msg")))) { request.SyncMsg = interfaceToString(v) @@ -481,8 +477,8 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResult(ctx context.Co return &request } -func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountSyncResultSyncList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountSyncResultSyncList{} +func expandRequestPnpVirtualAccountAddAddVirtualAccountV1SyncResultSyncListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1SyncResultSyncList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1SyncResultSyncList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -493,7 +489,7 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncListArray(c return nil } for item_no := range objs { - i := expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpVirtualAccountAddAddVirtualAccountV1SyncResultSyncList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -501,8 +497,8 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncListArray(c return &request } -func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountSyncResultSyncList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountSyncResultSyncList{} +func expandRequestPnpVirtualAccountAddAddVirtualAccountV1SyncResultSyncList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1SyncResultSyncList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddVirtualAccountV1SyncResultSyncList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_sn_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_sn_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_sn_list")))) { request.DeviceSnList = interfaceToSliceString(v) } @@ -512,14 +508,14 @@ func expandRequestPnpVirtualAccountAddAddVirtualAccountSyncResultSyncList(ctx co return &request } -func flattenDeviceOnboardingPnpAddVirtualAccountItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAddVirtualAccount) []map[string]interface{} { +func flattenDeviceOnboardingPnpAddVirtualAccountV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAddVirtualAccountV1) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) respItem["virtual_account_id"] = item.VirtualAccountID respItem["auto_sync_period"] = item.AutoSyncPeriod - respItem["profile"] = flattenDeviceOnboardingPnpAddVirtualAccountItemProfile(item.Profile) + respItem["profile"] = flattenDeviceOnboardingPnpAddVirtualAccountV1ItemProfile(item.Profile) respItem["cco_user"] = item.CcoUser respItem["sync_start_time"] = item.SyncStartTime respItem["last_sync"] = item.LastSync @@ -532,7 +528,7 @@ func flattenDeviceOnboardingPnpAddVirtualAccountItem(item *catalystcentersdkgo.R } } -func flattenDeviceOnboardingPnpAddVirtualAccountItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAddVirtualAccountProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpAddVirtualAccountV1ItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpAddVirtualAccountV1Profile) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_virtual_account_deregister.go b/catalystcenter/resource_pnp_virtual_account_deregister.go index 2e4263d..d5aa536 100644 --- a/catalystcenter/resource_pnp_virtual_account_deregister.go +++ b/catalystcenter/resource_pnp_virtual_account_deregister.go @@ -178,31 +178,31 @@ func resourcePnpVirtualAccountDeregisterCreate(ctx context.Context, d *schema.Re vName := resourceItem["name"] - queryParams1 := catalystcentersdkgo.DeregisterVirtualAccountQueryParams{} + queryParams1 := catalystcentersdkgo.DeregisterVirtualAccountV1QueryParams{} queryParams1.Domain = vDomain.(string) queryParams1.Name = vName.(string) - response1, restyResp1, err := client.DeviceOnboardingPnp.DeregisterVirtualAccount(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.DeviceOnboardingPnp.DeregisterVirtualAccountV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeregisterVirtualAccount", err)) + "Failure when executing DeregisterVirtualAccountV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpDeregisterVirtualAccountItem(response1) + vItem1 := flattenDeviceOnboardingPnpDeregisterVirtualAccountV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeregisterVirtualAccount response", + "Failure when setting DeregisterVirtualAccountV1 response", err)) return diags } @@ -210,6 +210,8 @@ func resourcePnpVirtualAccountDeregisterCreate(ctx context.Context, d *schema.Re d.SetId(getUnixTimeString()) return diags + //Analizar verificacion. + } func resourcePnpVirtualAccountDeregisterRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -224,7 +226,7 @@ func resourcePnpVirtualAccountDeregisterDelete(ctx context.Context, d *schema.Re return diags } -func flattenDeviceOnboardingPnpDeregisterVirtualAccountItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpDeregisterVirtualAccount) []map[string]interface{} { +func flattenDeviceOnboardingPnpDeregisterVirtualAccountV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpDeregisterVirtualAccountV1) []map[string]interface{} { if item == nil { return nil } @@ -235,7 +237,7 @@ func flattenDeviceOnboardingPnpDeregisterVirtualAccountItem(item *catalystcenter respItem["cco_user"] = item.CcoUser respItem["expiry"] = item.Expiry respItem["auto_sync_period"] = item.AutoSyncPeriod - respItem["profile"] = flattenDeviceOnboardingPnpDeregisterVirtualAccountItemProfile(item.Profile) + respItem["profile"] = flattenDeviceOnboardingPnpDeregisterVirtualAccountV1ItemProfile(item.Profile) respItem["sync_status"] = item.SyncStatus respItem["sync_start_time"] = item.SyncStartTime respItem["tenant_id"] = item.TenantID @@ -244,7 +246,7 @@ func flattenDeviceOnboardingPnpDeregisterVirtualAccountItem(item *catalystcenter } } -func flattenDeviceOnboardingPnpDeregisterVirtualAccountItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpDeregisterVirtualAccountProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpDeregisterVirtualAccountV1ItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpDeregisterVirtualAccountV1Profile) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_pnp_virtual_account_devices_sync.go b/catalystcenter/resource_pnp_virtual_account_devices_sync.go index fa22c6c..50ef757 100644 --- a/catalystcenter/resource_pnp_virtual_account_devices_sync.go +++ b/catalystcenter/resource_pnp_virtual_account_devices_sync.go @@ -373,31 +373,27 @@ func resourcePnpVirtualAccountDevicesSyncCreate(ctx context.Context, d *schema.R client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevices(ctx, "parameters.0", d) + request1 := expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.DeviceOnboardingPnp.SyncVirtualAccountDevices(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.DeviceOnboardingPnp.SyncVirtualAccountDevicesV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing SyncVirtualAccountDevices", err)) + "Failure when executing SyncVirtualAccountDevicesV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItem(response1) + vItem1 := flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SyncVirtualAccountDevices response", + "Failure when setting SyncVirtualAccountDevicesV1 response", err)) return diags } @@ -419,8 +415,8 @@ func resourcePnpVirtualAccountDevicesSyncDelete(ctx context.Context, d *schema.R return diags } -func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevices { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevices{} +func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auto_sync_period")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auto_sync_period")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auto_sync_period")))) { request.AutoSyncPeriod = interfaceToIntPtr(v) } @@ -434,13 +430,13 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevices(ctx cont request.LastSync = interfaceToIntPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile")))) { - request.Profile = expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesProfile(ctx, key+".profile.0", d) + request.Profile = expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1Profile(ctx, key+".profile.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".smart_account_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".smart_account_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".smart_account_id")))) { request.SmartAccountID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_result")))) { - request.SyncResult = expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResult(ctx, key+".sync_result.0", d) + request.SyncResult = expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1SyncResult(ctx, key+".sync_result.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_result_str")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_result_str")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_result_str")))) { request.SyncResultStr = interfaceToString(v) @@ -463,8 +459,8 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevices(ctx cont return &request } -func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesProfile { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesProfile{} +func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1Profile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1Profile { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1Profile{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".address_fqdn")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".address_fqdn")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".address_fqdn")))) { request.AddressFqdn = interfaceToString(v) } @@ -492,10 +488,10 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesProfile(c return &request } -func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResult(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResult { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResult{} +func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1SyncResult(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResult { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResult{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_list")))) { - request.SyncList = expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResultSyncListArray(ctx, key+".sync_list", d) + request.SyncList = expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1SyncResultSyncListArray(ctx, key+".sync_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sync_msg")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sync_msg")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sync_msg")))) { request.SyncMsg = interfaceToString(v) @@ -503,8 +499,8 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResul return &request } -func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResultSyncListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResultSyncList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResultSyncList{} +func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1SyncResultSyncListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResultSyncList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResultSyncList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -515,7 +511,7 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResul return nil } for item_no := range objs { - i := expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResultSyncList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1SyncResultSyncList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -523,8 +519,8 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResul return &request } -func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResultSyncList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResultSyncList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResultSyncList{} +func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesV1SyncResultSyncList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResultSyncList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResultSyncList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_sn_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_sn_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_sn_list")))) { request.DeviceSnList = interfaceToSliceString(v) } @@ -534,7 +530,7 @@ func expandRequestPnpVirtualAccountDevicesSyncSyncVirtualAccountDevicesSyncResul return &request } -func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItem(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevices) []map[string]interface{} { +func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1Item(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesV1) []map[string]interface{} { if item == nil { return nil } @@ -542,9 +538,9 @@ func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItem(item *catalystcente respItem["virtual_account_id"] = item.VirtualAccountID respItem["auto_sync_period"] = item.AutoSyncPeriod respItem["sync_result_str"] = item.SyncResultStr - respItem["profile"] = flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemProfile(item.Profile) + respItem["profile"] = flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1ItemProfile(item.Profile) respItem["cco_user"] = item.CcoUser - respItem["sync_result"] = flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemSyncResult(item.SyncResult) + respItem["sync_result"] = flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1ItemSyncResult(item.SyncResult) respItem["token"] = item.Token respItem["sync_start_time"] = item.SyncStartTime respItem["last_sync"] = item.LastSync @@ -557,7 +553,7 @@ func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItem(item *catalystcente } } -func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesProfile) []map[string]interface{} { +func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1ItemProfile(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesV1Profile) []map[string]interface{} { if item == nil { return nil } @@ -577,12 +573,12 @@ func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemProfile(item *cataly } -func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResult) []map[string]interface{} { +func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1ItemSyncResult(item *catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResult) []map[string]interface{} { if item == nil { return nil } respItem := make(map[string]interface{}) - respItem["sync_list"] = flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemSyncResultSyncList(item.SyncList) + respItem["sync_list"] = flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1ItemSyncResultSyncList(item.SyncList) respItem["sync_msg"] = item.SyncMsg return []map[string]interface{}{ @@ -591,7 +587,7 @@ func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemSyncResult(item *cat } -func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesItemSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesSyncResultSyncList) []map[string]interface{} { +func flattenDeviceOnboardingPnpSyncVirtualAccountDevicesV1ItemSyncResultSyncList(items *[]catalystcentersdkgo.ResponseDeviceOnboardingPnpSyncVirtualAccountDevicesV1SyncResultSyncList) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_pnp_workflow.go b/catalystcenter/resource_pnp_workflow.go index b05c41c..5800421 100644 --- a/catalystcenter/resource_pnp_workflow.go +++ b/catalystcenter/resource_pnp_workflow.go @@ -427,7 +427,7 @@ func resourcePnpWorkflowCreate(ctx context.Context, d *schema.ResourceData, m in var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestPnpWorkflowAddAWorkflow(ctx, "parameters.0", d) + request1 := expandRequestPnpWorkflowAddAWorkflowV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -447,7 +447,7 @@ func resourcePnpWorkflowCreate(ctx context.Context, d *schema.ResourceData, m in } } if okName && vvName != "" { - queryParams1 := catalystcentersdkgo.GetWorkflowsQueryParams{} + queryParams1 := catalystcentersdkgo.GetWorkflowsV1QueryParams{} queryParams1.Name = append(queryParams1.Name, vvName) getResponse2, err := searchDeviceOnboardingPnpGetWorkflows(m, queryParams1) if err == nil && getResponse2 != nil { @@ -488,7 +488,7 @@ func resourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m inte if okName && vName != "" { log.Printf("[DEBUG] Selected method 1: GetWorkflows") - queryParams1 := catalystcentersdkgo.GetWorkflowsQueryParams{} + queryParams1 := catalystcentersdkgo.GetWorkflowsV1QueryParams{} if okName { queryParams1.Name = append(queryParams1.Name, vName) @@ -525,7 +525,7 @@ func resourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m inte return diags } - vItem1 := flattenDeviceOnboardingPnpGetWorkflowByIDItem(response2) + vItem1 := flattenDeviceOnboardingPnpGetWorkflowByIDV1Item(response2) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetWorkflows search response", @@ -557,7 +557,7 @@ func resourcePnpWorkflowRead(ctx context.Context, d *schema.ResourceData, m inte log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenDeviceOnboardingPnpGetWorkflowByIDItem(response2) + vItem2 := flattenDeviceOnboardingPnpGetWorkflowByIDV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( "Failure when setting GetWorkflowByID response", @@ -584,7 +584,7 @@ func resourcePnpWorkflowUpdate(ctx context.Context, d *schema.ResourceData, m in vvID := "" if vName != "" { log.Printf("[DEBUG] Selected method 1: GetWorkflows") - queryParams1 := catalystcentersdkgo.GetWorkflowsQueryParams{} + queryParams1 := catalystcentersdkgo.GetWorkflowsV1QueryParams{} queryParams1.Name = append(queryParams1.Name, vName) @@ -615,7 +615,7 @@ func resourcePnpWorkflowUpdate(ctx context.Context, d *schema.ResourceData, m in if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestPnpWorkflowUpdateWorkflow(ctx, "parameters.0", d) + request1 := expandRequestPnpWorkflowUpdateWorkflowV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -662,7 +662,7 @@ func resourcePnpWorkflowDelete(ctx context.Context, d *schema.ResourceData, m in return diags } } else if vName != "" { - queryParams1 := catalystcentersdkgo.GetWorkflowsQueryParams{} + queryParams1 := catalystcentersdkgo.GetWorkflowsV1QueryParams{} queryParams1.Name = append(queryParams1.Name, vName) response1, err := searchDeviceOnboardingPnpGetWorkflows(m, queryParams1) @@ -694,8 +694,8 @@ func resourcePnpWorkflowDelete(ctx context.Context, d *schema.ResourceData, m in return diags } -func expandRequestPnpWorkflowAddAWorkflow(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflow { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflow{} +func expandRequestPnpWorkflowAddAWorkflowV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.TypeID = interfaceToString(v) } @@ -739,7 +739,7 @@ func expandRequestPnpWorkflowAddAWorkflow(ctx context.Context, key string, d *sc request.State = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tasks")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tasks")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tasks")))) { - request.Tasks = expandRequestPnpWorkflowAddAWorkflowTasksArray(ctx, key+".tasks", d) + request.Tasks = expandRequestPnpWorkflowAddAWorkflowV1TasksArray(ctx, key+".tasks", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tenant_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tenant_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tenant_id")))) { request.TenantID = interfaceToString(v) @@ -759,8 +759,8 @@ func expandRequestPnpWorkflowAddAWorkflow(ctx context.Context, key string, d *sc return &request } -func expandRequestPnpWorkflowAddAWorkflowTasksArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasks { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasks{} +func expandRequestPnpWorkflowAddAWorkflowV1TasksArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1Tasks { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1Tasks{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -771,7 +771,7 @@ func expandRequestPnpWorkflowAddAWorkflowTasksArray(ctx context.Context, key str return nil } for item_no := range objs { - i := expandRequestPnpWorkflowAddAWorkflowTasks(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpWorkflowAddAWorkflowV1Tasks(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -782,8 +782,8 @@ func expandRequestPnpWorkflowAddAWorkflowTasksArray(ctx context.Context, key str return &request } -func expandRequestPnpWorkflowAddAWorkflowTasks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasks { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasks{} +func expandRequestPnpWorkflowAddAWorkflowV1Tasks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1Tasks { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1Tasks{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".curr_work_item_idx")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".curr_work_item_idx")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".curr_work_item_idx")))) { request.CurrWorkItemIDx = interfaceToIntPtr(v) } @@ -809,7 +809,7 @@ func expandRequestPnpWorkflowAddAWorkflowTasks(ctx context.Context, key string, request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".work_item_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".work_item_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".work_item_list")))) { - request.WorkItemList = expandRequestPnpWorkflowAddAWorkflowTasksWorkItemListArray(ctx, key+".work_item_list", d) + request.WorkItemList = expandRequestPnpWorkflowAddAWorkflowV1TasksWorkItemListArray(ctx, key+".work_item_list", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -817,8 +817,8 @@ func expandRequestPnpWorkflowAddAWorkflowTasks(ctx context.Context, key string, return &request } -func expandRequestPnpWorkflowAddAWorkflowTasksWorkItemListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasksWorkItemList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasksWorkItemList{} +func expandRequestPnpWorkflowAddAWorkflowV1TasksWorkItemListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1TasksWorkItemList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1TasksWorkItemList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -829,7 +829,7 @@ func expandRequestPnpWorkflowAddAWorkflowTasksWorkItemListArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestPnpWorkflowAddAWorkflowTasksWorkItemList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpWorkflowAddAWorkflowV1TasksWorkItemList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -840,8 +840,8 @@ func expandRequestPnpWorkflowAddAWorkflowTasksWorkItemListArray(ctx context.Cont return &request } -func expandRequestPnpWorkflowAddAWorkflowTasksWorkItemList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasksWorkItemList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowTasksWorkItemList{} +func expandRequestPnpWorkflowAddAWorkflowV1TasksWorkItemList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1TasksWorkItemList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpAddAWorkflowV1TasksWorkItemList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".command")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".command")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".command")))) { request.Command = interfaceToString(v) } @@ -866,8 +866,8 @@ func expandRequestPnpWorkflowAddAWorkflowTasksWorkItemList(ctx context.Context, return &request } -func expandRequestPnpWorkflowUpdateWorkflow(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflow { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflow{} +func expandRequestPnpWorkflowUpdateWorkflowV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1 { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.TypeID = interfaceToString(v) } @@ -911,7 +911,7 @@ func expandRequestPnpWorkflowUpdateWorkflow(ctx context.Context, key string, d * request.State = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tasks")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tasks")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tasks")))) { - request.Tasks = expandRequestPnpWorkflowUpdateWorkflowTasksArray(ctx, key+".tasks", d) + request.Tasks = expandRequestPnpWorkflowUpdateWorkflowV1TasksArray(ctx, key+".tasks", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tenant_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tenant_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tenant_id")))) { request.TenantID = interfaceToString(v) @@ -931,8 +931,8 @@ func expandRequestPnpWorkflowUpdateWorkflow(ctx context.Context, key string, d * return &request } -func expandRequestPnpWorkflowUpdateWorkflowTasksArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasks { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasks{} +func expandRequestPnpWorkflowUpdateWorkflowV1TasksArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1Tasks { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1Tasks{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -943,7 +943,7 @@ func expandRequestPnpWorkflowUpdateWorkflowTasksArray(ctx context.Context, key s return nil } for item_no := range objs { - i := expandRequestPnpWorkflowUpdateWorkflowTasks(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpWorkflowUpdateWorkflowV1Tasks(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -954,8 +954,8 @@ func expandRequestPnpWorkflowUpdateWorkflowTasksArray(ctx context.Context, key s return &request } -func expandRequestPnpWorkflowUpdateWorkflowTasks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasks { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasks{} +func expandRequestPnpWorkflowUpdateWorkflowV1Tasks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1Tasks { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1Tasks{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".curr_work_item_idx")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".curr_work_item_idx")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".curr_work_item_idx")))) { request.CurrWorkItemIDx = interfaceToIntPtr(v) } @@ -981,7 +981,7 @@ func expandRequestPnpWorkflowUpdateWorkflowTasks(ctx context.Context, key string request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".work_item_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".work_item_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".work_item_list")))) { - request.WorkItemList = expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemListArray(ctx, key+".work_item_list", d) + request.WorkItemList = expandRequestPnpWorkflowUpdateWorkflowV1TasksWorkItemListArray(ctx, key+".work_item_list", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -989,8 +989,8 @@ func expandRequestPnpWorkflowUpdateWorkflowTasks(ctx context.Context, key string return &request } -func expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasksWorkItemList { - request := []catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasksWorkItemList{} +func expandRequestPnpWorkflowUpdateWorkflowV1TasksWorkItemListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1TasksWorkItemList { + request := []catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1TasksWorkItemList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1001,7 +1001,7 @@ func expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemListArray(ctx context.Co return nil } for item_no := range objs { - i := expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestPnpWorkflowUpdateWorkflowV1TasksWorkItemList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1012,8 +1012,8 @@ func expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemListArray(ctx context.Co return &request } -func expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasksWorkItemList { - request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowTasksWorkItemList{} +func expandRequestPnpWorkflowUpdateWorkflowV1TasksWorkItemList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1TasksWorkItemList { + request := catalystcentersdkgo.RequestDeviceOnboardingPnpUpdateWorkflowV1TasksWorkItemList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".command")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".command")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".command")))) { request.Command = interfaceToString(v) } @@ -1038,11 +1038,11 @@ func expandRequestPnpWorkflowUpdateWorkflowTasksWorkItemList(ctx context.Context return &request } -func searchDeviceOnboardingPnpGetWorkflows(m interface{}, queryParams catalystcentersdkgo.GetWorkflowsQueryParams) (*catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflows, error) { +func searchDeviceOnboardingPnpGetWorkflows(m interface{}, queryParams catalystcentersdkgo.GetWorkflowsV1QueryParams) (*catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflows - var ite *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflows + var foundItem *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsV1 + var ite *catalystcentersdkgo.ResponseDeviceOnboardingPnpGetWorkflowsV1 ite, _, err = client.DeviceOnboardingPnp.GetWorkflows(&queryParams) if err != nil { return foundItem, err @@ -1058,7 +1058,7 @@ func searchDeviceOnboardingPnpGetWorkflows(m interface{}, queryParams catalystce for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name[0] { - var getItem *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflows + var getItem *catalystcentersdkgo.ResponseItemDeviceOnboardingPnpGetWorkflowsV1 getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_profiling_rules_in_bulk_create.go b/catalystcenter/resource_profiling_rules_in_bulk_create.go new file mode 100644 index 0000000..dd82cea --- /dev/null +++ b/catalystcenter/resource_profiling_rules_in_bulk_create.go @@ -0,0 +1,470 @@ +package catalystcenter + +import ( + "context" + + "fmt" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceProfilingRulesInBulkCreate() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on AIEndpointAnalytics. + +- This data source action imports the given list of profiling rules. For each record, 1) If 'ruleType' for a record is +not 'Custom Rule', then it is rejected. 2) If 'ruleId' is provided in the input record, + 2a) Record with same 'ruleId' exists in the system, then it is replaced with new data. + 2b) Record with same 'ruleId' does not exist, then it is inserted in the database. +3) If 'ruleId' is not provided in the input record, then new 'ruleId' is generated by the system, and record is +inserted. +`, + + CreateContext: resourceProfilingRulesInBulkCreateCreate, + ReadContext: resourceProfilingRulesInBulkCreateRead, + DeleteContext: resourceProfilingRulesInBulkCreateDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "profiling_rules": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "cluster_id": &schema.Schema{ + Description: `Unique identifier for ML cluster. Only applicable for 'ML Rule'. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "condition_groups": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "condition": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "attribute": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "attribute_dictionary": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "condition_group": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "is_deleted": &schema.Schema{ + Description: `Flag to indicate whether the rule was deleted. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + ForceNew: true, + Computed: true, + }, + "last_modified_by": &schema.Schema{ + Description: `User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "last_modified_on": &schema.Schema{ + Description: `Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "plugin_id": &schema.Schema{ + Description: `Plugin for the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rejected": &schema.Schema{ + Description: `Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + ForceNew: true, + Computed: true, + }, + "result": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "device_type": &schema.Schema{ + Description: `List of device types determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_manufacturer": &schema.Schema{ + Description: `List of hardware manufacturers determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hardware_model": &schema.Schema{ + Description: `List of hardware models determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "operating_system": &schema.Schema{ + Description: `List of operating systems determined by the current rule. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "rule_id": &schema.Schema{ + Description: `Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_name": &schema.Schema{ + Description: `Human readable name for the rule. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_priority": &schema.Schema{ + Description: `Priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_type": &schema.Schema{ + Description: `Type of the rule. +`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "rule_version": &schema.Schema{ + Description: `Version of the rule. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "source_priority": &schema.Schema{ + Description: `Source priority for the rule. +`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "used_attributes": &schema.Schema{ + Description: `List of attributes used in the rule. Only applicable for 'Cisco Default' rules. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceProfilingRulesInBulkCreateCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1(ctx, "parameters.0", d) + + // has_unknown_response: True + + response1, err := client.AIEndpointAnalytics.ImportProfilingRulesInBulkV1(request1) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { + diags = append(diags, diagError( + "Failure when setting ImportProfilingRulesInBulkV1 response", + err)) + return diags + } + d.SetId(getUnixTimeString()) + return diags + +} +func resourceProfilingRulesInBulkCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceProfilingRulesInBulkCreateDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1 { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".profiling_rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profiling_rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profiling_rules")))) { + request.ProfilingRules = expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesArray(ctx, key+".profiling_rules", d) + } + return &request +} + +func expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules { + request := []catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules{} + key = fixKeyAccess(key) + o := d.Get(key) + if o == nil { + return nil + } + objs := o.([]interface{}) + if len(objs) == 0 { + return nil + } + for item_no := range objs { + i := expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + if i != nil { + request = append(request, *i) + } + } + return &request +} + +func expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRules{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_id")))) { + request.RuleID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_name")))) { + request.RuleName = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_type")))) { + request.RuleType = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_version")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_version")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_version")))) { + request.RuleVersion = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rule_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rule_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rule_priority")))) { + request.RulePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".source_priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".source_priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".source_priority")))) { + request.SourcePriority = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_deleted")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_deleted")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_deleted")))) { + request.IsDeleted = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_by")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_by")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_by")))) { + request.LastModifiedBy = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".last_modified_on")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".last_modified_on")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".last_modified_on")))) { + request.LastModifiedOn = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".plugin_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".plugin_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".plugin_id")))) { + request.PluginID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".cluster_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cluster_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cluster_id")))) { + request.ClusterID = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".rejected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rejected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rejected")))) { + request.Rejected = interfaceToBoolPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".result")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".result")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".result")))) { + request.Result = expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesResult(ctx, key+".result.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_groups")))) { + request.ConditionGroups = expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesConditionGroups(ctx, key+".condition_groups.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".used_attributes")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".used_attributes")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".used_attributes")))) { + request.UsedAttributes = interfaceToSliceString(v) + } + return &request +} + +func expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesResult(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesResult { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesResult{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_type")))) { + request.DeviceType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_manufacturer")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_manufacturer")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_manufacturer")))) { + request.HardwareManufacturer = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".hardware_model")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".hardware_model")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".hardware_model")))) { + request.HardwareModel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operating_system")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operating_system")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operating_system")))) { + request.OperatingSystem = interfaceToSliceString(v) + } + return &request +} + +func expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesConditionGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroups { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroups{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition")))) { + request.Condition = expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition(ctx, key+".condition.0", d) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".condition_group")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".condition_group")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".condition_group")))) { + request.ConditionGroup = interfaceToSliceString(v) + } + return &request +} + +func expandRequestProfilingRulesInBulkCreateImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition { + request := catalystcentersdkgo.RequestAIEndpointAnalyticsImportProfilingRulesInBulkV1ProfilingRulesConditionGroupsCondition{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute")))) { + request.Attribute = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".operator")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operator")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operator")))) { + request.Operator = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { + request.Value = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_dictionary")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_dictionary")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_dictionary")))) { + request.AttributeDictionary = interfaceToString(v) + } + return &request +} diff --git a/catalystcenter/resource_provisioning_settings.go b/catalystcenter/resource_provisioning_settings.go index 3aadc79..fc64313 100644 --- a/catalystcenter/resource_provisioning_settings.go +++ b/catalystcenter/resource_provisioning_settings.go @@ -122,7 +122,7 @@ func resourceProvisioningSettingsRead(ctx context.Context, d *schema.ResourceDat log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSystemSettingsGetProvisioningSettingsItem(response1.Response) + vItem1 := flattenSystemSettingsGetProvisioningSettingsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetProvisioningSettings response", @@ -142,7 +142,7 @@ func resourceProvisioningSettingsUpdate(ctx context.Context, d *schema.ResourceD var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestProvisioningSettingsSetProvisioningSettings(ctx, "parameters.0", d) + request1 := expandRequestProvisioningSettingsSetProvisioningSettingsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.SystemSettings.SetProvisioningSettings(request1) if err != nil || response1 == nil { @@ -201,8 +201,8 @@ func resourceProvisioningSettingsDelete(ctx context.Context, d *schema.ResourceD "Failure at ProvisioningSettingsDelete, unexpected response", "")) return diags } -func expandRequestProvisioningSettingsSetProvisioningSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsSetProvisioningSettings { - request := catalystcentersdkgo.RequestSystemSettingsSetProvisioningSettings{} +func expandRequestProvisioningSettingsSetProvisioningSettingsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSystemSettingsSetProvisioningSettingsV1 { + request := catalystcentersdkgo.RequestSystemSettingsSetProvisioningSettingsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".require_itsm_approval")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".require_itsm_approval")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".require_itsm_approval")))) { request.RequireItsmApproval = interfaceToBoolPtr(v) } diff --git a/catalystcenter/resource_qos_device_interface.go b/catalystcenter/resource_qos_device_interface.go index eb54b13..44e7308 100644 --- a/catalystcenter/resource_qos_device_interface.go +++ b/catalystcenter/resource_qos_device_interface.go @@ -417,7 +417,7 @@ func resourceQosDeviceInterfaceCreate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfo(ctx, "parameters.0", d) + request1 := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -426,7 +426,7 @@ func resourceQosDeviceInterfaceCreate(ctx context.Context, d *schema.ResourceDat vvNetworkDeviceID := interfaceToString(vNetworkDeviceID) vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetQosDeviceInterfaceInfoQueryParams{} + queryParamImport := catalystcentersdkgo.GetQosDeviceInterfaceInfoV1QueryParams{} queryParamImport.NetworkDeviceID = vvNetworkDeviceID item2, err := searchApplicationPolicyGetQosDeviceInterfaceInfo(m, queryParamImport, vvName, vvID) if err == nil && item2 != nil { @@ -476,7 +476,7 @@ func resourceQosDeviceInterfaceCreate(ctx context.Context, d *schema.ResourceDat return diags } } - queryParamValidate := catalystcentersdkgo.GetQosDeviceInterfaceInfoQueryParams{} + queryParamValidate := catalystcentersdkgo.GetQosDeviceInterfaceInfoV1QueryParams{} queryParamValidate.NetworkDeviceID = vvNetworkDeviceID item3, err := searchApplicationPolicyGetQosDeviceInterfaceInfo(m, queryParamValidate, vvName, vvID) if err != nil || item3 == nil { @@ -509,7 +509,7 @@ func resourceQosDeviceInterfaceRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetQosDeviceInterfaceInfo") - queryParams1 := catalystcentersdkgo.GetQosDeviceInterfaceInfoQueryParams{} + queryParams1 := catalystcentersdkgo.GetQosDeviceInterfaceInfoV1QueryParams{} queryParams1.NetworkDeviceID = vvNetworkDeviceID item1, err := searchApplicationPolicyGetQosDeviceInterfaceInfo(m, queryParams1, vvName, vvID) if err != nil || item1 == nil { @@ -517,10 +517,10 @@ func resourceQosDeviceInterfaceRead(ctx context.Context, d *schema.ResourceData, return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponse{ + items := []catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1Response{ *item1, } - vItem1 := flattenApplicationPolicyGetQosDeviceInterfaceInfoItems(&items) + vItem1 := flattenApplicationPolicyGetQosDeviceInterfaceInfoV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetQosDeviceInterfaceInfo search response", @@ -540,7 +540,7 @@ func resourceQosDeviceInterfaceUpdate(ctx context.Context, d *schema.ResourceDat resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfo(ctx, "parameters.0", d) + request1 := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -656,9 +656,9 @@ func resourceQosDeviceInterfaceDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateQosDeviceInterfaceInfo { - request := catalystcentersdkgo.RequestApplicationPolicyCreateQosDeviceInterfaceInfo{} - if v := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemArray(ctx, key+".payload", d); v != nil { +func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyCreateQosDeviceInterfaceInfoV1 { + request := catalystcentersdkgo.RequestApplicationPolicyCreateQosDeviceInterfaceInfoV1{} + if v := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -667,8 +667,8 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfo(ctx context.Con return &request } -func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfo { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -679,7 +679,7 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemArray(ctx co return nil } for item_no := range objs { - i := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -690,8 +690,8 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemArray(ctx co return &request } -func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfo { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -702,7 +702,7 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItem(ctx context request.NetworkDeviceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_device_interface_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_device_interface_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_device_interface_info")))) { - request.QosDeviceInterfaceInfo = expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfoArray(ctx, key+".qos_device_interface_info", d) + request.QosDeviceInterfaceInfo = expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfoArray(ctx, key+".qos_device_interface_info", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -710,8 +710,8 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItem(ctx context return &request } -func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoQosDeviceInterfaceInfo { - request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo { + request := []catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -722,7 +722,7 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInt return nil } for item_no := range objs { - i := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -733,8 +733,8 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInt return &request } -func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoQosDeviceInterfaceInfo { - request := catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo { + request := catalystcentersdkgo.RequestItemApplicationPolicyCreateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".dmvpn_remote_sites_bw")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dmvpn_remote_sites_bw")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dmvpn_remote_sites_bw")))) { request.DmvpnRemoteSitesBw = interfaceToSliceInt(v) } @@ -759,9 +759,9 @@ func expandRequestQosDeviceInterfaceCreateQosDeviceInterfaceInfoItemQosDeviceInt return &request } -func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyUpdateQosDeviceInterfaceInfo { - request := catalystcentersdkgo.RequestApplicationPolicyUpdateQosDeviceInterfaceInfo{} - if v := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemArray(ctx, key+".payload", d); v != nil { +func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestApplicationPolicyUpdateQosDeviceInterfaceInfoV1 { + request := catalystcentersdkgo.RequestApplicationPolicyUpdateQosDeviceInterfaceInfoV1{} + if v := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -770,8 +770,8 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfo(ctx context.Con return &request } -func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfo { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1 { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -782,7 +782,7 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemArray(ctx co return nil } for item_no := range objs { - i := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -793,8 +793,8 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemArray(ctx co return &request } -func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfo { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1 { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -808,7 +808,7 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItem(ctx context request.NetworkDeviceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_device_interface_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_device_interface_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_device_interface_info")))) { - request.QosDeviceInterfaceInfo = expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfoArray(ctx, key+".qos_device_interface_info", d) + request.QosDeviceInterfaceInfo = expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfoArray(ctx, key+".qos_device_interface_info", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -816,8 +816,8 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItem(ctx context return &request } -func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoQosDeviceInterfaceInfo { - request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo { + request := []catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -828,7 +828,7 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInt return nil } for item_no := range objs { - i := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -839,8 +839,8 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInt return &request } -func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInterfaceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoQosDeviceInterfaceInfo { - request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoQosDeviceInterfaceInfo{} +func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoV1ItemQosDeviceInterfaceInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo { + request := catalystcentersdkgo.RequestItemApplicationPolicyUpdateQosDeviceInterfaceInfoV1QosDeviceInterfaceInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".instance_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".instance_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".instance_id")))) { request.InstanceID = interfaceToIntPtr(v) } @@ -868,11 +868,11 @@ func expandRequestQosDeviceInterfaceUpdateQosDeviceInterfaceInfoItemQosDeviceInt return &request } -func searchApplicationPolicyGetQosDeviceInterfaceInfo(m interface{}, queryParams catalystcentersdkgo.GetQosDeviceInterfaceInfoQueryParams, vName string, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponse, error) { +func searchApplicationPolicyGetQosDeviceInterfaceInfo(m interface{}, queryParams catalystcentersdkgo.GetQosDeviceInterfaceInfoV1QueryParams, vName string, vID string) (*catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponse - var ite *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfo + var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1Response + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1 ite, _, err = client.ApplicationPolicy.GetQosDeviceInterfaceInfo(&queryParams) if err != nil || ite == nil { return foundItem, err @@ -883,7 +883,7 @@ func searchApplicationPolicyGetQosDeviceInterfaceInfo(m interface{}, queryParams for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == vName || item.ID == vID { - var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoResponse + var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetQosDeviceInterfaceInfoV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_reports.go b/catalystcenter/resource_reports.go index 7516db1..3d07b3b 100644 --- a/catalystcenter/resource_reports.go +++ b/catalystcenter/resource_reports.go @@ -498,7 +498,7 @@ func resourceReportsCreate(ctx context.Context, d *schema.ResourceData, m interf var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestReportsCreateOrScheduleAReport(ctx, "parameters.0", d) + request1 := expandRequestReportsCreateOrScheduleAReportV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -577,7 +577,7 @@ func resourceReportsRead(ctx context.Context, d *schema.ResourceData, m interfac log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenReportsGetAScheduledReportItem(response1) + vItem1 := flattenReportsGetAScheduledReportV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetAScheduledReport response", @@ -616,7 +616,7 @@ func resourceReportsRead(ctx context.Context, d *schema.ResourceData, m interfac log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenReportsGetAScheduledReportItem(response2) + vItem2 := flattenReportsGetAScheduledReportV1Item(response2) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( "Failure when setting GetAScheduledReport response", @@ -689,22 +689,22 @@ func resourceReportsDelete(ctx context.Context, d *schema.ResourceData, m interf return diags } -func expandRequestReportsCreateOrScheduleAReport(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReport { - request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReport{} +func expandRequestReportsCreateOrScheduleAReportV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1 { + request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tags")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tags")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tags")))) { request.Tags = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".deliveries")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".deliveries")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".deliveries")))) { - request.Deliveries = expandRequestReportsCreateOrScheduleAReportDeliveriesArray(ctx, key+".deliveries", d) + request.Deliveries = expandRequestReportsCreateOrScheduleAReportV1DeliveriesArray(ctx, key+".deliveries", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".schedule")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".schedule")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".schedule")))) { - request.Schedule = expandRequestReportsCreateOrScheduleAReportSchedule(ctx, key+".schedule.0", d) + request.Schedule = expandRequestReportsCreateOrScheduleAReportV1Schedule(ctx, key+".schedule.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".view")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".view")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".view")))) { - request.View = expandRequestReportsCreateOrScheduleAReportView(ctx, key+".view.0", d) + request.View = expandRequestReportsCreateOrScheduleAReportV1View(ctx, key+".view.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".view_group_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".view_group_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".view_group_id")))) { request.ViewGroupID = interfaceToString(v) @@ -721,8 +721,8 @@ func expandRequestReportsCreateOrScheduleAReport(ctx context.Context, key string return &request } -func expandRequestReportsCreateOrScheduleAReportDeliveriesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportDeliveries { - request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportDeliveries{} +func expandRequestReportsCreateOrScheduleAReportV1DeliveriesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1Deliveries { + request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1Deliveries{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -733,7 +733,7 @@ func expandRequestReportsCreateOrScheduleAReportDeliveriesArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestReportsCreateOrScheduleAReportDeliveries(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestReportsCreateOrScheduleAReportV1Deliveries(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -744,8 +744,8 @@ func expandRequestReportsCreateOrScheduleAReportDeliveriesArray(ctx context.Cont return &request } -func expandRequestReportsCreateOrScheduleAReportDeliveries(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportDeliveries { - var request catalystcentersdkgo.RequestReportsCreateOrScheduleAReportDeliveries +func expandRequestReportsCreateOrScheduleAReportV1Deliveries(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1Deliveries { + var request catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1Deliveries request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -753,8 +753,8 @@ func expandRequestReportsCreateOrScheduleAReportDeliveries(ctx context.Context, return &request } -func expandRequestReportsCreateOrScheduleAReportSchedule(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportSchedule { - var request catalystcentersdkgo.RequestReportsCreateOrScheduleAReportSchedule +func expandRequestReportsCreateOrScheduleAReportV1Schedule(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1Schedule { + var request catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1Schedule request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -762,16 +762,16 @@ func expandRequestReportsCreateOrScheduleAReportSchedule(ctx context.Context, ke return &request } -func expandRequestReportsCreateOrScheduleAReportView(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportView { - request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportView{} +func expandRequestReportsCreateOrScheduleAReportV1View(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1View { + request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1View{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".field_groups")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".field_groups")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".field_groups")))) { - request.FieldGroups = expandRequestReportsCreateOrScheduleAReportViewFieldGroupsArray(ctx, key+".field_groups", d) + request.FieldGroups = expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroupsArray(ctx, key+".field_groups", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".filters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".filters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".filters")))) { - request.Filters = expandRequestReportsCreateOrScheduleAReportViewFiltersArray(ctx, key+".filters", d) + request.Filters = expandRequestReportsCreateOrScheduleAReportV1ViewFiltersArray(ctx, key+".filters", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".format")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".format")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".format")))) { - request.Format = expandRequestReportsCreateOrScheduleAReportViewFormat(ctx, key+".format.0", d) + request.Format = expandRequestReportsCreateOrScheduleAReportV1ViewFormat(ctx, key+".format.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) @@ -785,8 +785,8 @@ func expandRequestReportsCreateOrScheduleAReportView(ctx context.Context, key st return &request } -func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroups { - request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroups{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroupsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroups { + request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroups{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -797,7 +797,7 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsArray(ctx context return nil } for item_no := range objs { - i := expandRequestReportsCreateOrScheduleAReportViewFieldGroups(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroups(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -808,8 +808,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsArray(ctx context return &request } -func expandRequestReportsCreateOrScheduleAReportViewFieldGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroups { - request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroups{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroups { + request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroups{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".field_group_display_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".field_group_display_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".field_group_display_name")))) { request.FieldGroupDisplayName = interfaceToString(v) } @@ -817,7 +817,7 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroups(ctx context.Cont request.FieldGroupName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".fields")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fields")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fields")))) { - request.Fields = expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFieldsArray(ctx, key+".fields", d) + request.Fields = expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFieldsArray(ctx, key+".fields", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -825,8 +825,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroups(ctx context.Cont return &request } -func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFieldsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroupsFields { - request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroupsFields{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFieldsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFields { + request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFields{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -837,7 +837,7 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFieldsArray(ctx c return nil } for item_no := range objs { - i := expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFields(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFields(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -848,8 +848,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFieldsArray(ctx c return &request } -func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFields(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroupsFields { - request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFieldGroupsFields{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFields(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFields { + request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFieldGroupsFields{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".display_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".display_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".display_name")))) { request.DisplayName = interfaceToString(v) } @@ -862,8 +862,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFieldGroupsFields(ctx contex return &request } -func expandRequestReportsCreateOrScheduleAReportViewFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFilters { - request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFilters{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFiltersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFilters { + request := []catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFilters{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -874,7 +874,7 @@ func expandRequestReportsCreateOrScheduleAReportViewFiltersArray(ctx context.Con return nil } for item_no := range objs { - i := expandRequestReportsCreateOrScheduleAReportViewFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestReportsCreateOrScheduleAReportV1ViewFilters(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -885,8 +885,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFiltersArray(ctx context.Con return &request } -func expandRequestReportsCreateOrScheduleAReportViewFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFilters { - request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFilters{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFilters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFilters { + request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFilters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".display_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".display_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".display_name")))) { request.DisplayName = interfaceToString(v) } @@ -897,7 +897,7 @@ func expandRequestReportsCreateOrScheduleAReportViewFilters(ctx context.Context, request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { - request.Value = expandRequestReportsCreateOrScheduleAReportViewFiltersValue(ctx, key+".value.0", d) + request.Value = expandRequestReportsCreateOrScheduleAReportV1ViewFiltersValue(ctx, key+".value.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -905,8 +905,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFilters(ctx context.Context, return &request } -func expandRequestReportsCreateOrScheduleAReportViewFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFiltersValue { - var request catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFiltersValue +func expandRequestReportsCreateOrScheduleAReportV1ViewFiltersValue(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFiltersValue { + var request catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFiltersValue request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -914,8 +914,8 @@ func expandRequestReportsCreateOrScheduleAReportViewFiltersValue(ctx context.Con return &request } -func expandRequestReportsCreateOrScheduleAReportViewFormat(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFormat { - request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportViewFormat{} +func expandRequestReportsCreateOrScheduleAReportV1ViewFormat(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFormat { + request := catalystcentersdkgo.RequestReportsCreateOrScheduleAReportV1ViewFormat{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".format_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".format_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".format_type")))) { request.FormatType = interfaceToString(v) } @@ -928,11 +928,11 @@ func expandRequestReportsCreateOrScheduleAReportViewFormat(ctx context.Context, return &request } -func searchReportsGetListOfScheduledReports(m interface{}, queryParams *catalystcentersdkgo.GetListOfScheduledReportsQueryParams, vName string) (*catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReports, error) { +func searchReportsGetListOfScheduledReports(m interface{}, queryParams *catalystcentersdkgo.GetListOfScheduledReportsV1QueryParams, vName string) (*catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReports - var ite *catalystcentersdkgo.ResponseReportsGetListOfScheduledReports + var foundItem *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1 + var ite *catalystcentersdkgo.ResponseReportsGetListOfScheduledReportsV1 ite, _, err = client.Reports.GetListOfScheduledReports(nil) if err != nil { return foundItem, err @@ -946,7 +946,7 @@ func searchReportsGetListOfScheduledReports(m interface{}, queryParams *catalyst for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == vName { - var getItem *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReports + var getItem *catalystcentersdkgo.ResponseItemReportsGetListOfScheduledReportsV1 getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_reserve_ip_subpool.go b/catalystcenter/resource_reserve_ip_subpool.go index 7b5c44b..4bc56c8 100644 --- a/catalystcenter/resource_reserve_ip_subpool.go +++ b/catalystcenter/resource_reserve_ip_subpool.go @@ -409,7 +409,7 @@ func resourceReserveIPSubpoolCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestReserveIPSubpoolReserveIPSubpool(ctx, "parameters.0", d) + request1 := expandRequestReserveIPSubpoolReserveIPSubpoolV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -419,7 +419,7 @@ func resourceReserveIPSubpoolCreate(ctx context.Context, d *schema.ResourceData, vName := resourceItem["name"] vvName := interfaceToString(vName) - queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolV1QueryParams{} queryParams1.SiteID = vvSiteID @@ -506,7 +506,7 @@ func resourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetReserveIPSubpool") - queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolV1QueryParams{} if okSiteID { queryParams1.SiteID = vSiteID @@ -527,17 +527,17 @@ func resourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, m } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - items := []catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponse{ + items := []catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1Response{ *response1, } - vItem1 := flattenNetworkSettingsGetReserveIPSubpoolItems(&items) + vItem1 := flattenNetworkSettingsGetReserveIPSubpoolV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetReserveIPSubpool search response", err)) return diags } - request1 := expandRequestReserveIPSubpoolReserveIPSubpool(ctx, "parameters.0", d) + request1 := expandRequestReserveIPSubpoolReserveIPSubpoolV1(ctx, "parameters.0", d) log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) updatedParameters := updateReserveIpPoolParameters(request1, response1) @@ -564,7 +564,7 @@ func resourceReserveIPSubpoolUpdate(ctx context.Context, d *schema.ResourceData, vSiteID := resourceMap["site_id"] vName := resourceMap["name"] - queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolV1QueryParams{} queryParams1.SiteID = vSiteID item, err := searchNetworkSettingsGetReserveIPSubpool(m, queryParams1, vName) if err != nil || item == nil { @@ -577,11 +577,11 @@ func resourceReserveIPSubpoolUpdate(ctx context.Context, d *schema.ResourceData, // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vSiteID) - request1 := expandRequestReserveIPSubpoolUpdateReserveIPSubpool(ctx, "parameters.0", d) + request1 := expandRequestReserveIPSubpoolUpdateReserveIPSubpoolV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } - queryParams2 := catalystcentersdkgo.UpdateReserveIPSubpoolQueryParams{} + queryParams2 := catalystcentersdkgo.UpdateReserveIPSubpoolV1QueryParams{} queryParams2.ID = item.ID response1, restyResp1, err := client.NetworkSettings.UpdateReserveIPSubpool(vSiteID, request1, &queryParams2) if err != nil || response1 == nil { @@ -648,7 +648,7 @@ func resourceReserveIPSubpoolDelete(ctx context.Context, d *schema.ResourceData, vSiteID := resourceMap["site_id"] vName := resourceMap["name"] - queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolQueryParams{} + queryParams1 := catalystcentersdkgo.GetReserveIPSubpoolV1QueryParams{} queryParams1.SiteID = vSiteID item, err := searchNetworkSettingsGetReserveIPSubpool(m, queryParams1, vName) if err != nil || item == nil { @@ -714,8 +714,8 @@ func resourceReserveIPSubpoolDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestReserveIPSubpoolReserveIPSubpool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpool { - request := catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpool{} +func expandRequestReserveIPSubpoolReserveIPSubpoolV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpoolV1 { + request := catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpoolV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -782,17 +782,13 @@ func expandRequestReserveIPSubpoolReserveIPSubpool(ctx context.Context, key stri return &request } -func expandRequestReserveIPSubpoolUpdateReserveIPSubpool(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateReserveIPSubpool { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateReserveIPSubpool{} +func expandRequestReserveIPSubpoolUpdateReserveIPSubpoolV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateReserveIPSubpoolV1 { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateReserveIPSubpoolV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv6_address_space")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv6_address_space")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv6_address_space")))) { request.IPv6AddressSpace = interfaceToBoolPtr(v) - if request.IPv6AddressSpace == nil { - defaultBool := false - request.IPv6AddressSpace = &defaultBool - } } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv4_dhcp_servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv4_dhcp_servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv4_dhcp_servers")))) { request.IPv4DhcpServers = interfaceToSliceString(v) @@ -808,22 +804,12 @@ func expandRequestReserveIPSubpoolUpdateReserveIPSubpool(ctx context.Context, ke } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv6_prefix_length")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv6_prefix_length")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv6_prefix_length")))) { request.IPv6PrefixLength = interfaceToIntPtr(v) - if request.IPv6PrefixLength != nil { - if *request.IPv6PrefixLength == 0 { - request.IPv6PrefixLength = nil - } - } } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv6_subnet")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv6_subnet")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv6_subnet")))) { request.IPv6Subnet = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv6_total_host")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv6_total_host")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv6_total_host")))) { request.IPv6TotalHost = interfaceToIntPtr(v) - if request.IPv6TotalHost != nil { - if *request.IPv6TotalHost == 0 { - request.IPv6TotalHost = nil - } - } } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv6_gate_way")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv6_gate_way")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv6_gate_way")))) { request.IPv6GateWay = interfaceToString(v) @@ -837,20 +823,20 @@ func expandRequestReserveIPSubpoolUpdateReserveIPSubpool(ctx context.Context, ke if v, ok := d.GetOkExists(fixKeyAccess(key + ".slaac_support")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".slaac_support")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".slaac_support")))) { request.SLAacSupport = interfaceToBoolPtr(v) } - // if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv4_gate_way")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv4_gate_way")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv4_gate_way")))) { - // request.IPv4GateWay = interfaceToString(v) - // } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".ipv4_gate_way")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ipv4_gate_way")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ipv4_gate_way")))) { + request.IPv4GateWay = interfaceToString(v) + } if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func searchNetworkSettingsGetReserveIPSubpool(m interface{}, queryParams catalystcentersdkgo.GetReserveIPSubpoolQueryParams, vName string) (*catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponse, error) { +func searchNetworkSettingsGetReserveIPSubpool(m interface{}, queryParams catalystcentersdkgo.GetReserveIPSubpoolV1QueryParams, vName string) (*catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponse - var nResponse *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpool + var foundItem *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1Response + var nResponse *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1 maxPageSize := 500 offset := 1 queryParams.Offset = float64(offset) @@ -887,10 +873,10 @@ func searchNetworkSettingsGetReserveIPSubpool(m interface{}, queryParams catalys return foundItem, err } -func updateReserveIpPoolParameters(request *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpool, response *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponse) *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpool { +func updateReserveIpPoolParameters(request *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpoolV1, response *catalystcentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolV1Response) *catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpoolV1 { log.Printf("IPPOOLREQUEST %s", responseInterfaceToString(request)) if request == nil { - request = &catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpool{} + request = &catalystcentersdkgo.RequestNetworkSettingsReserveIPSubpoolV1{} } for _, v := range *response.IPPools { log.Printf("IPPOOL %s", responseInterfaceToString(v)) diff --git a/catalystcenter/resource_sda_anycast_gateways_create.go b/catalystcenter/resource_sda_anycast_gateways_create.go index 454c7e4..6738644 100644 --- a/catalystcenter/resource_sda_anycast_gateways_create.go +++ b/catalystcenter/resource_sda_anycast_gateways_create.go @@ -64,7 +64,7 @@ func resourceSdaAnycastGatewaysCreate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSdaAddAnycastGateways`, + Description: `Array of RequestSdaAddAnycastGatewaysV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -248,20 +248,18 @@ func resourceSdaAnycastGatewaysCreateCreate(ctx context.Context, d *schema.Resou client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSdaAnycastGatewaysCreateAddAnycastGateways(ctx, "parameters.0", d) + request1 := expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sda.AddAnycastGateways(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sda.AddAnycastGatewaysV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AddAnycastGateways", err)) + "Failure when executing AddAnycastGatewaysV1", err)) return diags } @@ -269,7 +267,7 @@ func resourceSdaAnycastGatewaysCreateCreate(ctx context.Context, d *schema.Resou if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing AddAnycastGateways", err)) + "Failure when executing AddAnycastGatewaysV1", err)) return diags } taskId := response1.Response.TaskID @@ -303,22 +301,24 @@ func resourceSdaAnycastGatewaysCreateCreate(ctx context.Context, d *schema.Resou } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing AddAnycastGateways", err1)) + "Failure when executing AddAnycastGatewaysV1", err1)) return diags } } - vItem1 := flattenSdaAddAnycastGatewaysItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSdaAddAnycastGatewaysV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AddAnycastGateways response", + "Failure when setting AddAnycastGatewaysV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaAnycastGatewaysCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -333,16 +333,16 @@ func resourceSdaAnycastGatewaysCreateDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestSdaAnycastGatewaysCreateAddAnycastGateways(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddAnycastGateways { - request := catalystcentersdkgo.RequestSdaAddAnycastGateways{} - if v := expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddAnycastGatewaysV1 { + request := catalystcentersdkgo.RequestSdaAddAnycastGatewaysV1{} + if v := expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddAnycastGateways { - request := []catalystcentersdkgo.RequestItemSdaAddAnycastGateways{} +func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddAnycastGatewaysV1 { + request := []catalystcentersdkgo.RequestItemSdaAddAnycastGatewaysV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -353,7 +353,7 @@ func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItemArray(ctx contex return nil } for item_no := range objs { - i := expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -361,8 +361,8 @@ func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItemArray(ctx contex return &request } -func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddAnycastGateways { - request := catalystcentersdkgo.RequestItemSdaAddAnycastGateways{} +func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddAnycastGatewaysV1 { + request := catalystcentersdkgo.RequestItemSdaAddAnycastGatewaysV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_id")))) { request.FabricID = interfaceToString(v) } @@ -420,7 +420,7 @@ func expandRequestSdaAnycastGatewaysCreateAddAnycastGatewaysItem(ctx context.Con return &request } -func flattenSdaAddAnycastGatewaysItem(item *catalystcentersdkgo.ResponseSdaAddAnycastGatewaysResponse) []map[string]interface{} { +func flattenSdaAddAnycastGatewaysV1Item(item *catalystcentersdkgo.ResponseSdaAddAnycastGatewaysV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_anycast_gateways_delete.go b/catalystcenter/resource_sda_anycast_gateways_delete.go index a71e4e6..4108a96 100644 --- a/catalystcenter/resource_sda_anycast_gateways_delete.go +++ b/catalystcenter/resource_sda_anycast_gateways_delete.go @@ -84,14 +84,16 @@ func resourceSdaAnycastGatewaysDeleteCreate(ctx context.Context, d *schema.Resou vvID := vID.(string) - response1, restyResp1, err := client.Sda.DeleteAnycastGatewayByID(vvID) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.DeleteAnycastGatewayByIDV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeleteAnycastGatewayByID", err)) + "Failure when executing DeleteAnycastGatewayByIDV1", err)) return diags } @@ -99,7 +101,7 @@ func resourceSdaAnycastGatewaysDeleteCreate(ctx context.Context, d *schema.Resou if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing DeleteAnycastGatewayById", err)) + "Failure when executing DeleteAnycastGatewayByIdV1", err)) return diags } taskId := response1.Response.TaskID @@ -133,22 +135,20 @@ func resourceSdaAnycastGatewaysDeleteCreate(ctx context.Context, d *schema.Resou } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing DeleteAnycastGatewayById", err1)) + "Failure when executing DeleteAnycastGatewayByIdV1", err1)) return diags } } - - vItem1 := flattenSdaDeleteAnycastGatewayByIDItem(response1.Response) + vItem1 := flattenSdaDeleteAnycastGatewayByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeleteAnycastGatewayByID response", + "Failure when setting DeleteAnycastGatewayByIDV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaAnycastGatewaysDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -163,7 +163,7 @@ func resourceSdaAnycastGatewaysDeleteDelete(ctx context.Context, d *schema.Resou return diags } -func flattenSdaDeleteAnycastGatewayByIDItem(item *catalystcentersdkgo.ResponseSdaDeleteAnycastGatewayByIDResponse) []map[string]interface{} { +func flattenSdaDeleteAnycastGatewayByIDV1Item(item *catalystcentersdkgo.ResponseSdaDeleteAnycastGatewayByIDV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_anycast_gateways_update.go b/catalystcenter/resource_sda_anycast_gateways_update.go index 61e1e41..b446127 100644 --- a/catalystcenter/resource_sda_anycast_gateways_update.go +++ b/catalystcenter/resource_sda_anycast_gateways_update.go @@ -64,7 +64,7 @@ func resourceSdaAnycastGatewaysUpdate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSdaUpdateAnycastGateways`, + Description: `Array of RequestSdaUpdateAnycastGatewaysV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -246,20 +246,18 @@ func resourceSdaAnycastGatewaysUpdateCreate(ctx context.Context, d *schema.Resou client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGateways(ctx, "parameters.0", d) + request1 := expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sda.UpdateAnycastGateways(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sda.UpdateAnycastGatewaysV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateAnycastGateways", err)) + "Failure when executing UpdateAnycastGatewaysV1", err)) return diags } @@ -267,7 +265,7 @@ func resourceSdaAnycastGatewaysUpdateCreate(ctx context.Context, d *schema.Resou if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateAnycastGateways", err)) + "Failure when executing UpdateAnycastGatewaysV1", err)) return diags } taskId := response1.Response.TaskID @@ -301,22 +299,24 @@ func resourceSdaAnycastGatewaysUpdateCreate(ctx context.Context, d *schema.Resou } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateAnycastGateways", err1)) + "Failure when executing UpdateAnycastGatewaysV1", err1)) return diags } } - vItem1 := flattenSdaUpdateAnycastGatewaysItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSdaUpdateAnycastGatewaysV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateAnycastGateways response", + "Failure when setting UpdateAnycastGatewaysV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaAnycastGatewaysUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -331,16 +331,16 @@ func resourceSdaAnycastGatewaysUpdateDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGateways(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateAnycastGateways { - request := catalystcentersdkgo.RequestSdaUpdateAnycastGateways{} - if v := expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateAnycastGatewaysV1 { + request := catalystcentersdkgo.RequestSdaUpdateAnycastGatewaysV1{} + if v := expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateAnycastGateways { - request := []catalystcentersdkgo.RequestItemSdaUpdateAnycastGateways{} +func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateAnycastGatewaysV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateAnycastGatewaysV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -351,7 +351,7 @@ func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItemArray(ctx con return nil } for item_no := range objs { - i := expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -359,8 +359,8 @@ func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItemArray(ctx con return &request } -func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateAnycastGateways { - request := catalystcentersdkgo.RequestItemSdaUpdateAnycastGateways{} +func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateAnycastGatewaysV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateAnycastGatewaysV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -418,7 +418,7 @@ func expandRequestSdaAnycastGatewaysUpdateUpdateAnycastGatewaysItem(ctx context. return &request } -func flattenSdaUpdateAnycastGatewaysItem(item *catalystcentersdkgo.ResponseSdaUpdateAnycastGatewaysResponse) []map[string]interface{} { +func flattenSdaUpdateAnycastGatewaysV1Item(item *catalystcentersdkgo.ResponseSdaUpdateAnycastGatewaysV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_authentication_profiles.go b/catalystcenter/resource_sda_authentication_profiles.go index 20b54dc..ca4706d 100644 --- a/catalystcenter/resource_sda_authentication_profiles.go +++ b/catalystcenter/resource_sda_authentication_profiles.go @@ -202,7 +202,7 @@ func resourceSdaAuthenticationProfilesRead(ctx context.Context, d *schema.Resour selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetAuthenticationProfiles") - queryParams1 := catalystcentersdkgo.GetAuthenticationProfilesQueryParams{} + queryParams1 := catalystcentersdkgo.GetAuthenticationProfilesV1QueryParams{} queryParams1.AuthenticationProfileName = vvName @@ -213,10 +213,10 @@ func resourceSdaAuthenticationProfilesRead(ctx context.Context, d *schema.Resour } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesResponse{ + items := []catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesV1Response{ *item1, } - vItem1 := flattenSdaGetAuthenticationProfilesItems(&items) + vItem1 := flattenSdaGetAuthenticationProfilesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetAuthenticationProfiles search response", @@ -301,9 +301,9 @@ func resourceSdaAuthenticationProfilesDelete(ctx context.Context, d *schema.Reso "Failure at SdaAuthenticationProfilesDelete, unexpected response", "")) return diags } -func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateAuthenticationProfile { - request := catalystcentersdkgo.RequestSdaUpdateAuthenticationProfile{} - if v := expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateAuthenticationProfileV1 { + request := catalystcentersdkgo.RequestSdaUpdateAuthenticationProfileV1{} + if v := expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -312,8 +312,8 @@ func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfile(ctx conte return &request } -func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfile { - request := []catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfile{} +func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfileV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfileV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -324,7 +324,7 @@ func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItemArray( return nil } for item_no := range objs { - i := expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -335,8 +335,8 @@ func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItemArray( return &request } -func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfile { - request := catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfile{} +func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfileV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateAuthenticationProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -367,11 +367,11 @@ func expandRequestSdaAuthenticationProfilesUpdateAuthenticationProfileItem(ctx c return &request } -func searchSdaGetAuthenticationProfiles(m interface{}, queryParams catalystcentersdkgo.GetAuthenticationProfilesQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesResponse, error) { +func searchSdaGetAuthenticationProfiles(m interface{}, queryParams catalystcentersdkgo.GetAuthenticationProfilesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesResponse - var ite *catalystcentersdkgo.ResponseSdaGetAuthenticationProfiles + var foundItem *catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesV1Response + var ite *catalystcentersdkgo.ResponseSdaGetAuthenticationProfilesV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetAuthenticationProfiles(nil) diff --git a/catalystcenter/resource_sda_extranet_policies.go b/catalystcenter/resource_sda_extranet_policies.go index 636f1f4..e65bab9 100644 --- a/catalystcenter/resource_sda_extranet_policies.go +++ b/catalystcenter/resource_sda_extranet_policies.go @@ -158,14 +158,14 @@ func resourceSdaExtranetPoliciesCreate(ctx context.Context, d *schema.ResourceDa var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaExtranetPoliciesAddExtranetPolicy(ctx, "parameters.0", d) + request1 := expandRequestSdaExtranetPoliciesAddExtranetPolicyV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] vvID := interfaceToString(vID) vExtranetPolicyName := resourceItem["extranet_policy_name"] vvExtranetPolicyName := interfaceToString(vExtranetPolicyName) - queryParamImport := catalystcentersdkgo.GetExtranetPoliciesQueryParams{} + queryParamImport := catalystcentersdkgo.GetExtranetPoliciesV1QueryParams{} queryParamImport.ExtranetPolicyName = vvExtranetPolicyName item2, err := searchSdaGetExtranetPolicies(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -214,7 +214,7 @@ func resourceSdaExtranetPoliciesCreate(ctx context.Context, d *schema.ResourceDa return diags } } - queryParamValidate := catalystcentersdkgo.GetExtranetPoliciesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetExtranetPoliciesV1QueryParams{} queryParamValidate.ExtranetPolicyName = vvExtranetPolicyName item3, err := searchSdaGetExtranetPolicies(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -242,7 +242,7 @@ func resourceSdaExtranetPoliciesRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetExtranetPolicies") - queryParams1 := catalystcentersdkgo.GetExtranetPoliciesQueryParams{} + queryParams1 := catalystcentersdkgo.GetExtranetPoliciesV1QueryParams{} queryParams1.ExtranetPolicyName = vvName item1, err := searchSdaGetExtranetPolicies(m, queryParams1, vvID) if err != nil || item1 == nil { @@ -250,11 +250,11 @@ func resourceSdaExtranetPoliciesRead(ctx context.Context, d *schema.ResourceData return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetExtranetPoliciesResponse{ + items := []catalystcentersdkgo.ResponseSdaGetExtranetPoliciesV1Response{ *item1, } - vItem1 := flattenSdaGetExtranetPoliciesItems(&items) + vItem1 := flattenSdaGetExtranetPoliciesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetExtranetPolicies search response", @@ -274,7 +274,7 @@ func resourceSdaExtranetPoliciesUpdate(ctx context.Context, d *schema.ResourceDa resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaExtranetPoliciesUpdateExtranetPolicy(ctx, "parameters.0", d) + request1 := expandRequestSdaExtranetPoliciesUpdateExtranetPolicyV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -389,9 +389,9 @@ func resourceSdaExtranetPoliciesDelete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestSdaExtranetPoliciesAddExtranetPolicy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddExtranetPolicy { - request := catalystcentersdkgo.RequestSdaAddExtranetPolicy{} - if v := expandRequestSdaExtranetPoliciesAddExtranetPolicyItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaExtranetPoliciesAddExtranetPolicyV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddExtranetPolicyV1 { + request := catalystcentersdkgo.RequestSdaAddExtranetPolicyV1{} + if v := expandRequestSdaExtranetPoliciesAddExtranetPolicyV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -400,8 +400,8 @@ func expandRequestSdaExtranetPoliciesAddExtranetPolicy(ctx context.Context, key return &request } -func expandRequestSdaExtranetPoliciesAddExtranetPolicyItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddExtranetPolicy { - request := []catalystcentersdkgo.RequestItemSdaAddExtranetPolicy{} +func expandRequestSdaExtranetPoliciesAddExtranetPolicyV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddExtranetPolicyV1 { + request := []catalystcentersdkgo.RequestItemSdaAddExtranetPolicyV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -412,7 +412,7 @@ func expandRequestSdaExtranetPoliciesAddExtranetPolicyItemArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestSdaExtranetPoliciesAddExtranetPolicyItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaExtranetPoliciesAddExtranetPolicyV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -423,8 +423,8 @@ func expandRequestSdaExtranetPoliciesAddExtranetPolicyItemArray(ctx context.Cont return &request } -func expandRequestSdaExtranetPoliciesAddExtranetPolicyItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddExtranetPolicy { - request := catalystcentersdkgo.RequestItemSdaAddExtranetPolicy{} +func expandRequestSdaExtranetPoliciesAddExtranetPolicyV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddExtranetPolicyV1 { + request := catalystcentersdkgo.RequestItemSdaAddExtranetPolicyV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".extranet_policy_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".extranet_policy_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".extranet_policy_name")))) { request.ExtranetPolicyName = interfaceToString(v) } @@ -443,9 +443,9 @@ func expandRequestSdaExtranetPoliciesAddExtranetPolicyItem(ctx context.Context, return &request } -func expandRequestSdaExtranetPoliciesUpdateExtranetPolicy(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateExtranetPolicy { - request := catalystcentersdkgo.RequestSdaUpdateExtranetPolicy{} - if v := expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateExtranetPolicyV1 { + request := catalystcentersdkgo.RequestSdaUpdateExtranetPolicyV1{} + if v := expandRequestSdaExtranetPoliciesUpdateExtranetPolicyV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -454,8 +454,8 @@ func expandRequestSdaExtranetPoliciesUpdateExtranetPolicy(ctx context.Context, k return &request } -func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicy { - request := []catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicy{} +func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicyV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicyV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -466,7 +466,7 @@ func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItemArray(ctx context.C return nil } for item_no := range objs { - i := expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaExtranetPoliciesUpdateExtranetPolicyV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -477,8 +477,8 @@ func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItemArray(ctx context.C return &request } -func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicy { - request := catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicy{} +func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicyV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateExtranetPolicyV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -500,10 +500,10 @@ func expandRequestSdaExtranetPoliciesUpdateExtranetPolicyItem(ctx context.Contex return &request } -func searchSdaGetExtranetPolicies(m interface{}, queryParams catalystcentersdkgo.GetExtranetPoliciesQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetExtranetPoliciesResponse, error) { +func searchSdaGetExtranetPolicies(m interface{}, queryParams catalystcentersdkgo.GetExtranetPoliciesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetExtranetPoliciesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetExtranetPoliciesResponse + var foundItem *catalystcentersdkgo.ResponseSdaGetExtranetPoliciesV1Response ite, _, err := client.Sda.GetExtranetPolicies(&queryParams) if err != nil || ite == nil { diff --git a/catalystcenter/resource_sda_fabric_authentication_profile.go b/catalystcenter/resource_sda_fabric_authentication_profile.go index 772e442..19d465c 100644 --- a/catalystcenter/resource_sda_fabric_authentication_profile.go +++ b/catalystcenter/resource_sda_fabric_authentication_profile.go @@ -103,73 +103,56 @@ func resourceSdaFabricAuthenticationProfile() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddDefaultAuthenticationTemplateInSDAFabric`, + Description: `Array of RequestSdaAddDefaultAuthenticationTemplateInSDAFabricV1`, Type: schema.TypeList, - Required: true, - MaxItems: 1, - MinItems: 1, + Optional: true, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "payload": &schema.Schema{ - Description: `Array of RequestApplicationPolicyCreateApplication`, - Type: schema.TypeList, - Required: true, - MinItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "authenticate_template_name": &schema.Schema{ - Description: `Authenticate Template Name + + "authenticate_template_name": &schema.Schema{ + Description: `Authenticate Template Name `, - Type: schema.TypeString, - Optional: true, - DiffSuppressFunc: diffSupressOptional(), - Computed: true, - }, - "authentication_order": &schema.Schema{ - Description: `Authentication Order + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "authentication_order": &schema.Schema{ + Description: `Authentication Order `, - Type: schema.TypeString, - Optional: true, - DiffSuppressFunc: diffSupressOptional(), - Computed: true, - }, - "dot1x_to_mab_fallback_timeout": &schema.Schema{ - Description: `Dot1x To MabFallback Timeout( Allowed range is [3-120]) + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "dot1x_to_mab_fallback_timeout": &schema.Schema{ + Description: `Dot1x To MabFallback Timeout( Allowed range is [3-120]) `, - Type: schema.TypeString, - Optional: true, - DiffSuppressFunc: diffSupressOptional(), - Computed: true, - }, - "number_of_hosts": &schema.Schema{ - Description: `Number Of Hosts + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "number_of_hosts": &schema.Schema{ + Description: `Number Of Hosts `, - Type: schema.TypeString, - Optional: true, - DiffSuppressFunc: diffSupressOptional(), - Computed: true, - }, - "site_name_hierarchy": &schema.Schema{ - Description: `Path of sda Fabric Site + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "site_name_hierarchy": &schema.Schema{ + Description: `Path of sda Fabric Site `, - Type: schema.TypeString, - Optional: true, - DiffSuppressFunc: diffSupressOptional(), - Computed: true, - }, - "wake_on_lan": &schema.Schema{ - Description: `Wake On Lan + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "wake_on_lan": &schema.Schema{ + Description: `Wake On Lan `, - // Type: schema.TypeBool, - Type: schema.TypeString, - ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), - Optional: true, - DiffSuppressFunc: diffSupressOptional(), - Computed: true, - }, - }, - }, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, }, }, }, @@ -183,34 +166,30 @@ func resourceSdaFabricAuthenticationProfileCreate(ctx context.Context, d *schema var diags diag.Diagnostics - resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabric(ctx, "parameters.0", d) + resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricV1(ctx, "parameters", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSiteNameHierarchy := resourceItem["site_name_hierarchy"] vvSiteNameHierarchy := interfaceToString(vSiteNameHierarchy) - vAuthenticateTemplateName := resourceItem["authenticate_template_name"] - vvAuthenticateTemplateName := interfaceToString(vAuthenticateTemplateName) - queryParamImport := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricV1QueryParams{} queryParamImport.SiteNameHierarchy = vvSiteNameHierarchy - queryParamImport.AuthenticateTemplateName = vvAuthenticateTemplateName - item2, _, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["site_name_hierarchy"] = item2.SiteNameHierarchy - resourceMap["authenticate_template_name"] = vvAuthenticateTemplateName d.SetId(joinResourceID(resourceMap)) return resourceSdaFabricAuthenticationProfileRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddDefaultAuthenticationTemplateInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddDefaultAuthenticationTemplateInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddDefaultAuthenticationTemplateInSdaFabric", err, restyResp1.String())) + "Failure when executing AddDefaultAuthenticationTemplateInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddDefaultAuthenticationTemplateInSdaFabric", err)) + "Failure when executing AddDefaultAuthenticationTemplateInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -227,7 +206,7 @@ func resourceSdaFabricAuthenticationProfileCreate(ctx context.Context, d *schema "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -240,17 +219,26 @@ func resourceSdaFabricAuthenticationProfileCreate(ctx context.Context, d *schema return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddDefaultAuthenticationTemplateInSdaFabric", err)) + "Failure when executing AddDefaultAuthenticationTemplateInSdaFabricV1", err)) return diags } } + queryParamValidate := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricV1QueryParams{} + queryParamValidate.SiteNameHierarchy = vvSiteNameHierarchy + item3, _, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabricV1(&queryParamValidate) + if err != nil || item3 == nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing AddDefaultAuthenticationTemplateInSdaFabricV1", err, + "Failure at AddDefaultAuthenticationTemplateInSdaFabricV1, unexpected response", "")) + return diags + } resourceMap := make(map[string]string) - resourceMap["site_name_hierarchy"] = vvSiteNameHierarchy - resourceMap["authenticate_template_name"] = vvAuthenticateTemplateName + resourceMap["site_name_hierarchy"] = item3.SiteNameHierarchy + d.SetId(joinResourceID(resourceMap)) return resourceSdaFabricAuthenticationProfileRead(ctx, d, m) } @@ -264,16 +252,17 @@ func resourceSdaFabricAuthenticationProfileRead(ctx context.Context, d *schema.R resourceMap := separateResourceID(resourceID) vSiteNameHierarchy := resourceMap["site_name_hierarchy"] - vAuthenticateTemplateName := resourceMap["authenticate_template_name"] selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetDefaultAuthenticationProfileFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetDefaultAuthenticationProfileFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy - queryParams1.AuthenticateTemplateName = vAuthenticateTemplateName - response1, restyResp1, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabric(&queryParams1) + + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -285,22 +274,14 @@ func resourceSdaFabricAuthenticationProfileRead(ctx context.Context, d *schema.R log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetDefaultAuthenticationProfileFromSdaFabricItem(response1) + vItem1 := flattenSdaGetDefaultAuthenticationProfileFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetDefaultAuthenticationProfileFromSdaFabric response", + "Failure when setting GetDefaultAuthenticationProfileFromSdaFabricV1 response", err)) return diags } - vItem2 := flattenSdaGetDefaultAuthenticationProfileFromSdaFabricPayload(response1) - - if err := d.Set("parameters", vItem2); err != nil { - diags = append(diags, diagError( - "Failure when setting GetDefaultAuthenticationProfileFromSdaFabric response", - err)) - return diags - } return diags } @@ -311,21 +292,22 @@ func resourceSdaFabricAuthenticationProfileUpdate(ctx context.Context, d *schema client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics + if d.HasChange("parameters") { - request1 := expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricV1(ctx, "parameters", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - response1, restyResp1, err := client.Sda.UpdateDefaultAuthenticationProfileInSdaFabric(request1) + response1, restyResp1, err := client.Sda.UpdateDefaultAuthenticationProfileInSdaFabricV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing UpdateDefaultAuthenticationProfileInSdaFabric", err, restyResp1.String(), - "Failure at UpdateDefaultAuthenticationProfileInSdaFabric, unexpected response", "")) + "Failure when executing UpdateDefaultAuthenticationProfileInSdaFabricV1", err, restyResp1.String(), + "Failure at UpdateDefaultAuthenticationProfileInSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing UpdateDefaultAuthenticationProfileInSdaFabric", err, - "Failure at UpdateDefaultAuthenticationProfileInSdaFabric, unexpected response", "")) + "Failure when executing UpdateDefaultAuthenticationProfileInSdaFabricV1", err, + "Failure at UpdateDefaultAuthenticationProfileInSdaFabricV1, unexpected response", "")) return diags } @@ -343,7 +325,7 @@ func resourceSdaFabricAuthenticationProfileUpdate(ctx context.Context, d *schema "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -356,10 +338,10 @@ func resourceSdaFabricAuthenticationProfileUpdate(ctx context.Context, d *schema return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing UpdateDefaultAuthenticationProfileInSdaFabric", err)) + "Failure when executing UpdateDefaultAuthenticationProfileInSdaFabricV1", err)) return diags } } @@ -377,40 +359,24 @@ func resourceSdaFabricAuthenticationProfileDelete(ctx context.Context, d *schema resourceID := d.Id() resourceMap := separateResourceID(resourceID) - vSiteNameHierarchy := resourceMap["site_name_hierarchy"] - vAuthenticateTemplateName := resourceMap["authenticate_template_name"] - queryParams1 := catalystcentersdkgo.GetDefaultAuthenticationProfileFromSdaFabricQueryParams{} - queryParams1.SiteNameHierarchy = vSiteNameHierarchy - queryParams1.AuthenticateTemplateName = vAuthenticateTemplateName - item, restyResp1, err := client.Sda.GetDefaultAuthenticationProfileFromSdaFabric(&queryParams1) - - if err != nil || item == nil { - if restyResp1 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) - } - d.SetId("") - return diags - } + queryParamDelete := catalystcentersdkgo.DeleteDefaultAuthenticationProfileFromSdaFabricV1QueryParams{} - response2 := *item - // response2 := responseArray[0] - vvName := response2.SiteNameHierarchy + vvSiteNameHierarchy := resourceMap["site_name_hierarchy"] + queryParamDelete.SiteNameHierarchy = vvSiteNameHierarchy - queryParams2 := catalystcentersdkgo.DeleteDefaultAuthenticationProfileFromSdaFabricQueryParams{} - queryParams2.SiteNameHierarchy = vvName - response1, restyResp1, err := client.Sda.DeleteDefaultAuthenticationProfileFromSdaFabric(&queryParams2) + response1, restyResp1, err := client.Sda.DeleteDefaultAuthenticationProfileFromSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteDefaultAuthenticationProfileFromSdaFabric", err, restyResp1.String(), - "Failure at DeleteDefaultAuthenticationProfileFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteDefaultAuthenticationProfileFromSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteDefaultAuthenticationProfileFromSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteDefaultAuthenticationProfileFromSdaFabric", err, - "Failure at DeleteDefaultAuthenticationProfileFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteDefaultAuthenticationProfileFromSdaFabricV1", err, + "Failure at DeleteDefaultAuthenticationProfileFromSdaFabricV1, unexpected response", "")) return diags } @@ -428,7 +394,7 @@ func resourceSdaFabricAuthenticationProfileDelete(ctx context.Context, d *schema "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -441,10 +407,10 @@ func resourceSdaFabricAuthenticationProfileDelete(ctx context.Context, d *schema return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteDefaultAuthenticationProfileFromSdaFabric", err)) + "Failure when executing DeleteDefaultAuthenticationProfileFromSdaFabricV1", err)) return diags } } @@ -455,9 +421,9 @@ func resourceSdaFabricAuthenticationProfileDelete(ctx context.Context, d *schema return diags } -func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddDefaultAuthenticationTemplateInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddDefaultAuthenticationTemplateInSdaFabric{} - if v := expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddDefaultAuthenticationTemplateInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddDefaultAuthenticationTemplateInSdaFabricV1{} + if v := expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -466,8 +432,8 @@ func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplate return &request } -func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabric { - request := []catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabric{} +func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabricV1 { + request := []catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabricV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -478,7 +444,7 @@ func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplate return nil } for item_no := range objs { - i := expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -489,8 +455,8 @@ func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplate return &request } -func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabric { - request := catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabric{} +func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplateInSdaFabricV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabricV1 { + request := catalystcentersdkgo.RequestItemSdaAddDefaultAuthenticationTemplateInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } @@ -503,9 +469,9 @@ func expandRequestSdaFabricAuthenticationProfileAddDefaultAuthenticationTemplate return &request } -func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateDefaultAuthenticationProfileInSdaFabric { - request := catalystcentersdkgo.RequestSdaUpdateDefaultAuthenticationProfileInSdaFabric{} - if v := expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateDefaultAuthenticationProfileInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaUpdateDefaultAuthenticationProfileInSdaFabricV1{} + if v := expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -514,8 +480,8 @@ func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfi return &request } -func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabric { - request := []catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabric{} +func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabricV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabricV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -526,7 +492,7 @@ func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfi return nil } for item_no := range objs { - i := expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -537,8 +503,8 @@ func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfi return &request } -func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabric { - request := catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabric{} +func expandRequestSdaFabricAuthenticationProfileUpdateDefaultAuthenticationProfileInSdaFabricV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabricV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateDefaultAuthenticationProfileInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_fabric_border_device.go b/catalystcenter/resource_sda_fabric_border_device.go index 55237d9..047ba67 100644 --- a/catalystcenter/resource_sda_fabric_border_device.go +++ b/catalystcenter/resource_sda_fabric_border_device.go @@ -2,7 +2,6 @@ package catalystcenter import ( "context" - "errors" "fmt" "reflect" "time" @@ -698,105 +697,129 @@ func resourceSdaFabricBorderDevice() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddBorderDeviceInSDAFabric`, + Description: `Array of RequestSdaAddBorderDeviceInSDAFabricV1`, Type: schema.TypeList, Optional: true, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "payload": &schema.Schema{ - Description: `Array of RequestApplicationPolicyCreateApplication`, - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "border_priority": &schema.Schema{ - Description: `Border priority associated with a given device. Allowed range for Border Priority is [1-9]. A lower value indicates higher priority. E.g., a priority of 1 takes precedence over 5. Default priority would be set to 10. + "border_priority": &schema.Schema{ + Description: `Border priority associated with a given device. Allowed range for Border Priority is [1-9]. A lower value indicates higher priority. E.g., a priority of 1 takes precedence over 5. Default priority would be set to 10. `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "border_session_type": &schema.Schema{ - Description: `Border Session Type + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "border_session_type": &schema.Schema{ + Description: `Border Session Type `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "border_with_external_connectivity": &schema.Schema{ - Description: `Border With External Connectivity (Note: True for transit and False for non-transit border) + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "border_with_external_connectivity": &schema.Schema{ + Description: `Border With External Connectivity (Note: True for transit and False for non-transit border) `, - // Type: schema.TypeBool, - Type: schema.TypeString, - ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), - Optional: true, - Computed: true, - }, - "connected_to_internet": &schema.Schema{ - Description: `Connected to Internet + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "connected_to_internet": &schema.Schema{ + Description: `Connected to Internet `, - // Type: schema.TypeBool, - Type: schema.TypeString, - ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), - Optional: true, - Computed: true, - }, - "device_management_ip_address": &schema.Schema{ - Description: `Management Ip Address of the provisioned Device + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + Computed: true, + }, + "device_management_ip_address": &schema.Schema{ + Description: `Management Ip Address of the provisioned Device +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "device_role": &schema.Schema{ + Description: `Supported Device Roles in SD-Access fabric. Allowed roles are "Border_Node","Control_Plane_Node","Edge_Node". E.g. ["Border_Node"] or ["Border_Node", "Control_Plane_Node"] or ["Border_Node", "Control_Plane_Node","Edge_Node"] +`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "external_connectivity_ip_pool_name": &schema.Schema{ + Description: `External Connectivity IpPool Name +`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "external_connectivity_settings": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "external_autonomou_system_number": &schema.Schema{ + Description: `External Autonomous System Number peer (e.g.,1-65535) `, Type: schema.TypeString, Optional: true, Computed: true, }, - "device_role": &schema.Schema{ - Description: `Supported Device Roles in SD-Access fabric. Allowed roles are "Border_Node","Control_Plane_Node","Edge_Node". E.g. ["Border_Node"] or ["Border_Node", "Control_Plane_Node"] or ["Border_Node", "Control_Plane_Node","Edge_Node"] + "interface_description": &schema.Schema{ + Description: `Interface Description `, - Type: schema.TypeList, + Type: schema.TypeString, Optional: true, Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, }, - "external_connectivity_ip_pool_name": &schema.Schema{ - Description: `External Connectivity IpPool Name + "interface_name": &schema.Schema{ + Description: `Interface Name `, Type: schema.TypeString, Optional: true, Computed: true, }, - "external_connectivity_settings": &schema.Schema{ + "l2_handoff": &schema.Schema{ Type: schema.TypeList, Optional: true, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "external_autonomou_system_number": &schema.Schema{ - Description: `External Autonomous System Number peer (e.g.,1-65535) -`, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "interface_description": &schema.Schema{ - Description: `Interface Description + "virtual_network_name": &schema.Schema{ + Description: `Virtual Network Name, that is associated to Fabric Site `, Type: schema.TypeString, Optional: true, Computed: true, }, - "interface_name": &schema.Schema{ - Description: `Interface Name + "vlan_name": &schema.Schema{ + Description: `Vlan Name of L2 Handoff `, Type: schema.TypeString, Optional: true, Computed: true, }, - "l2_handoff": &schema.Schema{ + }, + }, + }, + "l3_handoff": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "virtual_network": &schema.Schema{ Type: schema.TypeList, Optional: true, Computed: true, @@ -810,8 +833,8 @@ func resourceSdaFabricBorderDevice() *schema.Resource { Optional: true, Computed: true, }, - "vlan_name": &schema.Schema{ - Description: `Vlan Name of L2 Handoff + "vlan_id": &schema.Schema{ + Description: `Vlan Id (e.g.,2-4096 except for reserved VLANs (1002-1005, 2046, 4095)) `, Type: schema.TypeString, Optional: true, @@ -820,80 +843,46 @@ func resourceSdaFabricBorderDevice() *schema.Resource { }, }, }, - "l3_handoff": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "virtual_network": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "virtual_network_name": &schema.Schema{ - Description: `Virtual Network Name, that is associated to Fabric Site -`, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "vlan_id": &schema.Schema{ - Description: `Vlan Id (e.g.,2-4096 except for reserved VLANs (1002-1005, 2046, 4095)) -`, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - }, - }, - }, - }, - }, }, }, }, - "external_domain_routing_protocol_name": &schema.Schema{ - Description: `External Domain Routing Protocol Name + }, + }, + }, + "external_domain_routing_protocol_name": &schema.Schema{ + Description: `External Domain Routing Protocol Name `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "internal_autonomou_system_number": &schema.Schema{ - Description: `Internal Autonomous System Number + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "internal_autonomou_system_number": &schema.Schema{ + Description: `Internal Autonomous System Number `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "route_distribution_protocol": &schema.Schema{ - Description: `Route Distribution Protocol for Control Plane Device. Allowed values are "LISP_BGP" or "LISP_PUB_SUB". Default value is "LISP_BGP" + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "route_distribution_protocol": &schema.Schema{ + Description: `Route Distribution Protocol for Control Plane Device. Allowed values are "LISP_BGP" or "LISP_PUB_SUB". Default value is "LISP_BGP" `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "sda_transit_network_name": &schema.Schema{ - Description: `SD-Access Transit Network Name + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "sda_transit_network_name": &schema.Schema{ + Description: `SD-Access Transit Network Name `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "site_name_hierarchy": &schema.Schema{ - Description: `Site Name Hierarchy of provisioned Device(site should be part of Fabric Site) + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "site_name_hierarchy": &schema.Schema{ + Description: `Site Name Hierarchy of provisioned Device(site should be part of Fabric Site) `, - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - }, + Type: schema.TypeString, + Optional: true, + Computed: true, }, }, }, @@ -907,30 +896,30 @@ func resourceSdaFabricBorderDeviceCreate(ctx context.Context, d *schema.Resource var diags diag.Diagnostics - resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabric(ctx, "parameters.0", d) + resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1(ctx, "parameters", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vDeviceManagementIPAddress := resourceItem["device_management_ip_address"] vvDeviceManagementIPAddress := interfaceToString(vDeviceManagementIPAddress) - queryParamImport := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricV1QueryParams{} queryParamImport.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item2, _, err := client.Sda.GetBorderDeviceDetailFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetBorderDeviceDetailFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["device_management_ip_address"] = vvDeviceManagementIPAddress d.SetId(joinResourceID(resourceMap)) return resourceSdaFabricBorderDeviceRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddBorderDeviceInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddBorderDeviceInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddBorderDeviceInSdaFabric", err, restyResp1.String())) + "Failure when executing AddBorderDeviceInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddBorderDeviceInSdaFabric", err)) + "Failure when executing AddBorderDeviceInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -947,7 +936,7 @@ func resourceSdaFabricBorderDeviceCreate(ctx context.Context, d *schema.Resource "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -960,20 +949,20 @@ func resourceSdaFabricBorderDeviceCreate(ctx context.Context, d *schema.Resource return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddBorderDeviceInSdaFabric", err)) + "Failure when executing AddBorderDeviceInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricV1QueryParams{} queryParamValidate.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item3, _, err := client.Sda.GetBorderDeviceDetailFromSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetBorderDeviceDetailFromSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddBorderDeviceInSdaFabric", err, - "Failure at AddBorderDeviceInSdaFabric, unexpected response", "")) + "Failure when executing AddBorderDeviceInSdaFabricV1", err, + "Failure at AddBorderDeviceInSdaFabricV1, unexpected response", "")) return diags } @@ -996,12 +985,14 @@ func resourceSdaFabricBorderDeviceRead(ctx context.Context, d *schema.ResourceDa selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetBorderDeviceDetailFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetBorderDeviceDetailFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetBorderDeviceDetailFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.GetBorderDeviceDetailFromSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetBorderDeviceDetailFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -1013,10 +1004,10 @@ func resourceSdaFabricBorderDeviceRead(ctx context.Context, d *schema.ResourceDa log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetBorderDeviceDetailFromSdaFabricItem(response1) + vItem1 := flattenSdaGetBorderDeviceDetailFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetBorderDeviceDetailFromSdaFabric response", + "Failure when setting GetBorderDeviceDetailFromSdaFabricV1 response", err)) return diags } @@ -1028,13 +1019,7 @@ func resourceSdaFabricBorderDeviceRead(ctx context.Context, d *schema.ResourceDa } func resourceSdaFabricBorderDeviceUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - var diags diag.Diagnostics - err := errors.New("Update not possible in this resource") - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing SdaFabricBorderDeviceUpdate", err, "Update method is not supported", - "Failure at SdaFabricBorderDeviceUpdate, unexpected response", "")) - - return diags + return resourceSdaFabricBorderDeviceRead(ctx, d, m) } func resourceSdaFabricBorderDeviceDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { @@ -1046,23 +1031,23 @@ func resourceSdaFabricBorderDeviceDelete(ctx context.Context, d *schema.Resource resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteBorderDeviceFromSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteBorderDeviceFromSdaFabricV1QueryParams{} vvDeviceManagementIPAddress := resourceMap["device_management_ip_address"] queryParamDelete.DeviceManagementIPAddress = vvDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.DeleteBorderDeviceFromSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteBorderDeviceFromSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteBorderDeviceFromSdaFabric", err, restyResp1.String(), - "Failure at DeleteBorderDeviceFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteBorderDeviceFromSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteBorderDeviceFromSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteBorderDeviceFromSdaFabric", err, - "Failure at DeleteBorderDeviceFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteBorderDeviceFromSdaFabricV1", err, + "Failure at DeleteBorderDeviceFromSdaFabricV1, unexpected response", "")) return diags } @@ -1080,7 +1065,7 @@ func resourceSdaFabricBorderDeviceDelete(ctx context.Context, d *schema.Resource "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -1093,10 +1078,10 @@ func resourceSdaFabricBorderDeviceDelete(ctx context.Context, d *schema.Resource return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteBorderDeviceFromSdaFabric", err)) + "Failure when executing DeleteBorderDeviceFromSdaFabricV1", err)) return diags } } @@ -1107,9 +1092,9 @@ func resourceSdaFabricBorderDeviceDelete(ctx context.Context, d *schema.Resource return diags } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddBorderDeviceInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddBorderDeviceInSdaFabric{} - if v := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddBorderDeviceInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddBorderDeviceInSdaFabricV1{} + if v := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -1118,8 +1103,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabric(ctx context.Co return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabric { - request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabric{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1 { + request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1130,7 +1115,7 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemArray(ctx c return nil } for item_no := range objs { - i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1141,8 +1126,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemArray(ctx c return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabric { - request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabric{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1 { + request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ip_address")))) { request.DeviceManagementIPAddress = interfaceToString(v) } @@ -1180,7 +1165,7 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItem(ctx contex request.BorderWithExternalConnectivity = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".external_connectivity_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".external_connectivity_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".external_connectivity_settings")))) { - request.ExternalConnectivitySettings = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsArray(ctx, key+".external_connectivity_settings", d) + request.ExternalConnectivitySettings = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsArray(ctx, key+".external_connectivity_settings", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1188,8 +1173,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItem(ctx contex return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettings { - request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettings{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettings { + request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1200,7 +1185,7 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return nil } for item_no := range objs { - i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1211,8 +1196,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettings { - request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettings{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettings { + request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) } @@ -1223,10 +1208,10 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon request.ExternalAutonomouSystemNumber = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".l3_handoff")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".l3_handoff")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".l3_handoff")))) { - request.L3Handoff = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL3HandoffArray(ctx, key+".l3_handoff", d) + request.L3Handoff = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL3HandoffArray(ctx, key+".l3_handoff", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".l2_handoff")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".l2_handoff")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".l2_handoff")))) { - request.L2Handoff = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL2HandoffArray(ctx, key+".l2_handoff", d) + request.L2Handoff = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL2HandoffArray(ctx, key+".l2_handoff", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1234,8 +1219,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL3HandoffArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL3Handoff { - request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL3Handoff{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL3HandoffArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL3Handoff { + request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL3Handoff{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1246,7 +1231,7 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return nil } for item_no := range objs { - i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL3Handoff(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL3Handoff(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1257,10 +1242,10 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL3Handoff(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL3Handoff { - request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL3Handoff{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL3Handoff(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL3Handoff { + request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL3Handoff{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network")))) { - request.VirtualNetwork = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL3HandoffVirtualNetwork(ctx, key+".virtual_network.0", d) + request.VirtualNetwork = expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL3HandoffVirtualNetwork(ctx, key+".virtual_network.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1268,8 +1253,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL3HandoffVirtualNetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL3HandoffVirtualNetwork { - request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL3HandoffVirtualNetwork{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL3HandoffVirtualNetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL3HandoffVirtualNetwork { + request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL3HandoffVirtualNetwork{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } @@ -1282,8 +1267,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL2HandoffArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL2Handoff { - request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL2Handoff{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL2HandoffArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL2Handoff { + request := []catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL2Handoff{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1294,7 +1279,7 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return nil } for item_no := range objs { - i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL2Handoff(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL2Handoff(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1305,8 +1290,8 @@ func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalCon return &request } -func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricItemExternalConnectivitySettingsL2Handoff(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL2Handoff { - request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricExternalConnectivitySettingsL2Handoff{} +func expandRequestSdaFabricBorderDeviceAddBorderDeviceInSdaFabricV1ItemExternalConnectivitySettingsL2Handoff(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL2Handoff { + request := catalystcentersdkgo.RequestItemSdaAddBorderDeviceInSdaFabricV1ExternalConnectivitySettingsL2Handoff{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_fabric_control_plane_device.go b/catalystcenter/resource_sda_fabric_control_plane_device.go index 7351d59..3414295 100644 --- a/catalystcenter/resource_sda_fabric_control_plane_device.go +++ b/catalystcenter/resource_sda_fabric_control_plane_device.go @@ -127,29 +127,29 @@ func resourceSdaFabricControlPlaneDeviceCreate(ctx context.Context, d *schema.Re var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaFabricControlPlaneDeviceAddControlPlaneDeviceInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricControlPlaneDeviceAddControlPlaneDeviceInSdaFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vDeviceManagementIPAddress := resourceItem["device_management_ip_address"] vvDeviceManagementIPAddress := interfaceToString(vDeviceManagementIPAddress) - queryParamImport := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricV1QueryParams{} queryParamImport.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item2, _, err := client.Sda.GetControlPlaneDeviceFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetControlPlaneDeviceFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["device_management_ip_address"] = item2.DeviceManagementIPAddress d.SetId(joinResourceID(resourceMap)) return resourceSdaFabricControlPlaneDeviceRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddControlPlaneDeviceInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddControlPlaneDeviceInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddControlPlaneDeviceInSdaFabric", err, restyResp1.String())) + "Failure when executing AddControlPlaneDeviceInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddControlPlaneDeviceInSdaFabric", err)) + "Failure when executing AddControlPlaneDeviceInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -182,17 +182,17 @@ func resourceSdaFabricControlPlaneDeviceCreate(ctx context.Context, d *schema.Re if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddControlPlaneDeviceInSdaFabric", err)) + "Failure when executing AddControlPlaneDeviceInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricV1QueryParams{} queryParamValidate.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item3, _, err := client.Sda.GetControlPlaneDeviceFromSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetControlPlaneDeviceFromSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddControlPlaneDeviceInSdaFabric", err, - "Failure at AddControlPlaneDeviceInSdaFabric, unexpected response", "")) + "Failure when executing AddControlPlaneDeviceInSdaFabricV1", err, + "Failure at AddControlPlaneDeviceInSdaFabricV1, unexpected response", "")) return diags } @@ -215,12 +215,14 @@ func resourceSdaFabricControlPlaneDeviceRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetControlPlaneDeviceFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetControlPlaneDeviceFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetControlPlaneDeviceFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.GetControlPlaneDeviceFromSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetControlPlaneDeviceFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -232,10 +234,10 @@ func resourceSdaFabricControlPlaneDeviceRead(ctx context.Context, d *schema.Reso log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetControlPlaneDeviceFromSdaFabricItem(response1) + vItem1 := flattenSdaGetControlPlaneDeviceFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetControlPlaneDeviceFromSdaFabric response", + "Failure when setting GetControlPlaneDeviceFromSdaFabricV1 response", err)) return diags } @@ -259,23 +261,23 @@ func resourceSdaFabricControlPlaneDeviceDelete(ctx context.Context, d *schema.Re resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteControlPlaneDeviceInSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteControlPlaneDeviceInSdaFabricV1QueryParams{} vvDeviceManagementIPAddress := resourceMap["device_management_ip_address"] queryParamDelete.DeviceManagementIPAddress = vvDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.DeleteControlPlaneDeviceInSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteControlPlaneDeviceInSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteControlPlaneDeviceInSdaFabric", err, restyResp1.String(), - "Failure at DeleteControlPlaneDeviceInSdaFabric, unexpected response", "")) + "Failure when executing DeleteControlPlaneDeviceInSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteControlPlaneDeviceInSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteControlPlaneDeviceInSdaFabric", err, - "Failure at DeleteControlPlaneDeviceInSdaFabric, unexpected response", "")) + "Failure when executing DeleteControlPlaneDeviceInSdaFabricV1", err, + "Failure at DeleteControlPlaneDeviceInSdaFabricV1, unexpected response", "")) return diags } @@ -309,7 +311,7 @@ func resourceSdaFabricControlPlaneDeviceDelete(ctx context.Context, d *schema.Re if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteControlPlaneDeviceInSdaFabric", err)) + "Failure when executing DeleteControlPlaneDeviceInSdaFabricV1", err)) return diags } } @@ -320,8 +322,8 @@ func resourceSdaFabricControlPlaneDeviceDelete(ctx context.Context, d *schema.Re return diags } -func expandRequestSdaFabricControlPlaneDeviceAddControlPlaneDeviceInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddControlPlaneDeviceInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddControlPlaneDeviceInSdaFabric{} +func expandRequestSdaFabricControlPlaneDeviceAddControlPlaneDeviceInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddControlPlaneDeviceInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddControlPlaneDeviceInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ip_address")))) { request.DeviceManagementIPAddress = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_fabric_devices.go b/catalystcenter/resource_sda_fabric_devices.go index ee566a6..6f0aaf3 100644 --- a/catalystcenter/resource_sda_fabric_devices.go +++ b/catalystcenter/resource_sda_fabric_devices.go @@ -267,7 +267,7 @@ func resourceSdaFabricDevicesCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricDevicesAddFabricDevices(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesAddFabricDevicesV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -276,7 +276,7 @@ func resourceSdaFabricDevicesCreate(ctx context.Context, d *schema.ResourceData, vvNetworkDevice := interfaceToString(vNetworkDevice) vFabricID := resourceItem["fabric_id"] vvFabricID := interfaceToString(vFabricID) - queryParamImport := catalystcentersdkgo.GetFabricDevicesQueryParams{} + queryParamImport := catalystcentersdkgo.GetFabricDevicesV1QueryParams{} queryParamImport.FabricID = vvFabricID queryParamImport.NetworkDeviceID = vvNetworkDevice item2, err := searchSdaGetFabricDevices(m, queryParamImport, vvID) @@ -327,7 +327,7 @@ func resourceSdaFabricDevicesCreate(ctx context.Context, d *schema.ResourceData, return diags } } - queryParamValidate := catalystcentersdkgo.GetFabricDevicesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetFabricDevicesV1QueryParams{} queryParamValidate.FabricID = vvFabricID item3, err := searchSdaGetFabricDevices(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -359,7 +359,7 @@ func resourceSdaFabricDevicesRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetFabricDevices") - queryParams1 := catalystcentersdkgo.GetFabricDevicesQueryParams{} + queryParams1 := catalystcentersdkgo.GetFabricDevicesV1QueryParams{} queryParams1.FabricID = vFabricID queryParams1.NetworkDeviceID = vNetworkDevice @@ -370,11 +370,11 @@ func resourceSdaFabricDevicesRead(ctx context.Context, d *schema.ResourceData, m return diags } - items := []catalystcentersdkgo.ResponseSdaGetFabricDevicesResponse{ + items := []catalystcentersdkgo.ResponseSdaGetFabricDevicesV1Response{ *item1, } // Review flatten function used - vItem1 := flattenSdaGetFabricDevicesItems(&items) + vItem1 := flattenSdaGetFabricDevicesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetFabricDevices search response", @@ -395,7 +395,7 @@ func resourceSdaFabricDevicesUpdate(ctx context.Context, d *schema.ResourceData, vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaFabricDevicesUpdateFabricDevices(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesUpdateFabricDevicesV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -512,9 +512,9 @@ func resourceSdaFabricDevicesDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestSdaFabricDevicesAddFabricDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevices { - request := catalystcentersdkgo.RequestSdaAddFabricDevices{} - if v := expandRequestSdaFabricDevicesAddFabricDevicesItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesAddFabricDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesV1 { + request := catalystcentersdkgo.RequestSdaAddFabricDevicesV1{} + if v := expandRequestSdaFabricDevicesAddFabricDevicesV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -523,8 +523,8 @@ func expandRequestSdaFabricDevicesAddFabricDevices(ctx context.Context, key stri return &request } -func expandRequestSdaFabricDevicesAddFabricDevicesItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevices { - request := []catalystcentersdkgo.RequestItemSdaAddFabricDevices{} +func expandRequestSdaFabricDevicesAddFabricDevicesV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1 { + request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -535,7 +535,7 @@ func expandRequestSdaFabricDevicesAddFabricDevicesItemArray(ctx context.Context, return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesAddFabricDevicesItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesAddFabricDevicesV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -546,8 +546,8 @@ func expandRequestSdaFabricDevicesAddFabricDevicesItemArray(ctx context.Context, return &request } -func expandRequestSdaFabricDevicesAddFabricDevicesItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevices { - request := catalystcentersdkgo.RequestItemSdaAddFabricDevices{} +func expandRequestSdaFabricDevicesAddFabricDevicesV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1 { + request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_device_id")))) { request.NetworkDeviceID = interfaceToString(v) } @@ -558,7 +558,7 @@ func expandRequestSdaFabricDevicesAddFabricDevicesItem(ctx context.Context, key request.DeviceRoles = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".border_device_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".border_device_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".border_device_settings")))) { - request.BorderDeviceSettings = expandRequestSdaFabricDevicesAddFabricDevicesItemBorderDeviceSettings(ctx, key+".border_device_settings.0", d) + request.BorderDeviceSettings = expandRequestSdaFabricDevicesAddFabricDevicesV1ItemBorderDeviceSettings(ctx, key+".border_device_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -566,13 +566,13 @@ func expandRequestSdaFabricDevicesAddFabricDevicesItem(ctx context.Context, key return &request } -func expandRequestSdaFabricDevicesAddFabricDevicesItemBorderDeviceSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesBorderDeviceSettings { - request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesBorderDeviceSettings{} +func expandRequestSdaFabricDevicesAddFabricDevicesV1ItemBorderDeviceSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1BorderDeviceSettings { + request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1BorderDeviceSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".border_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".border_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".border_types")))) { request.BorderTypes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".layer3_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".layer3_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".layer3_settings")))) { - request.Layer3Settings = expandRequestSdaFabricDevicesAddFabricDevicesItemBorderDeviceSettingsLayer3Settings(ctx, key+".layer3_settings.0", d) + request.Layer3Settings = expandRequestSdaFabricDevicesAddFabricDevicesV1ItemBorderDeviceSettingsLayer3Settings(ctx, key+".layer3_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -580,8 +580,8 @@ func expandRequestSdaFabricDevicesAddFabricDevicesItemBorderDeviceSettings(ctx c return &request } -func expandRequestSdaFabricDevicesAddFabricDevicesItemBorderDeviceSettingsLayer3Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesBorderDeviceSettingsLayer3Settings { - request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesBorderDeviceSettingsLayer3Settings{} +func expandRequestSdaFabricDevicesAddFabricDevicesV1ItemBorderDeviceSettingsLayer3Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1BorderDeviceSettingsLayer3Settings { + request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesV1BorderDeviceSettingsLayer3Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".local_autonomous_system_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".local_autonomous_system_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".local_autonomous_system_number")))) { request.LocalAutonomousSystemNumber = interfaceToString(v) } @@ -603,9 +603,9 @@ func expandRequestSdaFabricDevicesAddFabricDevicesItemBorderDeviceSettingsLayer3 return &request } -func expandRequestSdaFabricDevicesUpdateFabricDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricDevices { - request := catalystcentersdkgo.RequestSdaUpdateFabricDevices{} - if v := expandRequestSdaFabricDevicesUpdateFabricDevicesItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesUpdateFabricDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricDevicesV1 { + request := catalystcentersdkgo.RequestSdaUpdateFabricDevicesV1{} + if v := expandRequestSdaFabricDevicesUpdateFabricDevicesV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -614,8 +614,8 @@ func expandRequestSdaFabricDevicesUpdateFabricDevices(ctx context.Context, key s return &request } -func expandRequestSdaFabricDevicesUpdateFabricDevicesItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricDevices { - request := []catalystcentersdkgo.RequestItemSdaUpdateFabricDevices{} +func expandRequestSdaFabricDevicesUpdateFabricDevicesV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -626,7 +626,7 @@ func expandRequestSdaFabricDevicesUpdateFabricDevicesItemArray(ctx context.Conte return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesUpdateFabricDevicesItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesUpdateFabricDevicesV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -637,8 +637,8 @@ func expandRequestSdaFabricDevicesUpdateFabricDevicesItemArray(ctx context.Conte return &request } -func expandRequestSdaFabricDevicesUpdateFabricDevicesItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevices { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevices{} +func expandRequestSdaFabricDevicesUpdateFabricDevicesV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -652,7 +652,7 @@ func expandRequestSdaFabricDevicesUpdateFabricDevicesItem(ctx context.Context, k request.DeviceRoles = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".border_device_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".border_device_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".border_device_settings")))) { - request.BorderDeviceSettings = expandRequestSdaFabricDevicesUpdateFabricDevicesItemBorderDeviceSettings(ctx, key+".border_device_settings.0", d) + request.BorderDeviceSettings = expandRequestSdaFabricDevicesUpdateFabricDevicesV1ItemBorderDeviceSettings(ctx, key+".border_device_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -660,13 +660,13 @@ func expandRequestSdaFabricDevicesUpdateFabricDevicesItem(ctx context.Context, k return &request } -func expandRequestSdaFabricDevicesUpdateFabricDevicesItemBorderDeviceSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesBorderDeviceSettings { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesBorderDeviceSettings{} +func expandRequestSdaFabricDevicesUpdateFabricDevicesV1ItemBorderDeviceSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1BorderDeviceSettings { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1BorderDeviceSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".border_types")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".border_types")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".border_types")))) { request.BorderTypes = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".layer3_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".layer3_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".layer3_settings")))) { - request.Layer3Settings = expandRequestSdaFabricDevicesUpdateFabricDevicesItemBorderDeviceSettingsLayer3Settings(ctx, key+".layer3_settings.0", d) + request.Layer3Settings = expandRequestSdaFabricDevicesUpdateFabricDevicesV1ItemBorderDeviceSettingsLayer3Settings(ctx, key+".layer3_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -674,8 +674,8 @@ func expandRequestSdaFabricDevicesUpdateFabricDevicesItemBorderDeviceSettings(ct return &request } -func expandRequestSdaFabricDevicesUpdateFabricDevicesItemBorderDeviceSettingsLayer3Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesBorderDeviceSettingsLayer3Settings { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesBorderDeviceSettingsLayer3Settings{} +func expandRequestSdaFabricDevicesUpdateFabricDevicesV1ItemBorderDeviceSettingsLayer3Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1BorderDeviceSettingsLayer3Settings { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesV1BorderDeviceSettingsLayer3Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".local_autonomous_system_number")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".local_autonomous_system_number")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".local_autonomous_system_number")))) { request.LocalAutonomousSystemNumber = interfaceToString(v) } @@ -697,11 +697,11 @@ func expandRequestSdaFabricDevicesUpdateFabricDevicesItemBorderDeviceSettingsLay return &request } -func searchSdaGetFabricDevices(m interface{}, queryParams catalystcentersdkgo.GetFabricDevicesQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetFabricDevicesResponse, error) { +func searchSdaGetFabricDevices(m interface{}, queryParams catalystcentersdkgo.GetFabricDevicesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetFabricDevicesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetFabricDevicesResponse - var ite *catalystcentersdkgo.ResponseSdaGetFabricDevices + var foundItem *catalystcentersdkgo.ResponseSdaGetFabricDevicesV1Response + var ite *catalystcentersdkgo.ResponseSdaGetFabricDevicesV1 ite, _, err = client.Sda.GetFabricDevices(&queryParams) if err != nil || ite == nil { diff --git a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs.go b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs.go index 3575cfe..7a980a0 100644 --- a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs.go +++ b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs.go @@ -85,7 +85,7 @@ func resourceSdaFabricDevicesLayer2Handoffs() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddFabricDevicesLayer2Handoffs`, + Description: `Array of RequestSdaAddFabricDevicesLayer2HandoffsV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -155,7 +155,7 @@ func resourceSdaFabricDevicesLayer2HandoffsCreate(ctx context.Context, d *schema var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2Handoffs(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -164,7 +164,7 @@ func resourceSdaFabricDevicesLayer2HandoffsCreate(ctx context.Context, d *schema vvFabricID := interfaceToString(vFabricID) vInterfaceName := resourceItem["interface_name"] vvInterfaceName := interfaceToString(vInterfaceName) - queryParamImport := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsQueryParams{} + queryParamImport := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsV1QueryParams{} queryParamImport.FabricID = vvFabricID item2, err := searchSdaGetFabricDevicesLayer2Handoffs(m, queryParamImport, vvID, vvInterfaceName) if err == nil && item2 != nil { @@ -214,7 +214,7 @@ func resourceSdaFabricDevicesLayer2HandoffsCreate(ctx context.Context, d *schema return diags } } - queryParamValidate := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsV1QueryParams{} queryParamValidate.FabricID = vvFabricID item3, err := searchSdaGetFabricDevicesLayer2Handoffs(m, queryParamValidate, vvID, vvInterfaceName) if err != nil || item3 == nil { @@ -247,7 +247,7 @@ func resourceSdaFabricDevicesLayer2HandoffsRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer2Handoffs") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsQueryParams{} + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer2HandoffsV1QueryParams{} queryParams1.FabricID = vFabricID @@ -258,11 +258,11 @@ func resourceSdaFabricDevicesLayer2HandoffsRead(ctx context.Context, d *schema.R } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsResponse{ + items := []catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsV1Response{ *item1, } - vItem1 := flattenSdaGetFabricDevicesLayer2HandoffsItems(&items) + vItem1 := flattenSdaGetFabricDevicesLayer2HandoffsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetFabricDevicesLayer2Handoffs search response", @@ -337,9 +337,9 @@ func resourceSdaFabricDevicesLayer2HandoffsDelete(ctx context.Context, d *schema return diags } -func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2Handoffs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesLayer2Handoffs { - request := catalystcentersdkgo.RequestSdaAddFabricDevicesLayer2Handoffs{} - if v := expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesLayer2HandoffsV1 { + request := catalystcentersdkgo.RequestSdaAddFabricDevicesLayer2HandoffsV1{} + if v := expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -348,8 +348,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2Handoffs(c return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2Handoffs { - request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2Handoffs{} +func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2HandoffsV1 { + request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2HandoffsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -360,7 +360,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsIt return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -371,8 +371,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsIt return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2Handoffs { - request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2Handoffs{} +func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2HandoffsV1 { + request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer2HandoffsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_device_id")))) { request.NetworkDeviceID = interfaceToString(v) } @@ -394,10 +394,10 @@ func expandRequestSdaFabricDevicesLayer2HandoffsAddFabricDevicesLayer2HandoffsIt return &request } -func searchSdaGetFabricDevicesLayer2Handoffs(m interface{}, queryParams catalystcentersdkgo.GetFabricDevicesLayer2HandoffsQueryParams, vID string, vInterfaceName string) (*catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsResponse, error) { +func searchSdaGetFabricDevicesLayer2Handoffs(m interface{}, queryParams catalystcentersdkgo.GetFabricDevicesLayer2HandoffsV1QueryParams, vID string, vInterfaceName string) (*catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsResponse + var foundItem *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer2HandoffsV1Response queryParams.Offset = 1 nResponse, _, err := client.Sda.GetFabricDevicesLayer2Handoffs(&queryParams) diff --git a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_ip_transits.go b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_ip_transits.go index 7bc3564..6b3ee6b 100644 --- a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_ip_transits.go +++ b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_ip_transits.go @@ -250,7 +250,7 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsCreate(ctx context.Context, var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransit(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -259,7 +259,7 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsCreate(ctx context.Context, vvFabricID := interfaceToString(vFabricID) vInterfaceName := resourceItem["interface_name"] vvInterfaceName := interfaceToString(vInterfaceName) - queryParamImport := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitQueryParams{} + queryParamImport := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitV1QueryParams{} queryParamImport.FabricID = vvFabricID item2, err := searchSdaGetFabricDevicesLayer3HandoffsWithIPTransit(m, queryParamImport, vvID, vvInterfaceName) if err == nil && item2 != nil { @@ -309,7 +309,7 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsCreate(ctx context.Context, return diags } } - queryParamValidate := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitQueryParams{} + queryParamValidate := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitV1QueryParams{} queryParamValidate.FabricID = vvFabricID item3, err := searchSdaGetFabricDevicesLayer3HandoffsWithIPTransit(m, queryParamValidate, vvID, vvInterfaceName) if err != nil || item3 == nil { @@ -341,7 +341,7 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsRead(ctx context.Context, d selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetFabricDevicesLayer3HandoffsWithIPTransit") - queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitQueryParams{} + queryParams1 := catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitV1QueryParams{} queryParams1.FabricID = vFabricID @@ -351,12 +351,12 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsRead(ctx context.Context, d return diags } - items := []catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitResponse{ + items := []catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Response{ *item1, } // Review flatten function used - vItem1 := flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitItems(&items) + vItem1 := flattenSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetFabricDevicesLayer3HandoffsWithIPTransit search response", @@ -376,7 +376,7 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsUpdate(ctx context.Context, resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransit(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -492,9 +492,9 @@ func resourceSdaFabricDevicesLayer2HandoffsIPTransitsDelete(ctx context.Context, return diags } -func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransit(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithIPTransit { - request := catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithIPTransit{} - if v := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithIPTransitV1 { + request := catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithIPTransitV1{} + if v := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -503,8 +503,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3 return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransit { - request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransitV1 { + request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransitV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -515,7 +515,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3 return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -526,8 +526,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3 return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransit { - request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3HandoffsWithIPTransitV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransitV1 { + request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithIPTransitV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_device_id")))) { request.NetworkDeviceID = interfaceToString(v) } @@ -570,9 +570,9 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsAddFabricDevicesLayer3 return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransit(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithIPTransit { - request := catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithIPTransit{} - if v := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithIPTransitV1 { + request := catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithIPTransitV1{} + if v := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -581,8 +581,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLay return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransit { - request := []catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransitV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransitV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -593,7 +593,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLay return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -604,8 +604,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLay return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransit { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLayer3HandoffsWithIPTransitV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransitV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithIPTransitV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -651,10 +651,10 @@ func expandRequestSdaFabricDevicesLayer2HandoffsIPTransitsUpdateFabricDevicesLay return &request } -func searchSdaGetFabricDevicesLayer3HandoffsWithIPTransit(m interface{}, queryParams catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitQueryParams, vID string, vInterfaceName string) (*catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitResponse, error) { +func searchSdaGetFabricDevicesLayer3HandoffsWithIPTransit(m interface{}, queryParams catalystcentersdkgo.GetFabricDevicesLayer3HandoffsWithIPTransitV1QueryParams, vID string, vInterfaceName string) (*catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitResponse + var foundItem *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransitV1Response // var ite *catalystcentersdkgo.ResponseSdaGetFabricDevicesLayer3HandoffsWithIPTransit queryParams.Offset = 1 diff --git a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_create.go b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_create.go index bc79753..bf07ad6 100644 --- a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_create.go +++ b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_create.go @@ -64,7 +64,7 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreate() *schema.Resource Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransit`, + Description: `Array of RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -146,20 +146,18 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreateCreate(ctx context.C client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransit(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sda.AddFabricDevicesLayer3HandoffsWithSdaTransit(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sda.AddFabricDevicesLayer3HandoffsWithSdaTransitV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AddFabricDevicesLayer3HandoffsWithSdaTransit", err)) + "Failure when executing AddFabricDevicesLayer3HandoffsWithSdaTransitV1", err)) return diags } @@ -167,7 +165,7 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreateCreate(ctx context.C if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing AddFabricDevicesLayer3HandoffsWithSdaTransit", err)) + "Failure when executing AddFabricDevicesLayer3HandoffsWithSdaTransitV1", err)) return diags } taskId := response1.Response.TaskID @@ -201,22 +199,24 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreateCreate(ctx context.C } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing AddFabricDevicesLayer3HandoffsWithSdaTransit", err1)) + "Failure when executing AddFabricDevicesLayer3HandoffsWithSdaTransitV1", err1)) return diags } } - vItem1 := flattenSdaAddFabricDevicesLayer3HandoffsWithSdaTransitItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AddFabricDevicesLayer3HandoffsWithSdaTransit response", + "Failure when setting AddFabricDevicesLayer3HandoffsWithSdaTransitV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -231,16 +231,16 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsCreateDelete(ctx context.C return diags } -func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransit(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransit { - request := catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransit{} - if v := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1 { + request := catalystcentersdkgo.RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1{} + if v := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransit { - request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1 { + request := []catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -251,7 +251,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevice return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -259,8 +259,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevice return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransit { - request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevicesLayer3HandoffsWithSdaTransitV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1 { + request := catalystcentersdkgo.RequestItemSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_device_id")))) { request.NetworkDeviceID = interfaceToString(v) } @@ -285,7 +285,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsCreateAddFabricDevice return &request } -func flattenSdaAddFabricDevicesLayer3HandoffsWithSdaTransitItem(item *catalystcentersdkgo.ResponseSdaAddFabricDevicesLayer3HandoffsWithSdaTransitResponse) []map[string]interface{} { +func flattenSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1Item(item *catalystcentersdkgo.ResponseSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_delete.go b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_delete.go index addd5fd..ac99616 100644 --- a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_delete.go +++ b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_delete.go @@ -91,20 +91,22 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDeleteCreate(ctx context.C vNetworkDeviceID := resourceItem["network_device_id"] - queryParams1 := catalystcentersdkgo.DeleteFabricDeviceLayer3HandoffsWithSdaTransitQueryParams{} + queryParams1 := catalystcentersdkgo.DeleteFabricDeviceLayer3HandoffsWithSdaTransitV1QueryParams{} queryParams1.FabricID = vFabricID.(string) queryParams1.NetworkDeviceID = vNetworkDeviceID.(string) - response1, restyResp1, err := client.Sda.DeleteFabricDeviceLayer3HandoffsWithSdaTransit(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.DeleteFabricDeviceLayer3HandoffsWithSdaTransitV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeleteFabricDeviceLayer3HandoffsWithSdaTransit", err)) + "Failure when executing DeleteFabricDeviceLayer3HandoffsWithSdaTransitV1", err)) return diags } @@ -112,7 +114,7 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDeleteCreate(ctx context.C if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing DeleteFabricDeviceLayer3HandoffsWithSdaTransit", err)) + "Failure when executing DeleteFabricDeviceLayer3HandoffsWithSdaTransitV1", err)) return diags } taskId := response1.Response.TaskID @@ -146,22 +148,20 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDeleteCreate(ctx context.C } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing DeleteFabricDeviceLayer3HandoffsWithSdaTransit", err1)) + "Failure when executing DeleteFabricDeviceLayer3HandoffsWithSdaTransitV1", err1)) return diags } } - - vItem1 := flattenSdaDeleteFabricDeviceLayer3HandoffsWithSdaTransitItem(response1.Response) + vItem1 := flattenSdaDeleteFabricDeviceLayer3HandoffsWithSdaTransitV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeleteFabricDeviceLayer3HandoffsWithSdaTransit response", + "Failure when setting DeleteFabricDeviceLayer3HandoffsWithSdaTransitV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDeleteRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -176,7 +176,7 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsDeleteDelete(ctx context.C return diags } -func flattenSdaDeleteFabricDeviceLayer3HandoffsWithSdaTransitItem(item *catalystcentersdkgo.ResponseSdaDeleteFabricDeviceLayer3HandoffsWithSdaTransitResponse) []map[string]interface{} { +func flattenSdaDeleteFabricDeviceLayer3HandoffsWithSdaTransitV1Item(item *catalystcentersdkgo.ResponseSdaDeleteFabricDeviceLayer3HandoffsWithSdaTransitV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_update.go b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_update.go index 1bb77de..a1b5385 100644 --- a/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_update.go +++ b/catalystcenter/resource_sda_fabric_devices_layer2_handoffs_sda_transits_update.go @@ -64,7 +64,7 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdate() *schema.Resource Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit`, + Description: `Array of RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -146,20 +146,18 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateCreate(ctx context.C client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransit(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sda.UpdateFabricDevicesLayer3HandoffsWithSdaTransit(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sda.UpdateFabricDevicesLayer3HandoffsWithSdaTransitV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateFabricDevicesLayer3HandoffsWithSdaTransit", err)) + "Failure when executing UpdateFabricDevicesLayer3HandoffsWithSdaTransitV1", err)) return diags } @@ -167,7 +165,7 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateCreate(ctx context.C if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateFabricDevicesLayer3HandoffsWithSdaTransit", err)) + "Failure when executing UpdateFabricDevicesLayer3HandoffsWithSdaTransitV1", err)) return diags } taskId := response1.Response.TaskID @@ -201,22 +199,24 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateCreate(ctx context.C } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateFabricDevicesLayer3HandoffsWithSdaTransit", err1)) + "Failure when executing UpdateFabricDevicesLayer3HandoffsWithSdaTransitV1", err1)) return diags } } - vItem1 := flattenSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateFabricDevicesLayer3HandoffsWithSdaTransit response", + "Failure when setting UpdateFabricDevicesLayer3HandoffsWithSdaTransitV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -231,16 +231,16 @@ func resourceSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateDelete(ctx context.C return diags } -func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransit(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit { - request := catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit{} - if v := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1 { + request := catalystcentersdkgo.RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1{} + if v := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit { - request := []catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -251,7 +251,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDev return nil } for item_no := range objs { - i := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -259,8 +259,8 @@ func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDev return &request } -func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit{} +func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_device_id")))) { request.NetworkDeviceID = interfaceToString(v) } @@ -285,7 +285,7 @@ func expandRequestSdaFabricDevicesLayer2HandoffsSdaTransitsUpdateUpdateFabricDev return &request } -func flattenSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitItem(item *catalystcentersdkgo.ResponseSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitResponse) []map[string]interface{} { +func flattenSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1Item(item *catalystcentersdkgo.ResponseSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_fabric_edge_device.go b/catalystcenter/resource_sda_fabric_edge_device.go index 74c2a12..80b6f42 100644 --- a/catalystcenter/resource_sda_fabric_edge_device.go +++ b/catalystcenter/resource_sda_fabric_edge_device.go @@ -120,29 +120,29 @@ func resourceSdaFabricEdgeDeviceCreate(ctx context.Context, d *schema.ResourceDa var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaFabricEdgeDeviceAddEdgeDeviceInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricEdgeDeviceAddEdgeDeviceInSdaFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vDeviceManagementIPAddress := resourceItem["device_management_ip_address"] vvDeviceManagementIPAddress := interfaceToString(vDeviceManagementIPAddress) - queryParamImport := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricV1QueryParams{} queryParamImport.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item2, _, err := client.Sda.GetEdgeDeviceFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetEdgeDeviceFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["device_management_ip_address"] = item2.DeviceManagementIPAddress d.SetId(joinResourceID(resourceMap)) return resourceSdaFabricEdgeDeviceRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddEdgeDeviceInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddEdgeDeviceInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddEdgeDeviceInSdaFabric", err, restyResp1.String())) + "Failure when executing AddEdgeDeviceInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddEdgeDeviceInSdaFabric", err)) + "Failure when executing AddEdgeDeviceInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -175,17 +175,17 @@ func resourceSdaFabricEdgeDeviceCreate(ctx context.Context, d *schema.ResourceDa if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddEdgeDeviceInSdaFabric", err)) + "Failure when executing AddEdgeDeviceInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricV1QueryParams{} queryParamValidate.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item3, _, err := client.Sda.GetEdgeDeviceFromSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetEdgeDeviceFromSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddEdgeDeviceInSdaFabric", err, - "Failure at AddEdgeDeviceInSdaFabric, unexpected response", "")) + "Failure when executing AddEdgeDeviceInSdaFabricV1", err, + "Failure at AddEdgeDeviceInSdaFabricV1, unexpected response", "")) return diags } @@ -208,12 +208,14 @@ func resourceSdaFabricEdgeDeviceRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetEdgeDeviceFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetEdgeDeviceFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetEdgeDeviceFromSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.GetEdgeDeviceFromSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetEdgeDeviceFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -225,10 +227,10 @@ func resourceSdaFabricEdgeDeviceRead(ctx context.Context, d *schema.ResourceData log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetEdgeDeviceFromSdaFabricItem(response1) + vItem1 := flattenSdaGetEdgeDeviceFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetEdgeDeviceFromSdaFabric response", + "Failure when setting GetEdgeDeviceFromSdaFabricV1 response", err)) return diags } @@ -252,23 +254,23 @@ func resourceSdaFabricEdgeDeviceDelete(ctx context.Context, d *schema.ResourceDa resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteEdgeDeviceFromSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteEdgeDeviceFromSdaFabricV1QueryParams{} vvDeviceManagementIPAddress := resourceMap["device_management_ip_address"] queryParamDelete.DeviceManagementIPAddress = vvDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.DeleteEdgeDeviceFromSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteEdgeDeviceFromSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteEdgeDeviceFromSdaFabric", err, restyResp1.String(), - "Failure at DeleteEdgeDeviceFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteEdgeDeviceFromSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteEdgeDeviceFromSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteEdgeDeviceFromSdaFabric", err, - "Failure at DeleteEdgeDeviceFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteEdgeDeviceFromSdaFabricV1", err, + "Failure at DeleteEdgeDeviceFromSdaFabricV1, unexpected response", "")) return diags } @@ -302,7 +304,7 @@ func resourceSdaFabricEdgeDeviceDelete(ctx context.Context, d *schema.ResourceDa if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteEdgeDeviceFromSdaFabric", err)) + "Failure when executing DeleteEdgeDeviceFromSdaFabricV1", err)) return diags } } @@ -313,8 +315,8 @@ func resourceSdaFabricEdgeDeviceDelete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestSdaFabricEdgeDeviceAddEdgeDeviceInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddEdgeDeviceInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddEdgeDeviceInSdaFabric{} +func expandRequestSdaFabricEdgeDeviceAddEdgeDeviceInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddEdgeDeviceInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddEdgeDeviceInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ip_address")))) { request.DeviceManagementIPAddress = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_fabric_site.go b/catalystcenter/resource_sda_fabric_site.go index 91fe212..8ad67be 100644 --- a/catalystcenter/resource_sda_fabric_site.go +++ b/catalystcenter/resource_sda_fabric_site.go @@ -88,7 +88,7 @@ func resourceSdaFabricSite() *schema.Resource { Schema: map[string]*schema.Schema{ "fabric_name": &schema.Schema{ - Description: `Warning - Starting Catalyst Center 2.2.3.5 release, this field has been deprecated. SD-Access Fabric does not need it anymore. It will be removed in future Catalyst Center releases. + Description: `Warning - Starting DNA Center 2.2.3.5 release, this field has been deprecated. SD-Access Fabric does not need it anymore. It will be removed in future DNA Center releases. `, Type: schema.TypeString, Optional: true, @@ -121,29 +121,29 @@ func resourceSdaFabricSiteCreate(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaFabricSiteAddSiteInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricSiteAddSiteInSdaFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSiteNameHierarchy := resourceItem["site_name_hierarchy"] vvSiteNameHierarchy := interfaceToString(vSiteNameHierarchy) - queryParamImport := catalystcentersdkgo.GetSiteFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetSiteFromSdaFabricV1QueryParams{} queryParamImport.SiteNameHierarchy = vvSiteNameHierarchy - item2, _, err := client.Sda.GetSiteFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetSiteFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["site_name_hierarchy"] = item2.SiteNameHierarchy d.SetId(joinResourceID(resourceMap)) return resourceSdaFabricSiteRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddSiteInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddSiteInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddSiteInSdaFabric", err, restyResp1.String())) + "Failure when executing AddSiteInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddSiteInSdaFabric", err)) + "Failure when executing AddSiteInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -176,17 +176,17 @@ func resourceSdaFabricSiteCreate(ctx context.Context, d *schema.ResourceData, m if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddSiteInSdaFabric", err)) + "Failure when executing AddSiteInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetSiteFromSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetSiteFromSdaFabricV1QueryParams{} queryParamValidate.SiteNameHierarchy = vvSiteNameHierarchy - item3, _, err := client.Sda.GetSiteFromSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetSiteFromSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddSiteInSdaFabric", err, - "Failure at AddSiteInSdaFabric, unexpected response", "")) + "Failure when executing AddSiteInSdaFabricV1", err, + "Failure at AddSiteInSdaFabricV1, unexpected response", "")) return diags } @@ -209,12 +209,14 @@ func resourceSdaFabricSiteRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetSiteFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetSiteFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetSiteFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetSiteFromSdaFabricV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy - response1, restyResp1, err := client.Sda.GetSiteFromSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetSiteFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -226,10 +228,10 @@ func resourceSdaFabricSiteRead(ctx context.Context, d *schema.ResourceData, m in log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetSiteFromSdaFabricItem(response1) + vItem1 := flattenSdaGetSiteFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetSiteFromSdaFabric response", + "Failure when setting GetSiteFromSdaFabricV1 response", err)) return diags } @@ -253,23 +255,23 @@ func resourceSdaFabricSiteDelete(ctx context.Context, d *schema.ResourceData, m resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteSiteFromSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteSiteFromSdaFabricV1QueryParams{} vvSiteNameHierarchy := resourceMap["site_name_hierarchy"] queryParamDelete.SiteNameHierarchy = vvSiteNameHierarchy - response1, restyResp1, err := client.Sda.DeleteSiteFromSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteSiteFromSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteSiteFromSdaFabric", err, restyResp1.String(), - "Failure at DeleteSiteFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteSiteFromSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteSiteFromSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteSiteFromSdaFabric", err, - "Failure at DeleteSiteFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteSiteFromSdaFabricV1", err, + "Failure at DeleteSiteFromSdaFabricV1, unexpected response", "")) return diags } @@ -303,7 +305,7 @@ func resourceSdaFabricSiteDelete(ctx context.Context, d *schema.ResourceData, m if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteSiteFromSdaFabric", err)) + "Failure when executing DeleteSiteFromSdaFabricV1", err)) return diags } } @@ -314,8 +316,8 @@ func resourceSdaFabricSiteDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestSdaFabricSiteAddSiteInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddSiteInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddSiteInSdaFabric{} +func expandRequestSdaFabricSiteAddSiteInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddSiteInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddSiteInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_name")))) { request.FabricName = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_fabric_sites.go b/catalystcenter/resource_sda_fabric_sites.go index 566acd6..4a4ac0a 100644 --- a/catalystcenter/resource_sda_fabric_sites.go +++ b/catalystcenter/resource_sda_fabric_sites.go @@ -74,7 +74,7 @@ func resourceSdaFabricSites() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddFabricSite`, + Description: `Array of RequestSdaAddFabricSiteV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -133,14 +133,14 @@ func resourceSdaFabricSitesCreate(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricSitesAddFabricSite(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricSitesAddFabricSiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] vvID := interfaceToString(vID) vSiteID := resourceItem["site_id"] vvSiteID := interfaceToString(vSiteID) - queryParamImport := catalystcentersdkgo.GetFabricSitesQueryParams{} + queryParamImport := catalystcentersdkgo.GetFabricSitesV1QueryParams{} queryParamImport.SiteID = vvSiteID item2, err := searchSdaGetFabricSites(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -189,7 +189,7 @@ func resourceSdaFabricSitesCreate(ctx context.Context, d *schema.ResourceData, m return diags } } - queryParamValidate := catalystcentersdkgo.GetFabricSitesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetFabricSitesV1QueryParams{} queryParamValidate.SiteID = vvSiteID item3, err := searchSdaGetFabricSites(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -219,7 +219,7 @@ func resourceSdaFabricSitesRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetFabricSites") - queryParams1 := catalystcentersdkgo.GetFabricSitesQueryParams{} + queryParams1 := catalystcentersdkgo.GetFabricSitesV1QueryParams{} queryParams1.SiteID = vvSiteID item1, err := searchSdaGetFabricSites(m, queryParams1, vvID) @@ -228,11 +228,11 @@ func resourceSdaFabricSitesRead(ctx context.Context, d *schema.ResourceData, m i return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetFabricSitesResponse{ + items := []catalystcentersdkgo.ResponseSdaGetFabricSitesV1Response{ *item1, } - vItem1 := flattenSdaGetFabricSitesItems(&items) + vItem1 := flattenSdaGetFabricSitesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetFabricSites search response", @@ -254,7 +254,7 @@ func resourceSdaFabricSitesUpdate(ctx context.Context, d *schema.ResourceData, m vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaFabricSitesUpdateFabricSite(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricSitesUpdateFabricSiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -370,9 +370,9 @@ func resourceSdaFabricSitesDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestSdaFabricSitesAddFabricSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricSite { - request := catalystcentersdkgo.RequestSdaAddFabricSite{} - if v := expandRequestSdaFabricSitesAddFabricSiteItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricSitesAddFabricSiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricSiteV1 { + request := catalystcentersdkgo.RequestSdaAddFabricSiteV1{} + if v := expandRequestSdaFabricSitesAddFabricSiteV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -381,8 +381,8 @@ func expandRequestSdaFabricSitesAddFabricSite(ctx context.Context, key string, d return &request } -func expandRequestSdaFabricSitesAddFabricSiteItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricSite { - request := []catalystcentersdkgo.RequestItemSdaAddFabricSite{} +func expandRequestSdaFabricSitesAddFabricSiteV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricSiteV1 { + request := []catalystcentersdkgo.RequestItemSdaAddFabricSiteV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -393,7 +393,7 @@ func expandRequestSdaFabricSitesAddFabricSiteItemArray(ctx context.Context, key return nil } for item_no := range objs { - i := expandRequestSdaFabricSitesAddFabricSiteItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricSitesAddFabricSiteV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -404,8 +404,8 @@ func expandRequestSdaFabricSitesAddFabricSiteItemArray(ctx context.Context, key return &request } -func expandRequestSdaFabricSitesAddFabricSiteItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricSite { - request := catalystcentersdkgo.RequestItemSdaAddFabricSite{} +func expandRequestSdaFabricSitesAddFabricSiteV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricSiteV1 { + request := catalystcentersdkgo.RequestItemSdaAddFabricSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { request.SiteID = interfaceToString(v) } @@ -421,9 +421,9 @@ func expandRequestSdaFabricSitesAddFabricSiteItem(ctx context.Context, key strin return &request } -func expandRequestSdaFabricSitesUpdateFabricSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricSite { - request := catalystcentersdkgo.RequestSdaUpdateFabricSite{} - if v := expandRequestSdaFabricSitesUpdateFabricSiteItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricSitesUpdateFabricSiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricSiteV1 { + request := catalystcentersdkgo.RequestSdaUpdateFabricSiteV1{} + if v := expandRequestSdaFabricSitesUpdateFabricSiteV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -432,8 +432,8 @@ func expandRequestSdaFabricSitesUpdateFabricSite(ctx context.Context, key string return &request } -func expandRequestSdaFabricSitesUpdateFabricSiteItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricSite { - request := []catalystcentersdkgo.RequestItemSdaUpdateFabricSite{} +func expandRequestSdaFabricSitesUpdateFabricSiteV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricSiteV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateFabricSiteV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -444,7 +444,7 @@ func expandRequestSdaFabricSitesUpdateFabricSiteItemArray(ctx context.Context, k return nil } for item_no := range objs { - i := expandRequestSdaFabricSitesUpdateFabricSiteItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricSitesUpdateFabricSiteV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -455,8 +455,8 @@ func expandRequestSdaFabricSitesUpdateFabricSiteItemArray(ctx context.Context, k return &request } -func expandRequestSdaFabricSitesUpdateFabricSiteItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricSite { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricSite{} +func expandRequestSdaFabricSitesUpdateFabricSiteV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricSiteV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -475,11 +475,11 @@ func expandRequestSdaFabricSitesUpdateFabricSiteItem(ctx context.Context, key st return &request } -func searchSdaGetFabricSites(m interface{}, queryParams catalystcentersdkgo.GetFabricSitesQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetFabricSitesResponse, error) { +func searchSdaGetFabricSites(m interface{}, queryParams catalystcentersdkgo.GetFabricSitesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetFabricSitesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetFabricSitesResponse - var ite *catalystcentersdkgo.ResponseSdaGetFabricSites + var foundItem *catalystcentersdkgo.ResponseSdaGetFabricSitesV1Response + var ite *catalystcentersdkgo.ResponseSdaGetFabricSitesV1 ite, _, err = client.Sda.GetFabricSites(&queryParams) if err != nil || ite == nil { diff --git a/catalystcenter/resource_sda_fabric_zones.go b/catalystcenter/resource_sda_fabric_zones.go index f868daf..d5595dc 100644 --- a/catalystcenter/resource_sda_fabric_zones.go +++ b/catalystcenter/resource_sda_fabric_zones.go @@ -118,7 +118,7 @@ func resourceSdaFabricZonesCreate(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaFabricZonesAddFabricZone(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricZonesAddFabricZoneV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) // vID := resourceItem["id"] @@ -127,7 +127,7 @@ func resourceSdaFabricZonesCreate(ctx context.Context, d *schema.ResourceData, m vvSiteID := interfaceToString(vSiteID) vName := resourceItem["authentication_profile_name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetFabricZonesQueryParams{} + queryParamImport := catalystcentersdkgo.GetFabricZonesV1QueryParams{} queryParamImport.SiteID = vvSiteID item2, err := searchSdaGetFabricZones(m, queryParamImport, vvName) if err == nil && item2 != nil { @@ -177,7 +177,7 @@ func resourceSdaFabricZonesCreate(ctx context.Context, d *schema.ResourceData, m return diags } } - queryParamValidate := catalystcentersdkgo.GetFabricZonesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetFabricZonesV1QueryParams{} queryParamValidate.SiteID = vvSiteID item3, err := searchSdaGetFabricZones(m, queryParamValidate, vvName) if err != nil || item3 == nil { @@ -208,7 +208,7 @@ func resourceSdaFabricZonesRead(ctx context.Context, d *schema.ResourceData, m i selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetFabricZones") - queryParams1 := catalystcentersdkgo.GetFabricZonesQueryParams{} + queryParams1 := catalystcentersdkgo.GetFabricZonesV1QueryParams{} queryParams1.SiteID = vSiteID item1, err := searchSdaGetFabricZones(m, queryParams1, vName) @@ -217,10 +217,10 @@ func resourceSdaFabricZonesRead(ctx context.Context, d *schema.ResourceData, m i return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetFabricZonesResponse{ + items := []catalystcentersdkgo.ResponseSdaGetFabricZonesV1Response{ *item1, } - vItem1 := flattenSdaGetFabricZonesItems(&items) + vItem1 := flattenSdaGetFabricZonesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetFabricZones search response", @@ -241,7 +241,7 @@ func resourceSdaFabricZonesUpdate(ctx context.Context, d *schema.ResourceData, m vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaFabricZonesUpdateFabricZone(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricZonesUpdateFabricZoneV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -356,9 +356,9 @@ func resourceSdaFabricZonesDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestSdaFabricZonesAddFabricZone(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricZone { - request := catalystcentersdkgo.RequestSdaAddFabricZone{} - if v := expandRequestSdaFabricZonesAddFabricZoneItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricZonesAddFabricZoneV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddFabricZoneV1 { + request := catalystcentersdkgo.RequestSdaAddFabricZoneV1{} + if v := expandRequestSdaFabricZonesAddFabricZoneV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -367,8 +367,8 @@ func expandRequestSdaFabricZonesAddFabricZone(ctx context.Context, key string, d return &request } -func expandRequestSdaFabricZonesAddFabricZoneItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricZone { - request := []catalystcentersdkgo.RequestItemSdaAddFabricZone{} +func expandRequestSdaFabricZonesAddFabricZoneV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddFabricZoneV1 { + request := []catalystcentersdkgo.RequestItemSdaAddFabricZoneV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -379,7 +379,7 @@ func expandRequestSdaFabricZonesAddFabricZoneItemArray(ctx context.Context, key return nil } for item_no := range objs { - i := expandRequestSdaFabricZonesAddFabricZoneItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricZonesAddFabricZoneV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -390,8 +390,8 @@ func expandRequestSdaFabricZonesAddFabricZoneItemArray(ctx context.Context, key return &request } -func expandRequestSdaFabricZonesAddFabricZoneItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricZone { - request := catalystcentersdkgo.RequestItemSdaAddFabricZone{} +func expandRequestSdaFabricZonesAddFabricZoneV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddFabricZoneV1 { + request := catalystcentersdkgo.RequestItemSdaAddFabricZoneV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { request.SiteID = interfaceToString(v) } @@ -404,9 +404,9 @@ func expandRequestSdaFabricZonesAddFabricZoneItem(ctx context.Context, key strin return &request } -func expandRequestSdaFabricZonesUpdateFabricZone(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricZone { - request := catalystcentersdkgo.RequestSdaUpdateFabricZone{} - if v := expandRequestSdaFabricZonesUpdateFabricZoneItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricZonesUpdateFabricZoneV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateFabricZoneV1 { + request := catalystcentersdkgo.RequestSdaUpdateFabricZoneV1{} + if v := expandRequestSdaFabricZonesUpdateFabricZoneV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -415,8 +415,8 @@ func expandRequestSdaFabricZonesUpdateFabricZone(ctx context.Context, key string return &request } -func expandRequestSdaFabricZonesUpdateFabricZoneItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricZone { - request := []catalystcentersdkgo.RequestItemSdaUpdateFabricZone{} +func expandRequestSdaFabricZonesUpdateFabricZoneV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateFabricZoneV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateFabricZoneV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -427,7 +427,7 @@ func expandRequestSdaFabricZonesUpdateFabricZoneItemArray(ctx context.Context, k return nil } for item_no := range objs { - i := expandRequestSdaFabricZonesUpdateFabricZoneItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricZonesUpdateFabricZoneV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -438,8 +438,8 @@ func expandRequestSdaFabricZonesUpdateFabricZoneItemArray(ctx context.Context, k return &request } -func expandRequestSdaFabricZonesUpdateFabricZoneItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricZone { - request := catalystcentersdkgo.RequestItemSdaUpdateFabricZone{} +func expandRequestSdaFabricZonesUpdateFabricZoneV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateFabricZoneV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateFabricZoneV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -455,11 +455,11 @@ func expandRequestSdaFabricZonesUpdateFabricZoneItem(ctx context.Context, key st return &request } -func searchSdaGetFabricZones(m interface{}, queryParams catalystcentersdkgo.GetFabricZonesQueryParams, vName string) (*catalystcentersdkgo.ResponseSdaGetFabricZonesResponse, error) { +func searchSdaGetFabricZones(m interface{}, queryParams catalystcentersdkgo.GetFabricZonesV1QueryParams, vName string) (*catalystcentersdkgo.ResponseSdaGetFabricZonesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetFabricZonesResponse - var ite *catalystcentersdkgo.ResponseSdaGetFabricZones + var foundItem *catalystcentersdkgo.ResponseSdaGetFabricZonesV1Response + var ite *catalystcentersdkgo.ResponseSdaGetFabricZonesV1 ite, _, err = client.Sda.GetFabricZones(&queryParams) if err != nil || ite == nil { diff --git a/catalystcenter/resource_sda_fabrics_vlan_to_ssids_fabric_id.go b/catalystcenter/resource_sda_fabrics_vlan_to_ssids_fabric_id.go index 8644fe9..26feacb 100644 --- a/catalystcenter/resource_sda_fabrics_vlan_to_ssids_fabric_id.go +++ b/catalystcenter/resource_sda_fabrics_vlan_to_ssids_fabric_id.go @@ -19,7 +19,7 @@ func resourceSdaFabricsVLANToSSIDsFabricID() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Fabric Wireless. -- Add update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping +- Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared. The request must include all SSIDs currently mapped to a VLAN, as determined by the response from the GET operation for the same fabricId used in the request. If an already-mapped SSID is not included in the payload, its mapping will be removed by this API. Conversely, if a new SSID @@ -163,19 +163,19 @@ func resourceSdaFabricsVLANToSSIDsFabricIDRead(ctx context.Context, d *schema.Re if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite") - queryParams1 := catalystcentersdkgo.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1QueryParams{} item1, err := searchFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite(m, queryParams1, vID, vName) if err != nil || item1 == nil { d.SetId("") return diags } - items := []catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteResponse{ + items := []catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Response{ *item1, } // Review flatten function used - vItem1 := flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteItems(&items) + vItem1 := flattenFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite search response", @@ -195,7 +195,7 @@ func resourceSdaFabricsVLANToSSIDsFabricIDUpdate(ctx context.Context, d *schema. resourceMap := separateResourceID(resourceID) vvFabricID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLAN(ctx, "parameters.0", d) + request1 := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.FabricWireless.AddUpdateOrRemoveSSIDMappingToAVLAN(vvFabricID, request1) if err != nil || response1 == nil { @@ -254,9 +254,9 @@ func resourceSdaFabricsVLANToSSIDsFabricIDDelete(ctx context.Context, d *schema. "Failure at SdaFabricsVLANToSSIDsFabricIDDelete, unexpected response", "")) return diags } -func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLAN(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLAN { - request := catalystcentersdkgo.RequestFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLAN{} - if v := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1 { + request := catalystcentersdkgo.RequestFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1{} + if v := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -265,8 +265,8 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return &request } -func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLAN { - request := []catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLAN{} +func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1 { + request := []catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -277,7 +277,7 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return nil } for item_no := range objs { - i := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -288,13 +288,13 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return &request } -func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLAN { - request := catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLAN{} +func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1 { + request := catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".vlan_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".vlan_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".vlan_name")))) { request.VLANName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_details")))) { - request.SSIDDetails = expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItemSSIDDetailsArray(ctx, key+".ssid_details", d) + request.SSIDDetails = expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1ItemSSIDDetailsArray(ctx, key+".ssid_details", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -302,8 +302,8 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return &request } -func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItemSSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANSSIDDetails { - request := []catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANSSIDDetails{} +func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1ItemSSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1SSIDDetails { + request := []catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1SSIDDetails{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -314,7 +314,7 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return nil } for item_no := range objs { - i := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItemSSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1ItemSSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -325,8 +325,8 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return &request } -func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANItemSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANSSIDDetails { - request := catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANSSIDDetails{} +func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVLANV1ItemSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1SSIDDetails { + request := catalystcentersdkgo.RequestItemFabricWirelessAddUpdateOrRemoveSSIDMappingToAVLANV1SSIDDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -339,10 +339,10 @@ func expandRequestSdaFabricsVLANToSSIDsFabricIDAddUpdateOrRemoveSSIDMappingToAVL return &request } -func searchFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite(m interface{}, queryParams catalystcentersdkgo.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteQueryParams, vID string, vName string) (*catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteResponse, error) { +func searchFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite(m interface{}, queryParams catalystcentersdkgo.RetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1QueryParams, vID string, vName string) (*catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteResponse + var foundItem *catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSiteV1Response // var ite *catalystcentersdkgo.ResponseFabricWirelessRetrieveTheVLANsAndSSIDsMappedToTheVLANWithinAFabricSite if vID != "" { queryParams.Offset = 1 diff --git a/catalystcenter/resource_sda_layer2_virtual_networks.go b/catalystcenter/resource_sda_layer2_virtual_networks.go index 50295ac..cc32134 100644 --- a/catalystcenter/resource_sda_layer2_virtual_networks.go +++ b/catalystcenter/resource_sda_layer2_virtual_networks.go @@ -94,7 +94,7 @@ func resourceSdaLayer2VirtualNetworks() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddLayer2VirtualNetworks`, + Description: `Array of RequestSdaAddLayer2VirtualNetworksV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -174,7 +174,7 @@ func resourceSdaLayer2VirtualNetworksCreate(ctx context.Context, d *schema.Resou var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -184,7 +184,7 @@ func resourceSdaLayer2VirtualNetworksCreate(ctx context.Context, d *schema.Resou vName := resourceItem["associated_layer3_virtual_network_name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetLayer2VirtualNetworksQueryParams{} + queryParamImport := catalystcentersdkgo.GetLayer2VirtualNetworksV1QueryParams{} queryParamImport.FabricID = vvFabricID queryParamImport.AssociatedLayer3VirtualNetworkName = vvName item2, err := searchSdaGetLayer2VirtualNetworks(m, queryParamImport, vvID) @@ -235,7 +235,7 @@ func resourceSdaLayer2VirtualNetworksCreate(ctx context.Context, d *schema.Resou return diags } } - queryParamValidate := catalystcentersdkgo.GetLayer2VirtualNetworksQueryParams{} + queryParamValidate := catalystcentersdkgo.GetLayer2VirtualNetworksV1QueryParams{} queryParamValidate.ID = vvID queryParamValidate.FabricID = vvFabricID queryParamValidate.AssociatedLayer3VirtualNetworkName = vvName @@ -269,7 +269,7 @@ func resourceSdaLayer2VirtualNetworksRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetLayer2VirtualNetworks") - queryParams1 := catalystcentersdkgo.GetLayer2VirtualNetworksQueryParams{} + queryParams1 := catalystcentersdkgo.GetLayer2VirtualNetworksV1QueryParams{} queryParams1.FabricID = vvFabicID queryParams1.AssociatedLayer3VirtualNetworkName = vvName @@ -279,10 +279,10 @@ func resourceSdaLayer2VirtualNetworksRead(ctx context.Context, d *schema.Resourc return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksResponse{ + items := []catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksV1Response{ *item1, } - vItem1 := flattenSdaGetLayer2VirtualNetworksItems(&items) + vItem1 := flattenSdaGetLayer2VirtualNetworksV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetLayer2VirtualNetworks search response", @@ -304,7 +304,7 @@ func resourceSdaLayer2VirtualNetworksUpdate(ctx context.Context, d *schema.Resou vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -421,9 +421,9 @@ func resourceSdaLayer2VirtualNetworksDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddLayer2VirtualNetworks { - request := catalystcentersdkgo.RequestSdaAddLayer2VirtualNetworks{} - if v := expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddLayer2VirtualNetworksV1 { + request := catalystcentersdkgo.RequestSdaAddLayer2VirtualNetworksV1{} + if v := expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -432,8 +432,8 @@ func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworks(ctx context.C return &request } -func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworks { - request := []catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworks{} +func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -444,7 +444,7 @@ func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItemArray(ctx return nil } for item_no := range objs { - i := expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -455,8 +455,8 @@ func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItemArray(ctx return &request } -func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworks { - request := catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworks{} +func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaAddLayer2VirtualNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_id")))) { request.FabricID = interfaceToString(v) } @@ -481,9 +481,9 @@ func expandRequestSdaLayer2VirtualNetworksAddLayer2VirtualNetworksItem(ctx conte return &request } -func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateLayer2VirtualNetworks { - request := catalystcentersdkgo.RequestSdaUpdateLayer2VirtualNetworks{} - if v := expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateLayer2VirtualNetworksV1 { + request := catalystcentersdkgo.RequestSdaUpdateLayer2VirtualNetworksV1{} + if v := expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -492,8 +492,8 @@ func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworks(ctx contex return &request } -func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworks { - request := []catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworks{} +func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -504,7 +504,7 @@ func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItemArray(c return nil } for item_no := range objs { - i := expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -515,8 +515,8 @@ func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItemArray(c return &request } -func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworks { - request := catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworks{} +func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateLayer2VirtualNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -544,11 +544,11 @@ func expandRequestSdaLayer2VirtualNetworksUpdateLayer2VirtualNetworksItem(ctx co return &request } -func searchSdaGetLayer2VirtualNetworks(m interface{}, queryParams catalystcentersdkgo.GetLayer2VirtualNetworksQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksResponse, error) { +func searchSdaGetLayer2VirtualNetworks(m interface{}, queryParams catalystcentersdkgo.GetLayer2VirtualNetworksV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksResponse - var ite *catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworks + var foundItem *catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksV1Response + var ite *catalystcentersdkgo.ResponseSdaGetLayer2VirtualNetworksV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetLayer2VirtualNetworks(nil) diff --git a/catalystcenter/resource_sda_layer3_virtual_networks.go b/catalystcenter/resource_sda_layer3_virtual_networks.go index af99a8c..3eb2637 100644 --- a/catalystcenter/resource_sda_layer3_virtual_networks.go +++ b/catalystcenter/resource_sda_layer3_virtual_networks.go @@ -76,7 +76,7 @@ func resourceSdaLayer3VirtualNetworks() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddLayer3VirtualNetworks`, + Description: `Array of RequestSdaAddLayer3VirtualNetworksV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -136,13 +136,13 @@ func resourceSdaLayer3VirtualNetworksCreate(ctx context.Context, d *schema.Resou var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["virtual_network_name"] vvName := interfaceToString(vName) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParamImport := catalystcentersdkgo.GetLayer3VirtualNetworksQueryParams{} + queryParamImport := catalystcentersdkgo.GetLayer3VirtualNetworksV1QueryParams{} queryParamImport.VirtualNetworkName = vvName item2, err := searchSdaGetLayer3VirtualNetworks(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -191,7 +191,7 @@ func resourceSdaLayer3VirtualNetworksCreate(ctx context.Context, d *schema.Resou return diags } } - queryParamValidate := catalystcentersdkgo.GetLayer3VirtualNetworksQueryParams{} + queryParamValidate := catalystcentersdkgo.GetLayer3VirtualNetworksV1QueryParams{} queryParamValidate.VirtualNetworkName = vvName item3, err := searchSdaGetLayer3VirtualNetworks(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -219,7 +219,7 @@ func resourceSdaLayer3VirtualNetworksRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetLayer3VirtualNetworks") - queryParams1 := catalystcentersdkgo.GetLayer3VirtualNetworksQueryParams{} + queryParams1 := catalystcentersdkgo.GetLayer3VirtualNetworksV1QueryParams{} queryParams1.VirtualNetworkName = vName item1, err := searchSdaGetLayer3VirtualNetworks(m, queryParams1, vvID) if err != nil || item1 == nil { @@ -228,11 +228,11 @@ func resourceSdaLayer3VirtualNetworksRead(ctx context.Context, d *schema.Resourc } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksResponse{ + items := []catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksV1Response{ *item1, } - vItem1 := flattenSdaGetLayer3VirtualNetworksItems(&items) + vItem1 := flattenSdaGetLayer3VirtualNetworksV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetLayer3VirtualNetworks search response", @@ -252,7 +252,7 @@ func resourceSdaLayer3VirtualNetworksUpdate(ctx context.Context, d *schema.Resou resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -317,7 +317,7 @@ func resourceSdaLayer3VirtualNetworksDelete(ctx context.Context, d *schema.Resou resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteLayer3VirtualNetworksQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteLayer3VirtualNetworksV1QueryParams{} vvVirtualNetworkName := resourceMap["virtual_network_name"] queryParamDelete.VirtualNetworkName = vvVirtualNetworkName @@ -372,9 +372,9 @@ func resourceSdaLayer3VirtualNetworksDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddLayer3VirtualNetworks { - request := catalystcentersdkgo.RequestSdaAddLayer3VirtualNetworks{} - if v := expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddLayer3VirtualNetworksV1 { + request := catalystcentersdkgo.RequestSdaAddLayer3VirtualNetworksV1{} + if v := expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -383,8 +383,8 @@ func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworks(ctx context.C return &request } -func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworks { - request := []catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworks{} +func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -395,7 +395,7 @@ func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItemArray(ctx return nil } for item_no := range objs { - i := expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -406,8 +406,8 @@ func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItemArray(ctx return &request } -func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworks { - request := catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworks{} +func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaAddLayer3VirtualNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } @@ -423,9 +423,9 @@ func expandRequestSdaLayer3VirtualNetworksAddLayer3VirtualNetworksItem(ctx conte return &request } -func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateLayer3VirtualNetworks { - request := catalystcentersdkgo.RequestSdaUpdateLayer3VirtualNetworks{} - if v := expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateLayer3VirtualNetworksV1 { + request := catalystcentersdkgo.RequestSdaUpdateLayer3VirtualNetworksV1{} + if v := expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -434,8 +434,8 @@ func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworks(ctx contex return &request } -func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworks { - request := []catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworks{} +func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -446,7 +446,7 @@ func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItemArray(c return nil } for item_no := range objs { - i := expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -457,8 +457,8 @@ func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItemArray(c return &request } -func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworks { - request := catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworks{} +func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateLayer3VirtualNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -477,11 +477,11 @@ func expandRequestSdaLayer3VirtualNetworksUpdateLayer3VirtualNetworksItem(ctx co return &request } -func searchSdaGetLayer3VirtualNetworks(m interface{}, queryParams catalystcentersdkgo.GetLayer3VirtualNetworksQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksResponse, error) { +func searchSdaGetLayer3VirtualNetworks(m interface{}, queryParams catalystcentersdkgo.GetLayer3VirtualNetworksV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksResponse - var ite *catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworks + var foundItem *catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksV1Response + var ite *catalystcentersdkgo.ResponseSdaGetLayer3VirtualNetworksV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetLayer3VirtualNetworks(nil) diff --git a/catalystcenter/resource_sda_multicast.go b/catalystcenter/resource_sda_multicast.go index 67f5853..81e2070 100644 --- a/catalystcenter/resource_sda_multicast.go +++ b/catalystcenter/resource_sda_multicast.go @@ -232,29 +232,29 @@ func resourceSdaMulticastCreate(ctx context.Context, d *schema.ResourceData, m i var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaMulticastAddMulticastInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaMulticastAddMulticastInSdaFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSiteNameHierarchy := resourceItem["site_name_hierarchy"] vvSiteNameHierarchy := interfaceToString(vSiteNameHierarchy) - queryParamImport := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricV1QueryParams{} queryParamImport.SiteNameHierarchy = vvSiteNameHierarchy - item2, _, err := client.Sda.GetMulticastDetailsFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetMulticastDetailsFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["site_name_hierarchy"] = vvSiteNameHierarchy d.SetId(joinResourceID(resourceMap)) return resourceSdaMulticastRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddMulticastInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddMulticastInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddMulticastInSdaFabric", err, restyResp1.String())) + "Failure when executing AddMulticastInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddMulticastInSdaFabric", err)) + "Failure when executing AddMulticastInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -287,17 +287,17 @@ func resourceSdaMulticastCreate(ctx context.Context, d *schema.ResourceData, m i if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddMulticastInSdaFabric", err)) + "Failure when executing AddMulticastInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricV1QueryParams{} queryParamValidate.SiteNameHierarchy = vvSiteNameHierarchy - item3, _, err := client.Sda.GetMulticastDetailsFromSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetMulticastDetailsFromSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddMulticastInSdaFabric", err, - "Failure at AddMulticastInSdaFabric, unexpected response", "")) + "Failure when executing AddMulticastInSdaFabricV1", err, + "Failure at AddMulticastInSdaFabricV1, unexpected response", "")) return diags } @@ -320,12 +320,14 @@ func resourceSdaMulticastRead(ctx context.Context, d *schema.ResourceData, m int selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetMulticastDetailsFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetMulticastDetailsFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetMulticastDetailsFromSdaFabricV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy - response1, restyResp1, err := client.Sda.GetMulticastDetailsFromSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetMulticastDetailsFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -337,10 +339,10 @@ func resourceSdaMulticastRead(ctx context.Context, d *schema.ResourceData, m int log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetMulticastDetailsFromSdaFabricItem(response1) + vItem1 := flattenSdaGetMulticastDetailsFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetMulticastDetailsFromSdaFabric response", + "Failure when setting GetMulticastDetailsFromSdaFabricV1 response", err)) return diags } @@ -364,23 +366,23 @@ func resourceSdaMulticastDelete(ctx context.Context, d *schema.ResourceData, m i resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteMulticastFromSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteMulticastFromSdaFabricV1QueryParams{} vvSiteNameHierarchy := resourceMap["site_name_hierarchy"] queryParamDelete.SiteNameHierarchy = vvSiteNameHierarchy - response1, restyResp1, err := client.Sda.DeleteMulticastFromSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteMulticastFromSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteMulticastFromSdaFabric", err, restyResp1.String(), - "Failure at DeleteMulticastFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteMulticastFromSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteMulticastFromSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteMulticastFromSdaFabric", err, - "Failure at DeleteMulticastFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteMulticastFromSdaFabricV1", err, + "Failure at DeleteMulticastFromSdaFabricV1, unexpected response", "")) return diags } @@ -414,7 +416,7 @@ func resourceSdaMulticastDelete(ctx context.Context, d *schema.ResourceData, m i if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteMulticastFromSdaFabric", err)) + "Failure when executing DeleteMulticastFromSdaFabricV1", err)) return diags } } @@ -425,8 +427,8 @@ func resourceSdaMulticastDelete(ctx context.Context, d *schema.ResourceData, m i return diags } -func expandRequestSdaMulticastAddMulticastInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddMulticastInSdaFabric{} +func expandRequestSdaMulticastAddMulticastInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } @@ -437,7 +439,7 @@ func expandRequestSdaMulticastAddMulticastInSdaFabric(ctx context.Context, key s request.MulticastType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multicast_vn_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multicast_vn_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multicast_vn_info")))) { - request.MulticastVnInfo = expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoArray(ctx, key+".multicast_vn_info", d) + request.MulticastVnInfo = expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfoArray(ctx, key+".multicast_vn_info", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -445,8 +447,8 @@ func expandRequestSdaMulticastAddMulticastInSdaFabric(ctx context.Context, key s return &request } -func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfo { - request := []catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfo{} +func expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfo { + request := []catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfo{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -457,7 +459,7 @@ func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoArray(ctx co return nil } for item_no := range objs { - i := expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -468,8 +470,8 @@ func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoArray(ctx co return &request } -func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfo { - request := catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfo{} +func expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfo { + request := catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } @@ -483,7 +485,7 @@ func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfo(ctx context request.ExternalRpIPAddress = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssm_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssm_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssm_info")))) { - request.SsmInfo = expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoSsmInfoArray(ctx, key+".ssm_info", d) + request.SsmInfo = expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfoSsmInfoArray(ctx, key+".ssm_info", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -491,8 +493,8 @@ func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfo(ctx context return &request } -func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoSsmInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfoSsmInfo { - request := []catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfoSsmInfo{} +func expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfoSsmInfoArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfoSsmInfo { + request := []catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfoSsmInfo{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -503,7 +505,7 @@ func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoSsmInfoArray return nil } for item_no := range objs { - i := expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoSsmInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfoSsmInfo(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -514,8 +516,8 @@ func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoSsmInfoArray return &request } -func expandRequestSdaMulticastAddMulticastInSdaFabricMulticastVnInfoSsmInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfoSsmInfo { - request := catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricMulticastVnInfoSsmInfo{} +func expandRequestSdaMulticastAddMulticastInSdaFabricV1MulticastVnInfoSsmInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfoSsmInfo { + request := catalystcentersdkgo.RequestSdaAddMulticastInSdaFabricV1MulticastVnInfoSsmInfo{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssm_group_range")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssm_group_range")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssm_group_range")))) { request.SsmGroupRange = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_multicast_v1_update.go b/catalystcenter/resource_sda_multicast_v1_update.go index e7c6cac..173897d 100644 --- a/catalystcenter/resource_sda_multicast_v1_update.go +++ b/catalystcenter/resource_sda_multicast_v1_update.go @@ -64,7 +64,7 @@ func resourceSdaMulticastV1Update() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSdaUpdateMulticast`, + Description: `Array of RequestSdaUpdateMulticastV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -102,20 +102,18 @@ func resourceSdaMulticastV1UpdateCreate(ctx context.Context, d *schema.ResourceD client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSdaMulticastV1UpdateUpdateMulticast(ctx, "parameters.0", d) + request1 := expandRequestSdaMulticastV1UpdateUpdateMulticastV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sda.UpdateMulticast(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sda.UpdateMulticastV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateMulticast", err)) + "Failure when executing UpdateMulticastV1", err)) return diags } @@ -123,7 +121,7 @@ func resourceSdaMulticastV1UpdateCreate(ctx context.Context, d *schema.ResourceD if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateMulticast", err)) + "Failure when executing UpdateMulticastV1", err)) return diags } taskId := response1.Response.TaskID @@ -157,22 +155,24 @@ func resourceSdaMulticastV1UpdateCreate(ctx context.Context, d *schema.ResourceD } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateMulticast", err1)) + "Failure when executing UpdateMulticastV1", err1)) return diags } } - vItem1 := flattenSdaUpdateMulticastItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSdaUpdateMulticastV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateMulticast response", + "Failure when setting UpdateMulticastV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSdaMulticastV1UpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -187,16 +187,16 @@ func resourceSdaMulticastV1UpdateDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestSdaMulticastV1UpdateUpdateMulticast(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateMulticast { - request := catalystcentersdkgo.RequestSdaUpdateMulticast{} - if v := expandRequestSdaMulticastV1UpdateUpdateMulticastItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaMulticastV1UpdateUpdateMulticastV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateMulticastV1 { + request := catalystcentersdkgo.RequestSdaUpdateMulticastV1{} + if v := expandRequestSdaMulticastV1UpdateUpdateMulticastV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSdaMulticastV1UpdateUpdateMulticastItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateMulticast { - request := []catalystcentersdkgo.RequestItemSdaUpdateMulticast{} +func expandRequestSdaMulticastV1UpdateUpdateMulticastV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateMulticastV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateMulticastV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -207,7 +207,7 @@ func expandRequestSdaMulticastV1UpdateUpdateMulticastItemArray(ctx context.Conte return nil } for item_no := range objs { - i := expandRequestSdaMulticastV1UpdateUpdateMulticastItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastV1UpdateUpdateMulticastV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -215,8 +215,8 @@ func expandRequestSdaMulticastV1UpdateUpdateMulticastItemArray(ctx context.Conte return &request } -func expandRequestSdaMulticastV1UpdateUpdateMulticastItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateMulticast { - request := catalystcentersdkgo.RequestItemSdaUpdateMulticast{} +func expandRequestSdaMulticastV1UpdateUpdateMulticastV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateMulticastV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateMulticastV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_id")))) { request.FabricID = interfaceToString(v) } @@ -226,7 +226,7 @@ func expandRequestSdaMulticastV1UpdateUpdateMulticastItem(ctx context.Context, k return &request } -func flattenSdaUpdateMulticastItem(item *catalystcentersdkgo.ResponseSdaUpdateMulticastResponse) []map[string]interface{} { +func flattenSdaUpdateMulticastV1Item(item *catalystcentersdkgo.ResponseSdaUpdateMulticastV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sda_multicast_virtual_networks.go b/catalystcenter/resource_sda_multicast_virtual_networks.go index 12f2321..a000876 100644 --- a/catalystcenter/resource_sda_multicast_virtual_networks.go +++ b/catalystcenter/resource_sda_multicast_virtual_networks.go @@ -4,11 +4,10 @@ import ( "context" "errors" "fmt" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -297,7 +296,7 @@ func resourceSdaMulticastVirtualNetworksCreate(ctx context.Context, d *schema.Re var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -307,7 +306,7 @@ func resourceSdaMulticastVirtualNetworksCreate(ctx context.Context, d *schema.Re vName := resourceItem["virtual_network_name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetMulticastVirtualNetworksQueryParams{} + queryParamImport := catalystcentersdkgo.GetMulticastVirtualNetworksV1QueryParams{} queryParamImport.FabricID = vvFabricID queryParamImport.VirtualNetworkName = vvName item2, err := searchSdaGetMulticastVirtualNetworks(m, queryParamImport, vvID) @@ -358,7 +357,7 @@ func resourceSdaMulticastVirtualNetworksCreate(ctx context.Context, d *schema.Re return diags } } - queryParamValidate := catalystcentersdkgo.GetMulticastVirtualNetworksQueryParams{} + queryParamValidate := catalystcentersdkgo.GetMulticastVirtualNetworksV1QueryParams{} queryParamValidate.FabricID = vvFabricID queryParamValidate.VirtualNetworkName = vvName item3, err := searchSdaGetMulticastVirtualNetworks(m, queryParamValidate, vvID) @@ -389,7 +388,7 @@ func resourceSdaMulticastVirtualNetworksRead(ctx context.Context, d *schema.Reso selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetMulticastVirtualNetworks") - queryParams1 := catalystcentersdkgo.GetMulticastVirtualNetworksQueryParams{} + queryParams1 := catalystcentersdkgo.GetMulticastVirtualNetworksV1QueryParams{} queryParams1.FabricID = vvFabricID queryParams1.VirtualNetworkName = vvName item1, err := searchSdaGetMulticastVirtualNetworks(m, queryParams1, vvID) @@ -398,10 +397,10 @@ func resourceSdaMulticastVirtualNetworksRead(ctx context.Context, d *schema.Reso return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksResponse{ + items := []catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksV1Response{ *item1, } - vItem1 := flattenSdaGetMulticastVirtualNetworksItems(&items) + vItem1 := flattenSdaGetMulticastVirtualNetworksV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetMulticastVirtualNetworks search response", @@ -421,7 +420,7 @@ func resourceSdaMulticastVirtualNetworksUpdate(ctx context.Context, d *schema.Re resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -536,9 +535,9 @@ func resourceSdaMulticastVirtualNetworksDelete(ctx context.Context, d *schema.Re return diags } -func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastVirtualNetworks { - request := catalystcentersdkgo.RequestSdaAddMulticastVirtualNetworks{} - if v := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddMulticastVirtualNetworksV1 { + request := catalystcentersdkgo.RequestSdaAddMulticastVirtualNetworksV1{} + if v := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -547,8 +546,8 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworks(ctx con return &request } -func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworks { - request := []catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworks{} +func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -559,7 +558,7 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemArra return nil } for item_no := range objs { - i := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -570,8 +569,8 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemArra return &request } -func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworks { - request := catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworks{} +func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_id")))) { request.FabricID = interfaceToString(v) } @@ -585,7 +584,7 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItem(ctx request.IPv4SsmRanges = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multicast_r_ps")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multicast_r_ps")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multicast_r_ps")))) { - request.MulticastRPs = expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMulticastRPsArray(ctx, key+".multicast_r_ps", d) + request.MulticastRPs = expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1ItemMulticastRPsArray(ctx, key+".multicast_r_ps", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -593,8 +592,8 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItem(ctx return &request } -func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMulticastRPsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksMulticastRPs { - request := []catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksMulticastRPs{} +func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1ItemMulticastRPsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1MulticastRPs { + request := []catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1MulticastRPs{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -605,7 +604,7 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMult return nil } for item_no := range objs { - i := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMulticastRPs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1ItemMulticastRPs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -616,8 +615,8 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMult return &request } -func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMulticastRPs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksMulticastRPs { - request := catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksMulticastRPs{} +func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksV1ItemMulticastRPs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1MulticastRPs { + request := catalystcentersdkgo.RequestItemSdaAddMulticastVirtualNetworksV1MulticastRPs{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rp_device_location")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rp_device_location")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rp_device_location")))) { request.RpDeviceLocation = interfaceToString(v) } @@ -648,9 +647,9 @@ func expandRequestSdaMulticastVirtualNetworksAddMulticastVirtualNetworksItemMult return &request } -func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateMulticastVirtualNetworks { - request := catalystcentersdkgo.RequestSdaUpdateMulticastVirtualNetworks{} - if v := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateMulticastVirtualNetworksV1 { + request := catalystcentersdkgo.RequestSdaUpdateMulticastVirtualNetworksV1{} + if v := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -659,8 +658,8 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworks(ctx return &request } -func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworks { - request := []catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworks{} +func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -671,7 +670,7 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemA return nil } for item_no := range objs { - i := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -682,8 +681,8 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemA return &request } -func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworks { - request := catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworks{} +func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -700,7 +699,7 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItem( request.IPv4SsmRanges = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multicast_r_ps")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multicast_r_ps")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multicast_r_ps")))) { - request.MulticastRPs = expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemMulticastRPsArray(ctx, key+".multicast_r_ps", d) + request.MulticastRPs = expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1ItemMulticastRPsArray(ctx, key+".multicast_r_ps", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -708,8 +707,8 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItem( return &request } -func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemMulticastRPsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksMulticastRPs { - request := []catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksMulticastRPs{} +func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1ItemMulticastRPsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1MulticastRPs { + request := []catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1MulticastRPs{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -720,7 +719,7 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemM return nil } for item_no := range objs { - i := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemMulticastRPs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1ItemMulticastRPs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -731,8 +730,8 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemM return &request } -func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemMulticastRPs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksMulticastRPs { - request := catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksMulticastRPs{} +func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksV1ItemMulticastRPs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1MulticastRPs { + request := catalystcentersdkgo.RequestItemSdaUpdateMulticastVirtualNetworksV1MulticastRPs{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rp_device_location")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rp_device_location")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rp_device_location")))) { request.RpDeviceLocation = interfaceToString(v) } @@ -763,11 +762,11 @@ func expandRequestSdaMulticastVirtualNetworksUpdateMulticastVirtualNetworksItemM return &request } -func searchSdaGetMulticastVirtualNetworks(m interface{}, queryParams catalystcentersdkgo.GetMulticastVirtualNetworksQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksResponse, error) { +func searchSdaGetMulticastVirtualNetworks(m interface{}, queryParams catalystcentersdkgo.GetMulticastVirtualNetworksV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksResponse - var ite *catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworks + var foundItem *catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksV1Response + var ite *catalystcentersdkgo.ResponseSdaGetMulticastVirtualNetworksV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetMulticastVirtualNetworks(nil) diff --git a/catalystcenter/resource_sda_port_assignment_for_access_point.go b/catalystcenter/resource_sda_port_assignment_for_access_point.go index a05f9b7..e143bf5 100644 --- a/catalystcenter/resource_sda_port_assignment_for_access_point.go +++ b/catalystcenter/resource_sda_port_assignment_for_access_point.go @@ -151,33 +151,33 @@ func resourceSdaPortAssignmentForAccessPointCreate(ctx context.Context, d *schem var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaPortAssignmentForAccessPointAddPortAssignmentForAccessPointInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaPortAssignmentForAccessPointAddPortAssignmentForAccessPointInSdaFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vDeviceManagementIPAddress := resourceItem["device_management_ip_address"] vvDeviceManagementIPAddress := interfaceToString(vDeviceManagementIPAddress) vInterfaceName := resourceItem["interface_name"] vvInterfaceName := interfaceToString(vInterfaceName) - queryParamImport := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricV1QueryParams{} queryParamImport.DeviceManagementIPAddress = vvDeviceManagementIPAddress queryParamImport.InterfaceName = vvInterfaceName - item2, _, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["device_management_ip_address"] = item2.DeviceManagementIPAddress resourceMap["interface_name"] = item2.InterfaceName d.SetId(joinResourceID(resourceMap)) return resourceSdaPortAssignmentForAccessPointRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddPortAssignmentForAccessPointInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddPortAssignmentForAccessPointInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddPortAssignmentForAccessPointInSdaFabric", err, restyResp1.String())) + "Failure when executing AddPortAssignmentForAccessPointInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddPortAssignmentForAccessPointInSdaFabric", err)) + "Failure when executing AddPortAssignmentForAccessPointInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -210,18 +210,18 @@ func resourceSdaPortAssignmentForAccessPointCreate(ctx context.Context, d *schem if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddPortAssignmentForAccessPointInSdaFabric", err)) + "Failure when executing AddPortAssignmentForAccessPointInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricV1QueryParams{} queryParamValidate.DeviceManagementIPAddress = vvDeviceManagementIPAddress queryParamValidate.InterfaceName = vvInterfaceName - item3, _, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddPortAssignmentForAccessPointInSdaFabric", err, - "Failure at AddPortAssignmentForAccessPointInSdaFabric, unexpected response", "")) + "Failure when executing AddPortAssignmentForAccessPointInSdaFabricV1", err, + "Failure at AddPortAssignmentForAccessPointInSdaFabricV1, unexpected response", "")) return diags } @@ -247,14 +247,16 @@ func resourceSdaPortAssignmentForAccessPointRead(ctx context.Context, d *schema. selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortAssignmentForAccessPointInSdaFabric") - queryParams1 := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortAssignmentForAccessPointInSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetPortAssignmentForAccessPointInSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress queryParams1.InterfaceName = vInterfaceName - response1, restyResp1, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetPortAssignmentForAccessPointInSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -266,10 +268,10 @@ func resourceSdaPortAssignmentForAccessPointRead(ctx context.Context, d *schema. log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetPortAssignmentForAccessPointInSdaFabricItem(response1) + vItem1 := flattenSdaGetPortAssignmentForAccessPointInSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortAssignmentForAccessPointInSdaFabric response", + "Failure when setting GetPortAssignmentForAccessPointInSdaFabricV1 response", err)) return diags } @@ -293,7 +295,7 @@ func resourceSdaPortAssignmentForAccessPointDelete(ctx context.Context, d *schem resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeletePortAssignmentForAccessPointInSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeletePortAssignmentForAccessPointInSdaFabricV1QueryParams{} vvDeviceManagementIPAddress := resourceMap["device_management_ip_address"] @@ -302,18 +304,18 @@ func resourceSdaPortAssignmentForAccessPointDelete(ctx context.Context, d *schem queryParamDelete.InterfaceName = vvInterfaceName - response1, restyResp1, err := client.Sda.DeletePortAssignmentForAccessPointInSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeletePortAssignmentForAccessPointInSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeletePortAssignmentForAccessPointInSdaFabric", err, restyResp1.String(), - "Failure at DeletePortAssignmentForAccessPointInSdaFabric, unexpected response", "")) + "Failure when executing DeletePortAssignmentForAccessPointInSdaFabricV1", err, restyResp1.String(), + "Failure at DeletePortAssignmentForAccessPointInSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeletePortAssignmentForAccessPointInSdaFabric", err, - "Failure at DeletePortAssignmentForAccessPointInSdaFabric, unexpected response", "")) + "Failure when executing DeletePortAssignmentForAccessPointInSdaFabricV1", err, + "Failure at DeletePortAssignmentForAccessPointInSdaFabricV1, unexpected response", "")) return diags } @@ -347,7 +349,7 @@ func resourceSdaPortAssignmentForAccessPointDelete(ctx context.Context, d *schem if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeletePortAssignmentForAccessPointInSdaFabric", err)) + "Failure when executing DeletePortAssignmentForAccessPointInSdaFabricV1", err)) return diags } } @@ -358,8 +360,8 @@ func resourceSdaPortAssignmentForAccessPointDelete(ctx context.Context, d *schem return diags } -func expandRequestSdaPortAssignmentForAccessPointAddPortAssignmentForAccessPointInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortAssignmentForAccessPointInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddPortAssignmentForAccessPointInSdaFabric{} +func expandRequestSdaPortAssignmentForAccessPointAddPortAssignmentForAccessPointInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortAssignmentForAccessPointInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddPortAssignmentForAccessPointInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_port_assignment_for_user_device.go b/catalystcenter/resource_sda_port_assignment_for_user_device.go index de32808..37debb2 100644 --- a/catalystcenter/resource_sda_port_assignment_for_user_device.go +++ b/catalystcenter/resource_sda_port_assignment_for_user_device.go @@ -175,33 +175,33 @@ func resourceSdaPortAssignmentForUserDeviceCreate(ctx context.Context, d *schema var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaPortAssignmentForUserDeviceAddPortAssignmentForUserDeviceInSdaFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaPortAssignmentForUserDeviceAddPortAssignmentForUserDeviceInSdaFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vDeviceManagementIPAddress := resourceItem["device_management_ip_address"] vvDeviceManagementIPAddress := interfaceToString(vDeviceManagementIPAddress) vInterfaceName := resourceItem["interface_name"] vvInterfaceName := interfaceToString(vInterfaceName) - queryParamImport := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricV1QueryParams{} queryParamImport.DeviceManagementIPAddress = vvDeviceManagementIPAddress queryParamImport.InterfaceName = vvInterfaceName - item2, _, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["device_management_ip_address"] = item2.DeviceManagementIPAddress resourceMap["interface_name"] = item2.InterfaceName d.SetId(joinResourceID(resourceMap)) return resourceSdaPortAssignmentForUserDeviceRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddPortAssignmentForUserDeviceInSdaFabric(request1) + resp1, restyResp1, err := client.Sda.AddPortAssignmentForUserDeviceInSdaFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddPortAssignmentForUserDeviceInSdaFabric", err, restyResp1.String())) + "Failure when executing AddPortAssignmentForUserDeviceInSdaFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddPortAssignmentForUserDeviceInSdaFabric", err)) + "Failure when executing AddPortAssignmentForUserDeviceInSdaFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -234,18 +234,18 @@ func resourceSdaPortAssignmentForUserDeviceCreate(ctx context.Context, d *schema if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddPortAssignmentForUserDeviceInSdaFabric", err)) + "Failure when executing AddPortAssignmentForUserDeviceInSdaFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricV1QueryParams{} queryParamValidate.DeviceManagementIPAddress = vvDeviceManagementIPAddress queryParamValidate.InterfaceName = vvInterfaceName - item3, _, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddPortAssignmentForUserDeviceInSdaFabric", err, - "Failure at AddPortAssignmentForUserDeviceInSdaFabric, unexpected response", "")) + "Failure when executing AddPortAssignmentForUserDeviceInSdaFabricV1", err, + "Failure at AddPortAssignmentForUserDeviceInSdaFabricV1, unexpected response", "")) return diags } @@ -271,14 +271,16 @@ func resourceSdaPortAssignmentForUserDeviceRead(ctx context.Context, d *schema.R selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetPortAssignmentForUserDeviceInSdaFabric") - queryParams1 := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetPortAssignmentForUserDeviceInSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetPortAssignmentForUserDeviceInSdaFabricV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress queryParams1.InterfaceName = vInterfaceName - response1, restyResp1, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetPortAssignmentForUserDeviceInSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -290,10 +292,10 @@ func resourceSdaPortAssignmentForUserDeviceRead(ctx context.Context, d *schema.R log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetPortAssignmentForUserDeviceInSdaFabricItem(response1) + vItem1 := flattenSdaGetPortAssignmentForUserDeviceInSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetPortAssignmentForUserDeviceInSdaFabric response", + "Failure when setting GetPortAssignmentForUserDeviceInSdaFabricV1 response", err)) return diags } @@ -317,7 +319,7 @@ func resourceSdaPortAssignmentForUserDeviceDelete(ctx context.Context, d *schema resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeletePortAssignmentForUserDeviceInSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeletePortAssignmentForUserDeviceInSdaFabricV1QueryParams{} vvDeviceManagementIPAddress := resourceMap["device_management_ip_address"] @@ -326,18 +328,18 @@ func resourceSdaPortAssignmentForUserDeviceDelete(ctx context.Context, d *schema queryParamDelete.InterfaceName = vvInterfaceName - response1, restyResp1, err := client.Sda.DeletePortAssignmentForUserDeviceInSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeletePortAssignmentForUserDeviceInSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeletePortAssignmentForUserDeviceInSdaFabric", err, restyResp1.String(), - "Failure at DeletePortAssignmentForUserDeviceInSdaFabric, unexpected response", "")) + "Failure when executing DeletePortAssignmentForUserDeviceInSdaFabricV1", err, restyResp1.String(), + "Failure at DeletePortAssignmentForUserDeviceInSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeletePortAssignmentForUserDeviceInSdaFabric", err, - "Failure at DeletePortAssignmentForUserDeviceInSdaFabric, unexpected response", "")) + "Failure when executing DeletePortAssignmentForUserDeviceInSdaFabricV1", err, + "Failure at DeletePortAssignmentForUserDeviceInSdaFabricV1, unexpected response", "")) return diags } @@ -371,7 +373,7 @@ func resourceSdaPortAssignmentForUserDeviceDelete(ctx context.Context, d *schema if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeletePortAssignmentForUserDeviceInSdaFabric", err)) + "Failure when executing DeletePortAssignmentForUserDeviceInSdaFabricV1", err)) return diags } } @@ -382,8 +384,8 @@ func resourceSdaPortAssignmentForUserDeviceDelete(ctx context.Context, d *schema return diags } -func expandRequestSdaPortAssignmentForUserDeviceAddPortAssignmentForUserDeviceInSdaFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortAssignmentForUserDeviceInSdaFabric { - request := catalystcentersdkgo.RequestSdaAddPortAssignmentForUserDeviceInSdaFabric{} +func expandRequestSdaPortAssignmentForUserDeviceAddPortAssignmentForUserDeviceInSdaFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortAssignmentForUserDeviceInSdaFabricV1 { + request := catalystcentersdkgo.RequestSdaAddPortAssignmentForUserDeviceInSdaFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_port_assignments.go b/catalystcenter/resource_sda_port_assignments.go index 7785bb6..116da98 100644 --- a/catalystcenter/resource_sda_port_assignments.go +++ b/catalystcenter/resource_sda_port_assignments.go @@ -111,7 +111,7 @@ func resourceSdaPortAssignments() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestSdaAddPortAssignments`, + Description: `Array of RequestSdaAddPortAssignmentsV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -217,7 +217,7 @@ func resourceSdaPortAssignmentsCreate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaPortAssignmentsAddPortAssignments(ctx, "parameters.0", d) + request1 := expandRequestSdaPortAssignmentsAddPortAssignmentsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -233,7 +233,7 @@ func resourceSdaPortAssignmentsCreate(ctx context.Context, d *schema.ResourceDat vVoiceVLANName := resourceItem["voice_vlan_name"] vvVoiceVLANName := interfaceToString(vVoiceVLANName) - queryParamImport := catalystcentersdkgo.GetPortAssignmentsQueryParams{} + queryParamImport := catalystcentersdkgo.GetPortAssignmentsV1QueryParams{} queryParamImport.FabricID = vvFabricID queryParamImport.NetworkDeviceID = vvNetworkDeviceID queryParamImport.InterfaceName = vvInterfaceName @@ -290,7 +290,7 @@ func resourceSdaPortAssignmentsCreate(ctx context.Context, d *schema.ResourceDat return diags } } - queryParamValidate := catalystcentersdkgo.GetPortAssignmentsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetPortAssignmentsV1QueryParams{} queryParamValidate.FabricID = vvFabricID queryParamValidate.NetworkDeviceID = vvNetworkDeviceID queryParamValidate.InterfaceName = vvInterfaceName @@ -330,7 +330,7 @@ func resourceSdaPortAssignmentsRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetPortAssignments") - queryParams1 := catalystcentersdkgo.GetPortAssignmentsQueryParams{} + queryParams1 := catalystcentersdkgo.GetPortAssignmentsV1QueryParams{} queryParams1.FabricID = vvFabricID queryParams1.NetworkDeviceID = vvNetworkDeviceID queryParams1.InterfaceName = vvInterfaceName @@ -347,7 +347,7 @@ func resourceSdaPortAssignmentsRead(ctx context.Context, d *schema.ResourceData, } // Review flatten function used - vItem1 := flattenSdaGetPortAssignmentsItems(response1.Response) + vItem1 := flattenSdaGetPortAssignmentsV1Items(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetPortAssignments search response", @@ -367,7 +367,7 @@ func resourceSdaPortAssignmentsUpdate(ctx context.Context, d *schema.ResourceDat resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaPortAssignmentsUpdatePortAssignments(ctx, "parameters.0", d) + request1 := expandRequestSdaPortAssignmentsUpdatePortAssignmentsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -482,9 +482,9 @@ func resourceSdaPortAssignmentsDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestSdaPortAssignmentsAddPortAssignments(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortAssignments { - request := catalystcentersdkgo.RequestSdaAddPortAssignments{} - if v := expandRequestSdaPortAssignmentsAddPortAssignmentsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaPortAssignmentsAddPortAssignmentsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortAssignmentsV1 { + request := catalystcentersdkgo.RequestSdaAddPortAssignmentsV1{} + if v := expandRequestSdaPortAssignmentsAddPortAssignmentsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -493,8 +493,8 @@ func expandRequestSdaPortAssignmentsAddPortAssignments(ctx context.Context, key return &request } -func expandRequestSdaPortAssignmentsAddPortAssignmentsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddPortAssignments { - request := []catalystcentersdkgo.RequestItemSdaAddPortAssignments{} +func expandRequestSdaPortAssignmentsAddPortAssignmentsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddPortAssignmentsV1 { + request := []catalystcentersdkgo.RequestItemSdaAddPortAssignmentsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -505,7 +505,7 @@ func expandRequestSdaPortAssignmentsAddPortAssignmentsItemArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestSdaPortAssignmentsAddPortAssignmentsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaPortAssignmentsAddPortAssignmentsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -516,8 +516,8 @@ func expandRequestSdaPortAssignmentsAddPortAssignmentsItemArray(ctx context.Cont return &request } -func expandRequestSdaPortAssignmentsAddPortAssignmentsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddPortAssignments { - request := catalystcentersdkgo.RequestItemSdaAddPortAssignments{} +func expandRequestSdaPortAssignmentsAddPortAssignmentsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddPortAssignmentsV1 { + request := catalystcentersdkgo.RequestItemSdaAddPortAssignmentsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_id")))) { request.FabricID = interfaceToString(v) } @@ -551,9 +551,9 @@ func expandRequestSdaPortAssignmentsAddPortAssignmentsItem(ctx context.Context, return &request } -func expandRequestSdaPortAssignmentsUpdatePortAssignments(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdatePortAssignments { - request := catalystcentersdkgo.RequestSdaUpdatePortAssignments{} - if v := expandRequestSdaPortAssignmentsUpdatePortAssignmentsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaPortAssignmentsUpdatePortAssignmentsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdatePortAssignmentsV1 { + request := catalystcentersdkgo.RequestSdaUpdatePortAssignmentsV1{} + if v := expandRequestSdaPortAssignmentsUpdatePortAssignmentsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -562,8 +562,8 @@ func expandRequestSdaPortAssignmentsUpdatePortAssignments(ctx context.Context, k return &request } -func expandRequestSdaPortAssignmentsUpdatePortAssignmentsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdatePortAssignments { - request := []catalystcentersdkgo.RequestItemSdaUpdatePortAssignments{} +func expandRequestSdaPortAssignmentsUpdatePortAssignmentsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdatePortAssignmentsV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdatePortAssignmentsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -574,7 +574,7 @@ func expandRequestSdaPortAssignmentsUpdatePortAssignmentsItemArray(ctx context.C return nil } for item_no := range objs { - i := expandRequestSdaPortAssignmentsUpdatePortAssignmentsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaPortAssignmentsUpdatePortAssignmentsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -585,8 +585,8 @@ func expandRequestSdaPortAssignmentsUpdatePortAssignmentsItemArray(ctx context.C return &request } -func expandRequestSdaPortAssignmentsUpdatePortAssignmentsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdatePortAssignments { - request := catalystcentersdkgo.RequestItemSdaUpdatePortAssignments{} +func expandRequestSdaPortAssignmentsUpdatePortAssignmentsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdatePortAssignmentsV1 { + request := catalystcentersdkgo.RequestItemSdaUpdatePortAssignmentsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -623,11 +623,11 @@ func expandRequestSdaPortAssignmentsUpdatePortAssignmentsItem(ctx context.Contex return &request } -func searchSdaGetPortAssignments(m interface{}, queryParams catalystcentersdkgo.GetPortAssignmentsQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetPortAssignmentsResponse, error) { +func searchSdaGetPortAssignments(m interface{}, queryParams catalystcentersdkgo.GetPortAssignmentsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetPortAssignmentsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetPortAssignmentsResponse - var ite *catalystcentersdkgo.ResponseSdaGetPortAssignments + var foundItem *catalystcentersdkgo.ResponseSdaGetPortAssignmentsV1Response + var ite *catalystcentersdkgo.ResponseSdaGetPortAssignmentsV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetPortAssignments(nil) diff --git a/catalystcenter/resource_sda_port_channels.go b/catalystcenter/resource_sda_port_channels.go index 97e5722..2c91e50 100644 --- a/catalystcenter/resource_sda_port_channels.go +++ b/catalystcenter/resource_sda_port_channels.go @@ -4,11 +4,10 @@ import ( "context" "errors" "fmt" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -191,14 +190,14 @@ func resourceSdaPortChannelsCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaPortChannelsAddPortChannels(ctx, "parameters.0", d) + request1 := expandRequestSdaPortChannelsAddPortChannelsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] vvID := interfaceToString(vID) vName := resourceItem["port_channel_name"] vvName := interfaceToString(vName) - queryParamImport := catalystcentersdkgo.GetPortChannelsQueryParams{} + queryParamImport := catalystcentersdkgo.GetPortChannelsV1QueryParams{} queryParamImport.PortChannelName = vvName item2, err := searchSdaGetPortChannels(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -247,7 +246,7 @@ func resourceSdaPortChannelsCreate(ctx context.Context, d *schema.ResourceData, return diags } } - queryParamValidate := catalystcentersdkgo.GetPortChannelsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetPortChannelsV1QueryParams{} queryParamValidate.PortChannelName = vvName item3, err := searchSdaGetPortChannels(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -275,18 +274,18 @@ func resourceSdaPortChannelsRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetPortChannels") - queryParams1 := catalystcentersdkgo.GetPortChannelsQueryParams{} + queryParams1 := catalystcentersdkgo.GetPortChannelsV1QueryParams{} queryParams1.PortChannelName = vvName item1, err := searchSdaGetPortChannels(m, queryParams1, vvID) if err != nil || item1 == nil { d.SetId("") return diags } - items := []catalystcentersdkgo.ResponseSdaGetPortChannelsResponse{ + items := []catalystcentersdkgo.ResponseSdaGetPortChannelsV1Response{ *item1, } // Review flatten function used - vItem1 := flattenSdaGetPortChannelsItems(&items) + vItem1 := flattenSdaGetPortChannelsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetPortChannels search response", @@ -306,7 +305,7 @@ func resourceSdaPortChannelsUpdate(ctx context.Context, d *schema.ResourceData, resourceMap := separateResourceID(resourceID) vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaPortChannelsUpdatePortChannels(ctx, "parameters.0", d) + request1 := expandRequestSdaPortChannelsUpdatePortChannelsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -422,9 +421,9 @@ func resourceSdaPortChannelsDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestSdaPortChannelsAddPortChannels(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortChannels { - request := catalystcentersdkgo.RequestSdaAddPortChannels{} - if v := expandRequestSdaPortChannelsAddPortChannelsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaPortChannelsAddPortChannelsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddPortChannelsV1 { + request := catalystcentersdkgo.RequestSdaAddPortChannelsV1{} + if v := expandRequestSdaPortChannelsAddPortChannelsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -433,8 +432,8 @@ func expandRequestSdaPortChannelsAddPortChannels(ctx context.Context, key string return &request } -func expandRequestSdaPortChannelsAddPortChannelsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddPortChannels { - request := []catalystcentersdkgo.RequestItemSdaAddPortChannels{} +func expandRequestSdaPortChannelsAddPortChannelsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddPortChannelsV1 { + request := []catalystcentersdkgo.RequestItemSdaAddPortChannelsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -445,7 +444,7 @@ func expandRequestSdaPortChannelsAddPortChannelsItemArray(ctx context.Context, k return nil } for item_no := range objs { - i := expandRequestSdaPortChannelsAddPortChannelsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaPortChannelsAddPortChannelsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -456,8 +455,8 @@ func expandRequestSdaPortChannelsAddPortChannelsItemArray(ctx context.Context, k return &request } -func expandRequestSdaPortChannelsAddPortChannelsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddPortChannels { - request := catalystcentersdkgo.RequestItemSdaAddPortChannels{} +func expandRequestSdaPortChannelsAddPortChannelsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddPortChannelsV1 { + request := catalystcentersdkgo.RequestItemSdaAddPortChannelsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".fabric_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".fabric_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".fabric_id")))) { request.FabricID = interfaceToString(v) } @@ -482,9 +481,9 @@ func expandRequestSdaPortChannelsAddPortChannelsItem(ctx context.Context, key st return &request } -func expandRequestSdaPortChannelsUpdatePortChannels(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdatePortChannels { - request := catalystcentersdkgo.RequestSdaUpdatePortChannels{} - if v := expandRequestSdaPortChannelsUpdatePortChannelsItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaPortChannelsUpdatePortChannelsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdatePortChannelsV1 { + request := catalystcentersdkgo.RequestSdaUpdatePortChannelsV1{} + if v := expandRequestSdaPortChannelsUpdatePortChannelsV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -493,8 +492,8 @@ func expandRequestSdaPortChannelsUpdatePortChannels(ctx context.Context, key str return &request } -func expandRequestSdaPortChannelsUpdatePortChannelsItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdatePortChannels { - request := []catalystcentersdkgo.RequestItemSdaUpdatePortChannels{} +func expandRequestSdaPortChannelsUpdatePortChannelsV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdatePortChannelsV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdatePortChannelsV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -505,7 +504,7 @@ func expandRequestSdaPortChannelsUpdatePortChannelsItemArray(ctx context.Context return nil } for item_no := range objs { - i := expandRequestSdaPortChannelsUpdatePortChannelsItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaPortChannelsUpdatePortChannelsV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -516,8 +515,8 @@ func expandRequestSdaPortChannelsUpdatePortChannelsItemArray(ctx context.Context return &request } -func expandRequestSdaPortChannelsUpdatePortChannelsItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdatePortChannels { - request := catalystcentersdkgo.RequestItemSdaUpdatePortChannels{} +func expandRequestSdaPortChannelsUpdatePortChannelsV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdatePortChannelsV1 { + request := catalystcentersdkgo.RequestItemSdaUpdatePortChannelsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -548,11 +547,11 @@ func expandRequestSdaPortChannelsUpdatePortChannelsItem(ctx context.Context, key return &request } -func searchSdaGetPortChannels(m interface{}, queryParams catalystcentersdkgo.GetPortChannelsQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetPortChannelsResponse, error) { +func searchSdaGetPortChannels(m interface{}, queryParams catalystcentersdkgo.GetPortChannelsV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetPortChannelsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetPortChannelsResponse - var ite *catalystcentersdkgo.ResponseSdaGetPortChannels + var foundItem *catalystcentersdkgo.ResponseSdaGetPortChannelsV1Response + var ite *catalystcentersdkgo.ResponseSdaGetPortChannelsV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetPortChannels(nil) diff --git a/catalystcenter/resource_sda_provision_device.go b/catalystcenter/resource_sda_provision_device.go index 32abba3..b394b20 100644 --- a/catalystcenter/resource_sda_provision_device.go +++ b/catalystcenter/resource_sda_provision_device.go @@ -104,29 +104,29 @@ func resourceSdaProvisionDeviceCreate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaProvisionDeviceProvisionWiredDevice(ctx, "parameters.0", d) + request1 := expandRequestSdaProvisionDeviceProvisionWiredDeviceV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vDeviceManagementIPAddress := resourceItem["device_management_ip_address"] vvDeviceManagementIPAddress := interfaceToString(vDeviceManagementIPAddress) - queryParamImport := catalystcentersdkgo.GetProvisionedWiredDeviceQueryParams{} + queryParamImport := catalystcentersdkgo.GetProvisionedWiredDeviceV1QueryParams{} queryParamImport.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item2, _, err := client.Sda.GetProvisionedWiredDevice(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetProvisionedWiredDeviceV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["device_management_ip_address"] = item2.DeviceManagementIPAddress d.SetId(joinResourceID(resourceMap)) return resourceSdaProvisionDeviceRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.ProvisionWiredDevice(request1) + resp1, restyResp1, err := client.Sda.ProvisionWiredDeviceV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing ProvisionWiredDevice", err, restyResp1.String())) + "Failure when executing ProvisionWiredDeviceV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing ProvisionWiredDevice", err)) + "Failure when executing ProvisionWiredDeviceV1", err)) return diags } executionId := resp1.ExecutionID @@ -159,17 +159,17 @@ func resourceSdaProvisionDeviceCreate(ctx context.Context, d *schema.ResourceDat if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing ProvisionWiredDevice", err)) + "Failure when executing ProvisionWiredDeviceV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetProvisionedWiredDeviceQueryParams{} + queryParamValidate := catalystcentersdkgo.GetProvisionedWiredDeviceV1QueryParams{} queryParamValidate.DeviceManagementIPAddress = vvDeviceManagementIPAddress - item3, _, err := client.Sda.GetProvisionedWiredDevice(&queryParamValidate) + item3, _, err := client.Sda.GetProvisionedWiredDeviceV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing ProvisionWiredDevice", err, - "Failure at ProvisionWiredDevice, unexpected response", "")) + "Failure when executing ProvisionWiredDeviceV1", err, + "Failure at ProvisionWiredDeviceV1, unexpected response", "")) return diags } @@ -192,12 +192,14 @@ func resourceSdaProvisionDeviceRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetProvisionedWiredDevice") - queryParams1 := catalystcentersdkgo.GetProvisionedWiredDeviceQueryParams{} + log.Printf("[DEBUG] Selected method: GetProvisionedWiredDeviceV1") + queryParams1 := catalystcentersdkgo.GetProvisionedWiredDeviceV1QueryParams{} queryParams1.DeviceManagementIPAddress = vDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.GetProvisionedWiredDevice(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetProvisionedWiredDeviceV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -209,10 +211,10 @@ func resourceSdaProvisionDeviceRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetProvisionedWiredDeviceItem(response1) + vItem1 := flattenSdaGetProvisionedWiredDeviceV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetProvisionedWiredDevice response", + "Failure when setting GetProvisionedWiredDeviceV1 response", err)) return diags } @@ -229,20 +231,20 @@ func resourceSdaProvisionDeviceUpdate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestSdaProvisionDeviceReProvisionWiredDevice(ctx, "parameters.0", d) + request1 := expandRequestSdaProvisionDeviceReProvisionWiredDeviceV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - response1, restyResp1, err := client.Sda.ReProvisionWiredDevice(request1) + response1, restyResp1, err := client.Sda.ReProvisionWiredDeviceV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing ReProvisionWiredDevice", err, restyResp1.String(), - "Failure at ReProvisionWiredDevice, unexpected response", "")) + "Failure when executing ReProvisionWiredDeviceV1", err, restyResp1.String(), + "Failure at ReProvisionWiredDeviceV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing ReProvisionWiredDevice", err, - "Failure at ReProvisionWiredDevice, unexpected response", "")) + "Failure when executing ReProvisionWiredDeviceV1", err, + "Failure at ReProvisionWiredDeviceV1, unexpected response", "")) return diags } @@ -276,7 +278,7 @@ func resourceSdaProvisionDeviceUpdate(ctx context.Context, d *schema.ResourceDat if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing ReProvisionWiredDevice", err)) + "Failure when executing ReProvisionWiredDeviceV1", err)) return diags } } @@ -295,23 +297,23 @@ func resourceSdaProvisionDeviceDelete(ctx context.Context, d *schema.ResourceDat resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteProvisionedWiredDeviceQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteProvisionedWiredDeviceV1QueryParams{} vvDeviceManagementIPAddress := resourceMap["device_management_ip_address"] queryParamDelete.DeviceManagementIPAddress = vvDeviceManagementIPAddress - response1, restyResp1, err := client.Sda.DeleteProvisionedWiredDevice(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteProvisionedWiredDeviceV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteProvisionedWiredDevice", err, restyResp1.String(), - "Failure at DeleteProvisionedWiredDevice, unexpected response", "")) + "Failure when executing DeleteProvisionedWiredDeviceV1", err, restyResp1.String(), + "Failure at DeleteProvisionedWiredDeviceV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteProvisionedWiredDevice", err, - "Failure at DeleteProvisionedWiredDevice, unexpected response", "")) + "Failure when executing DeleteProvisionedWiredDeviceV1", err, + "Failure at DeleteProvisionedWiredDeviceV1, unexpected response", "")) return diags } @@ -345,7 +347,7 @@ func resourceSdaProvisionDeviceDelete(ctx context.Context, d *schema.ResourceDat if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteProvisionedWiredDevice", err)) + "Failure when executing DeleteProvisionedWiredDeviceV1", err)) return diags } } @@ -356,8 +358,8 @@ func resourceSdaProvisionDeviceDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestSdaProvisionDeviceProvisionWiredDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaProvisionWiredDevice { - request := catalystcentersdkgo.RequestSdaProvisionWiredDevice{} +func expandRequestSdaProvisionDeviceProvisionWiredDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaProvisionWiredDeviceV1 { + request := catalystcentersdkgo.RequestSdaProvisionWiredDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ip_address")))) { request.DeviceManagementIPAddress = interfaceToString(v) } @@ -370,8 +372,8 @@ func expandRequestSdaProvisionDeviceProvisionWiredDevice(ctx context.Context, ke return &request } -func expandRequestSdaProvisionDeviceReProvisionWiredDevice(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaReProvisionWiredDevice { - request := catalystcentersdkgo.RequestSdaReProvisionWiredDevice{} +func expandRequestSdaProvisionDeviceReProvisionWiredDeviceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaReProvisionWiredDeviceV1 { + request := catalystcentersdkgo.RequestSdaReProvisionWiredDeviceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_management_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_management_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_management_ip_address")))) { request.DeviceManagementIPAddress = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_provision_devices.go b/catalystcenter/resource_sda_provision_devices.go index 2055a60..46b74f3 100644 --- a/catalystcenter/resource_sda_provision_devices.go +++ b/catalystcenter/resource_sda_provision_devices.go @@ -120,7 +120,7 @@ func resourceSdaProvisionDevicesCreate(ctx context.Context, d *schema.ResourceDa var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaProvisionDevicesProvisionDevices(ctx, "parameters.0", d) + request1 := expandRequestSdaProvisionDevicesProvisionDevicesV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID := resourceItem["id"] @@ -129,7 +129,7 @@ func resourceSdaProvisionDevicesCreate(ctx context.Context, d *schema.ResourceDa vvNetworkDeviceID := interfaceToString(vNetworkID) vSiteID := resourceItem["site_id"] vvSiteID := interfaceToString(vSiteID) - queryParamImport := catalystcentersdkgo.GetProvisionedDevicesQueryParams{} + queryParamImport := catalystcentersdkgo.GetProvisionedDevicesV1QueryParams{} queryParamImport.NetworkDeviceID = vvNetworkDeviceID queryParamImport.SiteID = vvSiteID item2, err := searchSdaGetProvisionedDevices(m, queryParamImport, vvID) @@ -180,7 +180,7 @@ func resourceSdaProvisionDevicesCreate(ctx context.Context, d *schema.ResourceDa return diags } } - queryParamValidate := catalystcentersdkgo.GetProvisionedDevicesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetProvisionedDevicesV1QueryParams{} queryParamValidate.NetworkDeviceID = vvNetworkDeviceID queryParamValidate.SiteID = vvSiteID item3, err := searchSdaGetProvisionedDevices(m, queryParamValidate, vvID) @@ -213,7 +213,7 @@ func resourceSdaProvisionDevicesRead(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetProvisionedDevices") - queryParams1 := catalystcentersdkgo.GetProvisionedDevicesQueryParams{} + queryParams1 := catalystcentersdkgo.GetProvisionedDevicesV1QueryParams{} queryParams1.NetworkDeviceID = vvNetworkDeviceID queryParams1.SiteID = vvSiteID item1, err := searchSdaGetProvisionedDevices(m, queryParams1, vvID) @@ -222,11 +222,11 @@ func resourceSdaProvisionDevicesRead(ctx context.Context, d *schema.ResourceData return diags } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetProvisionedDevicesResponse{ + items := []catalystcentersdkgo.ResponseSdaGetProvisionedDevicesV1Response{ *item1, } - vItem1 := flattenSdaGetProvisionedDevicesItems(&items) + vItem1 := flattenSdaGetProvisionedDevicesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetProvisionedDevices search response", @@ -247,7 +247,7 @@ func resourceSdaProvisionDevicesUpdate(ctx context.Context, d *schema.ResourceDa vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaProvisionDevicesReProvisionDevices(ctx, "parameters.0", d) + request1 := expandRequestSdaProvisionDevicesReProvisionDevicesV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -363,9 +363,9 @@ func resourceSdaProvisionDevicesDelete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestSdaProvisionDevicesProvisionDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaProvisionDevices { - request := catalystcentersdkgo.RequestSdaProvisionDevices{} - if v := expandRequestSdaProvisionDevicesProvisionDevicesItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaProvisionDevicesProvisionDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaProvisionDevicesV1 { + request := catalystcentersdkgo.RequestSdaProvisionDevicesV1{} + if v := expandRequestSdaProvisionDevicesProvisionDevicesV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -374,8 +374,8 @@ func expandRequestSdaProvisionDevicesProvisionDevices(ctx context.Context, key s return &request } -func expandRequestSdaProvisionDevicesProvisionDevicesItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaProvisionDevices { - request := []catalystcentersdkgo.RequestItemSdaProvisionDevices{} +func expandRequestSdaProvisionDevicesProvisionDevicesV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaProvisionDevicesV1 { + request := []catalystcentersdkgo.RequestItemSdaProvisionDevicesV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -386,7 +386,7 @@ func expandRequestSdaProvisionDevicesProvisionDevicesItemArray(ctx context.Conte return nil } for item_no := range objs { - i := expandRequestSdaProvisionDevicesProvisionDevicesItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaProvisionDevicesProvisionDevicesV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -397,8 +397,8 @@ func expandRequestSdaProvisionDevicesProvisionDevicesItemArray(ctx context.Conte return &request } -func expandRequestSdaProvisionDevicesProvisionDevicesItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaProvisionDevices { - request := catalystcentersdkgo.RequestItemSdaProvisionDevices{} +func expandRequestSdaProvisionDevicesProvisionDevicesV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaProvisionDevicesV1 { + request := catalystcentersdkgo.RequestItemSdaProvisionDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { request.SiteID = interfaceToString(v) } @@ -411,9 +411,9 @@ func expandRequestSdaProvisionDevicesProvisionDevicesItem(ctx context.Context, k return &request } -func expandRequestSdaProvisionDevicesReProvisionDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaReProvisionDevices { - request := catalystcentersdkgo.RequestSdaReProvisionDevices{} - if v := expandRequestSdaProvisionDevicesReProvisionDevicesItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaProvisionDevicesReProvisionDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaReProvisionDevicesV1 { + request := catalystcentersdkgo.RequestSdaReProvisionDevicesV1{} + if v := expandRequestSdaProvisionDevicesReProvisionDevicesV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -422,8 +422,8 @@ func expandRequestSdaProvisionDevicesReProvisionDevices(ctx context.Context, key return &request } -func expandRequestSdaProvisionDevicesReProvisionDevicesItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaReProvisionDevices { - request := []catalystcentersdkgo.RequestItemSdaReProvisionDevices{} +func expandRequestSdaProvisionDevicesReProvisionDevicesV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaReProvisionDevicesV1 { + request := []catalystcentersdkgo.RequestItemSdaReProvisionDevicesV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -434,7 +434,7 @@ func expandRequestSdaProvisionDevicesReProvisionDevicesItemArray(ctx context.Con return nil } for item_no := range objs { - i := expandRequestSdaProvisionDevicesReProvisionDevicesItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaProvisionDevicesReProvisionDevicesV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -445,8 +445,8 @@ func expandRequestSdaProvisionDevicesReProvisionDevicesItemArray(ctx context.Con return &request } -func expandRequestSdaProvisionDevicesReProvisionDevicesItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaReProvisionDevices { - request := catalystcentersdkgo.RequestItemSdaReProvisionDevices{} +func expandRequestSdaProvisionDevicesReProvisionDevicesV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaReProvisionDevicesV1 { + request := catalystcentersdkgo.RequestItemSdaReProvisionDevicesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -462,11 +462,11 @@ func expandRequestSdaProvisionDevicesReProvisionDevicesItem(ctx context.Context, return &request } -func searchSdaGetProvisionedDevices(m interface{}, queryParams catalystcentersdkgo.GetProvisionedDevicesQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetProvisionedDevicesResponse, error) { +func searchSdaGetProvisionedDevices(m interface{}, queryParams catalystcentersdkgo.GetProvisionedDevicesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetProvisionedDevicesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetProvisionedDevicesResponse - var ite *catalystcentersdkgo.ResponseSdaGetProvisionedDevices + var foundItem *catalystcentersdkgo.ResponseSdaGetProvisionedDevicesV1Response + var ite *catalystcentersdkgo.ResponseSdaGetProvisionedDevicesV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetProvisionedDevices(nil) diff --git a/catalystcenter/resource_sda_transit_networks.go b/catalystcenter/resource_sda_transit_networks.go index a85e4ee..551784d 100644 --- a/catalystcenter/resource_sda_transit_networks.go +++ b/catalystcenter/resource_sda_transit_networks.go @@ -128,7 +128,7 @@ func resourceSdaTransitNetworks() *schema.Resource { "id": &schema.Schema{ Description: `ID of the transit network (updating this field is not allowed). - `, +`, Type: schema.TypeString, Optional: true, Computed: true, @@ -142,14 +142,14 @@ func resourceSdaTransitNetworks() *schema.Resource { "autonomous_system_number": &schema.Schema{ Description: `Autonomous system number of the IP transit network. Allowed range is [1 to 4294967295]. - `, +`, Type: schema.TypeString, Optional: true, Computed: true, }, "routing_protocol_name": &schema.Schema{ Description: `Routing protocol name of the IP transit network. - `, +`, Type: schema.TypeString, Optional: true, Computed: true, @@ -159,7 +159,7 @@ func resourceSdaTransitNetworks() *schema.Resource { }, "name": &schema.Schema{ Description: `Name of the transit network. - `, +`, Type: schema.TypeString, Optional: true, Computed: true, @@ -173,7 +173,7 @@ func resourceSdaTransitNetworks() *schema.Resource { "control_plane_network_device_ids": &schema.Schema{ Description: `List of network device IDs that will be used as control plane nodes. Maximum 2 network device IDs can be provided for transit of type SDA_LISP_BGP_TRANSIT and maximum 4 network device IDs can be provided for transit of type SDA_LISP_PUB_SUB_TRANSIT. - `, +`, Type: schema.TypeList, Optional: true, Computed: true, @@ -183,7 +183,7 @@ func resourceSdaTransitNetworks() *schema.Resource { }, "is_multicast_over_transit_enabled": &schema.Schema{ Description: `Set this to true to enable multicast over SD-Access transit. This supports Native Multicast over SD-Access Transit. This is only applicable for transit of type SDA_LISP_PUB_SUB_TRANSIT. - `, +`, // Type: schema.TypeBool, Type: schema.TypeString, ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), @@ -195,7 +195,7 @@ func resourceSdaTransitNetworks() *schema.Resource { }, "type": &schema.Schema{ Description: `Type of the transit network. - `, +`, Type: schema.TypeString, Optional: true, Computed: true, @@ -216,14 +216,14 @@ func resourceSdaTransitNetworksCreate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters.0.payload")) - request1 := expandRequestSdaTransitNetworksAddTransitNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaTransitNetworksAddTransitNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) vID := resourceItem["id"] vvID := interfaceToString(vID) - queryParamImport := catalystcentersdkgo.GetTransitNetworksQueryParams{} + queryParamImport := catalystcentersdkgo.GetTransitNetworksV1QueryParams{} queryParamImport.Name = vvName item2, err := searchSdaGetTransitNetworks(m, queryParamImport, vvID) if err == nil && item2 != nil { @@ -272,7 +272,7 @@ func resourceSdaTransitNetworksCreate(ctx context.Context, d *schema.ResourceDat return diags } } - queryParamValidate := catalystcentersdkgo.GetTransitNetworksQueryParams{} + queryParamValidate := catalystcentersdkgo.GetTransitNetworksV1QueryParams{} queryParamValidate.Name = vvName item3, err := searchSdaGetTransitNetworks(m, queryParamValidate, vvID) if err != nil || item3 == nil { @@ -303,7 +303,7 @@ func resourceSdaTransitNetworksRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetTransitNetworks") - queryParams1 := catalystcentersdkgo.GetTransitNetworksQueryParams{} + queryParams1 := catalystcentersdkgo.GetTransitNetworksV1QueryParams{} queryParams1.Name = vName item1, err := searchSdaGetTransitNetworks(m, queryParams1, vvID) @@ -313,11 +313,11 @@ func resourceSdaTransitNetworksRead(ctx context.Context, d *schema.ResourceData, } // Review flatten function used - items := []catalystcentersdkgo.ResponseSdaGetTransitNetworksResponse{ + items := []catalystcentersdkgo.ResponseSdaGetTransitNetworksV1Response{ *item1, } - vItem1 := flattenSdaGetTransitNetworksItems(&items) + vItem1 := flattenSdaGetTransitNetworksV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetTransitNetworks search response", @@ -338,7 +338,7 @@ func resourceSdaTransitNetworksUpdate(ctx context.Context, d *schema.ResourceDat vID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSdaTransitNetworksUpdateTransitNetworks(ctx, "parameters.0", d) + request1 := expandRequestSdaTransitNetworksUpdateTransitNetworksV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) if request1 != nil && len(*request1) > 0 { req := *request1 @@ -402,9 +402,10 @@ func resourceSdaTransitNetworksDelete(ctx context.Context, d *schema.ResourceDat "Failure at SdaTransitNetworksDelete, unexpected response", "")) return diags } -func expandRequestSdaTransitNetworksAddTransitNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitNetworks { - request := catalystcentersdkgo.RequestSdaAddTransitNetworks{} - if v := expandRequestSdaTransitNetworksAddTransitNetworksItemArray(ctx, key+".payload", d); v != nil { + +func expandRequestSdaTransitNetworksAddTransitNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitNetworksV1 { + request := catalystcentersdkgo.RequestSdaAddTransitNetworksV1{} + if v := expandRequestSdaTransitNetworksAddTransitNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -413,8 +414,8 @@ func expandRequestSdaTransitNetworksAddTransitNetworks(ctx context.Context, key return &request } -func expandRequestSdaTransitNetworksAddTransitNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddTransitNetworks { - request := []catalystcentersdkgo.RequestItemSdaAddTransitNetworks{} +func expandRequestSdaTransitNetworksAddTransitNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -425,7 +426,7 @@ func expandRequestSdaTransitNetworksAddTransitNetworksItemArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestSdaTransitNetworksAddTransitNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaTransitNetworksAddTransitNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -436,8 +437,8 @@ func expandRequestSdaTransitNetworksAddTransitNetworksItemArray(ctx context.Cont return &request } -func expandRequestSdaTransitNetworksAddTransitNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddTransitNetworks { - request := catalystcentersdkgo.RequestItemSdaAddTransitNetworks{} +func expandRequestSdaTransitNetworksAddTransitNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -445,10 +446,10 @@ func expandRequestSdaTransitNetworksAddTransitNetworksItem(ctx context.Context, request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_transit_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_transit_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_transit_settings")))) { - request.IPTransitSettings = expandRequestSdaTransitNetworksAddTransitNetworksItemIPTransitSettings(ctx, key+".ip_transit_settings.0", d) + request.IPTransitSettings = expandRequestSdaTransitNetworksAddTransitNetworksV1ItemIPTransitSettings(ctx, key+".ip_transit_settings.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sda_transit_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sda_transit_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sda_transit_settings")))) { - request.SdaTransitSettings = expandRequestSdaTransitNetworksAddTransitNetworksItemSdaTransitSettings(ctx, key+".sda_transit_settings.0", d) + request.SdaTransitSettings = expandRequestSdaTransitNetworksAddTransitNetworksV1ItemSdaTransitSettings(ctx, key+".sda_transit_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -456,8 +457,8 @@ func expandRequestSdaTransitNetworksAddTransitNetworksItem(ctx context.Context, return &request } -func expandRequestSdaTransitNetworksAddTransitNetworksItemIPTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddTransitNetworksIPTransitSettings { - request := catalystcentersdkgo.RequestItemSdaAddTransitNetworksIPTransitSettings{} +func expandRequestSdaTransitNetworksAddTransitNetworksV1ItemIPTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1IPTransitSettings { + request := catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1IPTransitSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".routing_protocol_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".routing_protocol_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".routing_protocol_name")))) { request.RoutingProtocolName = interfaceToString(v) } @@ -470,8 +471,8 @@ func expandRequestSdaTransitNetworksAddTransitNetworksItemIPTransitSettings(ctx return &request } -func expandRequestSdaTransitNetworksAddTransitNetworksItemSdaTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddTransitNetworksSdaTransitSettings { - request := catalystcentersdkgo.RequestItemSdaAddTransitNetworksSdaTransitSettings{} +func expandRequestSdaTransitNetworksAddTransitNetworksV1ItemSdaTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1SdaTransitSettings { + request := catalystcentersdkgo.RequestItemSdaAddTransitNetworksV1SdaTransitSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_multicast_over_transit_enabled")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_multicast_over_transit_enabled")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_multicast_over_transit_enabled")))) { request.IsMulticastOverTransitEnabled = interfaceToBoolPtr(v) } @@ -484,9 +485,9 @@ func expandRequestSdaTransitNetworksAddTransitNetworksItemSdaTransitSettings(ctx return &request } -func expandRequestSdaTransitNetworksUpdateTransitNetworks(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateTransitNetworks { - request := catalystcentersdkgo.RequestSdaUpdateTransitNetworks{} - if v := expandRequestSdaTransitNetworksUpdateTransitNetworksItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSdaTransitNetworksUpdateTransitNetworksV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateTransitNetworksV1 { + request := catalystcentersdkgo.RequestSdaUpdateTransitNetworksV1{} + if v := expandRequestSdaTransitNetworksUpdateTransitNetworksV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { @@ -495,8 +496,8 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworks(ctx context.Context, k return &request } -func expandRequestSdaTransitNetworksUpdateTransitNetworksItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateTransitNetworks { - request := []catalystcentersdkgo.RequestItemSdaUpdateTransitNetworks{} +func expandRequestSdaTransitNetworksUpdateTransitNetworksV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1 { + request := []catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -507,7 +508,7 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworksItemArray(ctx context.C return nil } for item_no := range objs { - i := expandRequestSdaTransitNetworksUpdateTransitNetworksItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSdaTransitNetworksUpdateTransitNetworksV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -518,8 +519,8 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworksItemArray(ctx context.C return &request } -func expandRequestSdaTransitNetworksUpdateTransitNetworksItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateTransitNetworks { - request := catalystcentersdkgo.RequestItemSdaUpdateTransitNetworks{} +func expandRequestSdaTransitNetworksUpdateTransitNetworksV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1 { + request := catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -530,10 +531,10 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworksItem(ctx context.Contex request.Type = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_transit_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_transit_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_transit_settings")))) { - request.IPTransitSettings = expandRequestSdaTransitNetworksUpdateTransitNetworksItemIPTransitSettings(ctx, key+".ip_transit_settings.0", d) + request.IPTransitSettings = expandRequestSdaTransitNetworksUpdateTransitNetworksV1ItemIPTransitSettings(ctx, key+".ip_transit_settings.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sda_transit_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sda_transit_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sda_transit_settings")))) { - request.SdaTransitSettings = expandRequestSdaTransitNetworksUpdateTransitNetworksItemSdaTransitSettings(ctx, key+".sda_transit_settings.0", d) + request.SdaTransitSettings = expandRequestSdaTransitNetworksUpdateTransitNetworksV1ItemSdaTransitSettings(ctx, key+".sda_transit_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -541,8 +542,8 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworksItem(ctx context.Contex return &request } -func expandRequestSdaTransitNetworksUpdateTransitNetworksItemIPTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksIPTransitSettings { - request := catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksIPTransitSettings{} +func expandRequestSdaTransitNetworksUpdateTransitNetworksV1ItemIPTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1IPTransitSettings { + request := catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1IPTransitSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".routing_protocol_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".routing_protocol_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".routing_protocol_name")))) { request.RoutingProtocolName = interfaceToString(v) } @@ -555,8 +556,8 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworksItemIPTransitSettings(c return &request } -func expandRequestSdaTransitNetworksUpdateTransitNetworksItemSdaTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksSdaTransitSettings { - request := catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksSdaTransitSettings{} +func expandRequestSdaTransitNetworksUpdateTransitNetworksV1ItemSdaTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1SdaTransitSettings { + request := catalystcentersdkgo.RequestItemSdaUpdateTransitNetworksV1SdaTransitSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_multicast_over_transit_enabled")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_multicast_over_transit_enabled")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_multicast_over_transit_enabled")))) { request.IsMulticastOverTransitEnabled = interfaceToBoolPtr(v) } @@ -569,11 +570,11 @@ func expandRequestSdaTransitNetworksUpdateTransitNetworksItemSdaTransitSettings( return &request } -func searchSdaGetTransitNetworks(m interface{}, queryParams catalystcentersdkgo.GetTransitNetworksQueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetTransitNetworksResponse, error) { +func searchSdaGetTransitNetworks(m interface{}, queryParams catalystcentersdkgo.GetTransitNetworksV1QueryParams, vID string) (*catalystcentersdkgo.ResponseSdaGetTransitNetworksV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSdaGetTransitNetworksResponse - var ite *catalystcentersdkgo.ResponseSdaGetTransitNetworks + var foundItem *catalystcentersdkgo.ResponseSdaGetTransitNetworksV1Response + var ite *catalystcentersdkgo.ResponseSdaGetTransitNetworksV1 if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Sda.GetTransitNetworks(nil) diff --git a/catalystcenter/resource_sda_virtual_network.go b/catalystcenter/resource_sda_virtual_network.go index 2394b7d..f502261 100644 --- a/catalystcenter/resource_sda_virtual_network.go +++ b/catalystcenter/resource_sda_virtual_network.go @@ -140,33 +140,33 @@ func resourceSdaVirtualNetworkCreate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaVirtualNetworkAddVnInFabric(ctx, "parameters.0", d) + request1 := expandRequestSdaVirtualNetworkAddVnInFabricV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vVirtualNetworkName := resourceItem["virtual_network_name"] vvVirtualNetworkName := interfaceToString(vVirtualNetworkName) vSiteNameHierarchy := resourceItem["site_name_hierarchy"] vvSiteNameHierarchy := interfaceToString(vSiteNameHierarchy) - queryParamImport := catalystcentersdkgo.GetVnFromSdaFabricQueryParams{} + queryParamImport := catalystcentersdkgo.GetVnFromSdaFabricV1QueryParams{} queryParamImport.VirtualNetworkName = vvVirtualNetworkName queryParamImport.SiteNameHierarchy = vvSiteNameHierarchy - item2, _, err := client.Sda.GetVnFromSdaFabric(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetVnFromSdaFabricV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["virtual_network_name"] = item2.VirtualNetworkName resourceMap["site_name_hierarchy"] = item2.SiteNameHierarchy d.SetId(joinResourceID(resourceMap)) return resourceSdaVirtualNetworkRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddVnInFabric(request1) + resp1, restyResp1, err := client.Sda.AddVnInFabricV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddVnInFabric", err, restyResp1.String())) + "Failure when executing AddVnInFabricV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddVnInFabric", err)) + "Failure when executing AddVnInFabricV1", err)) return diags } executionId := resp1.ExecutionID @@ -199,18 +199,18 @@ func resourceSdaVirtualNetworkCreate(ctx context.Context, d *schema.ResourceData if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddVnInFabric", err)) + "Failure when executing AddVnInFabricV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetVnFromSdaFabricQueryParams{} + queryParamValidate := catalystcentersdkgo.GetVnFromSdaFabricV1QueryParams{} queryParamValidate.VirtualNetworkName = vvVirtualNetworkName queryParamValidate.SiteNameHierarchy = vvSiteNameHierarchy - item3, _, err := client.Sda.GetVnFromSdaFabric(&queryParamValidate) + item3, _, err := client.Sda.GetVnFromSdaFabricV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddVnInFabric", err, - "Failure at AddVnInFabric, unexpected response", "")) + "Failure when executing AddVnInFabricV1", err, + "Failure at AddVnInFabricV1, unexpected response", "")) return diags } @@ -236,14 +236,16 @@ func resourceSdaVirtualNetworkRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVnFromSdaFabric") - queryParams1 := catalystcentersdkgo.GetVnFromSdaFabricQueryParams{} + log.Printf("[DEBUG] Selected method: GetVnFromSdaFabricV1") + queryParams1 := catalystcentersdkgo.GetVnFromSdaFabricV1QueryParams{} queryParams1.VirtualNetworkName = vVirtualNetworkName queryParams1.SiteNameHierarchy = vSiteNameHierarchy - response1, restyResp1, err := client.Sda.GetVnFromSdaFabric(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetVnFromSdaFabricV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -255,10 +257,10 @@ func resourceSdaVirtualNetworkRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetVnFromSdaFabricItem(response1) + vItem1 := flattenSdaGetVnFromSdaFabricV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVnFromSdaFabric response", + "Failure when setting GetVnFromSdaFabricV1 response", err)) return diags } @@ -282,7 +284,7 @@ func resourceSdaVirtualNetworkDelete(ctx context.Context, d *schema.ResourceData resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteVnFromSdaFabricQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteVnFromSdaFabricV1QueryParams{} vvVirtualNetworkName := resourceMap["virtual_network_name"] @@ -291,18 +293,18 @@ func resourceSdaVirtualNetworkDelete(ctx context.Context, d *schema.ResourceData queryParamDelete.SiteNameHierarchy = vvSiteNameHierarchy - response1, restyResp1, err := client.Sda.DeleteVnFromSdaFabric(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteVnFromSdaFabricV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteVnFromSdaFabric", err, restyResp1.String(), - "Failure at DeleteVnFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteVnFromSdaFabricV1", err, restyResp1.String(), + "Failure at DeleteVnFromSdaFabricV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteVnFromSdaFabric", err, - "Failure at DeleteVnFromSdaFabric, unexpected response", "")) + "Failure when executing DeleteVnFromSdaFabricV1", err, + "Failure at DeleteVnFromSdaFabricV1, unexpected response", "")) return diags } @@ -336,7 +338,7 @@ func resourceSdaVirtualNetworkDelete(ctx context.Context, d *schema.ResourceData if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteVnFromSdaFabric", err)) + "Failure when executing DeleteVnFromSdaFabricV1", err)) return diags } } @@ -347,8 +349,8 @@ func resourceSdaVirtualNetworkDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestSdaVirtualNetworkAddVnInFabric(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddVnInFabric { - request := catalystcentersdkgo.RequestSdaAddVnInFabric{} +func expandRequestSdaVirtualNetworkAddVnInFabricV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddVnInFabricV1 { + request := catalystcentersdkgo.RequestSdaAddVnInFabricV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_virtual_network_ip_pool.go b/catalystcenter/resource_sda_virtual_network_ip_pool.go index 3e6d3e2..ef9d289 100644 --- a/catalystcenter/resource_sda_virtual_network_ip_pool.go +++ b/catalystcenter/resource_sda_virtual_network_ip_pool.go @@ -239,7 +239,7 @@ func resourceSdaVirtualNetworkIPPoolCreate(ctx context.Context, d *schema.Resour var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaVirtualNetworkIPPoolAddIPPoolInSdaVirtualNetwork(ctx, "parameters.0", d) + request1 := expandRequestSdaVirtualNetworkIPPoolAddIPPoolInSdaVirtualNetworkV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSiteNameHierarchy := resourceItem["site_name_hierarchy"] @@ -248,12 +248,12 @@ func resourceSdaVirtualNetworkIPPoolCreate(ctx context.Context, d *schema.Resour vvVirtualNetworkName := interfaceToString(vVirtualNetworkName) vIPPoolName := resourceItem["ip_pool_name"] vvIPPoolName := interfaceToString(vIPPoolName) - queryParamImport := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkQueryParams{} + queryParamImport := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkV1QueryParams{} queryParamImport.SiteNameHierarchy = vvSiteNameHierarchy queryParamImport.VirtualNetworkName = vvVirtualNetworkName queryParamImport.IPPoolName = vvIPPoolName - item2, _, err := client.Sda.GetIPPoolFromSdaVirtualNetwork(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetIPPoolFromSdaVirtualNetworkV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["site_name_hierarchy"] = vvSiteNameHierarchy resourceMap["virtual_network_name"] = item2.VirtualNetworkName @@ -261,15 +261,15 @@ func resourceSdaVirtualNetworkIPPoolCreate(ctx context.Context, d *schema.Resour d.SetId(joinResourceID(resourceMap)) return resourceSdaVirtualNetworkIPPoolRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddIPPoolInSdaVirtualNetwork(request1) + resp1, restyResp1, err := client.Sda.AddIPPoolInSdaVirtualNetworkV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddIPPoolInSdaVirtualNetwork", err, restyResp1.String())) + "Failure when executing AddIPPoolInSdaVirtualNetworkV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddIPPoolInSdaVirtualNetwork", err)) + "Failure when executing AddIPPoolInSdaVirtualNetworkV1", err)) return diags } executionId := resp1.ExecutionID @@ -302,19 +302,19 @@ func resourceSdaVirtualNetworkIPPoolCreate(ctx context.Context, d *schema.Resour if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddIPPoolInSdaVirtualNetwork", err)) + "Failure when executing AddIPPoolInSdaVirtualNetworkV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkQueryParams{} + queryParamValidate := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkV1QueryParams{} queryParamValidate.SiteNameHierarchy = vvSiteNameHierarchy queryParamValidate.VirtualNetworkName = vvVirtualNetworkName queryParamValidate.IPPoolName = vvIPPoolName - item3, _, err := client.Sda.GetIPPoolFromSdaVirtualNetwork(&queryParamValidate) + item3, _, err := client.Sda.GetIPPoolFromSdaVirtualNetworkV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddIPPoolInSdaVirtualNetwork", err, - "Failure at AddIPPoolInSdaVirtualNetwork, unexpected response", "")) + "Failure when executing AddIPPoolInSdaVirtualNetworkV1", err, + "Failure at AddIPPoolInSdaVirtualNetworkV1, unexpected response", "")) return diags } @@ -343,8 +343,8 @@ func resourceSdaVirtualNetworkIPPoolRead(ctx context.Context, d *schema.Resource selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetIPPoolFromSdaVirtualNetwork") - queryParams1 := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkQueryParams{} + log.Printf("[DEBUG] Selected method: GetIPPoolFromSdaVirtualNetworkV1") + queryParams1 := catalystcentersdkgo.GetIPPoolFromSdaVirtualNetworkV1QueryParams{} queryParams1.SiteNameHierarchy = vSiteNameHierarchy @@ -352,7 +352,9 @@ func resourceSdaVirtualNetworkIPPoolRead(ctx context.Context, d *schema.Resource queryParams1.IPPoolName = vIPPoolName - response1, restyResp1, err := client.Sda.GetIPPoolFromSdaVirtualNetwork(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetIPPoolFromSdaVirtualNetworkV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -364,10 +366,10 @@ func resourceSdaVirtualNetworkIPPoolRead(ctx context.Context, d *schema.Resource log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetIPPoolFromSdaVirtualNetworkItem(response1) + vItem1 := flattenSdaGetIPPoolFromSdaVirtualNetworkV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetIPPoolFromSdaVirtualNetwork response", + "Failure when setting GetIPPoolFromSdaVirtualNetworkV1 response", err)) return diags } @@ -391,7 +393,7 @@ func resourceSdaVirtualNetworkIPPoolDelete(ctx context.Context, d *schema.Resour resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteIPPoolFromSdaVirtualNetworkQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteIPPoolFromSdaVirtualNetworkV1QueryParams{} vvSiteNameHierarchy := resourceMap["site_name_hierarchy"] @@ -404,18 +406,18 @@ func resourceSdaVirtualNetworkIPPoolDelete(ctx context.Context, d *schema.Resour queryParamDelete.IPPoolName = vvIPPoolName - response1, restyResp1, err := client.Sda.DeleteIPPoolFromSdaVirtualNetwork(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteIPPoolFromSdaVirtualNetworkV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteIPPoolFromSdaVirtualNetwork", err, restyResp1.String(), - "Failure at DeleteIPPoolFromSdaVirtualNetwork, unexpected response", "")) + "Failure when executing DeleteIPPoolFromSdaVirtualNetworkV1", err, restyResp1.String(), + "Failure at DeleteIPPoolFromSdaVirtualNetworkV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteIPPoolFromSdaVirtualNetwork", err, - "Failure at DeleteIPPoolFromSdaVirtualNetwork, unexpected response", "")) + "Failure when executing DeleteIPPoolFromSdaVirtualNetworkV1", err, + "Failure at DeleteIPPoolFromSdaVirtualNetworkV1, unexpected response", "")) return diags } @@ -449,7 +451,7 @@ func resourceSdaVirtualNetworkIPPoolDelete(ctx context.Context, d *schema.Resour if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteIPPoolFromSdaVirtualNetwork", err)) + "Failure when executing DeleteIPPoolFromSdaVirtualNetworkV1", err)) return diags } } @@ -460,8 +462,8 @@ func resourceSdaVirtualNetworkIPPoolDelete(ctx context.Context, d *schema.Resour return diags } -func expandRequestSdaVirtualNetworkIPPoolAddIPPoolInSdaVirtualNetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddIPPoolInSdaVirtualNetwork { - request := catalystcentersdkgo.RequestSdaAddIPPoolInSdaVirtualNetwork{} +func expandRequestSdaVirtualNetworkIPPoolAddIPPoolInSdaVirtualNetworkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddIPPoolInSdaVirtualNetworkV1 { + request := catalystcentersdkgo.RequestSdaAddIPPoolInSdaVirtualNetworkV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } diff --git a/catalystcenter/resource_sda_virtual_network_v2.go b/catalystcenter/resource_sda_virtual_network_v1.go similarity index 85% rename from catalystcenter/resource_sda_virtual_network_v2.go rename to catalystcenter/resource_sda_virtual_network_v1.go index 0fc0e02..dc3bd8d 100644 --- a/catalystcenter/resource_sda_virtual_network_v2.go +++ b/catalystcenter/resource_sda_virtual_network_v1.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceSdaVirtualNetworkV2() *schema.Resource { +func resourceSdaVirtualNetworkV1() *schema.Resource { return &schema.Resource{ Description: `It manages create, read, update and delete operations on SDA. @@ -24,10 +24,10 @@ func resourceSdaVirtualNetworkV2() *schema.Resource { - Update virtual network with scalable groups `, - CreateContext: resourceSdaVirtualNetworkV2Create, - ReadContext: resourceSdaVirtualNetworkV2Read, - UpdateContext: resourceSdaVirtualNetworkV2Update, - DeleteContext: resourceSdaVirtualNetworkV2Delete, + CreateContext: resourceSdaVirtualNetworkV1Create, + ReadContext: resourceSdaVirtualNetworkV1Read, + UpdateContext: resourceSdaVirtualNetworkV1Update, + DeleteContext: resourceSdaVirtualNetworkV1Delete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -145,35 +145,35 @@ func resourceSdaVirtualNetworkV2() *schema.Resource { } } -func resourceSdaVirtualNetworkV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceSdaVirtualNetworkV1Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSdaVirtualNetworkV2AddVirtualNetworkWithScalableGroups(ctx, "parameters.0", d) + request1 := expandRequestSdaVirtualNetworkV2AddVirtualNetworkWithScalableGroupsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vVirtualNetworkName := resourceItem["virtual_network_name"] vvVirtualNetworkName := interfaceToString(vVirtualNetworkName) - queryParamImport := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsQueryParams{} + queryParamImport := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsV1QueryParams{} queryParamImport.VirtualNetworkName = vvVirtualNetworkName - item2, _, err := client.Sda.GetVirtualNetworkWithScalableGroups(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetVirtualNetworkWithScalableGroupsV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["virtual_network_name"] = item2.VirtualNetworkName d.SetId(joinResourceID(resourceMap)) - return resourceSdaVirtualNetworkV2Read(ctx, d, m) + return resourceSdaVirtualNetworkV1Read(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddVirtualNetworkWithScalableGroups(request1) + resp1, restyResp1, err := client.Sda.AddVirtualNetworkWithScalableGroupsV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddVirtualNetworkWithScalableGroups", err, restyResp1.String())) + "Failure when executing AddVirtualNetworkWithScalableGroupsV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddVirtualNetworkWithScalableGroups", err)) + "Failure when executing AddVirtualNetworkWithScalableGroupsV1", err)) return diags } executionId := resp1.ExecutionID @@ -206,17 +206,17 @@ func resourceSdaVirtualNetworkV2Create(ctx context.Context, d *schema.ResourceDa if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddVirtualNetworkWithScalableGroups", err)) + "Failure when executing AddVirtualNetworkWithScalableGroupsV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsQueryParams{} + queryParamValidate := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsV1QueryParams{} queryParamValidate.VirtualNetworkName = vvVirtualNetworkName - item3, _, err := client.Sda.GetVirtualNetworkWithScalableGroups(&queryParamValidate) + item3, _, err := client.Sda.GetVirtualNetworkWithScalableGroupsV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddVirtualNetworkWithScalableGroups", err, - "Failure at AddVirtualNetworkWithScalableGroups, unexpected response", "")) + "Failure when executing AddVirtualNetworkWithScalableGroupsV1", err, + "Failure at AddVirtualNetworkWithScalableGroupsV1, unexpected response", "")) return diags } @@ -224,10 +224,10 @@ func resourceSdaVirtualNetworkV2Create(ctx context.Context, d *schema.ResourceDa resourceMap["virtual_network_name"] = item3.VirtualNetworkName d.SetId(joinResourceID(resourceMap)) - return resourceSdaVirtualNetworkV2Read(ctx, d, m) + return resourceSdaVirtualNetworkV1Read(ctx, d, m) } -func resourceSdaVirtualNetworkV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceSdaVirtualNetworkV1Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics @@ -239,12 +239,14 @@ func resourceSdaVirtualNetworkV2Read(ctx context.Context, d *schema.ResourceData selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetVirtualNetworkWithScalableGroups") - queryParams1 := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsQueryParams{} + log.Printf("[DEBUG] Selected method: GetVirtualNetworkWithScalableGroupsV1") + queryParams1 := catalystcentersdkgo.GetVirtualNetworkWithScalableGroupsV1QueryParams{} queryParams1.VirtualNetworkName = vVirtualNetworkName - response1, restyResp1, err := client.Sda.GetVirtualNetworkWithScalableGroups(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetVirtualNetworkWithScalableGroupsV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -256,10 +258,10 @@ func resourceSdaVirtualNetworkV2Read(ctx context.Context, d *schema.ResourceData log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetVirtualNetworkWithScalableGroupsItem(response1) + vItem1 := flattenSdaGetVirtualNetworkWithScalableGroupsV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetVirtualNetworkWithScalableGroups response", + "Failure when setting GetVirtualNetworkWithScalableGroupsV1 response", err)) return diags } @@ -270,26 +272,26 @@ func resourceSdaVirtualNetworkV2Read(ctx context.Context, d *schema.ResourceData return diags } -func resourceSdaVirtualNetworkV2Update(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceSdaVirtualNetworkV1Update(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestSdaVirtualNetworkV2UpdateVirtualNetworkWithScalableGroups(ctx, "parameters.0", d) + request1 := expandRequestSdaVirtualNetworkV2UpdateVirtualNetworkWithScalableGroupsV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - response1, restyResp1, err := client.Sda.UpdateVirtualNetworkWithScalableGroups(request1) + response1, restyResp1, err := client.Sda.UpdateVirtualNetworkWithScalableGroupsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing UpdateVirtualNetworkWithScalableGroups", err, restyResp1.String(), - "Failure at UpdateVirtualNetworkWithScalableGroups, unexpected response", "")) + "Failure when executing UpdateVirtualNetworkWithScalableGroupsV1", err, restyResp1.String(), + "Failure at UpdateVirtualNetworkWithScalableGroupsV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing UpdateVirtualNetworkWithScalableGroups", err, - "Failure at UpdateVirtualNetworkWithScalableGroups, unexpected response", "")) + "Failure when executing UpdateVirtualNetworkWithScalableGroupsV1", err, + "Failure at UpdateVirtualNetworkWithScalableGroupsV1, unexpected response", "")) return diags } @@ -323,17 +325,17 @@ func resourceSdaVirtualNetworkV2Update(ctx context.Context, d *schema.ResourceDa if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing UpdateVirtualNetworkWithScalableGroups", err)) + "Failure when executing UpdateVirtualNetworkWithScalableGroupsV1", err)) return diags } } } - return resourceSdaVirtualNetworkV2Read(ctx, d, m) + return resourceSdaVirtualNetworkV1Read(ctx, d, m) } -func resourceSdaVirtualNetworkV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceSdaVirtualNetworkV1Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) @@ -342,23 +344,23 @@ func resourceSdaVirtualNetworkV2Delete(ctx context.Context, d *schema.ResourceDa resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteVirtualNetworkWithScalableGroupsQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteVirtualNetworkWithScalableGroupsV1QueryParams{} vvVirtualNetworkName := resourceMap["virtual_network_name"] queryParamDelete.VirtualNetworkName = vvVirtualNetworkName - response1, restyResp1, err := client.Sda.DeleteVirtualNetworkWithScalableGroups(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteVirtualNetworkWithScalableGroupsV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteVirtualNetworkWithScalableGroups", err, restyResp1.String(), - "Failure at DeleteVirtualNetworkWithScalableGroups, unexpected response", "")) + "Failure when executing DeleteVirtualNetworkWithScalableGroupsV1", err, restyResp1.String(), + "Failure at DeleteVirtualNetworkWithScalableGroupsV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteVirtualNetworkWithScalableGroups", err, - "Failure at DeleteVirtualNetworkWithScalableGroups, unexpected response", "")) + "Failure when executing DeleteVirtualNetworkWithScalableGroupsV1", err, + "Failure at DeleteVirtualNetworkWithScalableGroupsV1, unexpected response", "")) return diags } @@ -392,7 +394,7 @@ func resourceSdaVirtualNetworkV2Delete(ctx context.Context, d *schema.ResourceDa if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteVirtualNetworkWithScalableGroups", err)) + "Failure when executing DeleteVirtualNetworkWithScalableGroupsV1", err)) return diags } } @@ -403,8 +405,8 @@ func resourceSdaVirtualNetworkV2Delete(ctx context.Context, d *schema.ResourceDa return diags } -func expandRequestSdaVirtualNetworkV2AddVirtualNetworkWithScalableGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddVirtualNetworkWithScalableGroups { - request := catalystcentersdkgo.RequestSdaAddVirtualNetworkWithScalableGroups{} +func expandRequestSdaVirtualNetworkV2AddVirtualNetworkWithScalableGroupsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddVirtualNetworkWithScalableGroupsV1 { + request := catalystcentersdkgo.RequestSdaAddVirtualNetworkWithScalableGroupsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } @@ -423,8 +425,8 @@ func expandRequestSdaVirtualNetworkV2AddVirtualNetworkWithScalableGroups(ctx con return &request } -func expandRequestSdaVirtualNetworkV2UpdateVirtualNetworkWithScalableGroups(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateVirtualNetworkWithScalableGroups { - request := catalystcentersdkgo.RequestSdaUpdateVirtualNetworkWithScalableGroups{} +func expandRequestSdaVirtualNetworkV2UpdateVirtualNetworkWithScalableGroupsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaUpdateVirtualNetworkWithScalableGroupsV1 { + request := catalystcentersdkgo.RequestSdaUpdateVirtualNetworkWithScalableGroupsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".virtual_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".virtual_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".virtual_network_name")))) { request.VirtualNetworkName = interfaceToString(v) } diff --git a/catalystcenter/resource_security_rogue_additional_details.go b/catalystcenter/resource_security_rogue_additional_details.go new file mode 100644 index 0000000..1183570 --- /dev/null +++ b/catalystcenter/resource_security_rogue_additional_details.go @@ -0,0 +1,358 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityRogueAdditionalDetails() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- This data source action provides additional information of the rogue threats with details at BSSID level. The +additional information includes Switch Port details in case of Rogue on Wire, first time when the rogue is seen in the +network etc. +`, + + CreateContext: resourceSecurityRogueAdditionalDetailsCreate, + ReadContext: resourceSecurityRogueAdditionalDetailsRead, + DeleteContext: resourceSecurityRogueAdditionalDetailsDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `This is the epoch end time in milliseconds upto which data need to be fetched. Default value is current time +`, + Type: schema.TypeFloat, + Optional: true, + ForceNew: true, + Computed: true, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ap_name": &schema.Schema{ + Description: `Detecting AP Name +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "channel_number": &schema.Schema{ + Description: `Channel Number on which the Rogue is detected +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "containment": &schema.Schema{ + Description: `Containment Status of the Rogue +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "controller_ip": &schema.Schema{ + Description: `IP Address of the Controller detecting this Rogue +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "controller_name": &schema.Schema{ + Description: `Name of the Controller detecting this Rogue +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "created_time": &schema.Schema{ + Description: `First time when the Rogue is seen in the network +`, + Type: schema.TypeInt, + ForceNew: true, + Computed: true, + }, + "detecting_apmac": &schema.Schema{ + Description: `MAC Address of the Detecting AP +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "encryption": &schema.Schema{ + Description: `Security status of the Rogue SSID +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `MAC Address of the Rogue BSSID +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "mld_mac_address": &schema.Schema{ + Description: `MLD MAC Address of the Rogue BSSID, this is applicable only for Wi-Fi 7 Rogues +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "port_description": &schema.Schema{ + Description: `Port information of the Switch on which the Rogue is connected. This will be filled only in case of Rogue on Wire Threat Type +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "radio_type": &schema.Schema{ + Description: `Radio Type on which Rogue is detected +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "site_name_hierarchy": &schema.Schema{ + Description: `Site Hierarchy of the Rogue +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "ssid": &schema.Schema{ + Description: `Rogue SSID +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "switch_ip": &schema.Schema{ + Description: `IP Address of the Switch on which the Rogue is connected. This will be filled only in case of Rogue on Wire Threat Type +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "switch_name": &schema.Schema{ + Description: `Name of the Switch on which the Rogue is connected. This will be filled only in case of Rogue on Wire Threat Type +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Level of the Rogue Threat +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "threat_type": &schema.Schema{ + Description: `Type of the Rogue Threat +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "updated_time": &schema.Schema{ + Description: `Last time when the Rogue is seen in the network +`, + Type: schema.TypeInt, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "limit": &schema.Schema{ + Description: `The maximum number of entries to return. Default value is 1000 +`, + Type: schema.TypeFloat, + Optional: true, + ForceNew: true, + Computed: true, + }, + "offset": &schema.Schema{ + Description: `The offset of the first item in the collection to return. Default value is 1 +`, + Type: schema.TypeFloat, + Optional: true, + ForceNew: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Filter Rogues by location. Site IDs information can be fetched from "Get Site" API +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `This is the epoch start time in milliseconds from which data need to be fetched. Default value is 24 hours earlier to endTime +`, + Type: schema.TypeFloat, + Optional: true, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Filter Rogues by Threat Level. Threat Level information can be fetched from "Get Threat Levels" API +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Filter Rogues by Threat Type. Threat Type information can be fetched from "Get Threat Types" API +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityRogueAdditionalDetailsCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityRogueAdditionalDetailsRogueAdditionalDetailsV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.RogueAdditionalDetailsV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing RogueAdditionalDetailsV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesRogueAdditionalDetailsV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting RogueAdditionalDetailsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceSecurityRogueAdditionalDetailsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityRogueAdditionalDetailsDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityRogueAdditionalDetailsRogueAdditionalDetailsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesRogueAdditionalDetailsV1 { + request := catalystcentersdkgo.RequestDevicesRogueAdditionalDetailsV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".offset")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".offset")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".offset")))) { + request.Offset = interfaceToFloat64Ptr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { + request.Limit = interfaceToFloat64Ptr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToFloat64Ptr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToFloat64Ptr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + return &request +} + +func flattenDevicesRogueAdditionalDetailsV1Items(items *[]catalystcentersdkgo.ResponseDevicesRogueAdditionalDetailsV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["mac_address"] = item.MacAddress + respItem["mld_mac_address"] = item.MldMacAddress + respItem["updated_time"] = item.UpdatedTime + respItem["created_time"] = item.CreatedTime + respItem["threat_type"] = item.ThreatType + respItem["threat_level"] = item.ThreatLevel + respItem["ap_name"] = item.ApName + respItem["detecting_apmac"] = item.DetectingApMac + respItem["ssid"] = item.SSID + respItem["containment"] = item.Containment + respItem["radio_type"] = item.RadioType + respItem["controller_ip"] = item.ControllerIP + respItem["controller_name"] = item.ControllerName + respItem["channel_number"] = item.ChannelNumber + respItem["site_name_hierarchy"] = item.SiteNameHierarchy + respItem["encryption"] = item.Encryption + respItem["switch_ip"] = item.SwitchIP + respItem["switch_name"] = item.SwitchName + respItem["port_description"] = item.PortDescription + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/resource_security_rogue_additional_details_count.go b/catalystcenter/resource_security_rogue_additional_details_count.go new file mode 100644 index 0000000..68fcb74 --- /dev/null +++ b/catalystcenter/resource_security_rogue_additional_details_count.go @@ -0,0 +1,191 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityRogueAdditionalDetailsCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- This data source action returns the count for the Rogue Additional Details. +`, + + CreateContext: resourceSecurityRogueAdditionalDetailsCountCreate, + ReadContext: resourceSecurityRogueAdditionalDetailsCountRead, + DeleteContext: resourceSecurityRogueAdditionalDetailsCountDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "response": &schema.Schema{ + Description: `Response`, + Type: schema.TypeInt, + Computed: true, + }, + "version": &schema.Schema{ + Description: `Version`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `This is the epoch end time in milliseconds upto which data need to be fetched. Default value is current time +`, + Type: schema.TypeFloat, + Optional: true, + ForceNew: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Filter Rogues by location. Site IDs information can be fetched from "Get Site" API +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `This is the epoch start time in milliseconds from which data need to be fetched. Default value is 24 hours earlier to endTime +`, + Type: schema.TypeFloat, + Optional: true, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `This information can be fetched from "Get Threat Levels" API +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `This information can be fetched from "Get Threat Types" API +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityRogueAdditionalDetailsCountCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityRogueAdditionalDetailsCountRogueAdditionalDetailCountV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.RogueAdditionalDetailCountV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing RogueAdditionalDetailCountV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenDevicesRogueAdditionalDetailCountV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting RogueAdditionalDetailCountV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceSecurityRogueAdditionalDetailsCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityRogueAdditionalDetailsCountDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityRogueAdditionalDetailsCountRogueAdditionalDetailCountV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesRogueAdditionalDetailCountV1 { + request := catalystcentersdkgo.RequestDevicesRogueAdditionalDetailCountV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToFloat64Ptr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToFloat64Ptr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + return &request +} + +func flattenDevicesRogueAdditionalDetailCountV1Item(item *catalystcentersdkgo.ResponseDevicesRogueAdditionalDetailCountV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["response"] = item.Response + respItem["version"] = item.Version + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/resource_security_rogue_wireless_containment_start.go b/catalystcenter/resource_security_rogue_wireless_containment_start.go new file mode 100644 index 0000000..529c0ca --- /dev/null +++ b/catalystcenter/resource_security_rogue_wireless_containment_start.go @@ -0,0 +1,223 @@ +package catalystcenter + +import ( + "context" + + "errors" + + "time" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityRogueWirelessContainmentStart() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- Intent API to start the wireless rogue access point containment. This data source action will initiate the containment +operation on the strongest detecting WLC for the given Rogue AP. This is a resource intensive operation which has legal +implications since the rogue access point on whom it is triggered, might be a valid neighbor access point. +`, + + CreateContext: resourceSecurityRogueWirelessContainmentStartCreate, + ReadContext: resourceSecurityRogueWirelessContainmentStartRead, + DeleteContext: resourceSecurityRogueWirelessContainmentStartDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "initiated_on_bssid": &schema.Schema{ + Description: `Initiated On Bssid`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "initiated_on_wlc_ip": &schema.Schema{ + Description: `Initiated On Wlc Ip`, + Type: schema.TypeString, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Computed: true, + }, + "task_id": &schema.Schema{ + Description: `Task Id`, + Type: schema.TypeString, + Computed: true, + }, + "task_type": &schema.Schema{ + Description: `Task Type`, + Type: schema.TypeString, + Computed: true, + }, + "type": &schema.Schema{ + Description: `Type`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "type": &schema.Schema{ + Description: `Type`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityRogueWirelessContainmentStartCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityRogueWirelessContainmentStartStartWirelessRogueApContainmentV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.StartWirelessRogueApContainmentV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing StartWirelessRogueApContainmentV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + if response1.Response == nil { + diags = append(diags, diagError( + "Failure when executing StartWirelessRogueAPContainmentV1", err)) + return diags + } + taskId := response1.Response.TaskID + log.Printf("[DEBUG] TASKID => %s", taskId) + if taskId != "" { + time.Sleep(5 * time.Second) + response2, restyResp2, err := client.Task.GetTaskByID(taskId) + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetTaskByID", err, + "Failure at GetTaskByID, unexpected response", "")) + return diags + } + if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { + log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) + restyResp3, err := client.CustomCall.GetCustomCall(response2.Response.AdditionalStatusURL, nil) + if err != nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetCustomCall", err, + "Failure at GetCustomCall, unexpected response", "")) + return diags + } + var errorMsg string + if restyResp3 == nil { + errorMsg = response2.Response.Progress + "\nFailure Reason: " + response2.Response.FailureReason + } else { + errorMsg = restyResp3.String() + } + err1 := errors.New(errorMsg) + diags = append(diags, diagError( + "Failure when executing StartWirelessRogueAPContainmentV1", err1)) + return diags + } + } + + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesStartWirelessRogueApContainmentV1Item(response1.Response) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting StartWirelessRogueApContainmentV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags +} +func resourceSecurityRogueWirelessContainmentStartRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityRogueWirelessContainmentStartDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityRogueWirelessContainmentStartStartWirelessRogueApContainmentV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesStartWirelessRogueApContainmentV1 { + request := catalystcentersdkgo.RequestDevicesStartWirelessRogueApContainmentV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".mac_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mac_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mac_address")))) { + request.MacAddress = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToIntPtr(v) + } + return &request +} + +func flattenDevicesStartWirelessRogueApContainmentV1Item(item *catalystcentersdkgo.ResponseDevicesStartWirelessRogueApContainmentV1Response) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["mac_address"] = item.MacAddress + respItem["type"] = item.Type + respItem["initiated_on_wlc_ip"] = item.InitiatedOnWlcIP + respItem["task_id"] = item.TaskID + respItem["task_type"] = item.TaskType + respItem["initiated_on_bssid"] = item.InitiatedOnBssid + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/resource_security_rogue_wireless_containment_stop.go b/catalystcenter/resource_security_rogue_wireless_containment_stop.go new file mode 100644 index 0000000..8a6fd16 --- /dev/null +++ b/catalystcenter/resource_security_rogue_wireless_containment_stop.go @@ -0,0 +1,233 @@ +package catalystcenter + +import ( + "context" + + "errors" + + "time" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityRogueWirelessContainmentStop() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- Intent API to stop the wireless rogue access point containment. This data source action will stop the containment +through single WLC. The response includes the details like WLC and BSSID on which the stop containment has been +initiated. +`, + + CreateContext: resourceSecurityRogueWirelessContainmentStopCreate, + ReadContext: resourceSecurityRogueWirelessContainmentStopRead, + DeleteContext: resourceSecurityRogueWirelessContainmentStopDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "initiated_on_bssid": &schema.Schema{ + Description: `Initiated On Bssid`, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "initiated_on_wlc_ip": &schema.Schema{ + Description: `Initiated On Wlc Ip`, + Type: schema.TypeString, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Computed: true, + }, + "task_id": &schema.Schema{ + Description: `Task Id`, + Type: schema.TypeString, + Computed: true, + }, + "task_type": &schema.Schema{ + Description: `Task Type`, + Type: schema.TypeString, + Computed: true, + }, + "type": &schema.Schema{ + Description: `Type`, + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + "type": &schema.Schema{ + Description: `Type`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "wlc_ip": &schema.Schema{ + Description: `Wlc Ip`, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityRogueWirelessContainmentStopCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityRogueWirelessContainmentStopStopWirelessRogueApContainmentV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.StopWirelessRogueApContainmentV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing StopWirelessRogueApContainmentV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + if response1.Response == nil { + diags = append(diags, diagError( + "Failure when executing StopWirelessRogueAPContainmentV1", err)) + return diags + } + taskId := response1.Response.TaskID + log.Printf("[DEBUG] TASKID => %s", taskId) + if taskId != "" { + time.Sleep(5 * time.Second) + response2, restyResp2, err := client.Task.GetTaskByID(taskId) + if err != nil || response2 == nil { + if restyResp2 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp2.String()) + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetTaskByID", err, + "Failure at GetTaskByID, unexpected response", "")) + return diags + } + if response2.Response != nil && response2.Response.IsError != nil && *response2.Response.IsError { + log.Printf("[DEBUG] Error reason %s", response2.Response.FailureReason) + restyResp3, err := client.CustomCall.GetCustomCall(response2.Response.AdditionalStatusURL, nil) + if err != nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing GetCustomCall", err, + "Failure at GetCustomCall, unexpected response", "")) + return diags + } + var errorMsg string + if restyResp3 == nil { + errorMsg = response2.Response.Progress + "\nFailure Reason: " + response2.Response.FailureReason + } else { + errorMsg = restyResp3.String() + } + err1 := errors.New(errorMsg) + diags = append(diags, diagError( + "Failure when executing StopWirelessRogueAPContainmentV1", err1)) + return diags + } + } + + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenDevicesStopWirelessRogueApContainmentV1Item(response1.Response) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting StopWirelessRogueApContainmentV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags +} +func resourceSecurityRogueWirelessContainmentStopRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityRogueWirelessContainmentStopDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityRogueWirelessContainmentStopStopWirelessRogueApContainmentV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesStopWirelessRogueApContainmentV1 { + request := catalystcentersdkgo.RequestDevicesStopWirelessRogueApContainmentV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".mac_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mac_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mac_address")))) { + request.MacAddress = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { + request.Type = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".wlc_ip")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wlc_ip")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wlc_ip")))) { + request.WlcIP = interfaceToString(v) + } + return &request +} + +func flattenDevicesStopWirelessRogueApContainmentV1Item(item *catalystcentersdkgo.ResponseDevicesStopWirelessRogueApContainmentV1Response) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["mac_address"] = item.MacAddress + respItem["type"] = item.Type + respItem["initiated_on_wlc_ip"] = item.InitiatedOnWlcIP + respItem["task_id"] = item.TaskID + respItem["task_type"] = item.TaskType + respItem["initiated_on_bssid"] = item.InitiatedOnBssid + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/resource_security_threats_details.go b/catalystcenter/resource_security_threats_details.go new file mode 100644 index 0000000..7c96e32 --- /dev/null +++ b/catalystcenter/resource_security_threats_details.go @@ -0,0 +1,300 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityThreatsDetails() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- The details for the Rogue and aWIPS threats +`, + + CreateContext: resourceSecurityThreatsDetailsCreate, + ReadContext: resourceSecurityThreatsDetailsRead, + DeleteContext: resourceSecurityThreatsDetailsDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `End Time`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "is_new_threat": &schema.Schema{ + Description: `Is New Threat`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + ForceNew: true, + Computed: true, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "ap_name": &schema.Schema{ + Description: `Ap Name`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "containment": &schema.Schema{ + Description: `Containment`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "detecting_apmac": &schema.Schema{ + Description: `Detecting A P Mac`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "rssi": &schema.Schema{ + Description: `Rssi`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "site_name_hierarchy": &schema.Schema{ + Description: `Site Name Hierarchy`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "ssid": &schema.Schema{ + Description: `Ssid`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "state": &schema.Schema{ + Description: `State`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "updated_time": &schema.Schema{ + Description: `Updated Time`, + Type: schema.TypeInt, + ForceNew: true, + Computed: true, + }, + "vendor": &schema.Schema{ + Description: `Vendor`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "limit": &schema.Schema{ + Description: `Limit`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "offset": &schema.Schema{ + Description: `Offset`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `Start Time`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityThreatsDetailsCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityThreatsDetailsThreatDetailsV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.ThreatDetailsV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing ThreatDetailsV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesThreatDetailsV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting ThreatDetailsV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceSecurityThreatsDetailsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityThreatsDetailsDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityThreatsDetailsThreatDetailsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesThreatDetailsV1 { + request := catalystcentersdkgo.RequestDevicesThreatDetailsV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".offset")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".offset")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".offset")))) { + request.Offset = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { + request.Limit = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_new_threat")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_new_threat")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_new_threat")))) { + request.IsNewThreat = interfaceToBoolPtr(v) + } + return &request +} + +func flattenDevicesThreatDetailsV1Items(items *[]catalystcentersdkgo.ResponseDevicesThreatDetailsV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["mac_address"] = item.MacAddress + respItem["updated_time"] = item.UpdatedTime + respItem["vendor"] = item.Vendor + respItem["threat_type"] = item.ThreatType + respItem["threat_level"] = item.ThreatLevel + respItem["ap_name"] = item.ApName + respItem["detecting_apmac"] = item.DetectingApMac + respItem["site_id"] = item.SiteID + respItem["rssi"] = item.Rssi + respItem["ssid"] = item.SSID + respItem["containment"] = item.Containment + respItem["state"] = item.State + respItem["site_name_hierarchy"] = item.SiteNameHierarchy + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/resource_security_threats_details_count.go b/catalystcenter/resource_security_threats_details_count.go new file mode 100644 index 0000000..18115c2 --- /dev/null +++ b/catalystcenter/resource_security_threats_details_count.go @@ -0,0 +1,218 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityThreatsDetailsCount() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- The details count for the Rogue and aWIPS threats +`, + + CreateContext: resourceSecurityThreatsDetailsCountCreate, + ReadContext: resourceSecurityThreatsDetailsCountRead, + DeleteContext: resourceSecurityThreatsDetailsCountDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "response": &schema.Schema{ + Description: `Response`, + Type: schema.TypeInt, + Computed: true, + }, + "version": &schema.Schema{ + Description: `Version`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `End Time`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "is_new_threat": &schema.Schema{ + Description: `Is New Threat`, + // Type: schema.TypeBool, + Type: schema.TypeString, + ValidateFunc: validateStringHasValueFunc([]string{"", "true", "false"}), + Optional: true, + ForceNew: true, + Computed: true, + }, + "limit": &schema.Schema{ + Description: `Limit`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "offset": &schema.Schema{ + Description: `Offset`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `Start Time`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityThreatsDetailsCountCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityThreatsDetailsCountThreatDetailCountV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.ThreatDetailCountV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing ThreatDetailCountV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItem1 := flattenDevicesThreatDetailCountV1Item(response1) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting ThreatDetailCountV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceSecurityThreatsDetailsCountRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityThreatsDetailsCountDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityThreatsDetailsCountThreatDetailCountV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesThreatDetailCountV1 { + request := catalystcentersdkgo.RequestDevicesThreatDetailCountV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".offset")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".offset")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".offset")))) { + request.Offset = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".limit")))) { + request.Limit = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".is_new_threat")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".is_new_threat")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".is_new_threat")))) { + request.IsNewThreat = interfaceToBoolPtr(v) + } + return &request +} + +func flattenDevicesThreatDetailCountV1Item(item *catalystcentersdkgo.ResponseDevicesThreatDetailCountV1) []map[string]interface{} { + if item == nil { + return nil + } + respItem := make(map[string]interface{}) + respItem["response"] = item.Response + respItem["version"] = item.Version + return []map[string]interface{}{ + respItem, + } +} diff --git a/catalystcenter/resource_security_threats_rogue_allowed_list.go b/catalystcenter/resource_security_threats_rogue_allowed_list.go new file mode 100644 index 0000000..b7fffba --- /dev/null +++ b/catalystcenter/resource_security_threats_rogue_allowed_list.go @@ -0,0 +1,277 @@ +package catalystcenter + +import ( + "context" + "fmt" + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceSecurityThreatsRogueAllowedList() *schema.Resource { + return &schema.Resource{ + Description: `It manages create, read and delete operations on Devices. + +- Intent API to add the threat mac address to allowed list. + +- Intent API to remove the threat mac address from allowed list. +`, + + CreateContext: resourceSecurityThreatsRogueAllowedListCreate, + ReadContext: resourceSecurityThreatsRogueAllowedListRead, + UpdateContext: resourceSecurityThreatsRogueAllowedListUpdate, + DeleteContext: resourceSecurityThreatsRogueAllowedListDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "item": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "category": &schema.Schema{ + Description: `Category`, + Type: schema.TypeInt, + Computed: true, + }, + "last_modified": &schema.Schema{ + Description: `Last Modified`, + Type: schema.TypeInt, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "parameters": &schema.Schema{ + Description: `Array of RequestDevicesAddAllowedMacAddressV1`, + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "category": &schema.Schema{ + Description: `Category`, + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "mac_address": &schema.Schema{ + Description: `Mac Address`, + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityThreatsRogueAllowedListCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestSecurityThreatsRogueAllowedListAddAllowedMacAddressV1(ctx, "parameters", d) + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + + vMacAddress := resourceItem["mac_address"] + vvMacAddress := interfaceToString(vMacAddress) + queryParamImport := catalystcentersdkgo.GetAllowedMacAddressV1QueryParams{} + item2, err := searchDevicesGetAllowedMacAddressV1(m, queryParamImport, vvMacAddress) + if err != nil || item2 != nil { + resourceMap := make(map[string]string) + resourceMap["mac_address"] = item2.MacAddress + d.SetId(joinResourceID(resourceMap)) + return resourceSecurityThreatsRogueAllowedListRead(ctx, d, m) + } + resp1, restyResp1, err := client.Devices.AddAllowedMacAddressV1(request1) + if err != nil || resp1 == nil { + if restyResp1 != nil { + diags = append(diags, diagErrorWithResponse( + "Failure when executing AddAllowedMacAddressV1", err, restyResp1.String())) + return diags + } + diags = append(diags, diagError( + "Failure when executing AddAllowedMacAddressV1", err)) + return diags + } + // TODO REVIEW + queryParamValidate := catalystcentersdkgo.GetAllowedMacAddressV1QueryParams{} + item3, err := searchDevicesGetAllowedMacAddressV1(m, queryParamValidate, vvMacAddress) + if err != nil || item3 == nil { + diags = append(diags, diagErrorWithAlt( + "Failure when executing AddAllowedMacAddressV1", err, + "Failure at AddAllowedMacAddressV1, unexpected response", "")) + return diags + } + + resourceMap := make(map[string]string) + resourceMap["mac_address"] = item3.MacAddress + d.SetId(joinResourceID(resourceMap)) + return resourceSecurityThreatsRogueAllowedListRead(ctx, d, m) +} + +func resourceSecurityThreatsRogueAllowedListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvMacAddress := resourceMap["mac_address"] + + selectedMethod := 1 + if selectedMethod == 1 { + log.Printf("[DEBUG] Selected method: GetAllowedMacAddressV1") + queryParams1 := catalystcentersdkgo.GetAllowedMacAddressV1QueryParams{} + + // has_unknown_response: None + + item1, err := searchDevicesGetAllowedMacAddressV1(m, queryParams1, vvMacAddress) + if err != nil || item1 == nil { + d.SetId("") + return diags + } + var items catalystcentersdkgo.ResponseDevicesGetAllowedMacAddressV1 + items = append(items, *item1) + // Review flatten function used + vItem1 := flattenDevicesGetAllowedMacAddressV1Items(&items) + if err := d.Set("item", vItem1); err != nil { + diags = append(diags, diagError( + "Failure when setting GetAllowedMacAddressV1 search response", + err)) + return diags + } + + } + return diags +} + +func resourceSecurityThreatsRogueAllowedListUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + return resourceSecurityThreatsRogueAllowedListRead(ctx, d, m) +} + +func resourceSecurityThreatsRogueAllowedListDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + + client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + + resourceID := d.Id() + resourceMap := separateResourceID(resourceID) + vvMacAddress := resourceMap["mac_address"] + + response1, restyResp1, err := client.Devices.RemoveAllowedMacAddressV1(vvMacAddress) + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) + diags = append(diags, diagErrorWithAltAndResponse( + "Failure when executing RemoveAllowedMacAddressV1", err, restyResp1.String(), + "Failure at RemoveAllowedMacAddressV1, unexpected response", "")) + return diags + } + diags = append(diags, diagErrorWithAlt( + "Failure when executing RemoveAllowedMacAddressV1", err, + "Failure at RemoveAllowedMacAddressV1, unexpected response", "")) + return diags + } + + //TODO REVIEW + + // d.SetId("") is automatically called assuming delete returns no errors, but + // it is added here for explicitness. + d.SetId("") + + return diags +} +func expandRequestSecurityThreatsRogueAllowedListAddAllowedMacAddressV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesAddAllowedMacAddressV1 { + request := catalystcentersdkgo.RequestDevicesAddAllowedMacAddressV1{} + if v := expandRequestSecurityThreatsRogueAllowedListAddAllowedMacAddressV1ItemArray(ctx, key+".payload", d); v != nil { + request = *v + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestSecurityThreatsRogueAllowedListAddAllowedMacAddressV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDevicesAddAllowedMacAddressV1 { + request := []catalystcentersdkgo.RequestItemDevicesAddAllowedMacAddressV1{} + key = fixKeyAccess(key) + o := d.Get(key) + if o == nil { + return nil + } + objs := o.([]interface{}) + if len(objs) == 0 { + return nil + } + for item_no := range objs { + i := expandRequestSecurityThreatsRogueAllowedListAddAllowedMacAddressV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + if i != nil { + request = append(request, *i) + } + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func expandRequestSecurityThreatsRogueAllowedListAddAllowedMacAddressV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDevicesAddAllowedMacAddressV1 { + request := catalystcentersdkgo.RequestItemDevicesAddAllowedMacAddressV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".mac_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mac_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mac_address")))) { + request.MacAddress = interfaceToString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".category")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".category")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".category")))) { + request.Category = interfaceToIntPtr(v) + } + if isEmptyValue(reflect.ValueOf(request)) { + return nil + } + return &request +} + +func searchDevicesGetAllowedMacAddressV1(m interface{}, queryParams catalystcentersdkgo.GetAllowedMacAddressV1QueryParams, vID string) (*catalystcentersdkgo.ResponseItemDevicesGetAllowedMacAddressV1, error) { + client := m.(*catalystcentersdkgo.Client) + var err error + var foundItem *catalystcentersdkgo.ResponseItemDevicesGetAllowedMacAddressV1 + if vID != "" { + queryParams.Offset = 1 + nResponse, _, err := client.Devices.GetAllowedMacAddressV1(nil) + maxPageSize := len(*nResponse) + for len(*nResponse) > 0 { + for _, item := range *nResponse { + if vID == item.MacAddress { + foundItem = &item + return foundItem, err + } + } + queryParams.Limit = float64(maxPageSize) + queryParams.Offset += float64(maxPageSize) + nResponse, _, err = client.Devices.GetAllowedMacAddressV1(&queryParams) + } + return nil, err + } + return foundItem, err +} diff --git a/catalystcenter/resource_security_threats_summary.go b/catalystcenter/resource_security_threats_summary.go new file mode 100644 index 0000000..12f952f --- /dev/null +++ b/catalystcenter/resource_security_threats_summary.go @@ -0,0 +1,228 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceSecurityThreatsSummary() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Devices. + +- The Threat Summary for the Rogues and aWIPS +`, + + CreateContext: resourceSecurityThreatsSummaryCreate, + ReadContext: resourceSecurityThreatsSummaryRead, + DeleteContext: resourceSecurityThreatsSummaryDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "end_time": &schema.Schema{ + Description: `End Time`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "threat_data": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "threat_count": &schema.Schema{ + Description: `Threat Count`, + Type: schema.TypeInt, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "timestamp": &schema.Schema{ + Description: `Timestamp`, + Type: schema.TypeInt, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + "site_id": &schema.Schema{ + Description: `Site Id`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "start_time": &schema.Schema{ + Description: `Start Time`, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + }, + "threat_level": &schema.Schema{ + Description: `Threat Level`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "threat_type": &schema.Schema{ + Description: `Threat Type`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } +} + +func resourceSecurityThreatsSummaryCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestSecurityThreatsSummaryThreatSummaryV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Devices.ThreatSummaryV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing ThreatSummaryV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenDevicesThreatSummaryV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting ThreatSummaryV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceSecurityThreatsSummaryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceSecurityThreatsSummaryDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestSecurityThreatsSummaryThreatSummaryV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDevicesThreatSummaryV1 { + request := catalystcentersdkgo.RequestDevicesThreatSummaryV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { + request.StartTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".end_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".end_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".end_time")))) { + request.EndTime = interfaceToIntPtr(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_id")))) { + request.SiteID = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_level")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_level")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_level")))) { + request.ThreatLevel = interfaceToSliceString(v) + } + if v, ok := d.GetOkExists(fixKeyAccess(key + ".threat_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".threat_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".threat_type")))) { + request.ThreatType = interfaceToSliceString(v) + } + return &request +} + +func flattenDevicesThreatSummaryV1Items(items *[]catalystcentersdkgo.ResponseDevicesThreatSummaryV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["timestamp"] = item.Timestamp + respItem["threat_data"] = flattenDevicesThreatSummaryV1ItemsThreatData(item.ThreatData) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenDevicesThreatSummaryV1ItemsThreatData(items *[]catalystcentersdkgo.ResponseDevicesThreatSummaryV1ResponseThreatData) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["threat_type"] = item.ThreatType + respItem["threat_level"] = item.ThreatLevel + respItem["threat_count"] = item.ThreatCount + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/resource_sensor.go b/catalystcenter/resource_sensor.go index 2f3cb39..64d707b 100644 --- a/catalystcenter/resource_sensor.go +++ b/catalystcenter/resource_sensor.go @@ -1510,7 +1510,7 @@ func resourceSensorCreate(ctx context.Context, d *schema.ResourceData, m interfa var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSensorCreateSensorTestTemplate(ctx, "parameters.0", d) + request1 := expandRequestSensorCreateSensorTestTemplateV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vName := resourceItem["name"] vvName := interfaceToString(vName) @@ -1567,10 +1567,10 @@ func resourceSensorRead(ctx context.Context, d *schema.ResourceData, m interface log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseSensorsSensorsResponse{ + items := []catalystcentersdkgo.ResponseSensorsSensorsV1Response{ *response1, } - vItem1 := flattenSensorsSensorsItems(&items) + vItem1 := flattenSensorsSensorsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting Sensors search response", @@ -1613,7 +1613,7 @@ func resourceSensorDelete(ctx context.Context, d *schema.ResourceData, m interfa //var vvName string // REVIEW: Add getAllItems and search function to get missing params - queryParams := catalystcentersdkgo.DeleteSensorTestQueryParams{ + queryParams := catalystcentersdkgo.DeleteSensorTestV1QueryParams{ TemplateName: vName, } response1, restyResp1, err := client.Sensors.DeleteSensorTest(&queryParams) @@ -1639,8 +1639,8 @@ func resourceSensorDelete(ctx context.Context, d *schema.ResourceData, m interfa return diags } -func expandRequestSensorCreateSensorTestTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplate { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplate{} +func expandRequestSensorCreateSensorTestTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1 { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -1654,10 +1654,10 @@ func expandRequestSensorCreateSensorTestTemplate(ctx context.Context, key string request.Connection = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssids")))) { - request.SSIDs = expandRequestSensorCreateSensorTestTemplateSSIDsArray(ctx, key+".ssids", d) + request.SSIDs = expandRequestSensorCreateSensorTestTemplateV1SSIDsArray(ctx, key+".ssids", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profiles")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profiles")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profiles")))) { - request.Profiles = expandRequestSensorCreateSensorTestTemplateProfilesArray(ctx, key+".profiles", d) + request.Profiles = expandRequestSensorCreateSensorTestTemplateV1ProfilesArray(ctx, key+".profiles", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".encryption_mode")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".encryption_mode")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".encryption_mode")))) { request.EncryptionMode = interfaceToString(v) @@ -1666,13 +1666,13 @@ func expandRequestSensorCreateSensorTestTemplate(ctx context.Context, key string request.RunNow = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_info_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_info_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_info_list")))) { - request.LocationInfoList = expandRequestSensorCreateSensorTestTemplateLocationInfoListArray(ctx, key+".location_info_list", d) + request.LocationInfoList = expandRequestSensorCreateSensorTestTemplateV1LocationInfoListArray(ctx, key+".location_info_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sensors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sensors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sensors")))) { - request.Sensors = expandRequestSensorCreateSensorTestTemplateSensorsArray(ctx, key+".sensors", d) + request.Sensors = expandRequestSensorCreateSensorTestTemplateV1SensorsArray(ctx, key+".sensors", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ap_coverage")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ap_coverage")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ap_coverage")))) { - request.ApCoverage = expandRequestSensorCreateSensorTestTemplateApCoverageArray(ctx, key+".ap_coverage", d) + request.ApCoverage = expandRequestSensorCreateSensorTestTemplateV1ApCoverageArray(ctx, key+".ap_coverage", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1680,8 +1680,8 @@ func expandRequestSensorCreateSensorTestTemplate(ctx context.Context, key string return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1692,7 +1692,7 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsArray(ctx context.Context, return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateSSIDs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1SSIDs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1703,8 +1703,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsArray(ctx context.Context, return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bands")))) { request.Bands = interfaceToString(v) } @@ -1727,7 +1727,7 @@ func expandRequestSensorCreateSensorTestTemplateSSIDs(ctx context.Context, key s request.Layer3WebAuthEmailAddress = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".third_party")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".third_party")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".third_party")))) { - request.ThirdParty = expandRequestSensorCreateSensorTestTemplateSSIDsThirdParty(ctx, key+".third_party.0", d) + request.ThirdParty = expandRequestSensorCreateSensorTestTemplateV1SSIDsThirdParty(ctx, key+".third_party.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".wlan_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wlan_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wlan_id")))) { request.WLANID = interfaceToIntPtr(v) @@ -1802,13 +1802,13 @@ func expandRequestSensorCreateSensorTestTemplateSSIDs(ctx context.Context, key s request.ExtWebAuthAccessURL = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ext_web_auth_html_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) { - request.ExtWebAuthHTMLTag = expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) + request.ExtWebAuthHTMLTag = expandRequestSensorCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_policy")))) { request.QosPolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tests")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tests")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tests")))) { - request.Tests = expandRequestSensorCreateSensorTestTemplateSSIDsTestsArray(ctx, key+".tests", d) + request.Tests = expandRequestSensorCreateSensorTestTemplateV1SSIDsTestsArray(ctx, key+".tests", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1816,8 +1816,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDs(ctx context.Context, key s return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsThirdParty(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsThirdParty { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsThirdParty{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsThirdParty(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsThirdParty { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsThirdParty{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".selected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selected")))) { request.Selected = interfaceToBoolPtr(v) } @@ -1827,8 +1827,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsThirdParty(ctx context.Cont return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1839,7 +1839,7 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1850,8 +1850,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".label")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".label")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".label")))) { request.Label = interfaceToString(v) } @@ -1867,8 +1867,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx conte return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1879,7 +1879,7 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsTestsArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateSSIDsTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1SSIDsTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1890,13 +1890,13 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsTestsArray(ctx context.Cont return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config")))) { - request.Config = expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfigArray(ctx, key+".config", d) + request.Config = expandRequestSensorCreateSensorTestTemplateV1SSIDsTestsConfigArray(ctx, key+".config", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1904,8 +1904,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsTests(ctx context.Context, return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1916,7 +1916,7 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfigArray(ctx contex return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1SSIDsTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1927,8 +1927,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfigArray(ctx contex return &request } -func expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig{} +func expandRequestSensorCreateSensorTestTemplateV1SSIDsTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains")))) { request.Domains = interfaceToSliceString(v) } @@ -2025,8 +2025,8 @@ func expandRequestSensorCreateSensorTestTemplateSSIDsTestsConfig(ctx context.Con return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2037,7 +2037,7 @@ func expandRequestSensorCreateSensorTestTemplateProfilesArray(ctx context.Contex return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateProfiles(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1Profiles(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2048,8 +2048,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesArray(ctx context.Contex return &request } -func expandRequestSensorCreateSensorTestTemplateProfiles(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles{} +func expandRequestSensorCreateSensorTestTemplateV1Profiles(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auth_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auth_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auth_type")))) { request.AuthType = interfaceToString(v) } @@ -2105,13 +2105,13 @@ func expandRequestSensorCreateSensorTestTemplateProfiles(ctx context.Context, ke request.ExtWebAuthAccessURL = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ext_web_auth_html_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) { - request.ExtWebAuthHTMLTag = expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) + request.ExtWebAuthHTMLTag = expandRequestSensorCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_policy")))) { request.QosPolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tests")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tests")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tests")))) { - request.Tests = expandRequestSensorCreateSensorTestTemplateProfilesTestsArray(ctx, key+".tests", d) + request.Tests = expandRequestSensorCreateSensorTestTemplateV1ProfilesTestsArray(ctx, key+".tests", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) @@ -2123,7 +2123,7 @@ func expandRequestSensorCreateSensorTestTemplateProfiles(ctx context.Context, ke request.VLAN = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_vlan_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_vlan_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_vlan_list")))) { - request.LocationVLANList = expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANListArray(ctx, key+".location_vlan_list", d) + request.LocationVLANList = expandRequestSensorCreateSensorTestTemplateV1ProfilesLocationVLANListArray(ctx, key+".location_vlan_list", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2131,8 +2131,8 @@ func expandRequestSensorCreateSensorTestTemplateProfiles(ctx context.Context, ke return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2143,7 +2143,7 @@ func expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTagArray(c return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2154,8 +2154,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTagArray(c return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".label")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".label")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".label")))) { request.Label = interfaceToString(v) } @@ -2171,8 +2171,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx co return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2183,7 +2183,7 @@ func expandRequestSensorCreateSensorTestTemplateProfilesTestsArray(ctx context.C return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateProfilesTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1ProfilesTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2194,13 +2194,13 @@ func expandRequestSensorCreateSensorTestTemplateProfilesTestsArray(ctx context.C return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config")))) { - request.Config = expandRequestSensorCreateSensorTestTemplateProfilesTestsConfigArray(ctx, key+".config", d) + request.Config = expandRequestSensorCreateSensorTestTemplateV1ProfilesTestsConfigArray(ctx, key+".config", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2208,8 +2208,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesTests(ctx context.Contex return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2220,7 +2220,7 @@ func expandRequestSensorCreateSensorTestTemplateProfilesTestsConfigArray(ctx con return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateProfilesTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1ProfilesTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2231,8 +2231,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesTestsConfigArray(ctx con return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains")))) { request.Domains = interfaceToSliceString(v) } @@ -2329,8 +2329,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesTestsConfig(ctx context. return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesLocationVLANListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2341,7 +2341,7 @@ func expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANListArray(ct return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1ProfilesLocationVLANList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2352,8 +2352,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANListArray(ct return &request } -func expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList{} +func expandRequestSensorCreateSensorTestTemplateV1ProfilesLocationVLANList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_id")))) { request.LocationID = interfaceToString(v) } @@ -2366,8 +2366,8 @@ func expandRequestSensorCreateSensorTestTemplateProfilesLocationVLANList(ctx con return &request } -func expandRequestSensorCreateSensorTestTemplateLocationInfoListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList{} +func expandRequestSensorCreateSensorTestTemplateV1LocationInfoListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2378,7 +2378,7 @@ func expandRequestSensorCreateSensorTestTemplateLocationInfoListArray(ctx contex return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateLocationInfoList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1LocationInfoList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2389,8 +2389,8 @@ func expandRequestSensorCreateSensorTestTemplateLocationInfoListArray(ctx contex return &request } -func expandRequestSensorCreateSensorTestTemplateLocationInfoList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList{} +func expandRequestSensorCreateSensorTestTemplateV1LocationInfoList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_id")))) { request.LocationID = interfaceToString(v) } @@ -2418,8 +2418,8 @@ func expandRequestSensorCreateSensorTestTemplateLocationInfoList(ctx context.Con return &request } -func expandRequestSensorCreateSensorTestTemplateSensorsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors{} +func expandRequestSensorCreateSensorTestTemplateV1SensorsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2430,7 +2430,7 @@ func expandRequestSensorCreateSensorTestTemplateSensorsArray(ctx context.Context return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateSensors(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1Sensors(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2441,8 +2441,8 @@ func expandRequestSensorCreateSensorTestTemplateSensorsArray(ctx context.Context return &request } -func expandRequestSensorCreateSensorTestTemplateSensors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors{} +func expandRequestSensorCreateSensorTestTemplateV1Sensors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -2501,7 +2501,7 @@ func expandRequestSensorCreateSensorTestTemplateSensors(ctx context.Context, key request.SensorType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".test_mac_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".test_mac_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".test_mac_addresses")))) { - request.TestMacAddresses = expandRequestSensorCreateSensorTestTemplateSensorsTestMacAddresses(ctx, key+".test_mac_addresses.0", d) + request.TestMacAddresses = expandRequestSensorCreateSensorTestTemplateV1SensorsTestMacAddresses(ctx, key+".test_mac_addresses.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -2510,7 +2510,7 @@ func expandRequestSensorCreateSensorTestTemplateSensors(ctx context.Context, key request.ServicePolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".i_perf_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".i_perf_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".i_perf_info")))) { - request.IPerfInfo = expandRequestSensorCreateSensorTestTemplateSensorsIPerfInfo(ctx, key+".i_perf_info.0", d) + request.IPerfInfo = expandRequestSensorCreateSensorTestTemplateV1SensorsIPerfInfo(ctx, key+".i_perf_info.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2518,8 +2518,8 @@ func expandRequestSensorCreateSensorTestTemplateSensors(ctx context.Context, key return &request } -func expandRequestSensorCreateSensorTestTemplateSensorsTestMacAddresses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsTestMacAddresses { - var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsTestMacAddresses +func expandRequestSensorCreateSensorTestTemplateV1SensorsTestMacAddresses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsTestMacAddresses { + var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsTestMacAddresses request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2527,8 +2527,8 @@ func expandRequestSensorCreateSensorTestTemplateSensorsTestMacAddresses(ctx cont return &request } -func expandRequestSensorCreateSensorTestTemplateSensorsIPerfInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsIPerfInfo { - var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsIPerfInfo +func expandRequestSensorCreateSensorTestTemplateV1SensorsIPerfInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsIPerfInfo { + var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsIPerfInfo request = d.Get(fixKeyAccess(key)) if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -2536,8 +2536,8 @@ func expandRequestSensorCreateSensorTestTemplateSensorsIPerfInfo(ctx context.Con return &request } -func expandRequestSensorCreateSensorTestTemplateApCoverageArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage{} +func expandRequestSensorCreateSensorTestTemplateV1ApCoverageArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2548,7 +2548,7 @@ func expandRequestSensorCreateSensorTestTemplateApCoverageArray(ctx context.Cont return nil } for item_no := range objs { - i := expandRequestSensorCreateSensorTestTemplateApCoverage(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorCreateSensorTestTemplateV1ApCoverage(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2559,8 +2559,8 @@ func expandRequestSensorCreateSensorTestTemplateApCoverageArray(ctx context.Cont return &request } -func expandRequestSensorCreateSensorTestTemplateApCoverage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage{} +func expandRequestSensorCreateSensorTestTemplateV1ApCoverage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bands")))) { request.Bands = interfaceToString(v) } @@ -2576,11 +2576,11 @@ func expandRequestSensorCreateSensorTestTemplateApCoverage(ctx context.Context, return &request } -func searchSensorsSensors(m interface{}, vName string) (*catalystcentersdkgo.ResponseSensorsSensorsResponse, error) { +func searchSensorsSensors(m interface{}, vName string) (*catalystcentersdkgo.ResponseSensorsSensorsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSensorsSensorsResponse - var ite *catalystcentersdkgo.ResponseSensorsSensors + var foundItem *catalystcentersdkgo.ResponseSensorsSensorsV1Response + var ite *catalystcentersdkgo.ResponseSensorsSensorsV1 ite, _, err = client.Sensors.Sensors(nil) if err != nil { return foundItem, err @@ -2593,7 +2593,7 @@ func searchSensorsSensors(m interface{}, vName string) (*catalystcentersdkgo.Res for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == vName { - var getItem *catalystcentersdkgo.ResponseSensorsSensorsResponse + var getItem *catalystcentersdkgo.ResponseSensorsSensorsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_sensor_test_create.go b/catalystcenter/resource_sensor_test_create.go index 0a91334..136e7b1 100644 --- a/catalystcenter/resource_sensor_test_create.go +++ b/catalystcenter/resource_sensor_test_create.go @@ -2,6 +2,7 @@ package catalystcenter import ( "context" + "fmt" "reflect" @@ -13,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) +// resourceAction func resourceSensorTestCreate() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Sensors. @@ -2869,30 +2871,27 @@ func resourceSensorTestCreateCreate(ctx context.Context, d *schema.ResourceData, client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSensorTestCreateCreateSensorTestTemplate(ctx, "parameters.0", d) + request1 := expandRequestSensorTestCreateCreateSensorTestTemplateV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sensors.CreateSensorTestTemplate(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sensors.CreateSensorTestTemplateV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } - d.SetId("") + diags = append(diags, diagError( + "Failure when executing CreateSensorTestTemplateV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenSensorsCreateSensorTestTemplateItem(response1.Response) + vItem1 := flattenSensorsCreateSensorTestTemplateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateSensorTestTemplate response", + "Failure when setting CreateSensorTestTemplateV1 response", err)) return diags } @@ -2914,8 +2913,8 @@ func resourceSensorTestCreateDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestSensorTestCreateCreateSensorTestTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplate { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplate{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1 { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -2929,10 +2928,10 @@ func expandRequestSensorTestCreateCreateSensorTestTemplate(ctx context.Context, request.Connection = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssids")))) { - request.SSIDs = expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsArray(ctx, key+".ssids", d) + request.SSIDs = expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsArray(ctx, key+".ssids", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profiles")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profiles")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profiles")))) { - request.Profiles = expandRequestSensorTestCreateCreateSensorTestTemplateProfilesArray(ctx, key+".profiles", d) + request.Profiles = expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesArray(ctx, key+".profiles", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".encryption_mode")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".encryption_mode")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".encryption_mode")))) { request.EncryptionMode = interfaceToString(v) @@ -2941,19 +2940,19 @@ func expandRequestSensorTestCreateCreateSensorTestTemplate(ctx context.Context, request.RunNow = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_info_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_info_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_info_list")))) { - request.LocationInfoList = expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoListArray(ctx, key+".location_info_list", d) + request.LocationInfoList = expandRequestSensorTestCreateCreateSensorTestTemplateV1LocationInfoListArray(ctx, key+".location_info_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sensors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sensors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sensors")))) { - request.Sensors = expandRequestSensorTestCreateCreateSensorTestTemplateSensorsArray(ctx, key+".sensors", d) + request.Sensors = expandRequestSensorTestCreateCreateSensorTestTemplateV1SensorsArray(ctx, key+".sensors", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ap_coverage")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ap_coverage")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ap_coverage")))) { - request.ApCoverage = expandRequestSensorTestCreateCreateSensorTestTemplateApCoverageArray(ctx, key+".ap_coverage", d) + request.ApCoverage = expandRequestSensorTestCreateCreateSensorTestTemplateV1ApCoverageArray(ctx, key+".ap_coverage", d) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -2964,7 +2963,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsArray(ctx context return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateSSIDs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -2972,8 +2971,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsArray(ctx context return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDs{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDs{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bands")))) { request.Bands = interfaceToString(v) } @@ -2996,7 +2995,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDs(ctx context.Cont request.Layer3WebAuthEmailAddress = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".third_party")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".third_party")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".third_party")))) { - request.ThirdParty = expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsThirdParty(ctx, key+".third_party.0", d) + request.ThirdParty = expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsThirdParty(ctx, key+".third_party.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".wlan_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wlan_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wlan_id")))) { request.WLANID = interfaceToIntPtr(v) @@ -3071,27 +3070,27 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDs(ctx context.Cont request.ExtWebAuthAccessURL = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ext_web_auth_html_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) { - request.ExtWebAuthHTMLTag = expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) + request.ExtWebAuthHTMLTag = expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_policy")))) { request.QosPolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tests")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tests")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tests")))) { - request.Tests = expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsArray(ctx, key+".tests", d) + request.Tests = expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTestsArray(ctx, key+".tests", d) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsThirdParty(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsThirdParty { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsThirdParty{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsThirdParty(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsThirdParty { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsThirdParty{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".selected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selected")))) { request.Selected = interfaceToBoolPtr(v) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3102,7 +3101,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3110,8 +3109,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsExtWebAuthHTMLTag{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".label")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".label")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".label")))) { request.Label = interfaceToString(v) } @@ -3124,8 +3123,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsExtWebAuthHTMLTag return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3136,7 +3135,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsArray(ctx co return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3144,19 +3143,19 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsArray(ctx co return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTests{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTests{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config")))) { - request.Config = expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfigArray(ctx, key+".config", d) + request.Config = expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTestsConfigArray(ctx, key+".config", d) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3167,7 +3166,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfigArray( return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3175,8 +3174,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfigArray( return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSSIDsTestsConfig{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SSIDsTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SSIDsTestsConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains")))) { request.Domains = interfaceToSliceString(v) } @@ -3270,8 +3269,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSSIDsTestsConfig(ctx c return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3282,7 +3281,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesArray(ctx cont return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateProfiles(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1Profiles(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3290,8 +3289,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesArray(ctx cont return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfiles(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfiles{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1Profiles(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Profiles{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auth_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auth_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auth_type")))) { request.AuthType = interfaceToString(v) } @@ -3347,13 +3346,13 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfiles(ctx context.C request.ExtWebAuthAccessURL = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ext_web_auth_html_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) { - request.ExtWebAuthHTMLTag = expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) + request.ExtWebAuthHTMLTag = expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_policy")))) { request.QosPolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tests")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tests")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tests")))) { - request.Tests = expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsArray(ctx, key+".tests", d) + request.Tests = expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTestsArray(ctx, key+".tests", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) @@ -3365,13 +3364,13 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfiles(ctx context.C request.VLAN = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_vlan_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_vlan_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_vlan_list")))) { - request.LocationVLANList = expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANListArray(ctx, key+".location_vlan_list", d) + request.LocationVLANList = expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesLocationVLANListArray(ctx, key+".location_vlan_list", d) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3382,7 +3381,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTML return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3390,8 +3389,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTML return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesExtWebAuthHTMLTag{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesExtWebAuthHTMLTag{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".label")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".label")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".label")))) { request.Label = interfaceToString(v) } @@ -3404,8 +3403,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesExtWebAuthHTML return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3416,7 +3415,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsArray(ctx return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3424,19 +3423,19 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsArray(ctx return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTests{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTests{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config")))) { - request.Config = expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfigArray(ctx, key+".config", d) + request.Config = expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTestsConfigArray(ctx, key+".config", d) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3447,7 +3446,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfigArr return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3455,8 +3454,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfigArr return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesTestsConfig{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesTestsConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains")))) { request.Domains = interfaceToSliceString(v) } @@ -3550,8 +3549,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesTestsConfig(ct return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesLocationVLANListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3562,7 +3561,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANLi return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesLocationVLANList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3570,8 +3569,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANLi return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateProfilesLocationVLANList{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ProfilesLocationVLANList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ProfilesLocationVLANList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_id")))) { request.LocationID = interfaceToString(v) } @@ -3581,8 +3580,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateProfilesLocationVLANLi return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1LocationInfoListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3593,7 +3592,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoListArray( return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1LocationInfoList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3601,8 +3600,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoListArray( return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateLocationInfoList{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1LocationInfoList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1LocationInfoList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_id")))) { request.LocationID = interfaceToString(v) } @@ -3627,8 +3626,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateLocationInfoList(ctx c return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSensorsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SensorsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3639,7 +3638,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSensorsArray(ctx conte return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateSensors(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1Sensors(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3647,8 +3646,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSensorsArray(ctx conte return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSensors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensors{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1Sensors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1Sensors{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -3707,7 +3706,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSensors(ctx context.Co request.SensorType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".test_mac_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".test_mac_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".test_mac_addresses")))) { - request.TestMacAddresses = expandRequestSensorTestCreateCreateSensorTestTemplateSensorsTestMacAddresses(ctx, key+".test_mac_addresses.0", d) + request.TestMacAddresses = expandRequestSensorTestCreateCreateSensorTestTemplateV1SensorsTestMacAddresses(ctx, key+".test_mac_addresses.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -3716,25 +3715,25 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateSensors(ctx context.Co request.ServicePolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".i_perf_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".i_perf_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".i_perf_info")))) { - request.IPerfInfo = expandRequestSensorTestCreateCreateSensorTestTemplateSensorsIPerfInfo(ctx, key+".i_perf_info.0", d) + request.IPerfInfo = expandRequestSensorTestCreateCreateSensorTestTemplateV1SensorsIPerfInfo(ctx, key+".i_perf_info.0", d) } return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSensorsTestMacAddresses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsTestMacAddresses { - var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsTestMacAddresses +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SensorsTestMacAddresses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsTestMacAddresses { + var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsTestMacAddresses request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateSensorsIPerfInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsIPerfInfo { - var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateSensorsIPerfInfo +func expandRequestSensorTestCreateCreateSensorTestTemplateV1SensorsIPerfInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsIPerfInfo { + var request catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1SensorsIPerfInfo request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateApCoverageArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage { - request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ApCoverageArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage { + request := []catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3745,7 +3744,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateApCoverageArray(ctx co return nil } for item_no := range objs { - i := expandRequestSensorTestCreateCreateSensorTestTemplateApCoverage(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestCreateCreateSensorTestTemplateV1ApCoverage(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3753,8 +3752,8 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateApCoverageArray(ctx co return &request } -func expandRequestSensorTestCreateCreateSensorTestTemplateApCoverage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage { - request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateApCoverage{} +func expandRequestSensorTestCreateCreateSensorTestTemplateV1ApCoverage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage { + request := catalystcentersdkgo.RequestSensorsCreateSensorTestTemplateV1ApCoverage{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bands")))) { request.Bands = interfaceToString(v) } @@ -3767,7 +3766,7 @@ func expandRequestSensorTestCreateCreateSensorTestTemplateApCoverage(ctx context return &request } -func flattenSensorsCreateSensorTestTemplateItem(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponse) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1Item(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1Response) []map[string]interface{} { if item == nil { return nil } @@ -3784,27 +3783,27 @@ func flattenSensorsCreateSensorTestTemplateItem(item *catalystcentersdkgo.Respon respItem["status"] = item.Status respItem["connection"] = item.Connection respItem["action_in_progress"] = item.ActionInProgress - respItem["frequency"] = flattenSensorsCreateSensorTestTemplateItemFrequency(item.Frequency) + respItem["frequency"] = flattenSensorsCreateSensorTestTemplateV1ItemFrequency(item.Frequency) respItem["rssi_threshold"] = item.RssiThreshold respItem["num_neighbor_apthreshold"] = item.NumNeighborApThreshold respItem["schedule_in_days"] = item.ScheduleInDays respItem["wlans"] = item.WLANs - respItem["ssids"] = flattenSensorsCreateSensorTestTemplateItemSSIDs(item.SSIDs) - respItem["profiles"] = flattenSensorsCreateSensorTestTemplateItemProfiles(item.Profiles) + respItem["ssids"] = flattenSensorsCreateSensorTestTemplateV1ItemSSIDs(item.SSIDs) + respItem["profiles"] = flattenSensorsCreateSensorTestTemplateV1ItemProfiles(item.Profiles) respItem["test_schedule_mode"] = item.TestScheduleMode respItem["show_wlc_upgrade_banner"] = boolPtrToString(item.ShowWlcUpgradeBanner) respItem["radio_as_sensor_removed"] = boolPtrToString(item.RadioAsSensorRemoved) respItem["encryption_mode"] = item.EncryptionMode respItem["run_now"] = item.RunNow - respItem["location_info_list"] = flattenSensorsCreateSensorTestTemplateItemLocationInfoList(item.LocationInfoList) - respItem["sensors"] = flattenSensorsCreateSensorTestTemplateItemSensors(item.Sensors) - respItem["ap_coverage"] = flattenSensorsCreateSensorTestTemplateItemApCoverage(item.ApCoverage) + respItem["location_info_list"] = flattenSensorsCreateSensorTestTemplateV1ItemLocationInfoList(item.LocationInfoList) + respItem["sensors"] = flattenSensorsCreateSensorTestTemplateV1ItemSensors(item.Sensors) + respItem["ap_coverage"] = flattenSensorsCreateSensorTestTemplateV1ItemApCoverage(item.ApCoverage) return []map[string]interface{}{ respItem, } } -func flattenSensorsCreateSensorTestTemplateItemFrequency(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseFrequency) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemFrequency(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseFrequency) []map[string]interface{} { if item == nil { return nil } @@ -3818,7 +3817,7 @@ func flattenSensorsCreateSensorTestTemplateItemFrequency(item *catalystcentersdk } -func flattenSensorsCreateSensorTestTemplateItemSSIDs(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSSIDs) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSSIDs(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSSIDs) []map[string]interface{} { if items == nil { return nil } @@ -3834,7 +3833,7 @@ func flattenSensorsCreateSensorTestTemplateItemSSIDs(items *[]catalystcentersdkg respItem["layer3web_authuser_name"] = item.Layer3WebAuthuserName respItem["layer3web_authpassword"] = item.Layer3WebAuthpassword respItem["layer3web_auth_email_address"] = item.Layer3WebAuthEmailAddress - respItem["third_party"] = flattenSensorsCreateSensorTestTemplateItemSSIDsThirdParty(item.ThirdParty) + respItem["third_party"] = flattenSensorsCreateSensorTestTemplateV1ItemSSIDsThirdParty(item.ThirdParty) respItem["id"] = item.ID respItem["wlan_id"] = item.WLANID respItem["wlc"] = item.Wlc @@ -3863,15 +3862,15 @@ func flattenSensorsCreateSensorTestTemplateItemSSIDs(items *[]catalystcentersdkg respItem["white_list"] = boolPtrToString(item.WhiteList) respItem["ext_web_auth_portal"] = item.ExtWebAuthPortal respItem["ext_web_auth_access_url"] = item.ExtWebAuthAccessURL - respItem["ext_web_auth_html_tag"] = flattenSensorsCreateSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) + respItem["ext_web_auth_html_tag"] = flattenSensorsCreateSensorTestTemplateV1ItemSSIDsExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) respItem["qos_policy"] = item.QosPolicy - respItem["tests"] = flattenSensorsCreateSensorTestTemplateItemSSIDsTests(item.Tests) + respItem["tests"] = flattenSensorsCreateSensorTestTemplateV1ItemSSIDsTests(item.Tests) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsCreateSensorTestTemplateItemSSIDsThirdParty(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSSIDsThirdParty) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSSIDsThirdParty(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSSIDsThirdParty) []map[string]interface{} { if item == nil { return nil } @@ -3884,7 +3883,7 @@ func flattenSensorsCreateSensorTestTemplateItemSSIDsThirdParty(item *catalystcen } -func flattenSensorsCreateSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSSIDsExtWebAuthHTMLTag) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSSIDsExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSSIDsExtWebAuthHTMLTag) []map[string]interface{} { if items == nil { return nil } @@ -3899,7 +3898,7 @@ func flattenSensorsCreateSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(items *[]c return respItems } -func flattenSensorsCreateSensorTestTemplateItemSSIDsTests(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSSIDsTests) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSSIDsTests(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSSIDsTests) []map[string]interface{} { if items == nil { return nil } @@ -3907,13 +3906,13 @@ func flattenSensorsCreateSensorTestTemplateItemSSIDsTests(items *[]catalystcente for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["config"] = flattenSensorsCreateSensorTestTemplateItemSSIDsTestsConfig(item.Config) + respItem["config"] = flattenSensorsCreateSensorTestTemplateV1ItemSSIDsTestsConfig(item.Config) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsCreateSensorTestTemplateItemSSIDsTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSSIDsTestsConfig) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSSIDsTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSSIDsTestsConfig) []map[string]interface{} { if items == nil { return nil } @@ -3955,7 +3954,7 @@ func flattenSensorsCreateSensorTestTemplateItemSSIDsTestsConfig(items *[]catalys return respItems } -func flattenSensorsCreateSensorTestTemplateItemProfiles(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseProfiles) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemProfiles(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseProfiles) []map[string]interface{} { if items == nil { return nil } @@ -3980,19 +3979,19 @@ func flattenSensorsCreateSensorTestTemplateItemProfiles(items *[]catalystcenters respItem["white_list"] = boolPtrToString(item.WhiteList) respItem["ext_web_auth_portal"] = item.ExtWebAuthPortal respItem["ext_web_auth_access_url"] = item.ExtWebAuthAccessURL - respItem["ext_web_auth_html_tag"] = flattenSensorsCreateSensorTestTemplateItemProfilesExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) + respItem["ext_web_auth_html_tag"] = flattenSensorsCreateSensorTestTemplateV1ItemProfilesExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) respItem["qos_policy"] = item.QosPolicy - respItem["tests"] = flattenSensorsCreateSensorTestTemplateItemProfilesTests(item.Tests) + respItem["tests"] = flattenSensorsCreateSensorTestTemplateV1ItemProfilesTests(item.Tests) respItem["profile_name"] = item.ProfileName respItem["device_type"] = item.DeviceType respItem["vlan"] = item.VLAN - respItem["location_vlan_list"] = flattenSensorsCreateSensorTestTemplateItemProfilesLocationVLANList(item.LocationVLANList) + respItem["location_vlan_list"] = flattenSensorsCreateSensorTestTemplateV1ItemProfilesLocationVLANList(item.LocationVLANList) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsCreateSensorTestTemplateItemProfilesExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseProfilesExtWebAuthHTMLTag) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemProfilesExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseProfilesExtWebAuthHTMLTag) []map[string]interface{} { if items == nil { return nil } @@ -4007,7 +4006,7 @@ func flattenSensorsCreateSensorTestTemplateItemProfilesExtWebAuthHTMLTag(items * return respItems } -func flattenSensorsCreateSensorTestTemplateItemProfilesTests(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseProfilesTests) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemProfilesTests(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseProfilesTests) []map[string]interface{} { if items == nil { return nil } @@ -4015,13 +4014,13 @@ func flattenSensorsCreateSensorTestTemplateItemProfilesTests(items *[]catalystce for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["config"] = flattenSensorsCreateSensorTestTemplateItemProfilesTestsConfig(item.Config) + respItem["config"] = flattenSensorsCreateSensorTestTemplateV1ItemProfilesTestsConfig(item.Config) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsCreateSensorTestTemplateItemProfilesTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseProfilesTestsConfig) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemProfilesTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseProfilesTestsConfig) []map[string]interface{} { if items == nil { return nil } @@ -4063,7 +4062,7 @@ func flattenSensorsCreateSensorTestTemplateItemProfilesTestsConfig(items *[]cata return respItems } -func flattenSensorsCreateSensorTestTemplateItemProfilesLocationVLANList(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseProfilesLocationVLANList) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemProfilesLocationVLANList(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseProfilesLocationVLANList) []map[string]interface{} { if items == nil { return nil } @@ -4077,7 +4076,7 @@ func flattenSensorsCreateSensorTestTemplateItemProfilesLocationVLANList(items *[ return respItems } -func flattenSensorsCreateSensorTestTemplateItemLocationInfoList(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseLocationInfoList) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemLocationInfoList(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseLocationInfoList) []map[string]interface{} { if items == nil { return nil } @@ -4096,7 +4095,7 @@ func flattenSensorsCreateSensorTestTemplateItemLocationInfoList(items *[]catalys return respItems } -func flattenSensorsCreateSensorTestTemplateItemSensors(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSensors) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSensors(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSensors) []map[string]interface{} { if items == nil { return nil } @@ -4122,16 +4121,16 @@ func flattenSensorsCreateSensorTestTemplateItemSensors(items *[]catalystcentersd respItem["all_sensor_addition"] = boolPtrToString(item.AllSensorAddition) respItem["config_updated"] = item.ConfigUpdated respItem["sensor_type"] = item.SensorType - respItem["test_mac_addresses"] = flattenSensorsCreateSensorTestTemplateItemSensorsTestMacAddresses(item.TestMacAddresses) + respItem["test_mac_addresses"] = flattenSensorsCreateSensorTestTemplateV1ItemSensorsTestMacAddresses(item.TestMacAddresses) respItem["id"] = item.ID respItem["service_policy"] = item.ServicePolicy - respItem["i_perf_info"] = flattenSensorsCreateSensorTestTemplateItemSensorsIPerfInfo(item.IPerfInfo) + respItem["i_perf_info"] = flattenSensorsCreateSensorTestTemplateV1ItemSensorsIPerfInfo(item.IPerfInfo) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsCreateSensorTestTemplateItemSensorsTestMacAddresses(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSensorsTestMacAddresses) interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSensorsTestMacAddresses(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSensorsTestMacAddresses) interface{} { if item == nil { return nil } @@ -4141,7 +4140,7 @@ func flattenSensorsCreateSensorTestTemplateItemSensorsTestMacAddresses(item *cat } -func flattenSensorsCreateSensorTestTemplateItemSensorsIPerfInfo(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseSensorsIPerfInfo) interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemSensorsIPerfInfo(item *catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseSensorsIPerfInfo) interface{} { if item == nil { return nil } @@ -4151,7 +4150,7 @@ func flattenSensorsCreateSensorTestTemplateItemSensorsIPerfInfo(item *catalystce } -func flattenSensorsCreateSensorTestTemplateItemApCoverage(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateResponseApCoverage) []map[string]interface{} { +func flattenSensorsCreateSensorTestTemplateV1ItemApCoverage(items *[]catalystcentersdkgo.ResponseSensorsCreateSensorTestTemplateV1ResponseApCoverage) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_sensor_test_delete.go b/catalystcenter/resource_sensor_test_delete.go index 2c489fe..70d50bc 100644 --- a/catalystcenter/resource_sensor_test_delete.go +++ b/catalystcenter/resource_sensor_test_delete.go @@ -74,7 +74,7 @@ func resourceSensorTestDeleteCreate(ctx context.Context, d *schema.ResourceData, vTemplateName := d.Get("parameters.0.template_name").(string) log.Printf("[DEBUG] Selected method 1: DeleteSensorTest") - queryParams1 := catalystcentersdkgo.DeleteSensorTestQueryParams{} + queryParams1 := catalystcentersdkgo.DeleteSensorTestV1QueryParams{} queryParams1.TemplateName = vTemplateName response1, restyResp1, err := client.Sensors.DeleteSensorTest(&queryParams1) @@ -117,7 +117,7 @@ func resourceSensorTestDeleteDelete(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics return diags } -func flattenSensorsDeleteSensorTestItem(item *catalystcentersdkgo.ResponseSensorsDeleteSensorTestResponse) []map[string]interface{} { +func flattenSensorsDeleteSensorTestItem(item *catalystcentersdkgo.ResponseSensorsDeleteSensorTestV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sensor_test_run.go b/catalystcenter/resource_sensor_test_run.go index 85e06c4..c4d4e63 100644 --- a/catalystcenter/resource_sensor_test_run.go +++ b/catalystcenter/resource_sensor_test_run.go @@ -5,6 +5,8 @@ import ( "reflect" + "log" + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -56,19 +58,31 @@ func resourceSensorTestRun() *schema.Resource { func resourceSensorTestRunCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request := expandRequestSensorTestRunRunNowSensorTest(ctx, "parameters.0", d) - response1, err := client.Sensors.RunNowSensorTest(request) - if err = d.Set("item", response1.String()); err != nil { + + request1 := expandRequestSensorTestRunRunNowSensorTestV1(ctx, "parameters.0", d) + + // has_unknown_response: True + + response1, err := client.Sensors.RunNowSensorTestV1(request1) + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { diags = append(diags, diagError( - "Failure when setting RunNowSensorTest response", + "Failure when setting RunNowSensorTestV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - //Analizar verificacion. - } func resourceSensorTestRunRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -83,8 +97,8 @@ func resourceSensorTestRunDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestSensorTestRunRunNowSensorTest(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsRunNowSensorTest { - request := catalystcentersdkgo.RequestSensorsRunNowSensorTest{} +func expandRequestSensorTestRunRunNowSensorTestV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsRunNowSensorTestV1 { + request := catalystcentersdkgo.RequestSensorsRunNowSensorTestV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_name")))) { request.TemplateName = interfaceToString(v) } diff --git a/catalystcenter/resource_sensor_test_template_duplicate.go b/catalystcenter/resource_sensor_test_template_duplicate.go index 413afdf..e000a85 100644 --- a/catalystcenter/resource_sensor_test_template_duplicate.go +++ b/catalystcenter/resource_sensor_test_template_duplicate.go @@ -1370,31 +1370,27 @@ func resourceSensorTestTemplateDuplicateCreate(ctx context.Context, d *schema.Re client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSensorTestTemplateDuplicateDuplicateSensorTestTemplate(ctx, "parameters.0", d) + request1 := expandRequestSensorTestTemplateDuplicateDuplicateSensorTestTemplateV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sensors.DuplicateSensorTestTemplate(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sensors.DuplicateSensorTestTemplateV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DuplicateSensorTestTemplate", err)) + "Failure when executing DuplicateSensorTestTemplateV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenSensorsDuplicateSensorTestTemplateItem(response1.Response) + vItem1 := flattenSensorsDuplicateSensorTestTemplateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DuplicateSensorTestTemplate response", + "Failure when setting DuplicateSensorTestTemplateV1 response", err)) return diags } @@ -1416,8 +1412,8 @@ func resourceSensorTestTemplateDuplicateDelete(ctx context.Context, d *schema.Re return diags } -func expandRequestSensorTestTemplateDuplicateDuplicateSensorTestTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsDuplicateSensorTestTemplate { - request := catalystcentersdkgo.RequestSensorsDuplicateSensorTestTemplate{} +func expandRequestSensorTestTemplateDuplicateDuplicateSensorTestTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsDuplicateSensorTestTemplateV1 { + request := catalystcentersdkgo.RequestSensorsDuplicateSensorTestTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_name")))) { request.TemplateName = interfaceToString(v) } @@ -1427,7 +1423,7 @@ func expandRequestSensorTestTemplateDuplicateDuplicateSensorTestTemplate(ctx con return &request } -func flattenSensorsDuplicateSensorTestTemplateItem(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponse) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1Item(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1Response) []map[string]interface{} { if item == nil { return nil } @@ -1444,27 +1440,27 @@ func flattenSensorsDuplicateSensorTestTemplateItem(item *catalystcentersdkgo.Res respItem["status"] = item.Status respItem["connection"] = item.Connection respItem["action_in_progress"] = item.ActionInProgress - respItem["frequency"] = flattenSensorsDuplicateSensorTestTemplateItemFrequency(item.Frequency) + respItem["frequency"] = flattenSensorsDuplicateSensorTestTemplateV1ItemFrequency(item.Frequency) respItem["rssi_threshold"] = item.RssiThreshold respItem["num_neighbor_apthreshold"] = item.NumNeighborApThreshold respItem["schedule_in_days"] = item.ScheduleInDays respItem["wlans"] = item.WLANs - respItem["ssids"] = flattenSensorsDuplicateSensorTestTemplateItemSSIDs(item.SSIDs) - respItem["profiles"] = flattenSensorsDuplicateSensorTestTemplateItemProfiles(item.Profiles) + respItem["ssids"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDs(item.SSIDs) + respItem["profiles"] = flattenSensorsDuplicateSensorTestTemplateV1ItemProfiles(item.Profiles) respItem["test_schedule_mode"] = item.TestScheduleMode respItem["show_wlc_upgrade_banner"] = boolPtrToString(item.ShowWlcUpgradeBanner) respItem["radio_as_sensor_removed"] = boolPtrToString(item.RadioAsSensorRemoved) respItem["encryption_mode"] = item.EncryptionMode respItem["run_now"] = item.RunNow - respItem["location_info_list"] = flattenSensorsDuplicateSensorTestTemplateItemLocationInfoList(item.LocationInfoList) - respItem["sensors"] = flattenSensorsDuplicateSensorTestTemplateItemSensors(item.Sensors) - respItem["ap_coverage"] = flattenSensorsDuplicateSensorTestTemplateItemApCoverage(item.ApCoverage) + respItem["location_info_list"] = flattenSensorsDuplicateSensorTestTemplateV1ItemLocationInfoList(item.LocationInfoList) + respItem["sensors"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSensors(item.Sensors) + respItem["ap_coverage"] = flattenSensorsDuplicateSensorTestTemplateV1ItemApCoverage(item.ApCoverage) return []map[string]interface{}{ respItem, } } -func flattenSensorsDuplicateSensorTestTemplateItemFrequency(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseFrequency) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemFrequency(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseFrequency) []map[string]interface{} { if item == nil { return nil } @@ -1478,7 +1474,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemFrequency(item *catalystcenter } -func flattenSensorsDuplicateSensorTestTemplateItemSSIDs(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSSIDs) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDs(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSSIDs) []map[string]interface{} { if items == nil { return nil } @@ -1494,7 +1490,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemSSIDs(items *[]catalystcenters respItem["layer3web_authuser_name"] = item.Layer3WebAuthuserName respItem["layer3web_authpassword"] = item.Layer3WebAuthpassword respItem["layer3web_auth_email_address"] = item.Layer3WebAuthEmailAddress - respItem["third_party"] = flattenSensorsDuplicateSensorTestTemplateItemSSIDsThirdParty(item.ThirdParty) + respItem["third_party"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsThirdParty(item.ThirdParty) respItem["id"] = item.ID respItem["wlan_id"] = item.WLANID respItem["wlc"] = item.Wlc @@ -1523,15 +1519,15 @@ func flattenSensorsDuplicateSensorTestTemplateItemSSIDs(items *[]catalystcenters respItem["white_list"] = boolPtrToString(item.WhiteList) respItem["ext_web_auth_portal"] = item.ExtWebAuthPortal respItem["ext_web_auth_access_url"] = item.ExtWebAuthAccessURL - respItem["ext_web_auth_html_tag"] = flattenSensorsDuplicateSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) + respItem["ext_web_auth_html_tag"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) respItem["qos_policy"] = item.QosPolicy - respItem["tests"] = flattenSensorsDuplicateSensorTestTemplateItemSSIDsTests(item.Tests) + respItem["tests"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsTests(item.Tests) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemSSIDsThirdParty(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSSIDsThirdParty) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsThirdParty(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSSIDsThirdParty) []map[string]interface{} { if item == nil { return nil } @@ -1544,7 +1540,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemSSIDsThirdParty(item *catalyst } -func flattenSensorsDuplicateSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSSIDsExtWebAuthHTMLTag) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSSIDsExtWebAuthHTMLTag) []map[string]interface{} { if items == nil { return nil } @@ -1559,7 +1555,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(items * return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemSSIDsTests(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSSIDsTests) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsTests(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSSIDsTests) []map[string]interface{} { if items == nil { return nil } @@ -1567,13 +1563,13 @@ func flattenSensorsDuplicateSensorTestTemplateItemSSIDsTests(items *[]catalystce for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["config"] = flattenSensorsDuplicateSensorTestTemplateItemSSIDsTestsConfig(item.Config) + respItem["config"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsTestsConfig(item.Config) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemSSIDsTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSSIDsTestsConfig) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSSIDsTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSSIDsTestsConfig) []map[string]interface{} { if items == nil { return nil } @@ -1615,7 +1611,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemSSIDsTestsConfig(items *[]cata return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemProfiles(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseProfiles) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemProfiles(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseProfiles) []map[string]interface{} { if items == nil { return nil } @@ -1640,19 +1636,19 @@ func flattenSensorsDuplicateSensorTestTemplateItemProfiles(items *[]catalystcent respItem["white_list"] = boolPtrToString(item.WhiteList) respItem["ext_web_auth_portal"] = item.ExtWebAuthPortal respItem["ext_web_auth_access_url"] = item.ExtWebAuthAccessURL - respItem["ext_web_auth_html_tag"] = flattenSensorsDuplicateSensorTestTemplateItemProfilesExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) + respItem["ext_web_auth_html_tag"] = flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) respItem["qos_policy"] = item.QosPolicy - respItem["tests"] = flattenSensorsDuplicateSensorTestTemplateItemProfilesTests(item.Tests) + respItem["tests"] = flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesTests(item.Tests) respItem["profile_name"] = item.ProfileName respItem["device_type"] = item.DeviceType respItem["vlan"] = item.VLAN - respItem["location_vlan_list"] = flattenSensorsDuplicateSensorTestTemplateItemProfilesLocationVLANList(item.LocationVLANList) + respItem["location_vlan_list"] = flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesLocationVLANList(item.LocationVLANList) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemProfilesExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseProfilesExtWebAuthHTMLTag) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseProfilesExtWebAuthHTMLTag) []map[string]interface{} { if items == nil { return nil } @@ -1667,7 +1663,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemProfilesExtWebAuthHTMLTag(item return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemProfilesTests(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseProfilesTests) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesTests(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseProfilesTests) []map[string]interface{} { if items == nil { return nil } @@ -1675,13 +1671,13 @@ func flattenSensorsDuplicateSensorTestTemplateItemProfilesTests(items *[]catalys for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["config"] = flattenSensorsDuplicateSensorTestTemplateItemProfilesTestsConfig(item.Config) + respItem["config"] = flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesTestsConfig(item.Config) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemProfilesTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseProfilesTestsConfig) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseProfilesTestsConfig) []map[string]interface{} { if items == nil { return nil } @@ -1723,7 +1719,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemProfilesTestsConfig(items *[]c return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemProfilesLocationVLANList(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseProfilesLocationVLANList) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemProfilesLocationVLANList(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseProfilesLocationVLANList) []map[string]interface{} { if items == nil { return nil } @@ -1737,7 +1733,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemProfilesLocationVLANList(items return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemLocationInfoList(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseLocationInfoList) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemLocationInfoList(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseLocationInfoList) []map[string]interface{} { if items == nil { return nil } @@ -1756,7 +1752,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemLocationInfoList(items *[]cata return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemSensors(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSensors) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSensors(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSensors) []map[string]interface{} { if items == nil { return nil } @@ -1782,16 +1778,16 @@ func flattenSensorsDuplicateSensorTestTemplateItemSensors(items *[]catalystcente respItem["all_sensor_addition"] = boolPtrToString(item.AllSensorAddition) respItem["config_updated"] = item.ConfigUpdated respItem["sensor_type"] = item.SensorType - respItem["test_mac_addresses"] = flattenSensorsDuplicateSensorTestTemplateItemSensorsTestMacAddresses(item.TestMacAddresses) + respItem["test_mac_addresses"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSensorsTestMacAddresses(item.TestMacAddresses) respItem["id"] = item.ID respItem["service_policy"] = item.ServicePolicy - respItem["i_perf_info"] = flattenSensorsDuplicateSensorTestTemplateItemSensorsIPerfInfo(item.IPerfInfo) + respItem["i_perf_info"] = flattenSensorsDuplicateSensorTestTemplateV1ItemSensorsIPerfInfo(item.IPerfInfo) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsDuplicateSensorTestTemplateItemSensorsTestMacAddresses(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSensorsTestMacAddresses) interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSensorsTestMacAddresses(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSensorsTestMacAddresses) interface{} { if item == nil { return nil } @@ -1801,7 +1797,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemSensorsTestMacAddresses(item * } -func flattenSensorsDuplicateSensorTestTemplateItemSensorsIPerfInfo(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseSensorsIPerfInfo) interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemSensorsIPerfInfo(item *catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseSensorsIPerfInfo) interface{} { if item == nil { return nil } @@ -1811,7 +1807,7 @@ func flattenSensorsDuplicateSensorTestTemplateItemSensorsIPerfInfo(item *catalys } -func flattenSensorsDuplicateSensorTestTemplateItemApCoverage(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateResponseApCoverage) []map[string]interface{} { +func flattenSensorsDuplicateSensorTestTemplateV1ItemApCoverage(items *[]catalystcentersdkgo.ResponseSensorsDuplicateSensorTestTemplateV1ResponseApCoverage) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_sensor_test_template_edit.go b/catalystcenter/resource_sensor_test_template_edit.go index 16c71c3..77ba17f 100644 --- a/catalystcenter/resource_sensor_test_template_edit.go +++ b/catalystcenter/resource_sensor_test_template_edit.go @@ -3081,31 +3081,27 @@ func resourceSensorTestTemplateEditCreate(ctx context.Context, d *schema.Resourc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSensorTestTemplateEditEditSensorTestTemplate(ctx, "parameters.0", d) + request1 := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Sensors.EditSensorTestTemplate(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sensors.EditSensorTestTemplateV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing EditSensorTestTemplate", err)) + "Failure when executing EditSensorTestTemplateV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenSensorsEditSensorTestTemplateItem(response1.Response) + vItem1 := flattenSensorsEditSensorTestTemplateV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting EditSensorTestTemplate response", + "Failure when setting EditSensorTestTemplateV1 response", err)) return diags } @@ -3127,8 +3123,8 @@ func resourceSensorTestTemplateEditDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestSensorTestTemplateEditEditSensorTestTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplate { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplate{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1 { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_name")))) { request.TemplateName = interfaceToString(v) } @@ -3169,7 +3165,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplate(ctx context.Conte request.ActionInProgress = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".frequency")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".frequency")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".frequency")))) { - request.Frequency = expandRequestSensorTestTemplateEditEditSensorTestTemplateFrequency(ctx, key+".frequency.0", d) + request.Frequency = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1Frequency(ctx, key+".frequency.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rssi_threshold")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rssi_threshold")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rssi_threshold")))) { request.RssiThreshold = interfaceToIntPtr(v) @@ -3184,10 +3180,10 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplate(ctx context.Conte request.WLANs = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssids")))) { - request.SSIDs = expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsArray(ctx, key+".ssids", d) + request.SSIDs = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsArray(ctx, key+".ssids", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profiles")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profiles")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profiles")))) { - request.Profiles = expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesArray(ctx, key+".profiles", d) + request.Profiles = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesArray(ctx, key+".profiles", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".test_schedule_mode")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".test_schedule_mode")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".test_schedule_mode")))) { request.TestScheduleMode = interfaceToString(v) @@ -3205,19 +3201,19 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplate(ctx context.Conte request.RunNow = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_info_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_info_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_info_list")))) { - request.LocationInfoList = expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoListArray(ctx, key+".location_info_list", d) + request.LocationInfoList = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1LocationInfoListArray(ctx, key+".location_info_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sensors")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sensors")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sensors")))) { - request.Sensors = expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsArray(ctx, key+".sensors", d) + request.Sensors = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SensorsArray(ctx, key+".sensors", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ap_coverage")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ap_coverage")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ap_coverage")))) { - request.ApCoverage = expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverageArray(ctx, key+".ap_coverage", d) + request.ApCoverage = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ApCoverageArray(ctx, key+".ap_coverage", d) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateFrequency(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateFrequency { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateFrequency{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1Frequency(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Frequency { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Frequency{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".value")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".value")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".value")))) { request.Value = interfaceToIntPtr(v) } @@ -3227,8 +3223,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateFrequency(ctx cont return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDs { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDs{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDs { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDs{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3239,7 +3235,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsArray(ctx con return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDs(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3247,8 +3243,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsArray(ctx con return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDs { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDs{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDs { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDs{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bands")))) { request.Bands = interfaceToString(v) } @@ -3277,7 +3273,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDs(ctx context. request.Layer3WebAuthEmailAddress = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".third_party")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".third_party")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".third_party")))) { - request.ThirdParty = expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsThirdParty(ctx, key+".third_party.0", d) + request.ThirdParty = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsThirdParty(ctx, key+".third_party.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToIntPtr(v) @@ -3364,27 +3360,27 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDs(ctx context. request.ExtWebAuthAccessURL = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ext_web_auth_html_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) { - request.ExtWebAuthHTMLTag = expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) + request.ExtWebAuthHTMLTag = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_policy")))) { request.QosPolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tests")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tests")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tests")))) { - request.Tests = expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsArray(ctx, key+".tests", d) + request.Tests = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTestsArray(ctx, key+".tests", d) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsThirdParty(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsThirdParty { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsThirdParty{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsThirdParty(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsThirdParty { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsThirdParty{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".selected")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".selected")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".selected")))) { request.Selected = interfaceToBoolPtr(v) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsExtWebAuthHTMLTag { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsExtWebAuthHTMLTag{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTag { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTag{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3395,7 +3391,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTM return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3403,8 +3399,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTM return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsExtWebAuthHTMLTag { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsExtWebAuthHTMLTag{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTag { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsExtWebAuthHTMLTag{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".label")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".label")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".label")))) { request.Label = interfaceToString(v) } @@ -3417,8 +3413,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsExtWebAuthHTM return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTests { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTests{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTests { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTests{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3429,7 +3425,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsArray(ct return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3437,19 +3433,19 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsArray(ct return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTests { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTests{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTests { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTests{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config")))) { - request.Config = expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfigArray(ctx, key+".config", d) + request.Config = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTestsConfigArray(ctx, key+".config", d) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTestsConfig { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTestsConfig{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTestsConfig { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTestsConfig{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3460,7 +3456,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfigAr return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3468,8 +3464,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfigAr return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTestsConfig { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSSIDsTestsConfig{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SSIDsTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTestsConfig { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SSIDsTestsConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains")))) { request.Domains = interfaceToSliceString(v) } @@ -3563,8 +3559,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSSIDsTestsConfig(c return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfiles { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfiles{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Profiles { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Profiles{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3575,7 +3571,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesArray(ctx return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateProfiles(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1Profiles(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3583,8 +3579,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesArray(ctx return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfiles(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfiles { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfiles{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1Profiles(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Profiles { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Profiles{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".auth_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".auth_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".auth_type")))) { request.AuthType = interfaceToString(v) } @@ -3640,13 +3636,13 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfiles(ctx conte request.ExtWebAuthAccessURL = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ext_web_auth_html_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ext_web_auth_html_tag")))) { - request.ExtWebAuthHTMLTag = expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) + request.ExtWebAuthHTMLTag = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTagArray(ctx, key+".ext_web_auth_html_tag", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos_policy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos_policy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos_policy")))) { request.QosPolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tests")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tests")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tests")))) { - request.Tests = expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsArray(ctx, key+".tests", d) + request.Tests = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTestsArray(ctx, key+".tests", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) @@ -3658,13 +3654,13 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfiles(ctx conte request.VLAN = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_vlan_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_vlan_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_vlan_list")))) { - request.LocationVLANList = expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVLANListArray(ctx, key+".location_vlan_list", d) + request.LocationVLANList = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesLocationVLANListArray(ctx, key+".location_vlan_list", d) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesExtWebAuthHTMLTag { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesExtWebAuthHTMLTag{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTagArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTag { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTag{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3675,7 +3671,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuth return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTag(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3683,8 +3679,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuth return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesExtWebAuthHTMLTag { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesExtWebAuthHTMLTag{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTag { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesExtWebAuthHTMLTag{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".label")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".label")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".label")))) { request.Label = interfaceToString(v) } @@ -3697,8 +3693,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesExtWebAuth return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTests { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTests{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTestsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTests { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTests{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3709,7 +3705,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsArray return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTests(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3717,19 +3713,19 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsArray return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTests { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTests{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTests(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTests { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTests{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".config")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config")))) { - request.Config = expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfigArray(ctx, key+".config", d) + request.Config = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTestsConfigArray(ctx, key+".config", d) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTestsConfig { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTestsConfig{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTestsConfigArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTestsConfig { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTestsConfig{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3740,7 +3736,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfi return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTestsConfig(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3748,8 +3744,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfi return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTestsConfig { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesTestsConfig{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesTestsConfig(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTestsConfig { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesTestsConfig{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domains")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domains")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domains")))) { request.Domains = interfaceToSliceString(v) } @@ -3843,8 +3839,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesTestsConfi return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVLANListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesLocationVLANList { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesLocationVLANList{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesLocationVLANListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesLocationVLANList { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesLocationVLANList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3855,7 +3851,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVL return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVLANList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesLocationVLANList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3863,8 +3859,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVL return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVLANList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesLocationVLANList { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateProfilesLocationVLANList{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ProfilesLocationVLANList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesLocationVLANList { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ProfilesLocationVLANList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_id")))) { request.LocationID = interfaceToString(v) } @@ -3874,8 +3870,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateProfilesLocationVL return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateLocationInfoList { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateLocationInfoList{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1LocationInfoListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1LocationInfoList { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1LocationInfoList{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3886,7 +3882,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoListAr return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1LocationInfoList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3894,8 +3890,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoListAr return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateLocationInfoList { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateLocationInfoList{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1LocationInfoList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1LocationInfoList { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1LocationInfoList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".location_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".location_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".location_id")))) { request.LocationID = interfaceToString(v) } @@ -3920,8 +3916,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateLocationInfoList(c return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensors { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensors{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SensorsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Sensors { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Sensors{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -3932,7 +3928,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsArray(ctx c return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateSensors(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1Sensors(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -3940,8 +3936,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsArray(ctx c return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensors { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensors{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1Sensors(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Sensors { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1Sensors{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -4000,7 +3996,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensors(ctx contex request.SensorType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".test_mac_addresses")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".test_mac_addresses")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".test_mac_addresses")))) { - request.TestMacAddresses = expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsTestMacAddresses(ctx, key+".test_mac_addresses.0", d) + request.TestMacAddresses = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SensorsTestMacAddresses(ctx, key+".test_mac_addresses.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) @@ -4009,25 +4005,25 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensors(ctx contex request.ServicePolicy = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".i_perf_info")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".i_perf_info")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".i_perf_info")))) { - request.IPerfInfo = expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsIPerfInfo(ctx, key+".i_perf_info.0", d) + request.IPerfInfo = expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SensorsIPerfInfo(ctx, key+".i_perf_info.0", d) } return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsTestMacAddresses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensorsTestMacAddresses { - var request catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensorsTestMacAddresses +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SensorsTestMacAddresses(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SensorsTestMacAddresses { + var request catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SensorsTestMacAddresses request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateSensorsIPerfInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensorsIPerfInfo { - var request catalystcentersdkgo.RequestSensorsEditSensorTestTemplateSensorsIPerfInfo +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1SensorsIPerfInfo(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SensorsIPerfInfo { + var request catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1SensorsIPerfInfo request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverageArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateApCoverage { - request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateApCoverage{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ApCoverageArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ApCoverage { + request := []catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ApCoverage{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -4038,7 +4034,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverageArray(ct return nil } for item_no := range objs { - i := expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverage(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ApCoverage(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -4046,8 +4042,8 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverageArray(ct return &request } -func expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateApCoverage { - request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateApCoverage{} +func expandRequestSensorTestTemplateEditEditSensorTestTemplateV1ApCoverage(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ApCoverage { + request := catalystcentersdkgo.RequestSensorsEditSensorTestTemplateV1ApCoverage{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".bands")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".bands")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".bands")))) { request.Bands = interfaceToString(v) } @@ -4060,7 +4056,7 @@ func expandRequestSensorTestTemplateEditEditSensorTestTemplateApCoverage(ctx con return &request } -func flattenSensorsEditSensorTestTemplateItem(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponse) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1Item(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1Response) []map[string]interface{} { if item == nil { return nil } @@ -4077,27 +4073,27 @@ func flattenSensorsEditSensorTestTemplateItem(item *catalystcentersdkgo.Response respItem["status"] = item.Status respItem["connection"] = item.Connection respItem["action_in_progress"] = item.ActionInProgress - respItem["frequency"] = flattenSensorsEditSensorTestTemplateItemFrequency(item.Frequency) + respItem["frequency"] = flattenSensorsEditSensorTestTemplateV1ItemFrequency(item.Frequency) respItem["rssi_threshold"] = item.RssiThreshold respItem["num_neighbor_apthreshold"] = item.NumNeighborApThreshold respItem["schedule_in_days"] = item.ScheduleInDays respItem["wlans"] = item.WLANs - respItem["ssids"] = flattenSensorsEditSensorTestTemplateItemSSIDs(item.SSIDs) - respItem["profiles"] = flattenSensorsEditSensorTestTemplateItemProfiles(item.Profiles) + respItem["ssids"] = flattenSensorsEditSensorTestTemplateV1ItemSSIDs(item.SSIDs) + respItem["profiles"] = flattenSensorsEditSensorTestTemplateV1ItemProfiles(item.Profiles) respItem["test_schedule_mode"] = item.TestScheduleMode respItem["show_wlc_upgrade_banner"] = boolPtrToString(item.ShowWlcUpgradeBanner) respItem["radio_as_sensor_removed"] = boolPtrToString(item.RadioAsSensorRemoved) respItem["encryption_mode"] = item.EncryptionMode respItem["run_now"] = item.RunNow - respItem["location_info_list"] = flattenSensorsEditSensorTestTemplateItemLocationInfoList(item.LocationInfoList) - respItem["sensors"] = flattenSensorsEditSensorTestTemplateItemSensors(item.Sensors) - respItem["ap_coverage"] = flattenSensorsEditSensorTestTemplateItemApCoverage(item.ApCoverage) + respItem["location_info_list"] = flattenSensorsEditSensorTestTemplateV1ItemLocationInfoList(item.LocationInfoList) + respItem["sensors"] = flattenSensorsEditSensorTestTemplateV1ItemSensors(item.Sensors) + respItem["ap_coverage"] = flattenSensorsEditSensorTestTemplateV1ItemApCoverage(item.ApCoverage) return []map[string]interface{}{ respItem, } } -func flattenSensorsEditSensorTestTemplateItemFrequency(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseFrequency) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemFrequency(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseFrequency) []map[string]interface{} { if item == nil { return nil } @@ -4111,7 +4107,7 @@ func flattenSensorsEditSensorTestTemplateItemFrequency(item *catalystcentersdkgo } -func flattenSensorsEditSensorTestTemplateItemSSIDs(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSSIDs) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSSIDs(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSSIDs) []map[string]interface{} { if items == nil { return nil } @@ -4127,7 +4123,7 @@ func flattenSensorsEditSensorTestTemplateItemSSIDs(items *[]catalystcentersdkgo. respItem["layer3web_authuser_name"] = item.Layer3WebAuthuserName respItem["layer3web_authpassword"] = item.Layer3WebAuthpassword respItem["layer3web_auth_email_address"] = item.Layer3WebAuthEmailAddress - respItem["third_party"] = flattenSensorsEditSensorTestTemplateItemSSIDsThirdParty(item.ThirdParty) + respItem["third_party"] = flattenSensorsEditSensorTestTemplateV1ItemSSIDsThirdParty(item.ThirdParty) respItem["id"] = item.ID respItem["wlan_id"] = item.WLANID respItem["wlc"] = item.Wlc @@ -4156,15 +4152,15 @@ func flattenSensorsEditSensorTestTemplateItemSSIDs(items *[]catalystcentersdkgo. respItem["white_list"] = boolPtrToString(item.WhiteList) respItem["ext_web_auth_portal"] = item.ExtWebAuthPortal respItem["ext_web_auth_access_url"] = item.ExtWebAuthAccessURL - respItem["ext_web_auth_html_tag"] = flattenSensorsEditSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) + respItem["ext_web_auth_html_tag"] = flattenSensorsEditSensorTestTemplateV1ItemSSIDsExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) respItem["qos_policy"] = item.QosPolicy - respItem["tests"] = flattenSensorsEditSensorTestTemplateItemSSIDsTests(item.Tests) + respItem["tests"] = flattenSensorsEditSensorTestTemplateV1ItemSSIDsTests(item.Tests) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsEditSensorTestTemplateItemSSIDsThirdParty(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSSIDsThirdParty) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSSIDsThirdParty(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSSIDsThirdParty) []map[string]interface{} { if item == nil { return nil } @@ -4177,7 +4173,7 @@ func flattenSensorsEditSensorTestTemplateItemSSIDsThirdParty(item *catalystcente } -func flattenSensorsEditSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSSIDsExtWebAuthHTMLTag) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSSIDsExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSSIDsExtWebAuthHTMLTag) []map[string]interface{} { if items == nil { return nil } @@ -4192,7 +4188,7 @@ func flattenSensorsEditSensorTestTemplateItemSSIDsExtWebAuthHTMLTag(items *[]cat return respItems } -func flattenSensorsEditSensorTestTemplateItemSSIDsTests(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSSIDsTests) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSSIDsTests(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSSIDsTests) []map[string]interface{} { if items == nil { return nil } @@ -4200,13 +4196,13 @@ func flattenSensorsEditSensorTestTemplateItemSSIDsTests(items *[]catalystcenters for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["config"] = flattenSensorsEditSensorTestTemplateItemSSIDsTestsConfig(item.Config) + respItem["config"] = flattenSensorsEditSensorTestTemplateV1ItemSSIDsTestsConfig(item.Config) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsEditSensorTestTemplateItemSSIDsTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSSIDsTestsConfig) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSSIDsTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSSIDsTestsConfig) []map[string]interface{} { if items == nil { return nil } @@ -4248,7 +4244,7 @@ func flattenSensorsEditSensorTestTemplateItemSSIDsTestsConfig(items *[]catalystc return respItems } -func flattenSensorsEditSensorTestTemplateItemProfiles(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseProfiles) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemProfiles(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseProfiles) []map[string]interface{} { if items == nil { return nil } @@ -4273,19 +4269,19 @@ func flattenSensorsEditSensorTestTemplateItemProfiles(items *[]catalystcentersdk respItem["white_list"] = boolPtrToString(item.WhiteList) respItem["ext_web_auth_portal"] = item.ExtWebAuthPortal respItem["ext_web_auth_access_url"] = item.ExtWebAuthAccessURL - respItem["ext_web_auth_html_tag"] = flattenSensorsEditSensorTestTemplateItemProfilesExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) + respItem["ext_web_auth_html_tag"] = flattenSensorsEditSensorTestTemplateV1ItemProfilesExtWebAuthHTMLTag(item.ExtWebAuthHTMLTag) respItem["qos_policy"] = item.QosPolicy - respItem["tests"] = flattenSensorsEditSensorTestTemplateItemProfilesTests(item.Tests) + respItem["tests"] = flattenSensorsEditSensorTestTemplateV1ItemProfilesTests(item.Tests) respItem["profile_name"] = item.ProfileName respItem["device_type"] = item.DeviceType respItem["vlan"] = item.VLAN - respItem["location_vlan_list"] = flattenSensorsEditSensorTestTemplateItemProfilesLocationVLANList(item.LocationVLANList) + respItem["location_vlan_list"] = flattenSensorsEditSensorTestTemplateV1ItemProfilesLocationVLANList(item.LocationVLANList) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsEditSensorTestTemplateItemProfilesExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseProfilesExtWebAuthHTMLTag) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemProfilesExtWebAuthHTMLTag(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseProfilesExtWebAuthHTMLTag) []map[string]interface{} { if items == nil { return nil } @@ -4300,7 +4296,7 @@ func flattenSensorsEditSensorTestTemplateItemProfilesExtWebAuthHTMLTag(items *[] return respItems } -func flattenSensorsEditSensorTestTemplateItemProfilesTests(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseProfilesTests) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemProfilesTests(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseProfilesTests) []map[string]interface{} { if items == nil { return nil } @@ -4308,13 +4304,13 @@ func flattenSensorsEditSensorTestTemplateItemProfilesTests(items *[]catalystcent for _, item := range *items { respItem := make(map[string]interface{}) respItem["name"] = item.Name - respItem["config"] = flattenSensorsEditSensorTestTemplateItemProfilesTestsConfig(item.Config) + respItem["config"] = flattenSensorsEditSensorTestTemplateV1ItemProfilesTestsConfig(item.Config) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsEditSensorTestTemplateItemProfilesTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseProfilesTestsConfig) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemProfilesTestsConfig(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseProfilesTestsConfig) []map[string]interface{} { if items == nil { return nil } @@ -4356,7 +4352,7 @@ func flattenSensorsEditSensorTestTemplateItemProfilesTestsConfig(items *[]cataly return respItems } -func flattenSensorsEditSensorTestTemplateItemProfilesLocationVLANList(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseProfilesLocationVLANList) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemProfilesLocationVLANList(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseProfilesLocationVLANList) []map[string]interface{} { if items == nil { return nil } @@ -4370,7 +4366,7 @@ func flattenSensorsEditSensorTestTemplateItemProfilesLocationVLANList(items *[]c return respItems } -func flattenSensorsEditSensorTestTemplateItemLocationInfoList(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseLocationInfoList) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemLocationInfoList(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseLocationInfoList) []map[string]interface{} { if items == nil { return nil } @@ -4389,7 +4385,7 @@ func flattenSensorsEditSensorTestTemplateItemLocationInfoList(items *[]catalystc return respItems } -func flattenSensorsEditSensorTestTemplateItemSensors(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSensors) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSensors(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSensors) []map[string]interface{} { if items == nil { return nil } @@ -4415,16 +4411,16 @@ func flattenSensorsEditSensorTestTemplateItemSensors(items *[]catalystcentersdkg respItem["all_sensor_addition"] = boolPtrToString(item.AllSensorAddition) respItem["config_updated"] = item.ConfigUpdated respItem["sensor_type"] = item.SensorType - respItem["test_mac_addresses"] = flattenSensorsEditSensorTestTemplateItemSensorsTestMacAddresses(item.TestMacAddresses) + respItem["test_mac_addresses"] = flattenSensorsEditSensorTestTemplateV1ItemSensorsTestMacAddresses(item.TestMacAddresses) respItem["id"] = item.ID respItem["service_policy"] = item.ServicePolicy - respItem["i_perf_info"] = flattenSensorsEditSensorTestTemplateItemSensorsIPerfInfo(item.IPerfInfo) + respItem["i_perf_info"] = flattenSensorsEditSensorTestTemplateV1ItemSensorsIPerfInfo(item.IPerfInfo) respItems = append(respItems, respItem) } return respItems } -func flattenSensorsEditSensorTestTemplateItemSensorsTestMacAddresses(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSensorsTestMacAddresses) interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSensorsTestMacAddresses(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSensorsTestMacAddresses) interface{} { if item == nil { return nil } @@ -4434,7 +4430,7 @@ func flattenSensorsEditSensorTestTemplateItemSensorsTestMacAddresses(item *catal } -func flattenSensorsEditSensorTestTemplateItemSensorsIPerfInfo(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseSensorsIPerfInfo) interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemSensorsIPerfInfo(item *catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseSensorsIPerfInfo) interface{} { if item == nil { return nil } @@ -4444,7 +4440,7 @@ func flattenSensorsEditSensorTestTemplateItemSensorsIPerfInfo(item *catalystcent } -func flattenSensorsEditSensorTestTemplateItemApCoverage(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateResponseApCoverage) []map[string]interface{} { +func flattenSensorsEditSensorTestTemplateV1ItemApCoverage(items *[]catalystcentersdkgo.ResponseSensorsEditSensorTestTemplateV1ResponseApCoverage) []map[string]interface{} { if items == nil { return nil } diff --git a/catalystcenter/resource_service_provider.go b/catalystcenter/resource_service_provider.go index 2d105de..cf31ddc 100644 --- a/catalystcenter/resource_service_provider.go +++ b/catalystcenter/resource_service_provider.go @@ -186,7 +186,7 @@ func resourceServiceProviderCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics //resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestServiceProviderCreateSpProfile(ctx, "parameters.0", d) + request1 := expandRequestServiceProviderCreateSpProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vvSpProfileName := "" @@ -288,10 +288,10 @@ func resourceServiceProviderRead(ctx context.Context, d *schema.ResourceData, m log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) //TODO FOR DNAC - items := []catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponse{ + items := []catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1Response{ *response1, } - vItem1 := flattenNetworkSettingsGetServiceProviderDetailsItems(&items) + vItem1 := flattenNetworkSettingsGetServiceProviderDetailsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetServiceProviderDetails search response", @@ -322,7 +322,7 @@ func resourceServiceProviderUpdate(ctx context.Context, d *schema.ResourceData, } if d.HasChange("parameters") { log.Printf("[DEBUG] Name used for update operation %s", vSpProfileName) - request1 := expandRequestServiceProviderUpdateSpProfile(ctx, "parameters.0", d) + request1 := expandRequestServiceProviderUpdateSpProfileV1(ctx, "parameters.0", d) newQos := *request1.Settings.Qos if d.HasChange("parameters.0.settings.0.qos.0.profile_name") { old, _ := d.GetChange("parameters.0.settings.0.qos.0.profile_name") @@ -463,19 +463,19 @@ func resourceServiceProviderDelete(ctx context.Context, d *schema.ResourceData, } return diags } -func expandRequestServiceProviderCreateSpProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateSpProfile { - request := catalystcentersdkgo.RequestNetworkSettingsCreateSpProfile{} - request.Settings = expandRequestServiceProviderCreateSpProfileSettings(ctx, key, d) +func expandRequestServiceProviderCreateSpProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1 { + request := catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1{} + request.Settings = expandRequestServiceProviderCreateSpProfileV1Settings(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestServiceProviderCreateSpProfileSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileSettings { - request := catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileSettings{} +func expandRequestServiceProviderCreateSpProfileV1Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1Settings { + request := catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos")))) { - request.Qos = expandRequestServiceProviderCreateSpProfileSettingsQosArray(ctx, key+".qos", d) + request.Qos = expandRequestServiceProviderCreateSpProfileV1SettingsQosArray(ctx, key+".qos", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -483,8 +483,8 @@ func expandRequestServiceProviderCreateSpProfileSettings(ctx context.Context, ke return &request } -func expandRequestServiceProviderCreateSpProfileSettingsQosArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileSettingsQos { - request := []catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileSettingsQos{} +func expandRequestServiceProviderCreateSpProfileV1SettingsQosArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1SettingsQos { + request := []catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1SettingsQos{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -495,7 +495,7 @@ func expandRequestServiceProviderCreateSpProfileSettingsQosArray(ctx context.Con return nil } for item_no := range objs { - i := expandRequestServiceProviderCreateSpProfileSettingsQos(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestServiceProviderCreateSpProfileV1SettingsQos(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -506,8 +506,8 @@ func expandRequestServiceProviderCreateSpProfileSettingsQosArray(ctx context.Con return &request } -func expandRequestServiceProviderCreateSpProfileSettingsQos(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileSettingsQos { - request := catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileSettingsQos{} +func expandRequestServiceProviderCreateSpProfileV1SettingsQos(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1SettingsQos { + request := catalystcentersdkgo.RequestNetworkSettingsCreateSpProfileV1SettingsQos{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) } @@ -523,19 +523,19 @@ func expandRequestServiceProviderCreateSpProfileSettingsQos(ctx context.Context, return &request } -func expandRequestServiceProviderUpdateSpProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfile { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfile{} - request.Settings = expandRequestServiceProviderUpdateSpProfileSettings(ctx, key, d) +func expandRequestServiceProviderUpdateSpProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1 { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1{} + request.Settings = expandRequestServiceProviderUpdateSpProfileV1Settings(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestServiceProviderUpdateSpProfileSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileSettings { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileSettings{} +func expandRequestServiceProviderUpdateSpProfileV1Settings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1Settings { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1Settings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".qos")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".qos")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".qos")))) { - request.Qos = expandRequestServiceProviderUpdateSpProfileSettingsQosArray(ctx, key+".qos", d) + request.Qos = expandRequestServiceProviderUpdateSpProfileV1SettingsQosArray(ctx, key+".qos", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -543,8 +543,8 @@ func expandRequestServiceProviderUpdateSpProfileSettings(ctx context.Context, ke return &request } -func expandRequestServiceProviderUpdateSpProfileSettingsQosArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileSettingsQos { - request := []catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileSettingsQos{} +func expandRequestServiceProviderUpdateSpProfileV1SettingsQosArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1SettingsQos { + request := []catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1SettingsQos{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -555,7 +555,7 @@ func expandRequestServiceProviderUpdateSpProfileSettingsQosArray(ctx context.Con return nil } for item_no := range objs { - i := expandRequestServiceProviderUpdateSpProfileSettingsQos(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestServiceProviderUpdateSpProfileV1SettingsQos(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -566,8 +566,8 @@ func expandRequestServiceProviderUpdateSpProfileSettingsQosArray(ctx context.Con return &request } -func expandRequestServiceProviderUpdateSpProfileSettingsQos(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileSettingsQos { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileSettingsQos{} +func expandRequestServiceProviderUpdateSpProfileV1SettingsQos(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1SettingsQos { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateSpProfileV1SettingsQos{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) } @@ -586,13 +586,13 @@ func expandRequestServiceProviderUpdateSpProfileSettingsQos(ctx context.Context, return &request } -func searchNetworkSettingsGetServiceProviderDetails(m interface{}, vSProfileName string) (*catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponse, error) { +func searchNetworkSettingsGetServiceProviderDetails(m interface{}, vSProfileName string) (*catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1Response, error) { log.Printf("[DEBUG] Search") log.Printf("[DEBUG] Search sp profile name =>%s", vSProfileName) client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponse - var ite *catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetails + var foundItem *catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1Response + var ite *catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1 ite, resty, err := client.NetworkSettings.GetServiceProviderDetails() log.Printf("[DEBUG] Load data") if resty != nil { @@ -618,7 +618,7 @@ func searchNetworkSettingsGetServiceProviderDetails(m interface{}, vSProfileName for _, item2 := range *item.Value { if item2.SpProfileName == vSProfileName { log.Printf("[DEBUG] Search finded item") - var getItem *catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponse + var getItem *catalystcentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_site_assign_credential.go b/catalystcenter/resource_site_assign_credential.go index 7810106..9d99cc0 100644 --- a/catalystcenter/resource_site_assign_credential.go +++ b/catalystcenter/resource_site_assign_credential.go @@ -17,7 +17,7 @@ import ( // resourceAction func resourceSiteAssignCredential() *schema.Resource { return &schema.Resource{ - Description: `It performs create operation on Sites. + Description: `It performs create operation on NetworkSettings. - Assign Device Credential to a site. `, @@ -129,24 +129,22 @@ func resourceSiteAssignCredentialCreate(ctx context.Context, d *schema.ResourceD vPersistbapioutput := resourceItem["persistbapioutput"] vvSiteID := vSiteID.(string) - request1 := expandRequestSiteAssignCredentialAssignDeviceCredentialToSite(ctx, "parameters.0", d) + request1 := expandRequestSiteAssignCredentialAssignDeviceCredentialToSiteV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.AssignDeviceCredentialToSiteHeaderParams{} + headerParams1 := catalystcentersdkgo.AssignDeviceCredentialToSiteV1HeaderParams{} headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.NetworkSettings.AssignDeviceCredentialToSite(vvSiteID, request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.NetworkSettings.AssignDeviceCredentialToSiteV1(vvSiteID, request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AssignDeviceCredentialToSite", err)) + "Failure when executing AssignDeviceCredentialToSiteV1", err)) return diags } @@ -182,23 +180,25 @@ func resourceSiteAssignCredentialCreate(ctx context.Context, d *schema.ResourceD if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing AssignDeviceCredentialToSite", err, - "Failure at AssignDeviceCredentialToSite execution", bapiError)) + "Failure when executing AssignDeviceCredentialToSiteV1", err, + "Failure at AssignDeviceCredentialToSiteV1 execution", bapiError)) return diags } } - vItem1 := flattenNetworkSettingsDeviceCredentialToSiteItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenNetworkSettingsAssignDeviceCredentialToSiteV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AssignDeviceCredentialToSite response", + "Failure when setting AssignDeviceCredentialToSiteV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSiteAssignCredentialRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -213,8 +213,8 @@ func resourceSiteAssignCredentialDelete(ctx context.Context, d *schema.ResourceD return diags } -func expandRequestSiteAssignCredentialAssignDeviceCredentialToSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsAssignDeviceCredentialToSite { - request := catalystcentersdkgo.RequestNetworkSettingsAssignDeviceCredentialToSite{} +func expandRequestSiteAssignCredentialAssignDeviceCredentialToSiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsAssignDeviceCredentialToSiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsAssignDeviceCredentialToSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cli_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cli_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cli_id")))) { request.CliID = interfaceToString(v) } @@ -236,7 +236,7 @@ func expandRequestSiteAssignCredentialAssignDeviceCredentialToSite(ctx context.C return &request } -func flattenNetworkSettingsDeviceCredentialToSiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsAssignDeviceCredentialToSite) []map[string]interface{} { +func flattenNetworkSettingsAssignDeviceCredentialToSiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsAssignDeviceCredentialToSiteV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_site_health_summaries_summary_analytics_create.go b/catalystcenter/resource_site_health_summaries_summary_analytics_create.go index ee178fe..daca557 100644 --- a/catalystcenter/resource_site_health_summaries_summary_analytics_create.go +++ b/catalystcenter/resource_site_health_summaries_summary_analytics_create.go @@ -19,17 +19,17 @@ func resourceSiteHealthSummariesSummaryAnalyticsCreate() *schema.Resource { Description: `It performs create operation on Sites. - Query an aggregated summary of all site health This data source action provides the latest health data from a given -'endTime' If data is not ready for the provided endTime, the request will fail, and the error message will indicate the +*endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, -since we are not a real time system. When 'endTime' is not provided, the API returns the latest data. This data source -action also provides issue data. The 'startTime' query param can be used to specify the beginning point of time range to -retrieve the active issue counts in. When this param is not provided, the default 'startTime' will be 24 hours before +since we are not a real time system. When *endTime* is not provided, the API returns the latest data. This data source +action also provides issue data. The *startTime* query param can be used to specify the beginning point of time range to +retrieve the active issue counts in. When this param is not provided, the default *startTime* will be 24 hours before endTime. Aggregated response data will NOT have unique identifier data populated. - List of unique identifier data: ['id', 'siteHierarchy', -'siteHierarchyId', 'siteType', 'latitude', 'longitude'] Please refer to the 'API Support Documentation' section to + List of unique identifier data: [*id*, *siteHierarchy*, +*siteHierarchyId*, *siteType*, *latitude*, *longitude*] Please refer to the 'API Support Documentation' section to understand which fields are supported. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.yaml @@ -308,22 +308,22 @@ specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.y ForceNew: true, }, "site_hierarchy": &schema.Schema{ - Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' + Description: `siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) `, Type: schema.TypeString, Optional: true, ForceNew: true, }, "site_hierarchy_id": &schema.Schema{ - Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' + Description: `siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) `, Type: schema.TypeString, Optional: true, @@ -331,10 +331,10 @@ Examples: }, "site_type": &schema.Schema{ Description: `siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) `, Type: schema.TypeString, Optional: true, @@ -385,37 +385,28 @@ func resourceSiteHealthSummariesSummaryAnalyticsCreateCreate(ctx context.Context client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - resourceItem := *getResourceItem(d.Get("parameters")) + request1 := expandRequestSiteHealthSummariesSummaryAnalyticsCreateQueryAnAggregatedSummaryOfSiteHealthDataV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.QueryAnAggregatedSummaryOfSiteHealthDataV1QueryParams{} - vID := resourceItem["id"] - vvID := interfaceToString(vID) + // has_unknown_response: None - request1 := expandRequestSiteHealthSummariesSummaryAnalyticsCreateQueryAnAggregatedSummaryOfSiteHealthData(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.QueryAnAggregatedSummaryOfSiteHealthDataQueryParams{} - queryParams1.ID = vvID - response1, restyResp1, err := client.Sites.QueryAnAggregatedSummaryOfSiteHealthData(request1, &queryParams1) - - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Sites.QueryAnAggregatedSummaryOfSiteHealthDataV1(request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing QueryAnAggregatedSummaryOfSiteHealthData", err)) + "Failure when executing QueryAnAggregatedSummaryOfSiteHealthDataV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenSitesQueryAnAggregatedSummaryOfSiteHealthDataItem(response1.Response) + vItem1 := flattenSitesQueryAnAggregatedSummaryOfSiteHealthDataV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting QueryAnAggregatedSummaryOfSiteHealthData response", + "Failure when setting QueryAnAggregatedSummaryOfSiteHealthDataV1 response", err)) return diags } @@ -437,8 +428,8 @@ func resourceSiteHealthSummariesSummaryAnalyticsCreateDelete(ctx context.Context return diags } -func expandRequestSiteHealthSummariesSummaryAnalyticsCreateQueryAnAggregatedSummaryOfSiteHealthData(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesQueryAnAggregatedSummaryOfSiteHealthData { - request := catalystcentersdkgo.RequestSitesQueryAnAggregatedSummaryOfSiteHealthData{} +func expandRequestSiteHealthSummariesSummaryAnalyticsCreateQueryAnAggregatedSummaryOfSiteHealthDataV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSitesQueryAnAggregatedSummaryOfSiteHealthDataV1 { + request := catalystcentersdkgo.RequestSitesQueryAnAggregatedSummaryOfSiteHealthDataV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".start_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".start_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".start_time")))) { request.StartTime = interfaceToIntPtr(v) } @@ -454,7 +445,7 @@ func expandRequestSiteHealthSummariesSummaryAnalyticsCreateQueryAnAggregatedSumm return &request } -func flattenSitesQueryAnAggregatedSummaryOfSiteHealthDataItem(item *catalystcentersdkgo.ResponseSitesQueryAnAggregatedSummaryOfSiteHealthDataResponse) []map[string]interface{} { +func flattenSitesQueryAnAggregatedSummaryOfSiteHealthDataV1Item(item *catalystcentersdkgo.ResponseSitesQueryAnAggregatedSummaryOfSiteHealthDataV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sites_aaa_settings.go b/catalystcenter/resource_sites_aaa_settings.go index f52ddc5..bfe4a67 100644 --- a/catalystcenter/resource_sites_aaa_settings.go +++ b/catalystcenter/resource_sites_aaa_settings.go @@ -3,11 +3,10 @@ package catalystcenter import ( "context" "errors" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -18,8 +17,8 @@ func resourceSitesAAASettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set AAA settings for a site; 'null' values indicate that the settings will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set AAA settings for a site; *null* values indicate that the settings will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesAAASettingsCreate, @@ -295,7 +294,7 @@ func resourceSitesAAASettingsRead(ctx context.Context, d *schema.ResourceData, m if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveAAASettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveAAASettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveAAASettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveAAASettingsForASite(vvID, &queryParams1) @@ -309,7 +308,7 @@ func resourceSitesAAASettingsRead(ctx context.Context, d *schema.ResourceData, m log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveAAASettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveAAASettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveAAASettingsForASite response", @@ -332,7 +331,7 @@ func resourceSitesAAASettingsUpdate(ctx context.Context, d *schema.ResourceData, vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesAAASettingsSetAAASettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesAAASettingsSetAAASettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetAAASettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -391,13 +390,13 @@ func resourceSitesAAASettingsDelete(ctx context.Context, d *schema.ResourceData, "Failure at SitesAAASettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesAAASettingsSetAAASettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASite{} +func expandRequestSitesAAASettingsSetAAASettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".aaa_network")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aaa_network")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aaa_network")))) { - request.AAANetwork = expandRequestSitesAAASettingsSetAAASettingsForASiteAAANetwork(ctx, key+".aaa_network.0", d) + request.AAANetwork = expandRequestSitesAAASettingsSetAAASettingsForASiteV1AAANetwork(ctx, key+".aaa_network.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".aaa_client")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".aaa_client")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".aaa_client")))) { - request.AAAClient = expandRequestSitesAAASettingsSetAAASettingsForASiteAAAClient(ctx, key+".aaa_client.0", d) + request.AAAClient = expandRequestSitesAAASettingsSetAAASettingsForASiteV1AAAClient(ctx, key+".aaa_client.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -405,8 +404,8 @@ func expandRequestSitesAAASettingsSetAAASettingsForASite(ctx context.Context, ke return &request } -func expandRequestSitesAAASettingsSetAAASettingsForASiteAAANetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteAAANetwork { - request := catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteAAANetwork{} +func expandRequestSitesAAASettingsSetAAASettingsForASiteV1AAANetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteV1AAANetwork { + request := catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteV1AAANetwork{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".server_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".server_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".server_type")))) { request.ServerType = interfaceToString(v) } @@ -431,8 +430,8 @@ func expandRequestSitesAAASettingsSetAAASettingsForASiteAAANetwork(ctx context.C return &request } -func expandRequestSitesAAASettingsSetAAASettingsForASiteAAAClient(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteAAAClient { - request := catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteAAAClient{} +func expandRequestSitesAAASettingsSetAAASettingsForASiteV1AAAClient(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteV1AAAClient { + request := catalystcentersdkgo.RequestNetworkSettingsSetAAASettingsForASiteV1AAAClient{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".server_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".server_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".server_type")))) { request.ServerType = interfaceToString(v) } diff --git a/catalystcenter/resource_sites_banner_settings.go b/catalystcenter/resource_sites_banner_settings.go index 9fdf7f7..52f968a 100644 --- a/catalystcenter/resource_sites_banner_settings.go +++ b/catalystcenter/resource_sites_banner_settings.go @@ -18,8 +18,8 @@ func resourceSitesBannerSettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set banner settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set banner settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesBannerSettingsCreate, @@ -144,7 +144,7 @@ func resourceSitesBannerSettingsRead(ctx context.Context, d *schema.ResourceData if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveBannerSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveBannerSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveBannerSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveBannerSettingsForASite(vvID, &queryParams1) @@ -158,7 +158,7 @@ func resourceSitesBannerSettingsRead(ctx context.Context, d *schema.ResourceData log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveBannerSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveBannerSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveBannerSettingsForASite response", @@ -181,7 +181,7 @@ func resourceSitesBannerSettingsUpdate(ctx context.Context, d *schema.ResourceDa vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesBannerSettingsSetBannerSettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesBannerSettingsSetBannerSettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetBannerSettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -240,17 +240,17 @@ func resourceSitesBannerSettingsDelete(ctx context.Context, d *schema.ResourceDa "Failure at SitesBannerSettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesBannerSettingsSetBannerSettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASite{} - request.Banner = expandRequestSitesBannerSettingsSetBannerSettingsForASiteBanner(ctx, key, d) +func expandRequestSitesBannerSettingsSetBannerSettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASiteV1{} + request.Banner = expandRequestSitesBannerSettingsSetBannerSettingsForASiteV1Banner(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestSitesBannerSettingsSetBannerSettingsForASiteBanner(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASiteBanner { - request := catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASiteBanner{} +func expandRequestSitesBannerSettingsSetBannerSettingsForASiteV1Banner(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASiteV1Banner { + request := catalystcentersdkgo.RequestNetworkSettingsSetBannerSettingsForASiteV1Banner{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".type")))) { request.Type = interfaceToString(v) } diff --git a/catalystcenter/resource_sites_bulk.go b/catalystcenter/resource_sites_bulk.go index 59fef2a..a84797b 100644 --- a/catalystcenter/resource_sites_bulk.go +++ b/catalystcenter/resource_sites_bulk.go @@ -65,7 +65,7 @@ payload need not to be ordered. Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestSiteDesignCreateSites`, + Description: `Array of RequestSiteDesignCreateSitesV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -190,20 +190,18 @@ func resourceSitesBulkCreate(ctx context.Context, d *schema.ResourceData, m inte client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSitesBulkCreateSites(ctx, "parameters.0", d) + request1 := expandRequestSitesBulkCreateSitesV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.SiteDesign.CreateSites(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.SiteDesign.CreateSitesV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreateSites", err)) + "Failure when executing CreateSitesV1", err)) return diags } @@ -211,7 +209,7 @@ func resourceSitesBulkCreate(ctx context.Context, d *schema.ResourceData, m inte if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing CreateSites", err)) + "Failure when executing CreateSitesV1", err)) return diags } taskId := response1.Response.TaskID @@ -245,22 +243,24 @@ func resourceSitesBulkCreate(ctx context.Context, d *schema.ResourceData, m inte } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing CreateSites", err1)) + "Failure when executing CreateSitesV1", err1)) return diags } } - vItem1 := flattenSiteDesignCreateSitesItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSiteDesignCreateSitesV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateSites response", + "Failure when setting CreateSitesV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSitesBulkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -275,16 +275,16 @@ func resourceSitesBulkDelete(ctx context.Context, d *schema.ResourceData, m inte return diags } -func expandRequestSitesBulkCreateSites(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignCreateSites { - request := catalystcentersdkgo.RequestSiteDesignCreateSites{} - if v := expandRequestSitesBulkCreateSitesItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSitesBulkCreateSitesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSiteDesignCreateSitesV1 { + request := catalystcentersdkgo.RequestSiteDesignCreateSitesV1{} + if v := expandRequestSitesBulkCreateSitesV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSitesBulkCreateSitesItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSiteDesignCreateSites { - request := []catalystcentersdkgo.RequestItemSiteDesignCreateSites{} +func expandRequestSitesBulkCreateSitesV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSiteDesignCreateSitesV1 { + request := []catalystcentersdkgo.RequestItemSiteDesignCreateSitesV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -295,7 +295,7 @@ func expandRequestSitesBulkCreateSitesItemArray(ctx context.Context, key string, return nil } for item_no := range objs { - i := expandRequestSitesBulkCreateSitesItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSitesBulkCreateSitesV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -303,8 +303,8 @@ func expandRequestSitesBulkCreateSitesItemArray(ctx context.Context, key string, return &request } -func expandRequestSitesBulkCreateSitesItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSiteDesignCreateSites { - request := catalystcentersdkgo.RequestItemSiteDesignCreateSites{} +func expandRequestSitesBulkCreateSitesV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSiteDesignCreateSitesV1 { + request := catalystcentersdkgo.RequestItemSiteDesignCreateSitesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_name_hierarchy")))) { request.ParentNameHierarchy = interfaceToString(v) } @@ -347,7 +347,7 @@ func expandRequestSitesBulkCreateSitesItem(ctx context.Context, key string, d *s return &request } -func flattenSiteDesignCreateSitesItem(item *catalystcentersdkgo.ResponseSiteDesignCreateSitesResponse) []map[string]interface{} { +func flattenSiteDesignCreateSitesV1Item(item *catalystcentersdkgo.ResponseSiteDesignCreateSitesV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sites_device_credentials.go b/catalystcenter/resource_sites_device_credentials.go index 953cf00..7021907 100644 --- a/catalystcenter/resource_sites_device_credentials.go +++ b/catalystcenter/resource_sites_device_credentials.go @@ -18,8 +18,8 @@ func resourceSitesDeviceCredentials() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Updates device credential settings for a site; 'null' values indicate that the setting will be inherited from the -parent site; empty objects ('{}') indicate that the credential is unset, and that no credential of that type will be +- Updates device credential settings for a site; *null* values indicate that the setting will be inherited from the +parent site; empty objects (*{}*) indicate that the credential is unset, and that no credential of that type will be used for the site. `, @@ -49,7 +49,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -74,7 +74,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -99,7 +99,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -124,7 +124,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -149,7 +149,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -174,7 +174,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Computed: true, @@ -210,7 +210,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Optional: true, @@ -227,7 +227,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Optional: true, @@ -244,7 +244,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Optional: true, @@ -254,7 +254,7 @@ used for the site. }, }, "id": &schema.Schema{ - Description: `id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' + Description: `id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* `, Type: schema.TypeString, Required: true, @@ -267,7 +267,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Optional: true, @@ -284,7 +284,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Optional: true, @@ -301,7 +301,7 @@ used for the site. Schema: map[string]*schema.Schema{ "credentials_id": &schema.Schema{ - Description: `The 'id' of the credentials. + Description: `The *id* of the credentials. `, Type: schema.TypeString, Optional: true, @@ -342,7 +342,7 @@ func resourceSitesDeviceCredentialsRead(ctx context.Context, d *schema.ResourceD if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetDeviceCredentialSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.GetDeviceCredentialSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.GetDeviceCredentialSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.GetDeviceCredentialSettingsForASite(vvID, &queryParams1) @@ -356,7 +356,7 @@ func resourceSitesDeviceCredentialsRead(ctx context.Context, d *schema.ResourceD log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsGetDeviceCredentialSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsGetDeviceCredentialSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDeviceCredentialSettingsForASite response", @@ -379,7 +379,7 @@ func resourceSitesDeviceCredentialsUpdate(ctx context.Context, d *schema.Resourc vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.UpdateDeviceCredentialSettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -438,25 +438,25 @@ func resourceSitesDeviceCredentialsDelete(ctx context.Context, d *schema.Resourc "Failure at SitesDeviceCredentialsDelete, unexpected response", "")) return diags } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASite{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".cli_credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".cli_credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".cli_credentials_id")))) { - request.CliCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteCliCredentialsID(ctx, key+".cli_credentials_id.0", d) + request.CliCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1CliCredentialsID(ctx, key+".cli_credentials_id.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".snmpv2c_read_credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".snmpv2c_read_credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".snmpv2c_read_credentials_id")))) { - request.SNMPv2CReadCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSNMPv2CReadCredentialsID(ctx, key+".snmpv2c_read_credentials_id.0", d) + request.SNMPv2CReadCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CReadCredentialsID(ctx, key+".snmpv2c_read_credentials_id.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".snmpv2c_write_credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".snmpv2c_write_credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".snmpv2c_write_credentials_id")))) { - request.SNMPv2CWriteCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSNMPv2CWriteCredentialsID(ctx, key+".snmpv2c_write_credentials_id.0", d) + request.SNMPv2CWriteCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CWriteCredentialsID(ctx, key+".snmpv2c_write_credentials_id.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".snmpv3_credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".snmpv3_credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".snmpv3_credentials_id")))) { - request.SNMPv3CredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSNMPv3CredentialsID(ctx, key+".snmpv3_credentials_id.0", d) + request.SNMPv3CredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1SNMPv3CredentialsID(ctx, key+".snmpv3_credentials_id.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".http_read_credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".http_read_credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".http_read_credentials_id")))) { - request.HTTPReadCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteHTTPReadCredentialsID(ctx, key+".http_read_credentials_id.0", d) + request.HTTPReadCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1HTTPReadCredentialsID(ctx, key+".http_read_credentials_id.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".http_write_credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".http_write_credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".http_write_credentials_id")))) { - request.HTTPWriteCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteHTTPWriteCredentialsID(ctx, key+".http_write_credentials_id.0", d) + request.HTTPWriteCredentialsID = expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1HTTPWriteCredentialsID(ctx, key+".http_write_credentials_id.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -464,8 +464,8 @@ func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASite(c return &request } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteCliCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteCliCredentialsID { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteCliCredentialsID{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1CliCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1CliCredentialsID { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1CliCredentialsID{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".credentials_id")))) { request.CredentialsID = interfaceToString(v) } @@ -475,8 +475,8 @@ func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteCl return &request } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSNMPv2CReadCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteSNMPv2CReadCredentialsID { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteSNMPv2CReadCredentialsID{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CReadCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CReadCredentialsID { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CReadCredentialsID{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".credentials_id")))) { request.CredentialsID = interfaceToString(v) } @@ -486,8 +486,8 @@ func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSN return &request } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSNMPv2CWriteCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteSNMPv2CWriteCredentialsID { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteSNMPv2CWriteCredentialsID{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CWriteCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CWriteCredentialsID { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1SNMPv2CWriteCredentialsID{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".credentials_id")))) { request.CredentialsID = interfaceToString(v) } @@ -497,8 +497,8 @@ func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSN return &request } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSNMPv3CredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteSNMPv3CredentialsID { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteSNMPv3CredentialsID{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1SNMPv3CredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1SNMPv3CredentialsID { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1SNMPv3CredentialsID{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".credentials_id")))) { request.CredentialsID = interfaceToString(v) } @@ -508,8 +508,8 @@ func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteSN return &request } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteHTTPReadCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteHTTPReadCredentialsID { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteHTTPReadCredentialsID{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1HTTPReadCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1HTTPReadCredentialsID { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1HTTPReadCredentialsID{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".credentials_id")))) { request.CredentialsID = interfaceToString(v) } @@ -519,8 +519,8 @@ func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteHT return &request } -func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteHTTPWriteCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteHTTPWriteCredentialsID { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteHTTPWriteCredentialsID{} +func expandRequestSitesDeviceCredentialsUpdateDeviceCredentialSettingsForASiteV1HTTPWriteCredentialsID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1HTTPWriteCredentialsID { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateDeviceCredentialSettingsForASiteV1HTTPWriteCredentialsID{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".credentials_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".credentials_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".credentials_id")))) { request.CredentialsID = interfaceToString(v) } diff --git a/catalystcenter/resource_sites_device_credentials_apply.go b/catalystcenter/resource_sites_device_credentials_apply.go index 7593e96..7b59392 100644 --- a/catalystcenter/resource_sites_device_credentials_apply.go +++ b/catalystcenter/resource_sites_device_credentials_apply.go @@ -93,20 +93,18 @@ func resourceSitesDeviceCredentialsApplyCreate(ctx context.Context, d *schema.Re client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSitesDeviceCredentialsApplySyncNetworkDevicesCredential(ctx, "parameters.0", d) + request1 := expandRequestSitesDeviceCredentialsApplySyncNetworkDevicesCredentialV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.NetworkSettings.SyncNetworkDevicesCredential(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.NetworkSettings.SyncNetworkDevicesCredentialV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing SyncNetworkDevicesCredential", err)) + "Failure when executing SyncNetworkDevicesCredentialV1", err)) return diags } @@ -114,7 +112,7 @@ func resourceSitesDeviceCredentialsApplyCreate(ctx context.Context, d *schema.Re if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing SyncNetworkDevicesCredential", err)) + "Failure when executing SyncNetworkDevicesCredentialV1", err)) return diags } taskId := response1.Response.TaskID @@ -148,22 +146,24 @@ func resourceSitesDeviceCredentialsApplyCreate(ctx context.Context, d *schema.Re } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing SyncNetworkDevicesCredential", err1)) + "Failure when executing SyncNetworkDevicesCredentialV1", err1)) return diags } } - vItem1 := flattenNetworkSettingsSyncNetworkDevicesCredentialItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenNetworkSettingsSyncNetworkDevicesCredentialV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting SyncNetworkDevicesCredential response", + "Failure when setting SyncNetworkDevicesCredentialV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSitesDeviceCredentialsApplyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -178,8 +178,8 @@ func resourceSitesDeviceCredentialsApplyDelete(ctx context.Context, d *schema.Re return diags } -func expandRequestSitesDeviceCredentialsApplySyncNetworkDevicesCredential(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSyncNetworkDevicesCredential { - request := catalystcentersdkgo.RequestNetworkSettingsSyncNetworkDevicesCredential{} +func expandRequestSitesDeviceCredentialsApplySyncNetworkDevicesCredentialV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSyncNetworkDevicesCredentialV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSyncNetworkDevicesCredentialV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_credential_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_credential_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_credential_id")))) { request.DeviceCredentialID = interfaceToString(v) } @@ -189,7 +189,7 @@ func expandRequestSitesDeviceCredentialsApplySyncNetworkDevicesCredential(ctx co return &request } -func flattenNetworkSettingsSyncNetworkDevicesCredentialItem(item *catalystcentersdkgo.ResponseNetworkSettingsSyncNetworkDevicesCredentialResponse) []map[string]interface{} { +func flattenNetworkSettingsSyncNetworkDevicesCredentialV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsSyncNetworkDevicesCredentialV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_sites_dhcp_settings.go b/catalystcenter/resource_sites_dhcp_settings.go index 5b4fdeb..60e2013 100644 --- a/catalystcenter/resource_sites_dhcp_settings.go +++ b/catalystcenter/resource_sites_dhcp_settings.go @@ -3,11 +3,10 @@ package catalystcenter import ( "context" "errors" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -18,8 +17,8 @@ func resourceSitesDhcpSettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set DHCP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set DHCP settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesDhcpSettingsCreate, @@ -139,7 +138,7 @@ func resourceSitesDhcpSettingsRead(ctx context.Context, d *schema.ResourceData, if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveDHCPSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveDHCPSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveDHCPSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveDHCPSettingsForASite(vvID, &queryParams1) @@ -153,7 +152,7 @@ func resourceSitesDhcpSettingsRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveDHCPSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveDHCPSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveDHCPSettingsForASite response", @@ -176,7 +175,7 @@ func resourceSitesDhcpSettingsUpdate(ctx context.Context, d *schema.ResourceData vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesDhcpSettingsSetDhcpSettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesDhcpSettingsSetDhcpSettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetDhcpSettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -235,17 +234,17 @@ func resourceSitesDhcpSettingsDelete(ctx context.Context, d *schema.ResourceData "Failure at SitesDhcpSettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesDhcpSettingsSetDhcpSettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASite{} - request.Dhcp = expandRequestSitesDhcpSettingsSetDhcpSettingsForASiteDhcp(ctx, key, d) +func expandRequestSitesDhcpSettingsSetDhcpSettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASiteV1{} + request.Dhcp = expandRequestSitesDhcpSettingsSetDhcpSettingsForASiteV1Dhcp(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestSitesDhcpSettingsSetDhcpSettingsForASiteDhcp(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASiteDhcp { - request := catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASiteDhcp{} +func expandRequestSitesDhcpSettingsSetDhcpSettingsForASiteV1Dhcp(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASiteV1Dhcp { + request := catalystcentersdkgo.RequestNetworkSettingsSetDhcpSettingsForASiteV1Dhcp{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToSliceString(v) } diff --git a/catalystcenter/resource_sites_dns_settings.go b/catalystcenter/resource_sites_dns_settings.go index d38136a..72f5077 100644 --- a/catalystcenter/resource_sites_dns_settings.go +++ b/catalystcenter/resource_sites_dns_settings.go @@ -3,11 +3,10 @@ package catalystcenter import ( "context" "errors" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -18,8 +17,8 @@ func resourceSitesDNSSettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set DNS settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set DNS settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesDNSSettingsCreate, @@ -153,7 +152,7 @@ func resourceSitesDNSSettingsRead(ctx context.Context, d *schema.ResourceData, m if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveDNSSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveDNSSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveDNSSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveDNSSettingsForASite(vvID, &queryParams1) @@ -167,7 +166,7 @@ func resourceSitesDNSSettingsRead(ctx context.Context, d *schema.ResourceData, m log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveDNSSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveDNSSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveDNSSettingsForASite response", @@ -190,7 +189,7 @@ func resourceSitesDNSSettingsUpdate(ctx context.Context, d *schema.ResourceData, vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesDNSSettingsSetDNSSettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesDNSSettingsSetDNSSettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetDNSSettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -249,17 +248,17 @@ func resourceSitesDNSSettingsDelete(ctx context.Context, d *schema.ResourceData, "Failure at SitesDNSSettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesDNSSettingsSetDNSSettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASite{} - request.DNS = expandRequestSitesDNSSettingsSetDNSSettingsForASiteDNS(ctx, key, d) +func expandRequestSitesDNSSettingsSetDNSSettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASiteV1{} + request.DNS = expandRequestSitesDNSSettingsSetDNSSettingsForASiteV1DNS(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestSitesDNSSettingsSetDNSSettingsForASiteDNS(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASiteDNS { - request := catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASiteDNS{} +func expandRequestSitesDNSSettingsSetDNSSettingsForASiteV1DNS(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASiteV1DNS { + request := catalystcentersdkgo.RequestNetworkSettingsSetDNSSettingsForASiteV1DNS{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".domain_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".domain_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".domain_name")))) { request.DomainName = interfaceToString(v) } diff --git a/catalystcenter/resource_sites_image_distribution_settings.go b/catalystcenter/resource_sites_image_distribution_settings.go index 6855acb..3611fd6 100644 --- a/catalystcenter/resource_sites_image_distribution_settings.go +++ b/catalystcenter/resource_sites_image_distribution_settings.go @@ -3,11 +3,10 @@ package catalystcenter import ( "context" "errors" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -18,8 +17,8 @@ func resourceSitesImageDistributionSettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set image distribution settings for a site; 'null' values indicate that the setting will be inherited from the parent -site; empty objects ('{}') indicate that the settings is unset. +- Set image distribution settings for a site; *null* values indicate that the setting will be inherited from the parent +site; empty objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesImageDistributionSettingsCreate, @@ -139,7 +138,7 @@ func resourceSitesImageDistributionSettingsRead(ctx context.Context, d *schema.R if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveImageDistributionSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveImageDistributionSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveImageDistributionSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveImageDistributionSettingsForASite(vvID, &queryParams1) @@ -153,7 +152,7 @@ func resourceSitesImageDistributionSettingsRead(ctx context.Context, d *schema.R log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveImageDistributionSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveImageDistributionSettingsForASite response", @@ -176,7 +175,7 @@ func resourceSitesImageDistributionSettingsUpdate(ctx context.Context, d *schema vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetImageDistributionSettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -235,17 +234,17 @@ func resourceSitesImageDistributionSettingsDelete(ctx context.Context, d *schema "Failure at SitesImageDistributionSettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASite{} - request.ImageDistribution = expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASiteImageDistribution(ctx, key, d) +func expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASiteV1{} + request.ImageDistribution = expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASiteV1ImageDistribution(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASiteImageDistribution(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASiteImageDistribution { - request := catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASiteImageDistribution{} +func expandRequestSitesImageDistributionSettingsSetImageDistributionSettingsForASiteV1ImageDistribution(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASiteV1ImageDistribution { + request := catalystcentersdkgo.RequestNetworkSettingsSetImageDistributionSettingsForASiteV1ImageDistribution{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToSliceString(v) } diff --git a/catalystcenter/resource_sites_ntp_settings.go b/catalystcenter/resource_sites_ntp_settings.go index ec182bd..795805d 100644 --- a/catalystcenter/resource_sites_ntp_settings.go +++ b/catalystcenter/resource_sites_ntp_settings.go @@ -18,8 +18,8 @@ func resourceSitesNtpSettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set NTP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set NTP settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesNtpSettingsCreate, @@ -139,7 +139,7 @@ func resourceSitesNtpSettingsRead(ctx context.Context, d *schema.ResourceData, m if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveNTPSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveNTPSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveNTPSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveNTPSettingsForASite(vvID, &queryParams1) @@ -153,7 +153,7 @@ func resourceSitesNtpSettingsRead(ctx context.Context, d *schema.ResourceData, m log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveNTPSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveNTPSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveNTPSettingsForASite response", @@ -176,7 +176,7 @@ func resourceSitesNtpSettingsUpdate(ctx context.Context, d *schema.ResourceData, vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesNtpSettingsSetNTPSettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesNtpSettingsSetNTPSettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetNTPSettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -235,17 +235,17 @@ func resourceSitesNtpSettingsDelete(ctx context.Context, d *schema.ResourceData, "Failure at SitesNtpSettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesNtpSettingsSetNTPSettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASite{} - request.Ntp = expandRequestSitesNtpSettingsSetNTPSettingsForASiteNtp(ctx, key, d) +func expandRequestSitesNtpSettingsSetNTPSettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASiteV1{} + request.Ntp = expandRequestSitesNtpSettingsSetNTPSettingsForASiteV1Ntp(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestSitesNtpSettingsSetNTPSettingsForASiteNtp(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASiteNtp { - request := catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASiteNtp{} +func expandRequestSitesNtpSettingsSetNTPSettingsForASiteV1Ntp(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASiteV1Ntp { + request := catalystcentersdkgo.RequestNetworkSettingsSetNTPSettingsForASiteV1Ntp{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".servers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".servers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".servers")))) { request.Servers = interfaceToSliceString(v) } diff --git a/catalystcenter/resource_sites_telemetry_settings.go b/catalystcenter/resource_sites_telemetry_settings.go index 3e962eb..c349808 100644 --- a/catalystcenter/resource_sites_telemetry_settings.go +++ b/catalystcenter/resource_sites_telemetry_settings.go @@ -18,7 +18,7 @@ func resourceSitesTelemetrySettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Sets telemetry settings for the given site; 'null' values indicate that the setting will be inherited from the parent +- Sets telemetry settings for the given site; *null* values indicate that the setting will be inherited from the parent site. `, @@ -275,7 +275,7 @@ site. }, }, "id": &schema.Schema{ - Description: `id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' + Description: `id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* `, Type: schema.TypeString, Required: true, @@ -408,7 +408,7 @@ func resourceSitesTelemetrySettingsRead(ctx context.Context, d *schema.ResourceD if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveTelemetrySettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveTelemetrySettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTelemetrySettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveTelemetrySettingsForASite(vvID, &queryParams1) @@ -422,7 +422,7 @@ func resourceSitesTelemetrySettingsRead(ctx context.Context, d *schema.ResourceD log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveTelemetrySettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveTelemetrySettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveTelemetrySettingsForASite response", @@ -445,7 +445,7 @@ func resourceSitesTelemetrySettingsUpdate(ctx context.Context, d *schema.Resourc vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetTelemetrySettingsForASite(vvID, request1) if err != nil || response1 == nil { @@ -504,22 +504,22 @@ func resourceSitesTelemetrySettingsDelete(ctx context.Context, d *schema.Resourc "Failure at SitesTelemetrySettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASite{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".wired_data_collection")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wired_data_collection")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wired_data_collection")))) { - request.WiredDataCollection = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteWiredDataCollection(ctx, key+".wired_data_collection.0", d) + request.WiredDataCollection = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1WiredDataCollection(ctx, key+".wired_data_collection.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".wireless_telemetry")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wireless_telemetry")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wireless_telemetry")))) { - request.WirelessTelemetry = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteWirelessTelemetry(ctx, key+".wireless_telemetry.0", d) + request.WirelessTelemetry = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1WirelessTelemetry(ctx, key+".wireless_telemetry.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".snmp_traps")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".snmp_traps")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".snmp_traps")))) { - request.SNMPTraps = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteSNMPTraps(ctx, key+".snmp_traps.0", d) + request.SNMPTraps = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1SNMPTraps(ctx, key+".snmp_traps.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".syslogs")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".syslogs")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".syslogs")))) { - request.Syslogs = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteSyslogs(ctx, key+".syslogs.0", d) + request.Syslogs = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1Syslogs(ctx, key+".syslogs.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".application_visibility")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".application_visibility")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".application_visibility")))) { - request.ApplicationVisibility = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteApplicationVisibility(ctx, key+".application_visibility.0", d) + request.ApplicationVisibility = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1ApplicationVisibility(ctx, key+".application_visibility.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -527,8 +527,8 @@ func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASite(ctx context return &request } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteWiredDataCollection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteWiredDataCollection { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteWiredDataCollection{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1WiredDataCollection(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1WiredDataCollection { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1WiredDataCollection{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_wired_data_collectio")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_wired_data_collectio")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_wired_data_collectio")))) { request.EnableWiredDataCollectio = interfaceToBoolPtr(v) } @@ -538,8 +538,8 @@ func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteWiredDataCol return &request } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteWirelessTelemetry(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteWirelessTelemetry { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteWirelessTelemetry{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1WirelessTelemetry(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1WirelessTelemetry { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1WirelessTelemetry{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_wireless_telemetry")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_wireless_telemetry")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_wireless_telemetry")))) { request.EnableWirelessTelemetry = interfaceToBoolPtr(v) } @@ -549,8 +549,8 @@ func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteWirelessTele return &request } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteSNMPTraps(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteSNMPTraps { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteSNMPTraps{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1SNMPTraps(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1SNMPTraps { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1SNMPTraps{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".use_builtin_trap_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".use_builtin_trap_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".use_builtin_trap_server")))) { request.UseBuiltinTrapServer = interfaceToBoolPtr(v) } @@ -563,8 +563,8 @@ func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteSNMPTraps(ct return &request } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteSyslogs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteSyslogs { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteSyslogs{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1Syslogs(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1Syslogs { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1Syslogs{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".use_builtin_syslog_server")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".use_builtin_syslog_server")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".use_builtin_syslog_server")))) { request.UseBuiltinSyslogServer = interfaceToBoolPtr(v) } @@ -577,10 +577,10 @@ func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteSyslogs(ctx return &request } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteApplicationVisibility(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteApplicationVisibility { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteApplicationVisibility{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1ApplicationVisibility(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1ApplicationVisibility { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1ApplicationVisibility{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".collector")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".collector")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".collector")))) { - request.Collector = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteApplicationVisibilityCollector(ctx, key+".collector.0", d) + request.Collector = expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1ApplicationVisibilityCollector(ctx, key+".collector.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_on_wired_access_devices")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_on_wired_access_devices")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_on_wired_access_devices")))) { request.EnableOnWiredAccessDevices = interfaceToBoolPtr(v) @@ -591,8 +591,8 @@ func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteApplicationV return &request } -func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteApplicationVisibilityCollector(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteApplicationVisibilityCollector { - request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteApplicationVisibilityCollector{} +func expandRequestSitesTelemetrySettingsSetTelemetrySettingsForASiteV1ApplicationVisibilityCollector(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1ApplicationVisibilityCollector { + request := catalystcentersdkgo.RequestNetworkSettingsSetTelemetrySettingsForASiteV1ApplicationVisibilityCollector{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".collector_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".collector_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".collector_type")))) { request.CollectorType = interfaceToString(v) } diff --git a/catalystcenter/resource_sites_time_zone_settings.go b/catalystcenter/resource_sites_time_zone_settings.go index e8c488a..948f65b 100644 --- a/catalystcenter/resource_sites_time_zone_settings.go +++ b/catalystcenter/resource_sites_time_zone_settings.go @@ -18,8 +18,8 @@ func resourceSitesTimeZoneSettings() *schema.Resource { return &schema.Resource{ Description: `It manages read and update operations on Network Settings. -- Set time zone settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the settings is unset. +- Set time zone settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the settings is unset. `, CreateContext: resourceSitesTimeZoneSettingsCreate, @@ -133,7 +133,7 @@ func resourceSitesTimeZoneSettingsRead(ctx context.Context, d *schema.ResourceDa if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: RetrieveTimeZoneSettingsForASite") vvID := vID - queryParams1 := catalystcentersdkgo.RetrieveTimeZoneSettingsForASiteQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveTimeZoneSettingsForASiteV1QueryParams{} response1, restyResp1, err := client.NetworkSettings.RetrieveTimeZoneSettingsForASite(vvID, &queryParams1) @@ -147,7 +147,7 @@ func resourceSitesTimeZoneSettingsRead(ctx context.Context, d *schema.ResourceDa log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteItem(response1.Response) + vItem1 := flattenNetworkSettingsRetrieveTimeZoneSettingsForASiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveTimeZoneSettingsForASite response", @@ -171,7 +171,7 @@ func resourceSitesTimeZoneSettingsUpdate(ctx context.Context, d *schema.Resource vvID := resourceMap["id"] if d.HasChange("parameters") { - request1 := expandRequestSitesTimeZoneSettingsSetTimeZoneForASite(ctx, "parameters.0", d) + request1 := expandRequestSitesTimeZoneSettingsSetTimeZoneForASiteV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.NetworkSettings.SetTimeZoneForASite(vvID, request1) if err != nil || response1 == nil { @@ -230,17 +230,17 @@ func resourceSitesTimeZoneSettingsDelete(ctx context.Context, d *schema.Resource "Failure at SitesTimeZoneSettingsDelete, unexpected response", "")) return diags } -func expandRequestSitesTimeZoneSettingsSetTimeZoneForASite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASite { - request := catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASite{} - request.TimeZone = expandRequestSitesTimeZoneSettingsSetTimeZoneForASiteTimeZone(ctx, key, d) +func expandRequestSitesTimeZoneSettingsSetTimeZoneForASiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASiteV1{} + request.TimeZone = expandRequestSitesTimeZoneSettingsSetTimeZoneForASiteV1TimeZone(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestSitesTimeZoneSettingsSetTimeZoneForASiteTimeZone(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASiteTimeZone { - request := catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASiteTimeZone{} +func expandRequestSitesTimeZoneSettingsSetTimeZoneForASiteV1TimeZone(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASiteV1TimeZone { + request := catalystcentersdkgo.RequestNetworkSettingsSetTimeZoneForASiteV1TimeZone{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".identifier")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".identifier")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".identifier")))) { request.IDentifier = interfaceToString(v) } diff --git a/catalystcenter/resource_sites_wireless_settings_ssids.go b/catalystcenter/resource_sites_wireless_settings_ssids.go index 906cfb2..e1ae0f1 100644 --- a/catalystcenter/resource_sites_wireless_settings_ssids.go +++ b/catalystcenter/resource_sites_wireless_settings_ssids.go @@ -4,11 +4,10 @@ import ( "context" "errors" "fmt" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -1157,7 +1156,7 @@ func resourceSitesWirelessSettingsSSIDsCreate(ctx context.Context, d *schema.Res var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSitesWirelessSettingsSSIDsCreateSSID(ctx, "parameters.0", d) + request1 := expandRequestSitesWirelessSettingsSSIDsCreateSSIDV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSiteID, okSiteID := resourceItem["site_id"] @@ -1176,7 +1175,7 @@ func resourceSitesWirelessSettingsSSIDsCreate(ctx context.Context, d *schema.Res return resourceSitesWirelessSettingsSSIDsRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.GetSSIDBySiteQueryParams{} + queryParamImport := catalystcentersdkgo.GetSSIDBySiteV1QueryParams{} response2, err := searchWirelessGetSSIDBySite(m, queryParamImport, vvSiteID, vvName) if response2 != nil && err == nil { @@ -1226,7 +1225,7 @@ func resourceSitesWirelessSettingsSSIDsCreate(ctx context.Context, d *schema.Res return diags } } - queryParamValidate := catalystcentersdkgo.GetSSIDBySiteQueryParams{} + queryParamValidate := catalystcentersdkgo.GetSSIDBySiteV1QueryParams{} item3, err := searchWirelessGetSSIDBySite(m, queryParamValidate, vvSiteID, vvName) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( @@ -1270,7 +1269,7 @@ func resourceSitesWirelessSettingsSSIDsRead(ctx context.Context, d *schema.Resou } // Review flatten function used - vItem1 := flattenWirelessGetSSIDByIDItem(response1.Response) + vItem1 := flattenWirelessGetSSIDByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetSSIDBySite search response", @@ -1293,7 +1292,7 @@ func resourceSitesWirelessSettingsSSIDsUpdate(ctx context.Context, d *schema.Res vvSiteID := resourceMap["site_id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestSitesWirelessSettingsSSIDsUpdateSSID(ctx, "parameters.0", d) + request1 := expandRequestSitesWirelessSettingsSSIDsUpdateSSIDV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Wireless.UpdateSSID(vvSiteID, vvID, request1) if err != nil || response1 == nil { @@ -1406,8 +1405,8 @@ func resourceSitesWirelessSettingsSSIDsDelete(ctx context.Context, d *schema.Res return diags } -func expandRequestSitesWirelessSettingsSSIDsCreateSSID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateSSID { - request := catalystcentersdkgo.RequestWirelessCreateSSID{} +func expandRequestSitesWirelessSettingsSSIDsCreateSSIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateSSIDV1 { + request := catalystcentersdkgo.RequestWirelessCreateSSIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid")))) { request.SSID = interfaceToString(v) } @@ -1475,7 +1474,7 @@ func expandRequestSitesWirelessSettingsSSIDsCreateSSID(ctx context.Context, key request.ProtectedManagementFrame = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multi_psk_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multi_psk_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multi_psk_settings")))) { - request.MultipSKSettings = expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettingsArray(ctx, key+".multi_psk_settings", d) + request.MultipSKSettings = expandRequestSitesWirelessSettingsSSIDsCreateSSIDV1MultipSKSettingsArray(ctx, key+".multi_psk_settings", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".client_rate_limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".client_rate_limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".client_rate_limit")))) { request.ClientRateLimit = interfaceToIntPtr(v) @@ -1612,8 +1611,8 @@ func expandRequestSitesWirelessSettingsSSIDsCreateSSID(ctx context.Context, key return &request } -func expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateSSIDMultipSKSettings { - request := []catalystcentersdkgo.RequestWirelessCreateSSIDMultipSKSettings{} +func expandRequestSitesWirelessSettingsSSIDsCreateSSIDV1MultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateSSIDV1MultipSKSettings { + request := []catalystcentersdkgo.RequestWirelessCreateSSIDV1MultipSKSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1624,7 +1623,7 @@ func expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettingsArray(ctx return nil } for item_no := range objs { - i := expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSitesWirelessSettingsSSIDsCreateSSIDV1MultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1635,8 +1634,8 @@ func expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettingsArray(ctx return &request } -func expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateSSIDMultipSKSettings { - request := catalystcentersdkgo.RequestWirelessCreateSSIDMultipSKSettings{} +func expandRequestSitesWirelessSettingsSSIDsCreateSSIDV1MultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateSSIDV1MultipSKSettings { + request := catalystcentersdkgo.RequestWirelessCreateSSIDV1MultipSKSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".priority")))) { request.Priority = interfaceToIntPtr(v) } @@ -1652,8 +1651,8 @@ func expandRequestSitesWirelessSettingsSSIDsCreateSSIDMultipSKSettings(ctx conte return &request } -func expandRequestSitesWirelessSettingsSSIDsUpdateSSID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateSSID { - request := catalystcentersdkgo.RequestWirelessUpdateSSID{} +func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateSSIDV1 { + request := catalystcentersdkgo.RequestWirelessUpdateSSIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid")))) { request.SSID = interfaceToString(v) } @@ -1721,7 +1720,7 @@ func expandRequestSitesWirelessSettingsSSIDsUpdateSSID(ctx context.Context, key request.ProtectedManagementFrame = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multi_psk_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multi_psk_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multi_psk_settings")))) { - request.MultipSKSettings = expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettingsArray(ctx, key+".multi_psk_settings", d) + request.MultipSKSettings = expandRequestSitesWirelessSettingsSSIDsUpdateSSIDV1MultipSKSettingsArray(ctx, key+".multi_psk_settings", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".client_rate_limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".client_rate_limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".client_rate_limit")))) { request.ClientRateLimit = interfaceToIntPtr(v) @@ -1858,8 +1857,8 @@ func expandRequestSitesWirelessSettingsSSIDsUpdateSSID(ctx context.Context, key return &request } -func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateSSIDMultipSKSettings { - request := []catalystcentersdkgo.RequestWirelessUpdateSSIDMultipSKSettings{} +func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDV1MultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateSSIDV1MultipSKSettings { + request := []catalystcentersdkgo.RequestWirelessUpdateSSIDV1MultipSKSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1870,7 +1869,7 @@ func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettingsArray(ctx return nil } for item_no := range objs { - i := expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSitesWirelessSettingsSSIDsUpdateSSIDV1MultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1881,8 +1880,8 @@ func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettingsArray(ctx return &request } -func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateSSIDMultipSKSettings { - request := catalystcentersdkgo.RequestWirelessUpdateSSIDMultipSKSettings{} +func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDV1MultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateSSIDV1MultipSKSettings { + request := catalystcentersdkgo.RequestWirelessUpdateSSIDV1MultipSKSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".priority")))) { request.Priority = interfaceToIntPtr(v) } @@ -1898,10 +1897,10 @@ func expandRequestSitesWirelessSettingsSSIDsUpdateSSIDMultipSKSettings(ctx conte return &request } -func searchWirelessGetSSIDBySite(m interface{}, queryParams catalystcentersdkgo.GetSSIDBySiteQueryParams, vSiteID string, vID string) (*catalystcentersdkgo.ResponseWirelessGetSSIDBySiteResponse, error) { +func searchWirelessGetSSIDBySite(m interface{}, queryParams catalystcentersdkgo.GetSSIDBySiteV1QueryParams, vSiteID string, vID string) (*catalystcentersdkgo.ResponseWirelessGetSSIDBySiteV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseWirelessGetSSIDBySiteResponse + var foundItem *catalystcentersdkgo.ResponseWirelessGetSSIDBySiteV1Response if vID != "" { queryParams.Offset = 1 nResponse, _, err := client.Wireless.GetSSIDBySite(vSiteID, nil) diff --git a/catalystcenter/resource_snmp_properties.go b/catalystcenter/resource_snmp_properties.go index 754f328..8569059 100644 --- a/catalystcenter/resource_snmp_properties.go +++ b/catalystcenter/resource_snmp_properties.go @@ -75,7 +75,7 @@ func resourceSNMPProperties() *schema.Resource { }, }, "parameters": &schema.Schema{ - Description: `Array of RequestDiscoveryCreateUpdateSNMPProperties`, + Description: `Array of RequestDiscoveryCreateUpdateSNMPPropertiesV1`, Type: schema.TypeList, Optional: true, Computed: true, @@ -129,7 +129,7 @@ func resourceSNMPPropertiesCreate(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestSNMPPropertiesCreateUpdateSNMPProperties(ctx, "parameters.0", d) + request1 := expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -219,10 +219,10 @@ func resourceSNMPPropertiesRead(ctx context.Context, d *schema.ResourceData, m i } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - items := []catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesResponse{ + items := []catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesV1Response{ *response1, } - vItem1 := flattenDiscoveryGetSNMPPropertiesItems(&items) + vItem1 := flattenDiscoveryGetSNMPPropertiesV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetSNMPProperties search response", @@ -253,20 +253,19 @@ func resourceSNMPPropertiesDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestSNMPPropertiesCreateUpdateSNMPProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateUpdateSNMPProperties { - request := catalystcentersdkgo.RequestDiscoveryCreateUpdateSNMPProperties{} - if v := expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItemArray(ctx, key, d); v != nil { +func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestDiscoveryCreateUpdateSNMPPropertiesV1 { + request := catalystcentersdkgo.RequestDiscoveryCreateUpdateSNMPPropertiesV1{} + if v := expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } if isEmptyValue(reflect.ValueOf(request)) { return nil } - return &request } -func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPProperties { - request := []catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPProperties{} +func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPPropertiesV1 { + request := []catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPPropertiesV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -277,7 +276,7 @@ func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItemArray(ctx context. return nil } for item_no := range objs { - i := expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -288,8 +287,8 @@ func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItemArray(ctx context. return &request } -func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPProperties { - request := catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPProperties{} +func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPPropertiesV1 { + request := catalystcentersdkgo.RequestItemDiscoveryCreateUpdateSNMPPropertiesV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".id")))) { request.ID = interfaceToString(v) } @@ -311,11 +310,11 @@ func expandRequestSNMPPropertiesCreateUpdateSNMPPropertiesItem(ctx context.Conte return &request } -func searchDiscoveryGetSNMPProperties(m interface{}, vID string, vName string) (*catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesResponse, error) { +func searchDiscoveryGetSNMPProperties(m interface{}, vID string, vName string) (*catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesResponse - var ite *catalystcentersdkgo.ResponseDiscoveryGetSNMPProperties + var foundItem *catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesV1Response + var ite *catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesV1 ite, _, err = client.Discovery.GetSNMPProperties() if err != nil { return foundItem, err @@ -329,7 +328,7 @@ func searchDiscoveryGetSNMPProperties(m interface{}, vID string, vName string) ( for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.InstanceTenantID == vID || item.SystemPropertyName == vName { - var getItem *catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesResponse + var getItem *catalystcentersdkgo.ResponseDiscoveryGetSNMPPropertiesV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_sp_profile_delete_v2.go b/catalystcenter/resource_sp_profile_delete_v2.go index 68d580f..28123b8 100644 --- a/catalystcenter/resource_sp_profile_delete_v2.go +++ b/catalystcenter/resource_sp_profile_delete_v2.go @@ -82,6 +82,8 @@ func resourceSpProfileDeleteV2Create(ctx context.Context, d *schema.ResourceData vvSpProfileName := vSpProfileName.(string) + // has_unknown_response: None + response1, restyResp1, err := client.NetworkSettings.DeleteSpProfileV2(vvSpProfileName) if err != nil || response1 == nil { @@ -135,7 +137,6 @@ func resourceSpProfileDeleteV2Create(ctx context.Context, d *schema.ResourceData return diags } } - vItem1 := flattenNetworkSettingsDeleteSpProfileV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -146,7 +147,6 @@ func resourceSpProfileDeleteV2Create(ctx context.Context, d *schema.ResourceData d.SetId(getUnixTimeString()) return diags - } func resourceSpProfileDeleteV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_swim_image_file.go b/catalystcenter/resource_swim_image_file.go index 8b1b5d6..b4e6233 100644 --- a/catalystcenter/resource_swim_image_file.go +++ b/catalystcenter/resource_swim_image_file.go @@ -20,20 +20,15 @@ import ( // resourceAction func resourceSwimImageFile() *schema.Resource { return &schema.Resource{ - Description: `It manages create and read operations on Software Image Management (SWIM). + Description: `It performs create operation on Software Image Management (SWIM). -- Fetches a software image from local file system and uploads to Catalyst Center. Supported software image files extensions -are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2. -Upload the file to the **file** form data field +- Fetches a software image from local file system and uploads to DNA Center. Supported software image files extensions +are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 `, CreateContext: resourceSwimImageFileCreate, ReadContext: resourceSwimImageFileRead, DeleteContext: resourceSwimImageFileDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ "last_updated": &schema.Schema{ Type: schema.TypeString, @@ -49,146 +44,7 @@ Upload the file to the **file** form data field Type: schema.TypeString, Computed: true, }, - - "created_time": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "extended_attributes": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "family": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "feature": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "file_service_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "file_size": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "image_integrity_status": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "image_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "image_series": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - - "image_source": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "image_type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "image_uuid": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "import_source_type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "is_tagged_golden": &schema.Schema{ - - Type: schema.TypeString, - Computed: true, - }, - - "md5_checksum": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "profile_info": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "extended_attributes": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "memory": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - - "product_type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "profile_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "shares": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - - "v_cpu": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - }, - }, - }, - - "sha_check_sum": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "vendor": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "version": &schema.Schema{ + "url": &schema.Schema{ Type: schema.TypeString, Computed: true, }, @@ -263,7 +119,7 @@ func resourceSwimImageFileCreate(ctx context.Context, d *schema.ResourceData, m vFilePath := resourceItem["file_path"] if vFileName.(string) != "" { - query := catalystcentersdkgo.GetSoftwareImageDetailsQueryParams{ + query := catalystcentersdkgo.GetSoftwareImageDetailsV1QueryParams{ Name: vFileName.(string), } item, err := searchSoftwareImageManagementSwimGetSoftwareImageDetailsFile(m, query) @@ -280,7 +136,7 @@ func resourceSwimImageFileCreate(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: ImportLocalSoftwareImage") - queryParams1 := catalystcentersdkgo.ImportLocalSoftwareImageQueryParams{} + queryParams1 := catalystcentersdkgo.ImportLocalSoftwareImageV1QueryParams{} if okIsThirdParty { queryParams1.IsThirdParty = vIsThirdParty.(bool) @@ -380,7 +236,6 @@ func resourceSwimImageFileCreate(ctx context.Context, d *schema.ResourceData, m d.SetId(joinResourceID(resourceMap)) return resourceSwimImageFileRead(ctx, d, m) } - func resourceSwimImageFileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -393,7 +248,7 @@ func resourceSwimImageFileRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetSoftwareImageDetails") - queryParams1 := catalystcentersdkgo.GetSoftwareImageDetailsQueryParams{ + queryParams1 := catalystcentersdkgo.GetSoftwareImageDetailsV1QueryParams{ Name: vName, } @@ -411,10 +266,10 @@ func resourceSwimImageFileRead(ctx context.Context, d *schema.ResourceData, m in } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - items := []catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponse{ + items := []catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1Response{ *response1, } - vItem1 := flattenSoftwareImageManagementSwimGetSoftwareImageDetailsItems(&items) + vItem1 := flattenSoftwareImageManagementSwimGetSoftwareImageDetailsV1Items(&items) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting ImportLocalSoftwareImage response", @@ -424,7 +279,6 @@ func resourceSwimImageFileRead(ctx context.Context, d *schema.ResourceData, m in } return diags - } func resourceSwimImageFileDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { @@ -439,11 +293,11 @@ func resourceSwimImageFileDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func searchSoftwareImageManagementSwimGetSoftwareImageDetailsFile(m interface{}, queryParams catalystcentersdkgo.GetSoftwareImageDetailsQueryParams) (*catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponse, error) { +func searchSoftwareImageManagementSwimGetSoftwareImageDetailsFile(m interface{}, queryParams catalystcentersdkgo.GetSoftwareImageDetailsV1QueryParams) (*catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponse - var ite *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetails + var foundItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1Response + var ite *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1 ite, _, err = client.SoftwareImageManagementSwim.GetSoftwareImageDetails(&queryParams) if err != nil { return foundItem, err @@ -456,7 +310,7 @@ func searchSoftwareImageManagementSwimGetSoftwareImageDetailsFile(m interface{}, for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsResponse + var getItem *catalystcentersdkgo.ResponseSoftwareImageManagementSwimGetSoftwareImageDetailsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_swim_image_url.go b/catalystcenter/resource_swim_image_url.go index 10de667..9e3ba5c 100644 --- a/catalystcenter/resource_swim_image_url.go +++ b/catalystcenter/resource_swim_image_url.go @@ -23,7 +23,7 @@ func resourceSwimImageURL() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Software Image Management (SWIM). -- Fetches a software image from remote file system (using URL for HTTP/FTP) and uploads to Catalyst Center. Supported image +- Fetches a software image from remote file system (using URL for HTTP/FTP) and uploads to DNA Center. Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 `, @@ -82,7 +82,7 @@ files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 ForceNew: true, }, "payload": &schema.Schema{ - Description: `Array of RequestSoftwareImageManagementSwimImportSoftwareImageViaURL`, + Description: `Array of RequestSoftwareImageManagementSwimImportSoftwareImageViaURLV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -136,21 +136,19 @@ func resourceSwimImageURLCreate(ctx context.Context, d *schema.ResourceData, m i client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestSwimImageURLImportSoftwareImageViaURL(ctx, "parameters.0", d) - queryParams1 := catalystcentersdkgo.ImportSoftwareImageViaURLQueryParams{} + request1 := expandRequestSwimImageURLImportSoftwareImageViaURLV1(ctx, "parameters.0", d) + queryParams1 := catalystcentersdkgo.ImportSoftwareImageViaURLV1QueryParams{} - response1, restyResp1, err := client.SoftwareImageManagementSwim.ImportSoftwareImageViaURL(request1, &queryParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.SoftwareImageManagementSwim.ImportSoftwareImageViaURLV1(request1, &queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ImportSoftwareImageViaURL", err)) + "Failure when executing ImportSoftwareImageViaURLV1", err)) return diags } @@ -158,7 +156,7 @@ func resourceSwimImageURLCreate(ctx context.Context, d *schema.ResourceData, m i if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing ImportSoftwareImageViaURL", err)) + "Failure when executing ImportSoftwareImageViaURLV1", err)) return diags } taskId := response1.Response.TaskID @@ -192,22 +190,24 @@ func resourceSwimImageURLCreate(ctx context.Context, d *schema.ResourceData, m i } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing ImportSoftwareImageViaURL", err1)) + "Failure when executing ImportSoftwareImageViaURLV1", err1)) return diags } } - vItem1 := flattenSoftwareImageManagementSwimImportSoftwareImageViaURLItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenSoftwareImageManagementSwimImportSoftwareImageViaURLV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ImportSoftwareImageViaURL response", + "Failure when setting ImportSoftwareImageViaURLV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceSwimImageURLRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -222,16 +222,16 @@ func resourceSwimImageURLDelete(ctx context.Context, d *schema.ResourceData, m i return diags } -func expandRequestSwimImageURLImportSoftwareImageViaURL(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimImportSoftwareImageViaURL { - request := catalystcentersdkgo.RequestSoftwareImageManagementSwimImportSoftwareImageViaURL{} - if v := expandRequestSwimImageURLImportSoftwareImageViaURLItemArray(ctx, key+".payload", d); v != nil { +func expandRequestSwimImageURLImportSoftwareImageViaURLV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSoftwareImageManagementSwimImportSoftwareImageViaURLV1 { + request := catalystcentersdkgo.RequestSoftwareImageManagementSwimImportSoftwareImageViaURLV1{} + if v := expandRequestSwimImageURLImportSoftwareImageViaURLV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestSwimImageURLImportSoftwareImageViaURLItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURL { - request := []catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURL{} +func expandRequestSwimImageURLImportSoftwareImageViaURLV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURLV1 { + request := []catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURLV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -242,7 +242,7 @@ func expandRequestSwimImageURLImportSoftwareImageViaURLItemArray(ctx context.Con return nil } for item_no := range objs { - i := expandRequestSwimImageURLImportSoftwareImageViaURLItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestSwimImageURLImportSoftwareImageViaURLV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -250,8 +250,8 @@ func expandRequestSwimImageURLImportSoftwareImageViaURLItemArray(ctx context.Con return &request } -func expandRequestSwimImageURLImportSoftwareImageViaURLItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURL { - request := catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURL{} +func expandRequestSwimImageURLImportSoftwareImageViaURLV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURLV1 { + request := catalystcentersdkgo.RequestItemSoftwareImageManagementSwimImportSoftwareImageViaURLV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".application_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".application_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".application_type")))) { request.ApplicationType = interfaceToString(v) } @@ -270,7 +270,7 @@ func expandRequestSwimImageURLImportSoftwareImageViaURLItem(ctx context.Context, return &request } -func flattenSoftwareImageManagementSwimImportSoftwareImageViaURLItem(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimImportSoftwareImageViaURLResponse) []map[string]interface{} { +func flattenSoftwareImageManagementSwimImportSoftwareImageViaURLV1Item(item *catalystcentersdkgo.ResponseSoftwareImageManagementSwimImportSoftwareImageViaURLV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_syslog_config_create.go b/catalystcenter/resource_syslog_config_create.go index d8cc8c3..52c1903 100644 --- a/catalystcenter/resource_syslog_config_create.go +++ b/catalystcenter/resource_syslog_config_create.go @@ -174,8 +174,8 @@ func resourceSyslogConfigCreateDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestSyslogConfigCreateCreateSyslogDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSyslogDestination { - request := catalystcentersdkgo.RequestEventManagementCreateSyslogDestination{} +func expandRequestSyslogConfigCreateCreateSyslogDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementCreateSyslogDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementCreateSyslogDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } @@ -197,7 +197,7 @@ func expandRequestSyslogConfigCreateCreateSyslogDestination(ctx context.Context, return &request } -func flattenEventManagementCreateSyslogDestinationItem(item *catalystcentersdkgo.ResponseEventManagementCreateSyslogDestination) []map[string]interface{} { +func flattenEventManagementCreateSyslogDestinationItem(item *catalystcentersdkgo.ResponseEventManagementCreateSyslogDestinationV1) []map[string]interface{} { if item == nil { return nil } @@ -210,7 +210,7 @@ func flattenEventManagementCreateSyslogDestinationItem(item *catalystcentersdkgo } } -func flattenEventManagementCreateSyslogDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementCreateSyslogDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementCreateSyslogDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementCreateSyslogDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_syslog_config_update.go b/catalystcenter/resource_syslog_config_update.go index ab81432..845d037 100644 --- a/catalystcenter/resource_syslog_config_update.go +++ b/catalystcenter/resource_syslog_config_update.go @@ -174,8 +174,8 @@ func resourceSyslogConfigUpdateDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestSyslogConfigUpdateUpdateSyslogDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSyslogDestination { - request := catalystcentersdkgo.RequestEventManagementUpdateSyslogDestination{} +func expandRequestSyslogConfigUpdateUpdateSyslogDestination(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestEventManagementUpdateSyslogDestinationV1 { + request := catalystcentersdkgo.RequestEventManagementUpdateSyslogDestinationV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".config_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".config_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".config_id")))) { request.ConfigID = interfaceToString(v) } @@ -197,7 +197,7 @@ func expandRequestSyslogConfigUpdateUpdateSyslogDestination(ctx context.Context, return &request } -func flattenEventManagementUpdateSyslogDestinationItem(item *catalystcentersdkgo.ResponseEventManagementUpdateSyslogDestination) []map[string]interface{} { +func flattenEventManagementUpdateSyslogDestinationItem(item *catalystcentersdkgo.ResponseEventManagementUpdateSyslogDestinationV1) []map[string]interface{} { if item == nil { return nil } @@ -210,7 +210,7 @@ func flattenEventManagementUpdateSyslogDestinationItem(item *catalystcentersdkgo } } -func flattenEventManagementUpdateSyslogDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementUpdateSyslogDestinationErrorMessage) []map[string]interface{} { +func flattenEventManagementUpdateSyslogDestinationItemErrorMessage(item *catalystcentersdkgo.ResponseEventManagementUpdateSyslogDestinationV1ErrorMessage) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_system_issue_definitions.go b/catalystcenter/resource_system_issue_definitions.go index e7bebcd..d316617 100644 --- a/catalystcenter/resource_system_issue_definitions.go +++ b/catalystcenter/resource_system_issue_definitions.go @@ -203,7 +203,7 @@ func resourceSystemIssueDefinitionsRead(ctx context.Context, d *schema.ResourceD log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) // Review flatten function used - vItem1 := flattenIssuesGetIssueTriggerDefinitionForGivenIDItem(response1.Response) + vItem1 := flattenIssuesGetIssueTriggerDefinitionForGivenIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting ReturnsAllIssueTriggerDefinitionsForGivenFilters search response", @@ -225,7 +225,7 @@ func resourceSystemIssueDefinitionsUpdate(ctx context.Context, d *schema.Resourc vvID := resourceMap["id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestSystemIssueDefinitionsIssueTriggerDefinitionUpdate(ctx, "parameters.0", d) + request1 := expandRequestSystemIssueDefinitionsIssueTriggerDefinitionUpdateV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Issues.IssueTriggerDefinitionUpdate(vvID, request1) if err != nil || response1 == nil { @@ -257,8 +257,8 @@ func resourceSystemIssueDefinitionsDelete(ctx context.Context, d *schema.Resourc "Failure at SystemIssueDefinitionsDelete, unexpected response", "")) return diags } -func expandRequestSystemIssueDefinitionsIssueTriggerDefinitionUpdate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesIssueTriggerDefinitionUpdate { - request := catalystcentersdkgo.RequestIssuesIssueTriggerDefinitionUpdate{} +func expandRequestSystemIssueDefinitionsIssueTriggerDefinitionUpdateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestIssuesIssueTriggerDefinitionUpdateV1 { + request := catalystcentersdkgo.RequestIssuesIssueTriggerDefinitionUpdateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".synchronize_to_health_threshold")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".synchronize_to_health_threshold")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".synchronize_to_health_threshold")))) { request.SynchronizeToHealthThreshold = interfaceToBoolPtr(v) } diff --git a/catalystcenter/resource_tag.go b/catalystcenter/resource_tag.go index b4c96f5..f5b402b 100644 --- a/catalystcenter/resource_tag.go +++ b/catalystcenter/resource_tag.go @@ -242,7 +242,7 @@ func resourceTagCreate(ctx context.Context, d *schema.ResourceData, m interface{ var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestTagCreateTag(ctx, "parameters.0", d) + request1 := expandRequestTagCreateTagV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -264,7 +264,7 @@ func resourceTagCreate(ctx context.Context, d *schema.ResourceData, m interface{ } } if okName && vvName != "" { - queryParams1 := catalystcentersdkgo.GetTagQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagV1QueryParams{} queryParams1.Name = vvName response1, err := searchTagGetTag(m, queryParams1) @@ -343,7 +343,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{}) selectedMethod := pickMethod([][]bool{method1, method2}) if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetTag") - queryParams1 := catalystcentersdkgo.GetTagQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagV1QueryParams{} if okName { queryParams1.Name = vName @@ -380,7 +380,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{}) return diags } - vItem2 := flattenTagGetTagByIDItem(response2.Response) + vItem2 := flattenTagGetTagByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( "Failure when setting GetTagByID response", @@ -418,7 +418,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, m interface{}) log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response2)) - vItem2 := flattenTagGetTagByIDItem(response2.Response) + vItem2 := flattenTagGetTagByIDV1Item(response2.Response) if err := d.Set("item", vItem2); err != nil { diags = append(diags, diagError( "Failure when setting GetTagByID response", @@ -460,7 +460,7 @@ func resourceTagUpdate(ctx context.Context, d *schema.ResourceData, m interface{ } } if vName != "" { - queryParams1 := catalystcentersdkgo.GetTagQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagV1QueryParams{} queryParams1.Name = vName response1, err := searchTagGetTag(m, queryParams1) @@ -478,7 +478,7 @@ func resourceTagUpdate(ctx context.Context, d *schema.ResourceData, m interface{ //Set value vvName = getResp if d.HasChange("parameters") { log.Printf("[DEBUG] Id used for update operation %s", vvID) - request1 := expandRequestTagUpdateTag(ctx, "parameters.0", d) + request1 := expandRequestTagUpdateTagV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) request1.ID = vvID @@ -551,7 +551,7 @@ func resourceTagDelete(ctx context.Context, d *schema.ResourceData, m interface{ return diags } } else if vName != "" { - queryParams1 := catalystcentersdkgo.GetTagQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagV1QueryParams{} queryParams1.Name = vName getResp, err := searchTagGetTag(m, queryParams1) @@ -611,8 +611,8 @@ func resourceTagDelete(ctx context.Context, d *schema.ResourceData, m interface{ return diags } -func expandRequestTagCreateTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTag { - request := catalystcentersdkgo.RequestTagCreateTag{} +func expandRequestTagCreateTagV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTagV1 { + request := catalystcentersdkgo.RequestTagCreateTagV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".system_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".system_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".system_tag")))) { request.SystemTag = interfaceToBoolPtr(v) } @@ -620,7 +620,7 @@ func expandRequestTagCreateTag(ctx context.Context, key string, d *schema.Resour request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dynamic_rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dynamic_rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dynamic_rules")))) { - request.DynamicRules = expandRequestTagCreateTagDynamicRulesArray(ctx, key+".dynamic_rules", d) + request.DynamicRules = expandRequestTagCreateTagV1DynamicRulesArray(ctx, key+".dynamic_rules", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) @@ -637,8 +637,8 @@ func expandRequestTagCreateTag(ctx context.Context, key string, d *schema.Resour return &request } -func expandRequestTagCreateTagDynamicRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestTagCreateTagDynamicRules { - request := []catalystcentersdkgo.RequestTagCreateTagDynamicRules{} +func expandRequestTagCreateTagV1DynamicRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestTagCreateTagV1DynamicRules { + request := []catalystcentersdkgo.RequestTagCreateTagV1DynamicRules{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -649,7 +649,7 @@ func expandRequestTagCreateTagDynamicRulesArray(ctx context.Context, key string, return nil } for item_no := range objs { - i := expandRequestTagCreateTagDynamicRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestTagCreateTagV1DynamicRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -660,13 +660,13 @@ func expandRequestTagCreateTagDynamicRulesArray(ctx context.Context, key string, return &request } -func expandRequestTagCreateTagDynamicRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTagDynamicRules { - request := catalystcentersdkgo.RequestTagCreateTagDynamicRules{} +func expandRequestTagCreateTagV1DynamicRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTagV1DynamicRules { + request := catalystcentersdkgo.RequestTagCreateTagV1DynamicRules{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".member_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_type")))) { request.MemberType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rules")))) { - request.Rules = expandRequestTagCreateTagDynamicRulesRules(ctx, key+".rules.0", d) + request.Rules = expandRequestTagCreateTagV1DynamicRulesRules(ctx, key+".rules.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -674,13 +674,13 @@ func expandRequestTagCreateTagDynamicRules(ctx context.Context, key string, d *s return &request } -func expandRequestTagCreateTagDynamicRulesRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTagDynamicRulesRules { - request := catalystcentersdkgo.RequestTagCreateTagDynamicRulesRules{} +func expandRequestTagCreateTagV1DynamicRulesRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTagV1DynamicRulesRules { + request := catalystcentersdkgo.RequestTagCreateTagV1DynamicRulesRules{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".values")))) { request.Values = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".items")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".items")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".items")))) { - request.Items = expandRequestTagCreateTagDynamicRulesRulesItemsArray(ctx, key+".items", d) + request.Items = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".operation")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operation")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operation")))) { request.Operation = interfaceToString(v) @@ -697,40 +697,8 @@ func expandRequestTagCreateTagDynamicRulesRules(ctx context.Context, key string, return &request } -func expandRequestTagCreateTagDynamicRulesRulesItemsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestTagCreateTagDynamicRulesRulesItems { - request := []catalystcentersdkgo.RequestTagCreateTagDynamicRulesRulesItems{} - key = fixKeyAccess(key) - o := d.Get(key) - if o == nil { - return nil - } - objs := o.([]interface{}) - if len(objs) == 0 { - return nil - } - for item_no := range objs { - i := expandRequestTagCreateTagDynamicRulesRulesItems(ctx, fmt.Sprintf("%s.%d", key, item_no), d) - if i != nil { - request = append(request, *i) - } - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func expandRequestTagCreateTagDynamicRulesRulesItems(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagCreateTagDynamicRulesRulesItems { - var request catalystcentersdkgo.RequestTagCreateTagDynamicRulesRulesItems - request = d.Get(fixKeyAccess(key)) - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func expandRequestTagUpdateTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTag { - request := catalystcentersdkgo.RequestTagUpdateTag{} +func expandRequestTagUpdateTagV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagV1 { + request := catalystcentersdkgo.RequestTagUpdateTagV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".system_tag")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".system_tag")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".system_tag")))) { request.SystemTag = interfaceToBoolPtr(v) } @@ -738,7 +706,7 @@ func expandRequestTagUpdateTag(ctx context.Context, key string, d *schema.Resour request.Description = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dynamic_rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dynamic_rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dynamic_rules")))) { - request.DynamicRules = expandRequestTagUpdateTagDynamicRulesArray(ctx, key+".dynamic_rules", d) + request.DynamicRules = expandRequestTagUpdateTagV1DynamicRulesArray(ctx, key+".dynamic_rules", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) @@ -755,8 +723,8 @@ func expandRequestTagUpdateTag(ctx context.Context, key string, d *schema.Resour return &request } -func expandRequestTagUpdateTagDynamicRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestTagUpdateTagDynamicRules { - request := []catalystcentersdkgo.RequestTagUpdateTagDynamicRules{} +func expandRequestTagUpdateTagV1DynamicRulesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestTagUpdateTagV1DynamicRules { + request := []catalystcentersdkgo.RequestTagUpdateTagV1DynamicRules{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -767,7 +735,7 @@ func expandRequestTagUpdateTagDynamicRulesArray(ctx context.Context, key string, return nil } for item_no := range objs { - i := expandRequestTagUpdateTagDynamicRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestTagUpdateTagV1DynamicRules(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -778,13 +746,13 @@ func expandRequestTagUpdateTagDynamicRulesArray(ctx context.Context, key string, return &request } -func expandRequestTagUpdateTagDynamicRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagDynamicRules { - request := catalystcentersdkgo.RequestTagUpdateTagDynamicRules{} +func expandRequestTagUpdateTagV1DynamicRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagV1DynamicRules { + request := catalystcentersdkgo.RequestTagUpdateTagV1DynamicRules{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".member_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_type")))) { request.MemberType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rules")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rules")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rules")))) { - request.Rules = expandRequestTagUpdateTagDynamicRulesRules(ctx, key+".rules.0", d) + request.Rules = expandRequestTagUpdateTagV1DynamicRulesRules(ctx, key+".rules.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -792,13 +760,13 @@ func expandRequestTagUpdateTagDynamicRules(ctx context.Context, key string, d *s return &request } -func expandRequestTagUpdateTagDynamicRulesRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagDynamicRulesRules { - request := catalystcentersdkgo.RequestTagUpdateTagDynamicRulesRules{} +func expandRequestTagUpdateTagV1DynamicRulesRules(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagV1DynamicRulesRules { + request := catalystcentersdkgo.RequestTagUpdateTagV1DynamicRulesRules{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".values")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".values")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".values")))) { request.Values = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".items")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".items")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".items")))) { - request.Items = expandRequestTagUpdateTagDynamicRulesRulesItemsArray(ctx, key+".items", d) + request.Items = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".operation")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".operation")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".operation")))) { request.Operation = interfaceToString(v) @@ -815,43 +783,11 @@ func expandRequestTagUpdateTagDynamicRulesRules(ctx context.Context, key string, return &request } -func expandRequestTagUpdateTagDynamicRulesRulesItemsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestTagUpdateTagDynamicRulesRulesItems { - request := []catalystcentersdkgo.RequestTagUpdateTagDynamicRulesRulesItems{} - key = fixKeyAccess(key) - o := d.Get(key) - if o == nil { - return nil - } - objs := o.([]interface{}) - if len(objs) == 0 { - return nil - } - for item_no := range objs { - i := expandRequestTagUpdateTagDynamicRulesRulesItems(ctx, fmt.Sprintf("%s.%d", key, item_no), d) - if i != nil { - request = append(request, *i) - } - } - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func expandRequestTagUpdateTagDynamicRulesRulesItems(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagDynamicRulesRulesItems { - var request catalystcentersdkgo.RequestTagUpdateTagDynamicRulesRulesItems - request = d.Get(fixKeyAccess(key)) - if isEmptyValue(reflect.ValueOf(request)) { - return nil - } - return &request -} - -func searchTagGetTag(m interface{}, queryParams catalystcentersdkgo.GetTagQueryParams) (*catalystcentersdkgo.ResponseTagGetTagResponse, error) { +func searchTagGetTag(m interface{}, queryParams catalystcentersdkgo.GetTagV1QueryParams) (*catalystcentersdkgo.ResponseTagGetTagV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseTagGetTagResponse - var ite *catalystcentersdkgo.ResponseTagGetTag + var foundItem *catalystcentersdkgo.ResponseTagGetTagV1Response + var ite *catalystcentersdkgo.ResponseTagGetTagV1 ite, _, err = client.Tag.GetTag(&queryParams) if err != nil { return foundItem, err @@ -864,7 +800,7 @@ func searchTagGetTag(m interface{}, queryParams catalystcentersdkgo.GetTagQueryP for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseTagGetTagResponse + var getItem *catalystcentersdkgo.ResponseTagGetTagV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_tag_membership.go b/catalystcenter/resource_tag_membership.go index f1c5fca..0f48369 100644 --- a/catalystcenter/resource_tag_membership.go +++ b/catalystcenter/resource_tag_membership.go @@ -167,7 +167,7 @@ func resourceTagMembershipRead(ctx context.Context, d *schema.ResourceData, m in selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetTagMembersByID") - queryParams1 := catalystcentersdkgo.GetTagMembersByIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetTagMembersByIDV1QueryParams{} queryParams1.MemberType = vMemberType response1, restyResp1, _ := client.Tag.GetTagMembersByID(vID, &queryParams1) @@ -187,7 +187,7 @@ func resourceTagMembershipRead(ctx context.Context, d *schema.ResourceData, m in log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItems1 := flattenTagGetTagMembersByIDItems(response1.Response) + vItems1 := flattenTagGetTagMembersByIDV1Items(response1.Response) if err := d.Set("item", vItems1); err != nil { diags = append(diags, diagError( "Failure when setting GetTagMembersByID response", @@ -313,8 +313,8 @@ func resourceTagMembershipDelete(ctx context.Context, d *schema.ResourceData, m return diags } -func expandRequestTagMemberCreateAddMembersToTheTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagAddMembersToTheTag { - request := catalystcentersdkgo.RequestTagAddMembersToTheTag{} +func expandRequestTagMemberCreateAddMembersToTheTag(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagAddMembersToTheTagV1 { + request := catalystcentersdkgo.RequestTagAddMembersToTheTagV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".member_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_type")))) { if v2, ok := d.GetOkExists(fixKeyAccess(key + ".member_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_id")))) { x := make(map[string][]string) @@ -329,8 +329,8 @@ func expandRequestTagMemberCreateAddMembersToTheTag(ctx context.Context, key str return &request } -func expandRequestTagMembershipUpdateTagMembership(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagMembership { - request := catalystcentersdkgo.RequestTagUpdateTagMembership{} +func expandRequestTagMembershipUpdateTagMembership(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagUpdateTagMembershipV1 { + request := catalystcentersdkgo.RequestTagUpdateTagMembershipV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".tag_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tag_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tag_id")))) { if v2, ok := d.GetOkExists(fixKeyAccess(key + ".member_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".member_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".member_id")))) { x := make(map[string][]string) @@ -348,11 +348,11 @@ func expandRequestTagMembershipUpdateTagMembership(ctx context.Context, key stri return &request } -func searchResourceTagMembership(m interface{}, queryParams catalystcentersdkgo.GetApplicationSetsQueryParams) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse, error) { +func searchResourceTagMembership(m interface{}, queryParams catalystcentersdkgo.GetApplicationSetsV1QueryParams) (*catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse - var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSets + var foundItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response + var ite *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1 ite, _, err = client.ApplicationPolicy.GetApplicationSets(&queryParams) if ite == nil { @@ -368,7 +368,7 @@ func searchResourceTagMembership(m interface{}, queryParams catalystcentersdkgo. for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.Name == queryParams.Name { - var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsResponse + var getItem *catalystcentersdkgo.ResponseApplicationPolicyGetApplicationSetsV1Response getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_tags_interfaces_members_associations_query.go b/catalystcenter/resource_tags_interfaces_members_associations_query.go new file mode 100644 index 0000000..34e1374 --- /dev/null +++ b/catalystcenter/resource_tags_interfaces_members_associations_query.go @@ -0,0 +1,181 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceTagsInterfacesMembersAssociationsQuery() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Tag. + +- Fetches the tags associated with the given interface *ids*. Interfaces that don't have any tags associated will not be +included in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is +tagged, it is called a member of the tag. *ids* can be fetched via */dna/intent/api/v1/interface* API. +`, + + CreateContext: resourceTagsInterfacesMembersAssociationsQueryCreate, + ReadContext: resourceTagsInterfacesMembersAssociationsQueryRead, + DeleteContext: resourceTagsInterfacesMembersAssociationsQueryDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ids": &schema.Schema{ + Description: `List of member ids (network device or interface), maximum 500 ids can be passed. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Id of the member (network device or interface) +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Tag id +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "name": &schema.Schema{ + Description: `Tag name +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceTagsInterfacesMembersAssociationsQueryCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestTagsInterfacesMembersAssociationsQueryQueryTheTagsAssociatedWithInterfacesV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Tag.QueryTheTagsAssociatedWithInterfacesV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing QueryTheTagsAssociatedWithInterfacesV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenTagQueryTheTagsAssociatedWithInterfacesV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting QueryTheTagsAssociatedWithInterfacesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceTagsInterfacesMembersAssociationsQueryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceTagsInterfacesMembersAssociationsQueryDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestTagsInterfacesMembersAssociationsQueryQueryTheTagsAssociatedWithInterfacesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithInterfacesV1 { + request := catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithInterfacesV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ids")))) { + request.IDs = interfaceToSliceString(v) + } + return &request +} + +func flattenTagQueryTheTagsAssociatedWithInterfacesV1Items(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithInterfacesV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["tags"] = flattenTagQueryTheTagsAssociatedWithInterfacesV1ItemsTags(item.Tags) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenTagQueryTheTagsAssociatedWithInterfacesV1ItemsTags(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithInterfacesV1ResponseTags) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["name"] = item.Name + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/resource_tags_network_devices_members_associations_query.go b/catalystcenter/resource_tags_network_devices_members_associations_query.go new file mode 100644 index 0000000..f6d3dd1 --- /dev/null +++ b/catalystcenter/resource_tags_network_devices_members_associations_query.go @@ -0,0 +1,181 @@ +package catalystcenter + +import ( + "context" + + "reflect" + + "log" + + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// resourceAction +func resourceTagsNetworkDevicesMembersAssociationsQuery() *schema.Resource { + return &schema.Resource{ + Description: `It performs create operation on Tag. + +- Fetches the tags associated with the given network device *ids*. Devices that don't have any tags associated will not +be included in the response. A tag is a user-defined or system-defined construct to group resources. When a device is +tagged, it is called a member of the tag. *ids* can be fetched via */dna/intent/api/v1/network-device* API. +`, + + CreateContext: resourceTagsNetworkDevicesMembersAssociationsQueryCreate, + ReadContext: resourceTagsNetworkDevicesMembersAssociationsQueryRead, + DeleteContext: resourceTagsNetworkDevicesMembersAssociationsQueryDelete, + Schema: map[string]*schema.Schema{ + "last_updated": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "parameters": &schema.Schema{ + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ids": &schema.Schema{ + Description: `List of member ids (network device or interface), maximum 500 ids can be passed. +`, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "items": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Id of the member (network device or interface) +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "id": &schema.Schema{ + Description: `Tag id +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + "name": &schema.Schema{ + Description: `Tag name +`, + Type: schema.TypeString, + ForceNew: true, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceTagsNetworkDevicesMembersAssociationsQueryCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + + request1 := expandRequestTagsNetworkDevicesMembersAssociationsQueryQueryTheTagsAssociatedWithNetworkDevicesV1(ctx, "parameters.0", d) + + // has_unknown_response: None + + response1, restyResp1, err := client.Tag.QueryTheTagsAssociatedWithNetworkDevicesV1(request1) + + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + diags = append(diags, diagError( + "Failure when executing QueryTheTagsAssociatedWithNetworkDevicesV1", err)) + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) + + vItems1 := flattenTagQueryTheTagsAssociatedWithNetworkDevicesV1Items(response1.Response) + if err := d.Set("items", vItems1); err != nil { + diags = append(diags, diagError( + "Failure when setting QueryTheTagsAssociatedWithNetworkDevicesV1 response", + err)) + return diags + } + + d.SetId(getUnixTimeString()) + return diags + +} +func resourceTagsNetworkDevicesMembersAssociationsQueryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + var diags diag.Diagnostics + return diags +} + +func resourceTagsNetworkDevicesMembersAssociationsQueryDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*catalystcentersdkgo.Client) + + var diags diag.Diagnostics + return diags +} + +func expandRequestTagsNetworkDevicesMembersAssociationsQueryQueryTheTagsAssociatedWithNetworkDevicesV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithNetworkDevicesV1 { + request := catalystcentersdkgo.RequestTagQueryTheTagsAssociatedWithNetworkDevicesV1{} + if v, ok := d.GetOkExists(fixKeyAccess(key + ".ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ids")))) { + request.IDs = interfaceToSliceString(v) + } + return &request +} + +func flattenTagQueryTheTagsAssociatedWithNetworkDevicesV1Items(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithNetworkDevicesV1Response) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["tags"] = flattenTagQueryTheTagsAssociatedWithNetworkDevicesV1ItemsTags(item.Tags) + respItems = append(respItems, respItem) + } + return respItems +} + +func flattenTagQueryTheTagsAssociatedWithNetworkDevicesV1ItemsTags(items *[]catalystcentersdkgo.ResponseTagQueryTheTagsAssociatedWithNetworkDevicesV1ResponseTags) []map[string]interface{} { + if items == nil { + return nil + } + var respItems []map[string]interface{} + for _, item := range *items { + respItem := make(map[string]interface{}) + respItem["id"] = item.ID + respItem["name"] = item.Name + respItems = append(respItems, respItem) + } + return respItems +} diff --git a/catalystcenter/resource_telemetry_settings_apply.go b/catalystcenter/resource_telemetry_settings_apply.go index 256d56a..6e32c28 100644 --- a/catalystcenter/resource_telemetry_settings_apply.go +++ b/catalystcenter/resource_telemetry_settings_apply.go @@ -85,20 +85,18 @@ func resourceTelemetrySettingsApplyCreate(ctx context.Context, d *schema.Resourc client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestTelemetrySettingsApplyUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite(ctx, "parameters.0", d) + request1 := expandRequestTelemetrySettingsApplyUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.NetworkSettings.UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.NetworkSettings.UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite", err)) + "Failure when executing UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1", err)) return diags } @@ -106,7 +104,7 @@ func resourceTelemetrySettingsApplyCreate(ctx context.Context, d *schema.Resourc if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite", err)) + "Failure when executing UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1", err)) return diags } taskId := response1.Response.TaskID @@ -140,22 +138,24 @@ func resourceTelemetrySettingsApplyCreate(ctx context.Context, d *schema.Resourc } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite", err1)) + "Failure when executing UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1", err1)) return diags } } - vItem1 := flattenNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite response", + "Failure when setting UpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceTelemetrySettingsApplyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -170,15 +170,15 @@ func resourceTelemetrySettingsApplyDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestTelemetrySettingsApplyUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite { - request := catalystcentersdkgo.RequestNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSite{} +func expandRequestTelemetrySettingsApplyUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1 { + request := catalystcentersdkgo.RequestNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_ids")))) { request.DeviceIDs = interfaceToSliceString(v) } return &request } -func flattenNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteItem(item *catalystcentersdkgo.ResponseNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteResponse) []map[string]interface{} { +func flattenNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1Item(item *catalystcentersdkgo.ResponseNetworkSettingsUpdateADevicesTelemetrySettingsToConformToTheTelemetrySettingsForItsSiteV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_template_preview.go b/catalystcenter/resource_template_preview.go index a600dd0..90f7122 100644 --- a/catalystcenter/resource_template_preview.go +++ b/catalystcenter/resource_template_preview.go @@ -113,31 +113,27 @@ func resourceTemplatePreviewCreate(ctx context.Context, d *schema.ResourceData, client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestTemplatePreviewPreviewTemplate(ctx, "parameters.0", d) + request1 := expandRequestTemplatePreviewPreviewTemplateV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.ConfigurationTemplates.PreviewTemplate(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.ConfigurationTemplates.PreviewTemplateV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing PreviewTemplate", err)) + "Failure when executing PreviewTemplateV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenConfigurationTemplatesPreviewTemplateItem(response1) + vItem1 := flattenConfigurationTemplatesPreviewTemplateV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting PreviewTemplate response", + "Failure when setting PreviewTemplateV1 response", err)) return diags } @@ -159,16 +155,16 @@ func resourceTemplatePreviewDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestTemplatePreviewPreviewTemplate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplate { - request := catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplate{} +func expandRequestTemplatePreviewPreviewTemplateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateV1 { + request := catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".params")))) { - request.Params = expandRequestTemplatePreviewPreviewTemplateParams(ctx, key+".params.0", d) + request.Params = expandRequestTemplatePreviewPreviewTemplateV1Params(ctx, key+".params.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".resource_params")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".resource_params")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".resource_params")))) { - request.ResourceParams = expandRequestTemplatePreviewPreviewTemplateResourceParams(ctx, key+".resource_params.0", d) + request.ResourceParams = expandRequestTemplatePreviewPreviewTemplateV1ResourceParams(ctx, key+".resource_params.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".template_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".template_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".template_id")))) { request.TemplateID = interfaceToString(v) @@ -176,19 +172,19 @@ func expandRequestTemplatePreviewPreviewTemplate(ctx context.Context, key string return &request } -func expandRequestTemplatePreviewPreviewTemplateParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateParams { - var request catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateParams +func expandRequestTemplatePreviewPreviewTemplateV1Params(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateV1Params { + var request catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateV1Params request = d.Get(fixKeyAccess(key)) return &request } -func expandRequestTemplatePreviewPreviewTemplateResourceParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateResourceParams { - var request catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateResourceParams +func expandRequestTemplatePreviewPreviewTemplateV1ResourceParams(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateV1ResourceParams { + var request catalystcentersdkgo.RequestConfigurationTemplatesPreviewTemplateV1ResourceParams request = d.Get(fixKeyAccess(key)) return &request } -func flattenConfigurationTemplatesPreviewTemplateItem(item *catalystcentersdkgo.ResponseConfigurationTemplatesPreviewTemplate) []map[string]interface{} { +func flattenConfigurationTemplatesPreviewTemplateV1Item(item *catalystcentersdkgo.ResponseConfigurationTemplatesPreviewTemplateV1) []map[string]interface{} { if item == nil { return nil } @@ -196,13 +192,13 @@ func flattenConfigurationTemplatesPreviewTemplateItem(item *catalystcentersdkgo. respItem["cli_preview"] = item.CliPreview respItem["device_id"] = item.DeviceID respItem["template_id"] = item.TemplateID - respItem["validation_errors"] = flattenConfigurationTemplatesPreviewTemplateItemValidationErrors(item.ValidationErrors) + respItem["validation_errors"] = flattenConfigurationTemplatesPreviewTemplateV1ItemValidationErrors(item.ValidationErrors) return []map[string]interface{}{ respItem, } } -func flattenConfigurationTemplatesPreviewTemplateItemValidationErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesPreviewTemplateValidationErrors) interface{} { +func flattenConfigurationTemplatesPreviewTemplateV1ItemValidationErrors(item *catalystcentersdkgo.ResponseConfigurationTemplatesPreviewTemplateV1ValidationErrors) interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_transit_peer_network.go b/catalystcenter/resource_transit_peer_network.go index cf024af..b3e8a89 100644 --- a/catalystcenter/resource_transit_peer_network.go +++ b/catalystcenter/resource_transit_peer_network.go @@ -2,7 +2,6 @@ package catalystcenter import ( "context" - "errors" "fmt" "reflect" "time" @@ -219,29 +218,29 @@ func resourceTransitPeerNetworkCreate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestTransitPeerNetworkAddTransitPeerNetwork(ctx, "parameters.0", d) + request1 := expandRequestTransitPeerNetworkAddTransitPeerNetworkV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vTransitPeerNetworkName := resourceItem["transit_peer_network_name"] vvTransitPeerNetworkName := interfaceToString(vTransitPeerNetworkName) - queryParamImport := catalystcentersdkgo.GetTransitPeerNetworkInfoQueryParams{} + queryParamImport := catalystcentersdkgo.GetTransitPeerNetworkInfoV1QueryParams{} queryParamImport.TransitPeerNetworkName = vvTransitPeerNetworkName - item2, _, err := client.Sda.GetTransitPeerNetworkInfo(&queryParamImport) - if err == nil && item2 != nil { + item2, _, err := client.Sda.GetTransitPeerNetworkInfoV1(&queryParamImport) + if err != nil || item2 != nil { resourceMap := make(map[string]string) resourceMap["transit_peer_network_name"] = item2.TransitPeerNetworkName d.SetId(joinResourceID(resourceMap)) return resourceTransitPeerNetworkRead(ctx, d, m) } - resp1, restyResp1, err := client.Sda.AddTransitPeerNetwork(request1) + resp1, restyResp1, err := client.Sda.AddTransitPeerNetworkV1(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( - "Failure when executing AddTransitPeerNetwork", err, restyResp1.String())) + "Failure when executing AddTransitPeerNetworkV1", err, restyResp1.String())) return diags } diags = append(diags, diagError( - "Failure when executing AddTransitPeerNetwork", err)) + "Failure when executing AddTransitPeerNetworkV1", err)) return diags } executionId := resp1.ExecutionID @@ -258,7 +257,7 @@ func resourceTransitPeerNetworkCreate(ctx context.Context, d *schema.ResourceDat "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -271,20 +270,20 @@ func resourceTransitPeerNetworkCreate(ctx context.Context, d *schema.ResourceDat return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing AddTransitPeerNetwork", err)) + "Failure when executing AddTransitPeerNetworkV1", err)) return diags } } - queryParamValidate := catalystcentersdkgo.GetTransitPeerNetworkInfoQueryParams{} + queryParamValidate := catalystcentersdkgo.GetTransitPeerNetworkInfoV1QueryParams{} queryParamValidate.TransitPeerNetworkName = vvTransitPeerNetworkName - item3, _, err := client.Sda.GetTransitPeerNetworkInfo(&queryParamValidate) + item3, _, err := client.Sda.GetTransitPeerNetworkInfoV1(&queryParamValidate) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( - "Failure when executing AddTransitPeerNetwork", err, - "Failure at AddTransitPeerNetwork, unexpected response", "")) + "Failure when executing AddTransitPeerNetworkV1", err, + "Failure at AddTransitPeerNetworkV1, unexpected response", "")) return diags } @@ -307,12 +306,14 @@ func resourceTransitPeerNetworkRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { - log.Printf("[DEBUG] Selected method: GetTransitPeerNetworkInfo") - queryParams1 := catalystcentersdkgo.GetTransitPeerNetworkInfoQueryParams{} + log.Printf("[DEBUG] Selected method: GetTransitPeerNetworkInfoV1") + queryParams1 := catalystcentersdkgo.GetTransitPeerNetworkInfoV1QueryParams{} queryParams1.TransitPeerNetworkName = vTransitPeerNetworkName - response1, restyResp1, err := client.Sda.GetTransitPeerNetworkInfo(&queryParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Sda.GetTransitPeerNetworkInfoV1(&queryParams1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -324,10 +325,10 @@ func resourceTransitPeerNetworkRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenSdaGetTransitPeerNetworkInfoItem(response1) + vItem1 := flattenSdaGetTransitPeerNetworkInfoV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting GetTransitPeerNetworkInfo response", + "Failure when setting GetTransitPeerNetworkInfoV1 response", err)) return diags } @@ -339,13 +340,7 @@ func resourceTransitPeerNetworkRead(ctx context.Context, d *schema.ResourceData, } func resourceTransitPeerNetworkUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - var diags diag.Diagnostics - err := errors.New("Update not possible in this resource") - diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing TransitPeerNetworkUpdate", err, "Update method is not supported", - "Failure at TransitPeerNetworkUpdate, unexpected response", "")) - - return diags + return resourceTransitPeerNetworkRead(ctx, d, m) } func resourceTransitPeerNetworkDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { @@ -357,23 +352,23 @@ func resourceTransitPeerNetworkDelete(ctx context.Context, d *schema.ResourceDat resourceID := d.Id() resourceMap := separateResourceID(resourceID) - queryParamDelete := catalystcentersdkgo.DeleteTransitPeerNetworkQueryParams{} + queryParamDelete := catalystcentersdkgo.DeleteTransitPeerNetworkV1QueryParams{} vvTransitPeerNetworkName := resourceMap["transit_peer_network_name"] queryParamDelete.TransitPeerNetworkName = vvTransitPeerNetworkName - response1, restyResp1, err := client.Sda.DeleteTransitPeerNetwork(&queryParamDelete) + response1, restyResp1, err := client.Sda.DeleteTransitPeerNetworkV1(&queryParamDelete) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) diags = append(diags, diagErrorWithAltAndResponse( - "Failure when executing DeleteTransitPeerNetwork", err, restyResp1.String(), - "Failure at DeleteTransitPeerNetwork, unexpected response", "")) + "Failure when executing DeleteTransitPeerNetworkV1", err, restyResp1.String(), + "Failure at DeleteTransitPeerNetworkV1, unexpected response", "")) return diags } diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteTransitPeerNetwork", err, - "Failure at DeleteTransitPeerNetwork, unexpected response", "")) + "Failure when executing DeleteTransitPeerNetworkV1", err, + "Failure at DeleteTransitPeerNetworkV1, unexpected response", "")) return diags } @@ -391,7 +386,7 @@ func resourceTransitPeerNetworkDelete(ctx context.Context, d *schema.ResourceDat "Failure at GetExecutionByID, unexpected response", "")) return diags } - for statusIsPending(response2.Status) { + for response2.Status == "IN_PROGRESS" { time.Sleep(10 * time.Second) response2, restyResp2, err = client.Task.GetBusinessAPIExecutionDetails(executionId) if err != nil || response2 == nil { @@ -404,10 +399,10 @@ func resourceTransitPeerNetworkDelete(ctx context.Context, d *schema.ResourceDat return diags } } - if statusIsFailure(response2.Status) { + if response2.Status == "FAILURE" { log.Printf("[DEBUG] Error %s", response2.BapiError) diags = append(diags, diagError( - "Failure when executing DeleteTransitPeerNetwork", err)) + "Failure when executing DeleteTransitPeerNetworkV1", err)) return diags } } @@ -418,8 +413,8 @@ func resourceTransitPeerNetworkDelete(ctx context.Context, d *schema.ResourceDat return diags } -func expandRequestTransitPeerNetworkAddTransitPeerNetwork(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetwork { - request := catalystcentersdkgo.RequestSdaAddTransitPeerNetwork{} +func expandRequestTransitPeerNetworkAddTransitPeerNetworkV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1 { + request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".transit_peer_network_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".transit_peer_network_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".transit_peer_network_name")))) { request.TransitPeerNetworkName = interfaceToString(v) } @@ -427,10 +422,10 @@ func expandRequestTransitPeerNetworkAddTransitPeerNetwork(ctx context.Context, k request.TransitPeerNetworkType = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ip_transit_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ip_transit_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ip_transit_settings")))) { - request.IPTransitSettings = expandRequestTransitPeerNetworkAddTransitPeerNetworkIPTransitSettings(ctx, key+".ip_transit_settings.0", d) + request.IPTransitSettings = expandRequestTransitPeerNetworkAddTransitPeerNetworkV1IPTransitSettings(ctx, key+".ip_transit_settings.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".sda_transit_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".sda_transit_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".sda_transit_settings")))) { - request.SdaTransitSettings = expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettings(ctx, key+".sda_transit_settings.0", d) + request.SdaTransitSettings = expandRequestTransitPeerNetworkAddTransitPeerNetworkV1SdaTransitSettings(ctx, key+".sda_transit_settings.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -438,8 +433,8 @@ func expandRequestTransitPeerNetworkAddTransitPeerNetwork(ctx context.Context, k return &request } -func expandRequestTransitPeerNetworkAddTransitPeerNetworkIPTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkIPTransitSettings { - request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkIPTransitSettings{} +func expandRequestTransitPeerNetworkAddTransitPeerNetworkV1IPTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1IPTransitSettings { + request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1IPTransitSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".routing_protocol_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".routing_protocol_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".routing_protocol_name")))) { request.RoutingProtocolName = interfaceToString(v) } @@ -452,10 +447,10 @@ func expandRequestTransitPeerNetworkAddTransitPeerNetworkIPTransitSettings(ctx c return &request } -func expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkSdaTransitSettings { - request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkSdaTransitSettings{} +func expandRequestTransitPeerNetworkAddTransitPeerNetworkV1SdaTransitSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1SdaTransitSettings { + request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1SdaTransitSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".transit_control_plane_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".transit_control_plane_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".transit_control_plane_settings")))) { - request.TransitControlPlaneSettings = expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettingsArray(ctx, key+".transit_control_plane_settings", d) + request.TransitControlPlaneSettings = expandRequestTransitPeerNetworkAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettingsArray(ctx, key+".transit_control_plane_settings", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -463,8 +458,8 @@ func expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettings(ctx return &request } -func expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSdaAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettings { - request := []catalystcentersdkgo.RequestSdaAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettings{} +func expandRequestTransitPeerNetworkAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettings { + request := []catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -475,7 +470,7 @@ func expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettingsTrans return nil } for item_no := range objs { - i := expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestTransitPeerNetworkAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -486,8 +481,8 @@ func expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettingsTrans return &request } -func expandRequestTransitPeerNetworkAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettings { - request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkSdaTransitSettingsTransitControlPlaneSettings{} +func expandRequestTransitPeerNetworkAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettings { + request := catalystcentersdkgo.RequestSdaAddTransitPeerNetworkV1SdaTransitSettingsTransitControlPlaneSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".site_name_hierarchy")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".site_name_hierarchy")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".site_name_hierarchy")))) { request.SiteNameHierarchy = interfaceToString(v) } diff --git a/catalystcenter/resource_trusted_certificates_import.go b/catalystcenter/resource_trusted_certificates_import.go index 975ca13..75119d6 100644 --- a/catalystcenter/resource_trusted_certificates_import.go +++ b/catalystcenter/resource_trusted_certificates_import.go @@ -3,6 +3,8 @@ package catalystcenter import ( "context" + "log" + catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -46,18 +48,29 @@ func resourceTrustedCertificatesImport() *schema.Resource { func resourceTrustedCertificatesImportCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - response1, err := client.CiscoTrustedCertificates.ImportTrustedCertificate() - if err = d.Set("item", response1.String()); err != nil { + + // has_unknown_response: True + + response1, err := client.CiscoTrustedCertificates.ImportTrustedCertificateV1() + + if err != nil || response1 == nil { + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %s", response1.String()) + + //Analizar verificacion. + + if err := d.Set("item", response1.String()); err != nil { diags = append(diags, diagError( - "Failure when setting ImportTrustedCertificate response", + "Failure when setting ImportTrustedCertificateV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - //Analizar verificacion. - } func resourceTrustedCertificatesImportRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_user.go b/catalystcenter/resource_user.go index 15f302b..e593ef5 100644 --- a/catalystcenter/resource_user.go +++ b/catalystcenter/resource_user.go @@ -17,9 +17,9 @@ func resourceUser() *schema.Resource { return &schema.Resource{ Description: `It manages create, read and update operations on User and Roles. -- Add a new user for Cisco Catalyst Center System. +- Add a new user for Cisco DNA Center System. -- Update a user for Cisco Catalyst Center System. +- Update a user for Cisco DNA Center System. `, CreateContext: resourceUserCreate, @@ -165,12 +165,12 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestUserAddUserAPI(ctx, "parameters.0", d) + request1 := expandRequestUserAddUserAPIV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vInvokeSource := resourceItem["invoke_source"] vvInvokeSource := interfaceToString(vInvokeSource) - queryParamImport := catalystcentersdkgo.GetUsersAPIQueryParams{} + queryParamImport := catalystcentersdkgo.GetUsersAPIV1QueryParams{} queryParamImport.InvokeSource = vvInvokeSource item2, _, err := client.UserandRoles.GetUsersAPI(&queryParamImport) if err == nil && item2 != nil { @@ -191,7 +191,7 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface return diags } // TODO REVIEW - queryParamValidate := catalystcentersdkgo.GetUsersAPIQueryParams{} + queryParamValidate := catalystcentersdkgo.GetUsersAPIV1QueryParams{} queryParamValidate.InvokeSource = vvInvokeSource item3, _, err := client.UserandRoles.GetUsersAPI(&queryParamValidate) if err != nil || item3 == nil { @@ -221,7 +221,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, m interface{} selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method: GetUsersAPI") - queryParams1 := catalystcentersdkgo.GetUsersAPIQueryParams{} + queryParams1 := catalystcentersdkgo.GetUsersAPIV1QueryParams{} queryParams1.InvokeSource = vInvokeSource @@ -237,7 +237,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, m interface{} log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetUsersAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetUsersAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetUsersAPI response", @@ -257,7 +257,7 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, m interface var diags diag.Diagnostics if d.HasChange("parameters") { - request1 := expandRequestUserUpdateUserAPI(ctx, "parameters.0", d) + request1 := expandRequestUserUpdateUserAPIV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.UserandRoles.UpdateUserAPI(request1) if err != nil || response1 == nil { @@ -289,8 +289,8 @@ func resourceUserDelete(ctx context.Context, d *schema.ResourceData, m interface "Failure at UserDelete, unexpected response", "")) return diags } -func expandRequestUserAddUserAPI(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesAddUserAPI { - request := catalystcentersdkgo.RequestUserandRolesAddUserAPI{} +func expandRequestUserAddUserAPIV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesAddUserAPIV1 { + request := catalystcentersdkgo.RequestUserandRolesAddUserAPIV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".first_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".first_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".first_name")))) { request.FirstName = interfaceToString(v) } @@ -315,8 +315,8 @@ func expandRequestUserAddUserAPI(ctx context.Context, key string, d *schema.Reso return &request } -func expandRequestUserUpdateUserAPI(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesUpdateUserAPI { - request := catalystcentersdkgo.RequestUserandRolesUpdateUserAPI{} +func expandRequestUserUpdateUserAPIV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesUpdateUserAPIV1 { + request := catalystcentersdkgo.RequestUserandRolesUpdateUserAPIV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".first_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".first_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".first_name")))) { request.FirstName = interfaceToString(v) } diff --git a/catalystcenter/resource_users_external_authentication_create.go b/catalystcenter/resource_users_external_authentication_create.go index cc832ee..25a6c17 100644 --- a/catalystcenter/resource_users_external_authentication_create.go +++ b/catalystcenter/resource_users_external_authentication_create.go @@ -18,7 +18,7 @@ func resourceUsersExternalAuthenticationCreate() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on User and Roles. -- Enable or disable external authentication on Cisco Catalyst Center System. +- Enable or disable external authentication on Cisco DNA Center System. Please find the Administrator Guide for your particular release from the list linked below and follow the steps required to enable external authentication before trying to do so from this API. https://www.cisco.com/c/en/us/support/cloud-systems-management/dna-center/products-maintenance-guides-list.html @@ -75,31 +75,27 @@ func resourceUsersExternalAuthenticationCreateCreate(ctx context.Context, d *sch client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestUsersExternalAuthenticationCreateManageExternalAuthenticationSettingAPI(ctx, "parameters.0", d) + request1 := expandRequestUsersExternalAuthenticationCreateManageExternalAuthenticationSettingAPIV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.UserandRoles.ManageExternalAuthenticationSettingAPI(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.UserandRoles.ManageExternalAuthenticationSettingAPIV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ManageExternalAuthenticationSettingAPI", err)) + "Failure when executing ManageExternalAuthenticationSettingAPIV1", err)) return diags } log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - //Analizar verificacion. - - vItem1 := flattenUserandRolesManageExternalAuthenticationSettingAPIItem(response1.Response) + vItem1 := flattenUserandRolesManageExternalAuthenticationSettingAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ManageExternalAuthenticationSettingAPI response", + "Failure when setting ManageExternalAuthenticationSettingAPIV1 response", err)) return diags } @@ -121,15 +117,15 @@ func resourceUsersExternalAuthenticationCreateDelete(ctx context.Context, d *sch return diags } -func expandRequestUsersExternalAuthenticationCreateManageExternalAuthenticationSettingAPI(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesManageExternalAuthenticationSettingAPI { - request := catalystcentersdkgo.RequestUserandRolesManageExternalAuthenticationSettingAPI{} +func expandRequestUsersExternalAuthenticationCreateManageExternalAuthenticationSettingAPIV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesManageExternalAuthenticationSettingAPIV1 { + request := catalystcentersdkgo.RequestUserandRolesManageExternalAuthenticationSettingAPIV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable")))) { request.Enable = interfaceToBoolPtr(v) } return &request } -func flattenUserandRolesManageExternalAuthenticationSettingAPIItem(item *catalystcentersdkgo.ResponseUserandRolesManageExternalAuthenticationSettingAPIResponse) []map[string]interface{} { +func flattenUserandRolesManageExternalAuthenticationSettingAPIV1Item(item *catalystcentersdkgo.ResponseUserandRolesManageExternalAuthenticationSettingAPIV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_users_external_servers_aaa_attribute.go b/catalystcenter/resource_users_external_servers_aaa_attribute.go index cfdaa0f..c46d5ca 100644 --- a/catalystcenter/resource_users_external_servers_aaa_attribute.go +++ b/catalystcenter/resource_users_external_servers_aaa_attribute.go @@ -88,7 +88,7 @@ func resourceUsersExternalServersAAAAttributeCreate(ctx context.Context, d *sche var diags diag.Diagnostics - request1 := expandRequestUsersExternalServersAAAAttributeAddAndUpdateAAAAttributeAPI(ctx, "parameters.0", d) + request1 := expandRequestUsersExternalServersAAAAttributeAddAndUpdateAAAAttributeAPIV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) item2, _, err := client.UserandRoles.GetAAAAttributeAPI() @@ -144,7 +144,7 @@ func resourceUsersExternalServersAAAAttributeRead(ctx context.Context, d *schema log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenUserandRolesGetAAAAttributeAPIItem(response1.Response) + vItem1 := flattenUserandRolesGetAAAAttributeAPIV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetAAAAttributeAPI response", @@ -191,8 +191,8 @@ func resourceUsersExternalServersAAAAttributeDelete(ctx context.Context, d *sche return diags } -func expandRequestUsersExternalServersAAAAttributeAddAndUpdateAAAAttributeAPI(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesAddAndUpdateAAAAttributeAPI { - request := catalystcentersdkgo.RequestUserandRolesAddAndUpdateAAAAttributeAPI{} +func expandRequestUsersExternalServersAAAAttributeAddAndUpdateAAAAttributeAPIV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestUserandRolesAddAndUpdateAAAAttributeAPIV1 { + request := catalystcentersdkgo.RequestUserandRolesAddAndUpdateAAAAttributeAPIV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".attribute_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".attribute_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".attribute_name")))) { request.AttributeName = interfaceToString(v) } diff --git a/catalystcenter/resource_wireless_accespoint_configuration.go b/catalystcenter/resource_wireless_accespoint_configuration.go index c81046c..1d8cb72 100644 --- a/catalystcenter/resource_wireless_accespoint_configuration.go +++ b/catalystcenter/resource_wireless_accespoint_configuration.go @@ -526,11 +526,9 @@ func resourceWirelessAccespointConfigurationCreate(ctx context.Context, d *schem request1 := expandRequestWirelessAccespointConfigurationConfigureAccessPointsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.ConfigureAccessPointsV1(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.ConfigureAccessPointsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { @@ -584,6 +582,9 @@ func resourceWirelessAccespointConfigurationCreate(ctx context.Context, d *schem } } + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } vItem1 := flattenWirelessConfigureAccessPointsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -594,7 +595,6 @@ func resourceWirelessAccespointConfigurationCreate(ctx context.Context, d *schem d.SetId(getUnixTimeString()) return diags - } func resourceWirelessAccespointConfigurationRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) diff --git a/catalystcenter/resource_wireless_accesspoint_configuration_create.go b/catalystcenter/resource_wireless_accespoint_configuration_v2.go similarity index 91% rename from catalystcenter/resource_wireless_accesspoint_configuration_create.go rename to catalystcenter/resource_wireless_accespoint_configuration_v2.go index 95597bb..996bda8 100644 --- a/catalystcenter/resource_wireless_accesspoint_configuration_create.go +++ b/catalystcenter/resource_wireless_accespoint_configuration_v2.go @@ -19,16 +19,16 @@ import ( ) // resourceAction -func resourceWirelessAccesspointConfigurationCreate() *schema.Resource { +func resourceWirelessAccespointConfigurationV2() *schema.Resource { return &schema.Resource{ Description: `It performs create operation on Wireless. - User can configure multiple access points with required options using this intent API `, - CreateContext: resourceWirelessAccesspointConfigurationCreateCreate, - ReadContext: resourceWirelessAccesspointConfigurationCreateRead, - DeleteContext: resourceWirelessAccesspointConfigurationCreateDelete, + CreateContext: resourceWirelessAccespointConfigurationV2Create, + ReadContext: resourceWirelessAccespointConfigurationV2Read, + DeleteContext: resourceWirelessAccespointConfigurationV2Delete, Schema: map[string]*schema.Schema{ "last_updated": &schema.Schema{ Type: schema.TypeString, @@ -561,11 +561,13 @@ func resourceWirelessAccesspointConfigurationCreate() *schema.Resource { } } -func resourceWirelessAccesspointConfigurationCreateCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func resourceWirelessAccespointConfigurationV2Create(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2(ctx, "parameters.0", d) + request1 := expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2(ctx, "parameters.0", d) + + // has_unknown_response: None response1, restyResp1, err := client.Wireless.ConfigureAccessPointsV2(request1) @@ -573,17 +575,6 @@ func resourceWirelessAccesspointConfigurationCreateCreate(ctx context.Context, d log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } - if err != nil || response1 == nil { - if restyResp1 != nil { - log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) - } - diags = append(diags, diagError( - "Failure when executing ConfigureAccessPointsV2", err)) - return diags - } - - log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - if response1.Response == nil { diags = append(diags, diagError( "Failure when executing ConfigureAccessPointsV2", err)) @@ -625,6 +616,15 @@ func resourceWirelessAccesspointConfigurationCreateCreate(ctx context.Context, d } } + if err != nil || response1 == nil { + if restyResp1 != nil { + log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) + } + d.SetId("") + return diags + } + + log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) vItem1 := flattenWirelessConfigureAccessPointsV2Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( @@ -637,23 +637,23 @@ func resourceWirelessAccesspointConfigurationCreateCreate(ctx context.Context, d return diags } -func resourceWirelessAccesspointConfigurationCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - //client := m.(*catalystcentersdkgo.Client) +func resourceWirelessAccespointConfigurationV2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*dnacentersdkgo.Client) var diags diag.Diagnostics return diags } -func resourceWirelessAccesspointConfigurationCreateDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - //client := m.(*catalystcentersdkgo.Client) +func resourceWirelessAccespointConfigurationV2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + //client := m.(*dnacentersdkgo.Client) var diags diag.Diagnostics return diags } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2 { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2 { request := catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ap_list")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ap_list")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ap_list")))) { - request.ApList = expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2ApListArray(ctx, key+".ap_list", d) + request.ApList = expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2ApListArray(ctx, key+".ap_list", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".configure_admin_status")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".configure_admin_status")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".configure_admin_status")))) { request.ConfigureAdminStatus = interfaceToBoolPtr(v) @@ -698,22 +698,22 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2( request.PrimaryControllerName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".primary_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".primary_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".primary_ip_address")))) { - request.PrimaryIPAddress = expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2PrimaryIPAddress(ctx, key+".primary_ip_address.0", d) + request.PrimaryIPAddress = expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2PrimaryIPAddress(ctx, key+".primary_ip_address.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".secondary_controller_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".secondary_controller_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".secondary_controller_name")))) { request.SecondaryControllerName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".secondary_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".secondary_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".secondary_ip_address")))) { - request.SecondaryIPAddress = expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2SecondaryIPAddress(ctx, key+".secondary_ip_address.0", d) + request.SecondaryIPAddress = expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2SecondaryIPAddress(ctx, key+".secondary_ip_address.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tertiary_controller_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tertiary_controller_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tertiary_controller_name")))) { request.TertiaryControllerName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".tertiary_ip_address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".tertiary_ip_address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".tertiary_ip_address")))) { - request.TertiaryIPAddress = expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2TertiaryIPAddress(ctx, key+".tertiary_ip_address.0", d) + request.TertiaryIPAddress = expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2TertiaryIPAddress(ctx, key+".tertiary_ip_address.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_configurations")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_configurations")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_configurations")))) { - request.RadioConfigurations = expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2RadioConfigurationsArray(ctx, key+".radio_configurations", d) + request.RadioConfigurations = expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2RadioConfigurationsArray(ctx, key+".radio_configurations", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".configure_clean_air_s_i24_ghz")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".configure_clean_air_s_i24_ghz")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".configure_clean_air_s_i24_ghz")))) { request.ConfigureCleanAirSI24Ghz = interfaceToBoolPtr(v) @@ -739,7 +739,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2( return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2ApListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2ApList { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2ApListArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2ApList { request := []catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2ApList{} key = fixKeyAccess(key) o := d.Get(key) @@ -751,7 +751,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2A return nil } for item_no := range objs { - i := expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2ApList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2ApList(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -759,7 +759,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2A return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2ApList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2ApList { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2ApList(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2ApList { request := catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2ApList{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ap_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ap_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ap_name")))) { request.ApName = interfaceToString(v) @@ -773,7 +773,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2A return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2PrimaryIPAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2PrimaryIPAddress { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2PrimaryIPAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2PrimaryIPAddress { request := catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2PrimaryIPAddress{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".address")))) { request.Address = interfaceToString(v) @@ -781,7 +781,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2P return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2SecondaryIPAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2SecondaryIPAddress { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2SecondaryIPAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2SecondaryIPAddress { request := catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2SecondaryIPAddress{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".address")))) { request.Address = interfaceToString(v) @@ -789,7 +789,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2S return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2TertiaryIPAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2TertiaryIPAddress { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2TertiaryIPAddress(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2TertiaryIPAddress { request := catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2TertiaryIPAddress{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".address")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".address")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".address")))) { request.Address = interfaceToString(v) @@ -797,7 +797,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2T return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2RadioConfigurationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2RadioConfigurations { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2RadioConfigurationsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2RadioConfigurations { request := []catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2RadioConfigurations{} key = fixKeyAccess(key) o := d.Get(key) @@ -809,7 +809,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2R return nil } for item_no := range objs { - i := expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2RadioConfigurations(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2RadioConfigurations(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -817,7 +817,7 @@ func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2R return &request } -func expandRequestWirelessAccesspointConfigurationCreateConfigureAccessPointsV2RadioConfigurations(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2RadioConfigurations { +func expandRequestWirelessAccespointConfigurationV2ConfigureAccessPointsV2RadioConfigurations(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2RadioConfigurations { request := catalystcentersdkgo.RequestWirelessConfigureAccessPointsV2RadioConfigurations{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".configure_radio_role_assignment")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".configure_radio_role_assignment")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".configure_radio_role_assignment")))) { request.ConfigureRadioRoleAssignment = interfaceToBoolPtr(v) diff --git a/catalystcenter/resource_wireless_access_points_factory_reset_request_provision.go b/catalystcenter/resource_wireless_access_points_factory_reset_request_provision.go index ffcbbd2..826f647 100644 --- a/catalystcenter/resource_wireless_access_points_factory_reset_request_provision.go +++ b/catalystcenter/resource_wireless_access_points_factory_reset_request_provision.go @@ -94,20 +94,18 @@ func resourceWirelessAccessPointsFactoryResetRequestProvisionCreate(ctx context. client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestWirelessAccessPointsFactoryResetRequestProvisionFactoryResetAccessPoints(ctx, "parameters.0", d) + request1 := expandRequestWirelessAccessPointsFactoryResetRequestProvisionFactoryResetAccessPointsV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.FactoryResetAccessPoints(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.FactoryResetAccessPointsV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing FactoryResetAccessPoints", err)) + "Failure when executing FactoryResetAccessPointsV1", err)) return diags } @@ -115,7 +113,7 @@ func resourceWirelessAccessPointsFactoryResetRequestProvisionCreate(ctx context. if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing FactoryResetAccessPoints", err)) + "Failure when executing FactoryResetAccessPointsV1", err)) return diags } taskId := response1.Response.TaskID @@ -149,22 +147,24 @@ func resourceWirelessAccessPointsFactoryResetRequestProvisionCreate(ctx context. } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing FactoryResetAccessPoints", err1)) + "Failure when executing FactoryResetAccessPointsV1", err1)) return diags } } - vItem1 := flattenWirelessFactoryResetAccessPointsItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessFactoryResetAccessPointsV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting FactoryResetAccessPoints response", + "Failure when setting FactoryResetAccessPointsV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessAccessPointsFactoryResetRequestProvisionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -179,8 +179,8 @@ func resourceWirelessAccessPointsFactoryResetRequestProvisionDelete(ctx context. return diags } -func expandRequestWirelessAccessPointsFactoryResetRequestProvisionFactoryResetAccessPoints(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessFactoryResetAccessPoints { - request := catalystcentersdkgo.RequestWirelessFactoryResetAccessPoints{} +func expandRequestWirelessAccessPointsFactoryResetRequestProvisionFactoryResetAccessPointsV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessFactoryResetAccessPointsV1 { + request := catalystcentersdkgo.RequestWirelessFactoryResetAccessPointsV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".keep_static_ipconfig")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".keep_static_ipconfig")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".keep_static_ipconfig")))) { request.KeepStaticIPConfig = interfaceToBoolPtr(v) } @@ -190,7 +190,7 @@ func expandRequestWirelessAccessPointsFactoryResetRequestProvisionFactoryResetAc return &request } -func flattenWirelessFactoryResetAccessPointsItem(item *catalystcentersdkgo.ResponseWirelessFactoryResetAccessPointsResponse) []map[string]interface{} { +func flattenWirelessFactoryResetAccessPointsV1Item(item *catalystcentersdkgo.ResponseWirelessFactoryResetAccessPointsV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_access_points_provision.go b/catalystcenter/resource_wireless_access_points_provision.go index 672aae7..9b63bee 100644 --- a/catalystcenter/resource_wireless_access_points_provision.go +++ b/catalystcenter/resource_wireless_access_points_provision.go @@ -125,20 +125,18 @@ func resourceWirelessAccessPointsProvisionCreate(ctx context.Context, d *schema. client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestWirelessAccessPointsProvisionApProvision(ctx, "parameters.0", d) + request1 := expandRequestWirelessAccessPointsProvisionApProvisionV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.ApProvision(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.ApProvisionV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ApProvision", err)) + "Failure when executing ApProvisionV1", err)) return diags } @@ -146,7 +144,7 @@ func resourceWirelessAccessPointsProvisionCreate(ctx context.Context, d *schema. if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing APProvision", err)) + "Failure when executing APProvisionV1", err)) return diags } taskId := response1.Response.TaskID @@ -180,22 +178,24 @@ func resourceWirelessAccessPointsProvisionCreate(ctx context.Context, d *schema. } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing APProvision", err1)) + "Failure when executing APProvisionV1", err1)) return diags } } - vItem1 := flattenWirelessApProvisionItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessApProvisionV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ApProvision response", + "Failure when setting ApProvisionV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessAccessPointsProvisionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -210,10 +210,10 @@ func resourceWirelessAccessPointsProvisionDelete(ctx context.Context, d *schema. return diags } -func expandRequestWirelessAccessPointsProvisionApProvision(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessApProvision { - request := catalystcentersdkgo.RequestWirelessApProvision{} +func expandRequestWirelessAccessPointsProvisionApProvisionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessApProvisionV1 { + request := catalystcentersdkgo.RequestWirelessApProvisionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_devices")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_devices")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_devices")))) { - request.NetworkDevices = expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevicesArray(ctx, key+".network_devices", d) + request.NetworkDevices = expandRequestWirelessAccessPointsProvisionApProvisionV1NetworkDevicesArray(ctx, key+".network_devices", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rf_profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rf_profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rf_profile_name")))) { request.RfProfileName = interfaceToString(v) @@ -227,8 +227,8 @@ func expandRequestWirelessAccessPointsProvisionApProvision(ctx context.Context, return &request } -func expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevicesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessApProvisionNetworkDevices { - request := []catalystcentersdkgo.RequestWirelessApProvisionNetworkDevices{} +func expandRequestWirelessAccessPointsProvisionApProvisionV1NetworkDevicesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessApProvisionV1NetworkDevices { + request := []catalystcentersdkgo.RequestWirelessApProvisionV1NetworkDevices{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -239,7 +239,7 @@ func expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevicesArray(ct return nil } for item_no := range objs { - i := expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevices(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessAccessPointsProvisionApProvisionV1NetworkDevices(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -247,8 +247,8 @@ func expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevicesArray(ct return &request } -func expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessApProvisionNetworkDevices { - request := catalystcentersdkgo.RequestWirelessApProvisionNetworkDevices{} +func expandRequestWirelessAccessPointsProvisionApProvisionV1NetworkDevices(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessApProvisionV1NetworkDevices { + request := catalystcentersdkgo.RequestWirelessApProvisionV1NetworkDevices{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_id")))) { request.DeviceID = interfaceToString(v) } @@ -258,7 +258,7 @@ func expandRequestWirelessAccessPointsProvisionApProvisionNetworkDevices(ctx con return &request } -func flattenWirelessApProvisionItem(item *catalystcentersdkgo.ResponseWirelessApProvisionResponse) []map[string]interface{} { +func flattenWirelessApProvisionV1Item(item *catalystcentersdkgo.ResponseWirelessApProvisionV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_controllers_assign_managed_ap_locations.go b/catalystcenter/resource_wireless_controllers_assign_managed_ap_locations.go index 7ea8403..9780380 100644 --- a/catalystcenter/resource_wireless_controllers_assign_managed_ap_locations.go +++ b/catalystcenter/resource_wireless_controllers_assign_managed_ap_locations.go @@ -109,20 +109,18 @@ func resourceWirelessControllersAssignManagedApLocationsCreate(ctx context.Conte vDeviceID := resourceItem["device_id"] vvDeviceID := vDeviceID.(string) - request1 := expandRequestWirelessControllersAssignManagedApLocationsAssignManagedApLocationsForWLC(ctx, "parameters.0", d) + request1 := expandRequestWirelessControllersAssignManagedApLocationsAssignManagedApLocationsForWLCV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.AssignManagedApLocationsForWLC(vvDeviceID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.AssignManagedApLocationsForWLCV1(vvDeviceID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing AssignManagedApLocationsForWLC", err)) + "Failure when executing AssignManagedApLocationsForWLCV1", err)) return diags } @@ -130,7 +128,7 @@ func resourceWirelessControllersAssignManagedApLocationsCreate(ctx context.Conte if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing AssignManagedAPLocationsForWLC", err)) + "Failure when executing AssignManagedAPLocationsForWLCV1", err)) return diags } taskId := response1.Response.TaskID @@ -164,22 +162,24 @@ func resourceWirelessControllersAssignManagedApLocationsCreate(ctx context.Conte } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing AssignManagedAPLocationsForWLC", err1)) + "Failure when executing AssignManagedAPLocationsForWLCV1", err1)) return diags } } - vItem1 := flattenWirelessAssignManagedApLocationsForWLCItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessAssignManagedApLocationsForWLCV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting AssignManagedApLocationsForWLC response", + "Failure when setting AssignManagedApLocationsForWLCV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessControllersAssignManagedApLocationsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -194,8 +194,8 @@ func resourceWirelessControllersAssignManagedApLocationsDelete(ctx context.Conte return diags } -func expandRequestWirelessControllersAssignManagedApLocationsAssignManagedApLocationsForWLC(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessAssignManagedApLocationsForWLC { - request := catalystcentersdkgo.RequestWirelessAssignManagedApLocationsForWLC{} +func expandRequestWirelessControllersAssignManagedApLocationsAssignManagedApLocationsForWLCV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessAssignManagedApLocationsForWLCV1 { + request := catalystcentersdkgo.RequestWirelessAssignManagedApLocationsForWLCV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".primary_managed_aplocations_site_ids")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".primary_managed_aplocations_site_ids")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".primary_managed_aplocations_site_ids")))) { request.PrimaryManagedApLocationsSiteIDs = interfaceToSliceString(v) } @@ -205,7 +205,7 @@ func expandRequestWirelessControllersAssignManagedApLocationsAssignManagedApLoca return &request } -func flattenWirelessAssignManagedApLocationsForWLCItem(item *catalystcentersdkgo.ResponseWirelessAssignManagedApLocationsForWLCResponse) []map[string]interface{} { +func flattenWirelessAssignManagedApLocationsForWLCV1Item(item *catalystcentersdkgo.ResponseWirelessAssignManagedApLocationsForWLCV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_controllers_provision.go b/catalystcenter/resource_wireless_controllers_provision.go index 052ba29..f5ba3b9 100644 --- a/catalystcenter/resource_wireless_controllers_provision.go +++ b/catalystcenter/resource_wireless_controllers_provision.go @@ -184,20 +184,18 @@ func resourceWirelessControllersProvisionCreate(ctx context.Context, d *schema.R vDeviceID := resourceItem["device_id"] vvDeviceID := vDeviceID.(string) - request1 := expandRequestWirelessControllersProvisionWirelessControllerProvision(ctx, "parameters.0", d) + request1 := expandRequestWirelessControllersProvisionWirelessControllerProvisionV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.WirelessControllerProvision(vvDeviceID, request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.WirelessControllerProvisionV1(vvDeviceID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing WirelessControllerProvision", err)) + "Failure when executing WirelessControllerProvisionV1", err)) return diags } @@ -205,7 +203,7 @@ func resourceWirelessControllersProvisionCreate(ctx context.Context, d *schema.R if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing WirelessControllerProvision", err)) + "Failure when executing WirelessControllerProvisionV1", err)) return diags } taskId := response1.Response.TaskID @@ -239,22 +237,24 @@ func resourceWirelessControllersProvisionCreate(ctx context.Context, d *schema.R } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing WirelessControllerProvision", err1)) + "Failure when executing WirelessControllerProvisionV1", err1)) return diags } } - vItem1 := flattenWirelessWirelessControllerProvisionItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessWirelessControllerProvisionV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting WirelessControllerProvision response", + "Failure when setting WirelessControllerProvisionV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessControllersProvisionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -269,22 +269,22 @@ func resourceWirelessControllersProvisionDelete(ctx context.Context, d *schema.R return diags } -func expandRequestWirelessControllersProvisionWirelessControllerProvision(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessWirelessControllerProvision { - request := catalystcentersdkgo.RequestWirelessWirelessControllerProvision{} +func expandRequestWirelessControllersProvisionWirelessControllerProvisionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1 { + request := catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interfaces")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interfaces")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interfaces")))) { - request.Interfaces = expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfacesArray(ctx, key+".interfaces", d) + request.Interfaces = expandRequestWirelessControllersProvisionWirelessControllerProvisionV1InterfacesArray(ctx, key+".interfaces", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".skip_ap_provision")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".skip_ap_provision")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".skip_ap_provision")))) { request.SkipApProvision = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".rolling_ap_upgrade")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rolling_ap_upgrade")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rolling_ap_upgrade")))) { - request.RollingApUpgrade = expandRequestWirelessControllersProvisionWirelessControllerProvisionRollingApUpgrade(ctx, key+".rolling_ap_upgrade.0", d) + request.RollingApUpgrade = expandRequestWirelessControllersProvisionWirelessControllerProvisionV1RollingApUpgrade(ctx, key+".rolling_ap_upgrade.0", d) } return &request } -func expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfacesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessWirelessControllerProvisionInterfaces { - request := []catalystcentersdkgo.RequestWirelessWirelessControllerProvisionInterfaces{} +func expandRequestWirelessControllersProvisionWirelessControllerProvisionV1InterfacesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1Interfaces { + request := []catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1Interfaces{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -295,7 +295,7 @@ func expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfa return nil } for item_no := range objs { - i := expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfaces(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessControllersProvisionWirelessControllerProvisionV1Interfaces(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -303,8 +303,8 @@ func expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfa return &request } -func expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessWirelessControllerProvisionInterfaces { - request := catalystcentersdkgo.RequestWirelessWirelessControllerProvisionInterfaces{} +func expandRequestWirelessControllersProvisionWirelessControllerProvisionV1Interfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1Interfaces { + request := catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1Interfaces{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) } @@ -326,8 +326,8 @@ func expandRequestWirelessControllersProvisionWirelessControllerProvisionInterfa return &request } -func expandRequestWirelessControllersProvisionWirelessControllerProvisionRollingApUpgrade(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessWirelessControllerProvisionRollingApUpgrade { - request := catalystcentersdkgo.RequestWirelessWirelessControllerProvisionRollingApUpgrade{} +func expandRequestWirelessControllersProvisionWirelessControllerProvisionV1RollingApUpgrade(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1RollingApUpgrade { + request := catalystcentersdkgo.RequestWirelessWirelessControllerProvisionV1RollingApUpgrade{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_rolling_ap_upgrade")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_rolling_ap_upgrade")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_rolling_ap_upgrade")))) { request.EnableRollingApUpgrade = interfaceToBoolPtr(v) } @@ -337,7 +337,7 @@ func expandRequestWirelessControllersProvisionWirelessControllerProvisionRolling return &request } -func flattenWirelessWirelessControllerProvisionItem(item *catalystcentersdkgo.ResponseWirelessWirelessControllerProvisionResponse) []map[string]interface{} { +func flattenWirelessWirelessControllerProvisionV1Item(item *catalystcentersdkgo.ResponseWirelessWirelessControllerProvisionV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_provision.go b/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_provision.go index 58c7ea5..84656df 100644 --- a/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_provision.go +++ b/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_provision.go @@ -201,20 +201,18 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityProvisionCreate(ct client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvision(ctx, "parameters.0", d) + request1 := expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.MobilityProvision(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.MobilityProvisionV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing MobilityProvision", err)) + "Failure when executing MobilityProvisionV1", err)) return diags } @@ -222,7 +220,7 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityProvisionCreate(ct if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing MobilityProvision", err)) + "Failure when executing MobilityProvisionV1", err)) return diags } taskId := response1.Response.TaskID @@ -256,22 +254,24 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityProvisionCreate(ct } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing MobilityProvision", err1)) + "Failure when executing MobilityProvisionV1", err1)) return diags } } - vItem1 := flattenWirelessMobilityProvisionItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessMobilityProvisionV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting MobilityProvision response", + "Failure when setting MobilityProvisionV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessControllersWirelessMobilityGroupsMobilityProvisionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -286,8 +286,8 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityProvisionDelete(ct return diags } -func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvision(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessMobilityProvision { - request := catalystcentersdkgo.RequestWirelessMobilityProvision{} +func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessMobilityProvisionV1 { + request := catalystcentersdkgo.RequestWirelessMobilityProvisionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".mobility_group_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mobility_group_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mobility_group_name")))) { request.MobilityGroupName = interfaceToString(v) } @@ -307,13 +307,13 @@ func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobi request.DataLinkEncryption = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".mobility_peers")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".mobility_peers")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".mobility_peers")))) { - request.MobilityPeers = expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionMobilityPeersArray(ctx, key+".mobility_peers", d) + request.MobilityPeers = expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionV1MobilityPeersArray(ctx, key+".mobility_peers", d) } return &request } -func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionMobilityPeersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessMobilityProvisionMobilityPeers { - request := []catalystcentersdkgo.RequestWirelessMobilityProvisionMobilityPeers{} +func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionV1MobilityPeersArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessMobilityProvisionV1MobilityPeers { + request := []catalystcentersdkgo.RequestWirelessMobilityProvisionV1MobilityPeers{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -324,7 +324,7 @@ func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobi return nil } for item_no := range objs { - i := expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionMobilityPeers(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionV1MobilityPeers(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -332,8 +332,8 @@ func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobi return &request } -func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionMobilityPeers(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessMobilityProvisionMobilityPeers { - request := catalystcentersdkgo.RequestWirelessMobilityProvisionMobilityPeers{} +func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobilityProvisionV1MobilityPeers(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessMobilityProvisionV1MobilityPeers { + request := catalystcentersdkgo.RequestWirelessMobilityProvisionV1MobilityPeers{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".peer_ip")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".peer_ip")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".peer_ip")))) { request.PeerIP = interfaceToString(v) } @@ -361,7 +361,7 @@ func expandRequestWirelessControllersWirelessMobilityGroupsMobilityProvisionMobi return &request } -func flattenWirelessMobilityProvisionItem(item *catalystcentersdkgo.ResponseWirelessMobilityProvisionResponse) []map[string]interface{} { +func flattenWirelessMobilityProvisionV1Item(item *catalystcentersdkgo.ResponseWirelessMobilityProvisionV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_reset.go b/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_reset.go index 82fb9ad..9e7ee3b 100644 --- a/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_reset.go +++ b/catalystcenter/resource_wireless_controllers_wireless_mobility_groups_mobility_reset.go @@ -81,20 +81,18 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityResetCreate(ctx co client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestWirelessControllersWirelessMobilityGroupsMobilityResetMobilityReset(ctx, "parameters.0", d) + request1 := expandRequestWirelessControllersWirelessMobilityGroupsMobilityResetMobilityResetV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.MobilityReset(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.MobilityResetV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing MobilityReset", err)) + "Failure when executing MobilityResetV1", err)) return diags } @@ -102,7 +100,7 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityResetCreate(ctx co if response1.Response == nil { diags = append(diags, diagError( - "Failure when executing MobilityReset", err)) + "Failure when executing MobilityResetV1", err)) return diags } taskId := response1.Response.TaskID @@ -136,22 +134,24 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityResetCreate(ctx co } err1 := errors.New(errorMsg) diags = append(diags, diagError( - "Failure when executing MobilityReset", err1)) + "Failure when executing MobilityResetV1", err1)) return diags } } - vItem1 := flattenWirelessMobilityResetItem(response1.Response) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessMobilityResetV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting MobilityReset response", + "Failure when setting MobilityResetV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessControllersWirelessMobilityGroupsMobilityResetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -166,15 +166,15 @@ func resourceWirelessControllersWirelessMobilityGroupsMobilityResetDelete(ctx co return diags } -func expandRequestWirelessControllersWirelessMobilityGroupsMobilityResetMobilityReset(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessMobilityReset { - request := catalystcentersdkgo.RequestWirelessMobilityReset{} +func expandRequestWirelessControllersWirelessMobilityGroupsMobilityResetMobilityResetV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessMobilityResetV1 { + request := catalystcentersdkgo.RequestWirelessMobilityResetV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".network_device_id")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".network_device_id")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".network_device_id")))) { request.NetworkDeviceID = interfaceToString(v) } return &request } -func flattenWirelessMobilityResetItem(item *catalystcentersdkgo.ResponseWirelessMobilityResetResponse) []map[string]interface{} { +func flattenWirelessMobilityResetV1Item(item *catalystcentersdkgo.ResponseWirelessMobilityResetV1Response) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_dynamic_interface.go b/catalystcenter/resource_wireless_dynamic_interface.go index fce35ad..6b8bbd4 100644 --- a/catalystcenter/resource_wireless_dynamic_interface.go +++ b/catalystcenter/resource_wireless_dynamic_interface.go @@ -89,7 +89,7 @@ func resourceWirelessDynamicInterfaceCreate(ctx context.Context, d *schema.Resou var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterface(ctx, "parameters.0", d) + request1 := expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterfaceV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -97,7 +97,7 @@ func resourceWirelessDynamicInterfaceCreate(ctx context.Context, d *schema.Resou vInterfaceName := resourceItem["interface_name"] vvInterfaceName := interfaceToString(vInterfaceName) - queryParams1 := catalystcentersdkgo.GetDynamicInterfaceQueryParams{} + queryParams1 := catalystcentersdkgo.GetDynamicInterfaceV1QueryParams{} queryParams1.InterfaceName = vvInterfaceName @@ -173,7 +173,7 @@ func resourceWirelessDynamicInterfaceRead(ctx context.Context, d *schema.Resourc selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetDynamicInterface") - queryParams1 := catalystcentersdkgo.GetDynamicInterfaceQueryParams{} + queryParams1 := catalystcentersdkgo.GetDynamicInterfaceV1QueryParams{} if okInterfaceName { queryParams1.InterfaceName = vInterfaceName @@ -197,7 +197,7 @@ func resourceWirelessDynamicInterfaceRead(ctx context.Context, d *schema.Resourc log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetDynamicInterfaceItems(response1) + vItem1 := flattenWirelessGetDynamicInterfaceV1Items(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetDynamicInterface search response", @@ -217,7 +217,7 @@ func resourceWirelessDynamicInterfaceUpdate(ctx context.Context, d *schema.Resou resourceID := d.Id() resourceMap := separateResourceID(resourceID) - request1 := expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterface(ctx, "parameters.0", d) + request1 := expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterfaceV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -225,7 +225,7 @@ func resourceWirelessDynamicInterfaceUpdate(ctx context.Context, d *schema.Resou vInterfaceName := resourceMap["interface_name"] vvInterfaceName := interfaceToString(vInterfaceName) - queryParams1 := catalystcentersdkgo.GetDynamicInterfaceQueryParams{} + queryParams1 := catalystcentersdkgo.GetDynamicInterfaceV1QueryParams{} queryParams1.InterfaceName = vvInterfaceName @@ -300,7 +300,7 @@ func resourceWirelessDynamicInterfaceDelete(ctx context.Context, d *schema.Resou resourceMap := separateResourceID(resourceID) vInterfaceName := resourceMap["interface_name"] - queryParams1 := catalystcentersdkgo.GetDynamicInterfaceQueryParams{} + queryParams1 := catalystcentersdkgo.GetDynamicInterfaceV1QueryParams{} queryParams1.InterfaceName = vInterfaceName item, err := searchWirelessGetDynamicInterface(m, queryParams1) var vvInterfaceName string @@ -321,7 +321,7 @@ func resourceWirelessDynamicInterfaceDelete(ctx context.Context, d *schema.Resou vvInterfaceName = queryParams1.InterfaceName } - _, restyResp1, err := client.Wireless.DeleteDynamicInterface(nil, &catalystcentersdkgo.DeleteDynamicInterfaceQueryParams{ + _, restyResp1, err := client.Wireless.DeleteDynamicInterface(nil, &catalystcentersdkgo.DeleteDynamicInterfaceV1QueryParams{ InterfaceName: vvInterfaceName, }) if err != nil { @@ -344,8 +344,8 @@ func resourceWirelessDynamicInterfaceDelete(ctx context.Context, d *schema.Resou return diags } -func expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterface(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateUpdateDynamicInterface { - request := catalystcentersdkgo.RequestWirelessCreateUpdateDynamicInterface{} +func expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterfaceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateUpdateDynamicInterfaceV1 { + request := catalystcentersdkgo.RequestWirelessCreateUpdateDynamicInterfaceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) } @@ -355,15 +355,14 @@ func expandRequestWirelessDynamicInterfaceCreateUpdateDynamicInterface(ctx conte if isEmptyValue(reflect.ValueOf(request)) { return nil } - return &request } -func searchWirelessGetDynamicInterface(m interface{}, queryParams catalystcentersdkgo.GetDynamicInterfaceQueryParams) (*catalystcentersdkgo.ResponseItemWirelessGetDynamicInterface, error) { +func searchWirelessGetDynamicInterface(m interface{}, queryParams catalystcentersdkgo.GetDynamicInterfaceV1QueryParams) (*catalystcentersdkgo.ResponseItemWirelessGetDynamicInterfaceV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemWirelessGetDynamicInterface - var ite *catalystcentersdkgo.ResponseWirelessGetDynamicInterface + var foundItem *catalystcentersdkgo.ResponseItemWirelessGetDynamicInterfaceV1 + var ite *catalystcentersdkgo.ResponseWirelessGetDynamicInterfaceV1 ite, _, err = client.Wireless.GetDynamicInterface(&queryParams) if err != nil { return foundItem, err @@ -379,7 +378,7 @@ func searchWirelessGetDynamicInterface(m interface{}, queryParams catalystcenter for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.InterfaceName == queryParams.InterfaceName { - var getItem *catalystcentersdkgo.ResponseItemWirelessGetDynamicInterface + var getItem *catalystcentersdkgo.ResponseItemWirelessGetDynamicInterfaceV1 getItem = &item foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_wireless_enterprise_ssid.go b/catalystcenter/resource_wireless_enterprise_ssid.go index 59e9f58..db5b8c0 100644 --- a/catalystcenter/resource_wireless_enterprise_ssid.go +++ b/catalystcenter/resource_wireless_enterprise_ssid.go @@ -595,13 +595,13 @@ func resourceWirelessEnterpriseSSIDCreate(ctx context.Context, d *schema.Resourc var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSID(ctx, "parameters.0", d) + request1 := expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vSSIDName := resourceItem["name"] vvSSIDName := interfaceToString(vSSIDName) - queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDV1QueryParams{} queryParams1.SSIDName = vvSSIDName getResponse2, err := searchWirelessGetEnterpriseSSID(m, queryParams1) if err == nil && getResponse2 != nil { @@ -673,7 +673,7 @@ func resourceWirelessEnterpriseSSIDRead(ctx context.Context, d *schema.ResourceD selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetEnterpriseSSID") - queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDV1QueryParams{} if okSSIDName { queryParams1.SSIDName = vSSIDName @@ -697,7 +697,7 @@ func resourceWirelessEnterpriseSSIDRead(ctx context.Context, d *schema.ResourceD log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessGetEnterpriseSSIDItems(response1) + vItem1 := flattenWirelessGetEnterpriseSSIDV1Items(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetEnterpriseSSID search response", @@ -707,7 +707,7 @@ func resourceWirelessEnterpriseSSIDRead(ctx context.Context, d *schema.ResourceD response1NoPointer := *response1 responseItemSSID := *response1NoPointer[0].SSIDDetails responseItemSSIDItem := responseItemSSID[0] - request := expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSID(ctx, "parameters.0", d) + request := expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1(ctx, "parameters.0", d) vParameters := map[string]interface{}{ "basic_service_set_client_idle_timeout": request.BasicServiceSetClientIDleTimeout, "client_exclusion_timeout": request.ClientExclusionTimeout, @@ -751,7 +751,7 @@ func resourceWirelessEnterpriseSSIDUpdate(ctx context.Context, d *schema.Resourc resourceMap := separateResourceID(resourceID) vSSIDName := resourceMap["name"] - queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDV1QueryParams{} queryParams1.SSIDName = vSSIDName item, err := searchWirelessGetEnterpriseSSID(m, queryParams1) if err != nil || item == nil { @@ -822,7 +822,7 @@ func resourceWirelessEnterpriseSSIDUpdate(ctx context.Context, d *schema.Resourc } } log.Printf("[DEBUG] Name used for update operation %v", queryParams1) - request1 := expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSID(ctx, "parameters.0", d) + request1 := expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -890,7 +890,7 @@ func resourceWirelessEnterpriseSSIDDelete(ctx context.Context, d *schema.Resourc resourceMap := separateResourceID(resourceID) vSSIDName := resourceMap["name"] - queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDQueryParams{} + queryParams1 := catalystcentersdkgo.GetEnterpriseSSIDV1QueryParams{} queryParams1.SSIDName = vSSIDName var vvSSIDName string item, err := searchWirelessGetEnterpriseSSID(m, queryParams1) @@ -955,8 +955,9 @@ func resourceWirelessEnterpriseSSIDDelete(ctx context.Context, d *schema.Resourc return diags } -func expandRequestWirelessPskOverridePSKOverride(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessPSKOverride { - request := catalystcentersdkgo.RequestWirelessPSKOverride{} + +func expandRequestWirelessPskOverridePSKOverride(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessPSKOverrideV1 { + request := catalystcentersdkgo.RequestWirelessPSKOverrideV1{} if v := expandRequestWirelessPskOverridePSKOverrideItemArray(ctx, key, d); v != nil { request = *v } @@ -967,8 +968,8 @@ func expandRequestWirelessPskOverridePSKOverride(ctx context.Context, key string return &request } -func expandRequestWirelessPskOverridePSKOverrideItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessPSKOverride { - request := []catalystcentersdkgo.RequestItemWirelessPSKOverride{} +func expandRequestWirelessPskOverridePSKOverrideItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessPSKOverrideV1 { + request := []catalystcentersdkgo.RequestItemWirelessPSKOverrideV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -991,8 +992,8 @@ func expandRequestWirelessPskOverridePSKOverrideItemArray(ctx context.Context, k return &request } -func expandRequestWirelessPskOverridePSKOverrideItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessPSKOverride { - request := catalystcentersdkgo.RequestItemWirelessPSKOverride{} +func expandRequestWirelessPskOverridePSKOverrideItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessPSKOverrideV1 { + request := catalystcentersdkgo.RequestItemWirelessPSKOverrideV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_name")))) { request.SSID = interfaceToString(v) } @@ -1008,8 +1009,9 @@ func expandRequestWirelessPskOverridePSKOverrideItem(ctx context.Context, key st return &request } -func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateEnterpriseSSID { - request := catalystcentersdkgo.RequestWirelessCreateEnterpriseSSID{} + +func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDV1 { + request := catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -1083,7 +1085,7 @@ func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSID(ctx context.Context request.ProtectedManagementFrame = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multi_psk_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multi_psk_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multi_psk_settings")))) { - request.MultipSKSettings = expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettingsArray(ctx, key+".multi_psk_settings", d) + request.MultipSKSettings = expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1MultipSKSettingsArray(ctx, key+".multi_psk_settings", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".client_rate_limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".client_rate_limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".client_rate_limit")))) { request.ClientRateLimit = interfaceToFloat64Ptr(v) @@ -1112,8 +1114,8 @@ func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSID(ctx context.Context return &request } -func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDMultipSKSettings { - request := []catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDMultipSKSettings{} +func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1MultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDV1MultipSKSettings { + request := []catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDV1MultipSKSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1124,7 +1126,7 @@ func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettingsArra return nil } for item_no := range objs { - i := expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1MultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1135,8 +1137,8 @@ func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettingsArra return &request } -func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDMultipSKSettings { - request := catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDMultipSKSettings{} +func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDV1MultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDV1MultipSKSettings { + request := catalystcentersdkgo.RequestWirelessCreateEnterpriseSSIDV1MultipSKSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".priority")))) { request.Priority = interfaceToIntPtr(v) } @@ -1152,8 +1154,8 @@ func expandRequestWirelessEnterpriseSSIDCreateEnterpriseSSIDMultipSKSettings(ctx return &request } -func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSID { - request := catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSID{} +func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDV1 { + request := catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -1227,7 +1229,7 @@ func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSID(ctx context.Context request.ProtectedManagementFrame = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multi_psk_settings")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multi_psk_settings")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multi_psk_settings")))) { - request.MultipSKSettings = expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettingsArray(ctx, key+".multi_psk_settings", d) + request.MultipSKSettings = expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDV1MultipSKSettingsArray(ctx, key+".multi_psk_settings", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".client_rate_limit")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".client_rate_limit")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".client_rate_limit")))) { request.ClientRateLimit = interfaceToFloat64Ptr(v) @@ -1256,8 +1258,8 @@ func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSID(ctx context.Context return &request } -func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDMultipSKSettings { - request := []catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDMultipSKSettings{} +func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDV1MultipSKSettingsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDV1MultipSKSettings { + request := []catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDV1MultipSKSettings{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -1268,7 +1270,7 @@ func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettingsArra return nil } for item_no := range objs { - i := expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDV1MultipSKSettings(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -1279,8 +1281,8 @@ func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettingsArra return &request } -func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDMultipSKSettings { - request := catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDMultipSKSettings{} +func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDV1MultipSKSettings(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDV1MultipSKSettings { + request := catalystcentersdkgo.RequestWirelessUpdateEnterpriseSSIDV1MultipSKSettings{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".priority")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".priority")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".priority")))) { request.Priority = interfaceToIntPtr(v) } @@ -1296,11 +1298,11 @@ func expandRequestWirelessEnterpriseSSIDUpdateEnterpriseSSIDMultipSKSettings(ctx return &request } -func searchWirelessGetEnterpriseSSID(m interface{}, queryParams catalystcentersdkgo.GetEnterpriseSSIDQueryParams) (*catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDSSIDDetails, error) { +func searchWirelessGetEnterpriseSSID(m interface{}, queryParams catalystcentersdkgo.GetEnterpriseSSIDV1QueryParams) (*catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDV1SSIDDetails, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDSSIDDetails - var ite *catalystcentersdkgo.ResponseWirelessGetEnterpriseSSID + var foundItem *catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDV1SSIDDetails + var ite *catalystcentersdkgo.ResponseWirelessGetEnterpriseSSIDV1 ite, _, err = client.Wireless.GetEnterpriseSSID(&queryParams) if err != nil { return foundItem, err @@ -1318,10 +1320,8 @@ func searchWirelessGetEnterpriseSSID(m interface{}, queryParams catalystcentersd itemsCopy2 := *item.SSIDDetails for _, item := range itemsCopy2 { if item.Name == queryParams.SSIDName { - var getItem *catalystcentersdkgo.ResponseItemWirelessGetEnterpriseSSIDSSIDDetails - getItem = &item - foundItem = getItem - return foundItem, err + + return &item, err } } } diff --git a/catalystcenter/resource_wireless_profile.go b/catalystcenter/resource_wireless_profile.go index d89a65b..7a9cde1 100644 --- a/catalystcenter/resource_wireless_profile.go +++ b/catalystcenter/resource_wireless_profile.go @@ -23,7 +23,7 @@ func resourceWirelessProfile() *schema.Resource { - Updates the wireless Network Profile with updated details provided. All sites to be present in the network profile should be provided. -- Creates Wireless Network Profile on Cisco Catalyst Center and associates sites and SSIDs to it. +- Creates Wireless Network Profile on Cisco DNA Center and associates sites and SSIDs to it. `, CreateContext: resourceWirelessProfileCreate, @@ -254,7 +254,7 @@ func resourceWirelessProfileCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics //resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessProfileCreateWirelessProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessProfileCreateWirelessProfileV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -269,7 +269,7 @@ func resourceWirelessProfileCreate(ctx context.Context, d *schema.ResourceData, } } - queryParams1 := catalystcentersdkgo.GetWirelessProfileQueryParams{} + queryParams1 := catalystcentersdkgo.GetWirelessProfileV1QueryParams{} queryParams1.ProfileName = vvName getResponse2, err := searchWirelessGetWirelessProfile(m, queryParams1) if getResponse2 != nil { @@ -344,7 +344,7 @@ func resourceWirelessProfileRead(ctx context.Context, d *schema.ResourceData, m selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: GetWirelessProfile") - queryParams1 := catalystcentersdkgo.GetWirelessProfileQueryParams{} + queryParams1 := catalystcentersdkgo.GetWirelessProfileV1QueryParams{} if okProfileName { queryParams1.ProfileName = vProfileName @@ -379,9 +379,9 @@ func resourceWirelessProfileRead(ctx context.Context, d *schema.ResourceData, m // response1 = &resp - request1 := expandRequestWirelessProfileCreateWirelessProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessProfileCreateWirelessProfileV1(ctx, "parameters.0", d) *resp[0].ProfileDetails.SSIDDetails = *orderSSIDDetails(*request1.ProfileDetails.SSIDDetails, *resp[0].ProfileDetails.SSIDDetails) - vItem1 := flattenWirelessGetWirelessProfileItems(response1) + vItem1 := flattenWirelessGetWirelessProfileV1Items(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetWirelessProfile search response", @@ -418,7 +418,7 @@ func resourceWirelessProfileUpdate(ctx context.Context, d *schema.ResourceData, // } // } // } - queryParams1 := catalystcentersdkgo.GetWirelessProfileQueryParams{} + queryParams1 := catalystcentersdkgo.GetWirelessProfileV1QueryParams{} queryParams1.ProfileName = vvName item, err := searchWirelessGetWirelessProfile(m, queryParams1) if err != nil || item == nil { @@ -431,7 +431,7 @@ func resourceWirelessProfileUpdate(ctx context.Context, d *schema.ResourceData, // NOTE: Consider adding getAllItems and search function to get missing params if d.HasChange("parameters") { log.Printf("[DEBUG] Name used for update operation %v", queryParams1) - request1 := expandRequestWirelessProfileUpdateWirelessProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessProfileUpdateWirelessProfileV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -506,7 +506,7 @@ func resourceWirelessProfileDelete(ctx context.Context, d *schema.ResourceData, } } } - queryParams1 := catalystcentersdkgo.GetWirelessProfileQueryParams{} + queryParams1 := catalystcentersdkgo.GetWirelessProfileV1QueryParams{} queryParams1.ProfileName = vvName // item, err := searchWirelessGetWirelessProfile(m, queryParams1) // var vvWirelessProfileName string @@ -570,17 +570,17 @@ func resourceWirelessProfileDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestWirelessProfileCreateWirelessProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfile { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfile{} - request.ProfileDetails = expandRequestWirelessProfileCreateWirelessProfileProfileDetails(ctx, key+".profile_details.0", d) +func expandRequestWirelessProfileCreateWirelessProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1 { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1{} + request.ProfileDetails = expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetails(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestWirelessProfileCreateWirelessProfileProfileDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetails { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetails{} +func expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetails { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -588,7 +588,7 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetails(ctx context request.Sites = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_details")))) { - request.SSIDDetails = expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsArray(ctx, key+".ssid_details", d) + request.SSIDDetails = expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetailsSSIDDetailsArray(ctx, key+".ssid_details", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -596,8 +596,8 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetails(ctx context return &request } -func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetails { - request := []catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetails{} +func expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetailsSSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetails { + request := []catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetails{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -608,7 +608,7 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsA return nil } for item_no := range objs { - i := expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetailsSSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -619,8 +619,8 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsA return &request } -func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetails { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetails{} +func expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetailsSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetails { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -628,7 +628,7 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetails( request.EnableFabric = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".flex_connect")))) { - request.FlexConnect = expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) + request.FlexConnect = expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) @@ -645,8 +645,8 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetails( return &request } -func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetailsFlexConnect { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetailsFlexConnect{} +func expandRequestWirelessProfileCreateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_flex_connect")))) { request.EnableFlexConnect = interfaceToBoolPtr(v) } @@ -659,17 +659,17 @@ func expandRequestWirelessProfileCreateWirelessProfileProfileDetailsSSIDDetailsF return &request } -func expandRequestWirelessProfileUpdateWirelessProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfile { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfile{} - request.ProfileDetails = expandRequestWirelessProfileUpdateWirelessProfileProfileDetails(ctx, key, d) +func expandRequestWirelessProfileUpdateWirelessProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1 { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1{} + request.ProfileDetails = expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetails(ctx, key, d) if isEmptyValue(reflect.ValueOf(request)) { return nil } return &request } -func expandRequestWirelessProfileUpdateWirelessProfileProfileDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetails { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetails{} +func expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetails { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -677,7 +677,7 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetails(ctx context request.Sites = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_details")))) { - request.SSIDDetails = expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsArray(ctx, key+".ssid_details", d) + request.SSIDDetails = expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetailsSSIDDetailsArray(ctx, key+".ssid_details", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -685,8 +685,8 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetails(ctx context return &request } -func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetailsSSIDDetails { - request := []catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetailsSSIDDetails{} +func expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetailsSSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetailsSSIDDetails { + request := []catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetailsSSIDDetails{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -697,7 +697,7 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsA return nil } for item_no := range objs { - i := expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetailsSSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -708,8 +708,8 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsA return &request } -func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetailsSSIDDetails { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetailsSSIDDetails{} +func expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetailsSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetailsSSIDDetails { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetailsSSIDDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -717,7 +717,7 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetails( request.EnableFabric = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".flex_connect")))) { - request.FlexConnect = expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) + request.FlexConnect = expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) @@ -734,8 +734,8 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetails( return &request } -func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetailsSSIDDetailsFlexConnect { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileProfileDetailsSSIDDetailsFlexConnect{} +func expandRequestWirelessProfileUpdateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileV1ProfileDetailsSSIDDetailsFlexConnect{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_flex_connect")))) { request.EnableFlexConnect = interfaceToBoolPtr(v) } @@ -748,11 +748,11 @@ func expandRequestWirelessProfileUpdateWirelessProfileProfileDetailsSSIDDetailsF return &request } -func searchWirelessGetWirelessProfile(m interface{}, queryParams catalystcentersdkgo.GetWirelessProfileQueryParams) (*catalystcentersdkgo.ResponseItemWirelessGetWirelessProfile, error) { +func searchWirelessGetWirelessProfile(m interface{}, queryParams catalystcentersdkgo.GetWirelessProfileV1QueryParams) (*catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfile - var ite *catalystcentersdkgo.ResponseWirelessGetWirelessProfile + var foundItem *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1 + var ite *catalystcentersdkgo.ResponseWirelessGetWirelessProfileV1 ite, _, err = client.Wireless.GetWirelessProfile(&queryParams) if err != nil { return foundItem, err @@ -768,7 +768,7 @@ func searchWirelessGetWirelessProfile(m interface{}, queryParams catalystcenters for _, item := range itemsCopy { // Call get by _ method and set value to foundItem and return if item.ProfileDetails.Name == queryParams.ProfileName { - var getItem *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfile + var getItem *catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1 getItem = &item foundItem = getItem return foundItem, err @@ -777,10 +777,10 @@ func searchWirelessGetWirelessProfile(m interface{}, queryParams catalystcenters return foundItem, err } -func orderSSIDDetails(requestSSID []catalystcentersdkgo.RequestWirelessCreateWirelessProfileProfileDetailsSSIDDetails, responseSSID []catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetails) *[]catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetails { - var notFound []catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetails +func orderSSIDDetails(requestSSID []catalystcentersdkgo.RequestWirelessCreateWirelessProfileV1ProfileDetailsSSIDDetails, responseSSID []catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetails) *[]catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetails { + var notFound []catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetails - var orderedResponse []catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetails + var orderedResponse []catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetails for i := 0; i < len(requestSSID); i++ { found1 := false for j := 0; j < len(responseSSID); j++ { @@ -791,7 +791,7 @@ func orderSSIDDetails(requestSSID []catalystcentersdkgo.RequestWirelessCreateWir } } if !found1 { - orderedResponse = append(orderedResponse, catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileProfileDetailsSSIDDetails{}) + orderedResponse = append(orderedResponse, catalystcentersdkgo.ResponseItemWirelessGetWirelessProfileV1ProfileDetailsSSIDDetails{}) } } diff --git a/catalystcenter/resource_wireless_profiles.go b/catalystcenter/resource_wireless_profiles.go index 1d86255..73aeece 100644 --- a/catalystcenter/resource_wireless_profiles.go +++ b/catalystcenter/resource_wireless_profiles.go @@ -234,7 +234,7 @@ func resourceWirelessProfilesCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessProfilesCreateWirelessProfile2(ctx, "parameters.0", d) + request1 := expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID, okID := resourceItem["id"] @@ -250,7 +250,7 @@ func resourceWirelessProfilesCreate(ctx context.Context, d *schema.ResourceData, return resourceWirelessProfilesRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.GetWirelessProfilesQueryParams{} + queryParamImport := catalystcentersdkgo.GetWirelessProfilesV1QueryParams{} response2, err := searchWirelessGetWirelessProfiles(m, queryParamImport, vvName) if response2 != nil && err == nil { @@ -260,7 +260,7 @@ func resourceWirelessProfilesCreate(ctx context.Context, d *schema.ResourceData, return resourceWirelessProfilesRead(ctx, d, m) } } - resp1, restyResp1, err := client.Wireless.CreateWirelessProfile2(request1) + resp1, restyResp1, err := client.Wireless.CreateWirelessProfileConnectivity(request1) if err != nil || resp1 == nil { if restyResp1 != nil { diags = append(diags, diagErrorWithResponse( @@ -299,7 +299,7 @@ func resourceWirelessProfilesCreate(ctx context.Context, d *schema.ResourceData, return diags } } - queryParamValidate := catalystcentersdkgo.GetWirelessProfilesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetWirelessProfilesV1QueryParams{} item3, err := searchWirelessGetWirelessProfiles(m, queryParamValidate, vvID) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( @@ -340,7 +340,7 @@ func resourceWirelessProfilesRead(ctx context.Context, d *schema.ResourceData, m } // Review flatten function used - vItem1 := flattenWirelessGetWirelessProfileByIDItem(response1.Response) + vItem1 := flattenWirelessGetWirelessProfileByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetWirelessProfiles search response", @@ -362,9 +362,9 @@ func resourceWirelessProfilesUpdate(ctx context.Context, d *schema.ResourceData, vvID := resourceMap["id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestWirelessProfilesUpdateWirelessProfile2(ctx, "parameters.0", d) + request1 := expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - response1, restyResp1, err := client.Wireless.UpdateWirelessProfile2(vvID, request1) + response1, restyResp1, err := client.Wireless.UpdateWirelessProfileConnectivity(vvID, request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for update operation => %v", restyResp1.String()) @@ -424,7 +424,7 @@ func resourceWirelessProfilesDelete(ctx context.Context, d *schema.ResourceData, vvID := resourceMap["id"] - response1, restyResp1, err := client.Wireless.DeleteWirelessProfile2(vvID) + response1, restyResp1, err := client.Wireless.DeleteWirelessProfileConnectivityV1(vvID) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] resty response for delete operation => %v", restyResp1.String()) @@ -474,13 +474,13 @@ func resourceWirelessProfilesDelete(ctx context.Context, d *schema.ResourceData, return diags } -func expandRequestWirelessProfilesCreateWirelessProfile2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfile2 { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfile2{} +func expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1 { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".wireless_profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wireless_profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wireless_profile_name")))) { request.WirelessProfileName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_details")))) { - request.SSIDDetails = expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsArray(ctx, key+".ssid_details", d) + request.SSIDDetails = expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1SSIDDetailsArray(ctx, key+".ssid_details", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -488,8 +488,8 @@ func expandRequestWirelessProfilesCreateWirelessProfile2(ctx context.Context, ke return &request } -func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateWirelessProfile2SSIDDetails { - request := []catalystcentersdkgo.RequestWirelessCreateWirelessProfile2SSIDDetails{} +func expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1SSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1SSIDDetails { + request := []catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1SSIDDetails{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -500,7 +500,7 @@ func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsArray(ctx con return nil } for item_no := range objs { - i := expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1SSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -511,13 +511,13 @@ func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsArray(ctx con return &request } -func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfile2SSIDDetails { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfile2SSIDDetails{} +func expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1SSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1SSIDDetails { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1SSIDDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_name")))) { request.SSIDName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".flex_connect")))) { - request.FlexConnect = expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) + request.FlexConnect = expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1SSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_fabric")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_fabric")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_fabric")))) { request.EnableFabric = interfaceToBoolPtr(v) @@ -537,8 +537,8 @@ func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetails(ctx context. return &request } -func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfile2SSIDDetailsFlexConnect { - request := catalystcentersdkgo.RequestWirelessCreateWirelessProfile2SSIDDetailsFlexConnect{} +func expandRequestWirelessProfilesCreateWirelessProfileConnectivityV1SSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1SSIDDetailsFlexConnect { + request := catalystcentersdkgo.RequestWirelessCreateWirelessProfileConnectivityV1SSIDDetailsFlexConnect{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_flex_connect")))) { request.EnableFlexConnect = interfaceToBoolPtr(v) } @@ -551,13 +551,13 @@ func expandRequestWirelessProfilesCreateWirelessProfile2SSIDDetailsFlexConnect(c return &request } -func expandRequestWirelessProfilesUpdateWirelessProfile2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2 { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2{} +func expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1 { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".wireless_profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".wireless_profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".wireless_profile_name")))) { request.WirelessProfileName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_details")))) { - request.SSIDDetails = expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsArray(ctx, key+".ssid_details", d) + request.SSIDDetails = expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1SSIDDetailsArray(ctx, key+".ssid_details", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -565,8 +565,8 @@ func expandRequestWirelessProfilesUpdateWirelessProfile2(ctx context.Context, ke return &request } -func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2SSIDDetails { - request := []catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2SSIDDetails{} +func expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1SSIDDetailsArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1SSIDDetails { + request := []catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1SSIDDetails{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -577,7 +577,7 @@ func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsArray(ctx con return nil } for item_no := range objs { - i := expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1SSIDDetails(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -588,13 +588,13 @@ func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsArray(ctx con return &request } -func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2SSIDDetails { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2SSIDDetails{} +func expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1SSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1SSIDDetails { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1SSIDDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_name")))) { request.SSIDName = interfaceToString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".flex_connect")))) { - request.FlexConnect = expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) + request.FlexConnect = expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1SSIDDetailsFlexConnect(ctx, key+".flex_connect.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_fabric")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_fabric")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_fabric")))) { request.EnableFabric = interfaceToBoolPtr(v) @@ -614,8 +614,8 @@ func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetails(ctx context. return &request } -func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2SSIDDetailsFlexConnect { - request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfile2SSIDDetailsFlexConnect{} +func expandRequestWirelessProfilesUpdateWirelessProfileConnectivityV1SSIDDetailsFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1SSIDDetailsFlexConnect { + request := catalystcentersdkgo.RequestWirelessUpdateWirelessProfileConnectivityV1SSIDDetailsFlexConnect{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_flex_connect")))) { request.EnableFlexConnect = interfaceToBoolPtr(v) } @@ -628,10 +628,10 @@ func expandRequestWirelessProfilesUpdateWirelessProfile2SSIDDetailsFlexConnect(c return &request } -func searchWirelessGetWirelessProfiles(m interface{}, queryParams catalystcentersdkgo.GetWirelessProfilesQueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetWirelessProfilesResponse, error) { +func searchWirelessGetWirelessProfiles(m interface{}, queryParams catalystcentersdkgo.GetWirelessProfilesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetWirelessProfilesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseWirelessGetWirelessProfilesResponse + var foundItem *catalystcentersdkgo.ResponseWirelessGetWirelessProfilesV1Response queryParams.Offset = 1 nResponse, _, err := client.Wireless.GetWirelessProfiles(nil) diff --git a/catalystcenter/resource_wireless_provision_access_point.go b/catalystcenter/resource_wireless_provision_access_point.go index af133cd..2d46457 100644 --- a/catalystcenter/resource_wireless_provision_access_point.go +++ b/catalystcenter/resource_wireless_provision_access_point.go @@ -67,7 +67,7 @@ func resourceWirelessProvisionAccessPoint() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestWirelessAPProvision2`, + Description: `Array of RequestWirelessAPProvisionConnectivityV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -144,24 +144,22 @@ func resourceWirelessProvisionAccessPointCreate(ctx context.Context, d *schema.R vPersistbapioutput := resourceItem["persistbapioutput"] - request1 := expandRequestWirelessProvisionAccessPointApProvision2(ctx, "parameters.0", d) + request1 := expandRequestWirelessProvisionAccessPointApProvisionConnectivityV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.ApProvision2HeaderParams{} + headerParams1 := catalystcentersdkgo.ApProvisionConnectivityV1HeaderParams{} headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Wireless.ApProvision2(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.ApProvisionConnectivityV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ApProvision2", err)) + "Failure when executing ApProvisionConnectivityV1", err)) return diags } @@ -197,23 +195,25 @@ func resourceWirelessProvisionAccessPointCreate(ctx context.Context, d *schema.R if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing APProvision2", err, - "Failure at APProvision2 execution", bapiError)) + "Failure when executing APProvisionConnectivityV1", err, + "Failure at APProvisionConnectivityV1 execution", bapiError)) return diags } } - vItem1 := flattenWirelessApProvision2Item(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessApProvisionConnectivityV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ApProvision2 response", + "Failure when setting ApProvisionConnectivityV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessProvisionAccessPointRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -228,16 +228,16 @@ func resourceWirelessProvisionAccessPointDelete(ctx context.Context, d *schema.R return diags } -func expandRequestWirelessProvisionAccessPointApProvision2(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessApProvision2 { - request := catalystcentersdkgo.RequestWirelessApProvision2{} - if v := expandRequestWirelessProvisionAccessPointApProvision2ItemArray(ctx, key+".payload", d); v != nil { +func expandRequestWirelessProvisionAccessPointApProvisionConnectivityV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessApProvisionConnectivityV1 { + request := catalystcentersdkgo.RequestWirelessApProvisionConnectivityV1{} + if v := expandRequestWirelessProvisionAccessPointApProvisionConnectivityV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestWirelessProvisionAccessPointApProvision2ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessApProvision2 { - request := []catalystcentersdkgo.RequestItemWirelessApProvision2{} +func expandRequestWirelessProvisionAccessPointApProvisionConnectivityV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessApProvisionConnectivityV1 { + request := []catalystcentersdkgo.RequestItemWirelessApProvisionConnectivityV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -248,7 +248,7 @@ func expandRequestWirelessProvisionAccessPointApProvision2ItemArray(ctx context. return nil } for item_no := range objs { - i := expandRequestWirelessProvisionAccessPointApProvision2Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProvisionAccessPointApProvisionConnectivityV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -256,8 +256,8 @@ func expandRequestWirelessProvisionAccessPointApProvision2ItemArray(ctx context. return &request } -func expandRequestWirelessProvisionAccessPointApProvision2Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessApProvision2 { - request := catalystcentersdkgo.RequestItemWirelessApProvision2{} +func expandRequestWirelessProvisionAccessPointApProvisionConnectivityV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessApProvisionConnectivityV1 { + request := catalystcentersdkgo.RequestItemWirelessApProvisionConnectivityV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rf_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rf_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rf_profile")))) { request.RfProfile = interfaceToString(v) } @@ -279,7 +279,7 @@ func expandRequestWirelessProvisionAccessPointApProvision2Item(ctx context.Conte return &request } -func flattenWirelessApProvision2Item(item *catalystcentersdkgo.ResponseWirelessApProvision2) []map[string]interface{} { +func flattenWirelessApProvisionConnectivityV1Item(item *catalystcentersdkgo.ResponseWirelessApProvisionConnectivityV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_provision_device_create.go b/catalystcenter/resource_wireless_provision_device_create.go index 3d8f7a6..fa535eb 100644 --- a/catalystcenter/resource_wireless_provision_device_create.go +++ b/catalystcenter/resource_wireless_provision_device_create.go @@ -67,7 +67,7 @@ func resourceWirelessProvisionDeviceCreate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestWirelessProvision`, + Description: `Array of RequestWirelessProvisionV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -175,20 +175,18 @@ func resourceWirelessProvisionDeviceCreateCreate(ctx context.Context, d *schema. client := m.(*catalystcentersdkgo.Client) var diags diag.Diagnostics - request1 := expandRequestWirelessProvisionDeviceCreateProvision(ctx, "parameters.0", d) + request1 := expandRequestWirelessProvisionDeviceCreateProvisionV1(ctx, "parameters.0", d) - response1, restyResp1, err := client.Wireless.Provision(request1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.ProvisionV1(request1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing Provision", err)) + "Failure when executing ProvisionV1", err)) return diags } @@ -224,23 +222,25 @@ func resourceWirelessProvisionDeviceCreateCreate(ctx context.Context, d *schema. if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing Provision", err, - "Failure at Provision execution", bapiError)) + "Failure when executing ProvisionV1", err, + "Failure at ProvisionV1 execution", bapiError)) return diags } } - vItem1 := flattenWirelessProvisionItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessProvisionV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting Provision response", + "Failure when setting ProvisionV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessProvisionDeviceCreateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -255,16 +255,16 @@ func resourceWirelessProvisionDeviceCreateDelete(ctx context.Context, d *schema. return diags } -func expandRequestWirelessProvisionDeviceCreateProvision(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessProvision { - request := catalystcentersdkgo.RequestWirelessProvision{} - if v := expandRequestWirelessProvisionDeviceCreateProvisionItemArray(ctx, key+".payload", d); v != nil { +func expandRequestWirelessProvisionDeviceCreateProvisionV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessProvisionV1 { + request := catalystcentersdkgo.RequestWirelessProvisionV1{} + if v := expandRequestWirelessProvisionDeviceCreateProvisionV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestWirelessProvisionDeviceCreateProvisionItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvision { - request := []catalystcentersdkgo.RequestItemWirelessProvision{} +func expandRequestWirelessProvisionDeviceCreateProvisionV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionV1 { + request := []catalystcentersdkgo.RequestItemWirelessProvisionV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -275,7 +275,7 @@ func expandRequestWirelessProvisionDeviceCreateProvisionItemArray(ctx context.Co return nil } for item_no := range objs { - i := expandRequestWirelessProvisionDeviceCreateProvisionItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProvisionDeviceCreateProvisionV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -283,8 +283,8 @@ func expandRequestWirelessProvisionDeviceCreateProvisionItemArray(ctx context.Co return &request } -func expandRequestWirelessProvisionDeviceCreateProvisionItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvision { - request := catalystcentersdkgo.RequestItemWirelessProvision{} +func expandRequestWirelessProvisionDeviceCreateProvisionV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionV1 { + request := catalystcentersdkgo.RequestItemWirelessProvisionV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_name")))) { request.DeviceName = interfaceToString(v) } @@ -295,13 +295,13 @@ func expandRequestWirelessProvisionDeviceCreateProvisionItem(ctx context.Context request.ManagedApLocations = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dynamic_interfaces")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dynamic_interfaces")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dynamic_interfaces")))) { - request.DynamicInterfaces = expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfacesArray(ctx, key+".dynamic_interfaces", d) + request.DynamicInterfaces = expandRequestWirelessProvisionDeviceCreateProvisionV1ItemDynamicInterfacesArray(ctx, key+".dynamic_interfaces", d) } return &request } -func expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfacesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionDynamicInterfaces { - request := []catalystcentersdkgo.RequestItemWirelessProvisionDynamicInterfaces{} +func expandRequestWirelessProvisionDeviceCreateProvisionV1ItemDynamicInterfacesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionV1DynamicInterfaces { + request := []catalystcentersdkgo.RequestItemWirelessProvisionV1DynamicInterfaces{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -312,7 +312,7 @@ func expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfacesArr return nil } for item_no := range objs { - i := expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfaces(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProvisionDeviceCreateProvisionV1ItemDynamicInterfaces(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -320,8 +320,8 @@ func expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfacesArr return &request } -func expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionDynamicInterfaces { - request := catalystcentersdkgo.RequestItemWirelessProvisionDynamicInterfaces{} +func expandRequestWirelessProvisionDeviceCreateProvisionV1ItemDynamicInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionV1DynamicInterfaces { + request := catalystcentersdkgo.RequestItemWirelessProvisionV1DynamicInterfaces{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_ipaddress")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_ipaddress")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_ipaddress")))) { request.InterfaceIPAddress = interfaceToString(v) } @@ -343,7 +343,7 @@ func expandRequestWirelessProvisionDeviceCreateProvisionItemDynamicInterfaces(ct return &request } -func flattenWirelessProvisionItem(item *catalystcentersdkgo.ResponseWirelessProvision) []map[string]interface{} { +func flattenWirelessProvisionV1Item(item *catalystcentersdkgo.ResponseWirelessProvisionV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_provision_device_update.go b/catalystcenter/resource_wireless_provision_device_update.go index 6b4e54c..7b4d0d3 100644 --- a/catalystcenter/resource_wireless_provision_device_update.go +++ b/catalystcenter/resource_wireless_provision_device_update.go @@ -67,7 +67,7 @@ func resourceWirelessProvisionDeviceUpdate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "payload": &schema.Schema{ - Description: `Array of RequestWirelessProvisionUpdate`, + Description: `Array of RequestWirelessProvisionUpdateV1`, Type: schema.TypeList, Optional: true, ForceNew: true, @@ -171,24 +171,22 @@ func resourceWirelessProvisionDeviceUpdateCreate(ctx context.Context, d *schema. vPersistbapioutput := resourceItem["persistbapioutput"] - request1 := expandRequestWirelessProvisionDeviceUpdateProvisionUpdate(ctx, "parameters.0", d) + request1 := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.ProvisionUpdateHeaderParams{} + headerParams1 := catalystcentersdkgo.ProvisionUpdateV1HeaderParams{} headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Wireless.ProvisionUpdate(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.ProvisionUpdateV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing ProvisionUpdate", err)) + "Failure when executing ProvisionUpdateV1", err)) return diags } @@ -230,17 +228,19 @@ func resourceWirelessProvisionDeviceUpdateCreate(ctx context.Context, d *schema. } } - vItem1 := flattenWirelessProvisionUpdateItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessProvisionUpdateV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting ProvisionUpdate response", + "Failure when setting ProvisionUpdateV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessProvisionDeviceUpdateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -255,16 +255,16 @@ func resourceWirelessProvisionDeviceUpdateDelete(ctx context.Context, d *schema. return diags } -func expandRequestWirelessProvisionDeviceUpdateProvisionUpdate(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessProvisionUpdate { - request := catalystcentersdkgo.RequestWirelessProvisionUpdate{} - if v := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemArray(ctx, key+".payload", d); v != nil { +func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessProvisionUpdateV1 { + request := catalystcentersdkgo.RequestWirelessProvisionUpdateV1{} + if v := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1ItemArray(ctx, key+".payload", d); v != nil { request = *v } return &request } -func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionUpdate { - request := []catalystcentersdkgo.RequestItemWirelessProvisionUpdate{} +func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1ItemArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1 { + request := []catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -275,7 +275,7 @@ func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemArray(ctx cont return nil } for item_no := range objs { - i := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItem(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1Item(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -283,8 +283,8 @@ func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemArray(ctx cont return &request } -func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItem(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionUpdate { - request := catalystcentersdkgo.RequestItemWirelessProvisionUpdate{} +func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1Item(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1 { + request := catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".device_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".device_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".device_name")))) { request.DeviceName = interfaceToString(v) } @@ -292,13 +292,13 @@ func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItem(ctx context.C request.ManagedApLocations = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dynamic_interfaces")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dynamic_interfaces")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dynamic_interfaces")))) { - request.DynamicInterfaces = expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfacesArray(ctx, key+".dynamic_interfaces", d) + request.DynamicInterfaces = expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1ItemDynamicInterfacesArray(ctx, key+".dynamic_interfaces", d) } return &request } -func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfacesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionUpdateDynamicInterfaces { - request := []catalystcentersdkgo.RequestItemWirelessProvisionUpdateDynamicInterfaces{} +func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1ItemDynamicInterfacesArray(ctx context.Context, key string, d *schema.ResourceData) *[]catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1DynamicInterfaces { + request := []catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1DynamicInterfaces{} key = fixKeyAccess(key) o := d.Get(key) if o == nil { @@ -309,7 +309,7 @@ func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfa return nil } for item_no := range objs { - i := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfaces(ctx, fmt.Sprintf("%s.%d", key, item_no), d) + i := expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1ItemDynamicInterfaces(ctx, fmt.Sprintf("%s.%d", key, item_no), d) if i != nil { request = append(request, *i) } @@ -317,8 +317,8 @@ func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfa return &request } -func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionUpdateDynamicInterfaces { - request := catalystcentersdkgo.RequestItemWirelessProvisionUpdateDynamicInterfaces{} +func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateV1ItemDynamicInterfaces(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1DynamicInterfaces { + request := catalystcentersdkgo.RequestItemWirelessProvisionUpdateV1DynamicInterfaces{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_ipaddress")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_ipaddress")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_ipaddress")))) { request.InterfaceIPAddress = interfaceToString(v) } @@ -340,7 +340,7 @@ func expandRequestWirelessProvisionDeviceUpdateProvisionUpdateItemDynamicInterfa return &request } -func flattenWirelessProvisionUpdateItem(item *catalystcentersdkgo.ResponseWirelessProvisionUpdate) []map[string]interface{} { +func flattenWirelessProvisionUpdateV1Item(item *catalystcentersdkgo.ResponseWirelessProvisionUpdateV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_provision_ssid_create_provision.go b/catalystcenter/resource_wireless_provision_ssid_create_provision.go index 0cda8d3..951d0cb 100644 --- a/catalystcenter/resource_wireless_provision_ssid_create_provision.go +++ b/catalystcenter/resource_wireless_provision_ssid_create_provision.go @@ -292,24 +292,22 @@ func resourceWirelessProvisionSSIDCreateProvisionCreate(ctx context.Context, d * vPersistbapioutput := resourceItem["persistbapioutput"] - request1 := expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSID(ctx, "parameters.0", d) + request1 := expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDV1(ctx, "parameters.0", d) - headerParams1 := catalystcentersdkgo.CreateAndProvisionSSIDHeaderParams{} + headerParams1 := catalystcentersdkgo.CreateAndProvisionSSIDV1HeaderParams{} headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Wireless.CreateAndProvisionSSID(request1, &headerParams1) + // has_unknown_response: None - if request1 != nil { - log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) - } + response1, restyResp1, err := client.Wireless.CreateAndProvisionSSIDV1(request1, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing CreateAndProvisionSSID", err)) + "Failure when executing CreateAndProvisionSSIDV1", err)) return diags } @@ -345,23 +343,25 @@ func resourceWirelessProvisionSSIDCreateProvisionCreate(ctx context.Context, d * if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing CreateAndProvisionSSID", err, - "Failure at CreateAndProvisionSSID execution", bapiError)) + "Failure when executing CreateAndProvisionSSIDV1", err, + "Failure at CreateAndProvisionSSIDV1 execution", bapiError)) return diags } } - vItem1 := flattenWirelessCreateAndProvisionSSIDItem(response1) + if request1 != nil { + log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) + } + vItem1 := flattenWirelessCreateAndProvisionSSIDV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting CreateAndProvisionSSID response", + "Failure when setting CreateAndProvisionSSIDV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessProvisionSSIDCreateProvisionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -376,13 +376,13 @@ func resourceWirelessProvisionSSIDCreateProvisionDelete(ctx context.Context, d * return diags } -func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSID(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateAndProvisionSSID { - request := catalystcentersdkgo.RequestWirelessCreateAndProvisionSSID{} +func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDV1 { + request := catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".managed_aplocations")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".managed_aplocations")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".managed_aplocations")))) { request.ManagedApLocations = interfaceToSliceString(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_details")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_details")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_details")))) { - request.SSIDDetails = expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDSSIDDetails(ctx, key+".ssid_details.0", d) + request.SSIDDetails = expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDV1SSIDDetails(ctx, key+".ssid_details.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".ssid_type")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ssid_type")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ssid_type")))) { request.SSIDType = interfaceToString(v) @@ -391,13 +391,13 @@ func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSID(ctx request.EnableFabric = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".flex_connect")))) { - request.FlexConnect = expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDFlexConnect(ctx, key+".flex_connect.0", d) + request.FlexConnect = expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDV1FlexConnect(ctx, key+".flex_connect.0", d) } return &request } -func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDSSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDSSIDDetails { - request := catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDSSIDDetails{} +func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDV1SSIDDetails(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDV1SSIDDetails { + request := catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDV1SSIDDetails{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -449,8 +449,8 @@ func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDSSID return &request } -func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDFlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDFlexConnect { - request := catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDFlexConnect{} +func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDV1FlexConnect(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDV1FlexConnect { + request := catalystcentersdkgo.RequestWirelessCreateAndProvisionSSIDV1FlexConnect{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_flex_connect")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_flex_connect")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_flex_connect")))) { request.EnableFlexConnect = interfaceToBoolPtr(v) } @@ -460,7 +460,7 @@ func expandRequestWirelessProvisionSSIDCreateProvisionCreateAndProvisionSSIDFlex return &request } -func flattenWirelessCreateAndProvisionSSIDItem(item *catalystcentersdkgo.ResponseWirelessCreateAndProvisionSSID) []map[string]interface{} { +func flattenWirelessCreateAndProvisionSSIDV1Item(item *catalystcentersdkgo.ResponseWirelessCreateAndProvisionSSIDV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_provision_ssid_delete_reprovision.go b/catalystcenter/resource_wireless_provision_ssid_delete_reprovision.go index 87cb288..51349a3 100644 --- a/catalystcenter/resource_wireless_provision_ssid_delete_reprovision.go +++ b/catalystcenter/resource_wireless_provision_ssid_delete_reprovision.go @@ -17,7 +17,7 @@ func resourceWirelessProvisionSSIDDeleteReprovision() *schema.Resource { return &schema.Resource{ Description: `It performs delete operation on Wireless. -- Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from Catalyst Center +- Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from DNA Center `, CreateContext: resourceWirelessProvisionSSIDDeleteReprovisionCreate, @@ -96,18 +96,20 @@ func resourceWirelessProvisionSSIDDeleteReprovisionCreate(ctx context.Context, d vvSSIDName := vSSIDName.(string) vvManagedApLocations := vManagedApLocations.(string) - headerParams1 := catalystcentersdkgo.DeleteSSIDAndProvisionItToDevicesHeaderParams{} + headerParams1 := catalystcentersdkgo.DeleteSSIDAndProvisionItToDevicesV1HeaderParams{} headerParams1.Persistbapioutput = vPersistbapioutput.(string) - response1, restyResp1, err := client.Wireless.DeleteSSIDAndProvisionItToDevices(vvSSIDName, vvManagedApLocations, &headerParams1) + // has_unknown_response: None + + response1, restyResp1, err := client.Wireless.DeleteSSIDAndProvisionItToDevicesV1(vvSSIDName, vvManagedApLocations, &headerParams1) if err != nil || response1 == nil { if restyResp1 != nil { log.Printf("[DEBUG] Retrieved error response %s", restyResp1.String()) } diags = append(diags, diagError( - "Failure when executing DeleteSSIDAndProvisionItToDevices", err)) + "Failure when executing DeleteSSIDAndProvisionItToDevicesV1", err)) return diags } @@ -143,23 +145,21 @@ func resourceWirelessProvisionSSIDDeleteReprovisionCreate(ctx context.Context, d if response2.Status == "FAILURE" { bapiError := response2.BapiError diags = append(diags, diagErrorWithAlt( - "Failure when executing DeleteSSIDAndProvisionItToDevices", err, - "Failure at DeleteSSIDAndProvisionItToDevices execution", bapiError)) + "Failure when executing DeleteSSIDAndProvisionItToDevicesV1", err, + "Failure at DeleteSSIDAndProvisionItToDevicesV1 execution", bapiError)) return diags } } - - vItem1 := flattenWirelessDeleteSSIDAndProvisionItToDevicesItem(response1) + vItem1 := flattenWirelessDeleteSSIDAndProvisionItToDevicesV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( - "Failure when setting DeleteSSIDAndProvisionItToDevices response", + "Failure when setting DeleteSSIDAndProvisionItToDevicesV1 response", err)) return diags } d.SetId(getUnixTimeString()) return diags - } func resourceWirelessProvisionSSIDDeleteReprovisionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { //client := m.(*catalystcentersdkgo.Client) @@ -174,7 +174,7 @@ func resourceWirelessProvisionSSIDDeleteReprovisionDelete(ctx context.Context, d return diags } -func flattenWirelessDeleteSSIDAndProvisionItToDevicesItem(item *catalystcentersdkgo.ResponseWirelessDeleteSSIDAndProvisionItToDevices) []map[string]interface{} { +func flattenWirelessDeleteSSIDAndProvisionItToDevicesV1Item(item *catalystcentersdkgo.ResponseWirelessDeleteSSIDAndProvisionItToDevicesV1) []map[string]interface{} { if item == nil { return nil } diff --git a/catalystcenter/resource_wireless_rf_profile.go b/catalystcenter/resource_wireless_rf_profile.go index 2db8fa3..8b38a55 100644 --- a/catalystcenter/resource_wireless_rf_profile.go +++ b/catalystcenter/resource_wireless_rf_profile.go @@ -561,13 +561,13 @@ func resourceWirelessRfProfileCreate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessRfProfileCreateOrUpdateRfProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vRfProfileName := resourceItem["name"] vvRfProfileName := interfaceToString(vRfProfileName) - queryParams1 := catalystcentersdkgo.RetrieveRfProfilesQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveRfProfilesV1QueryParams{} queryParams1.RfProfileName = vvRfProfileName getResponse2, err := searchWirelessRetrieveRfProfiles(m, queryParams1) if err == nil && getResponse2 != nil { @@ -639,7 +639,7 @@ func resourceWirelessRfProfileRead(ctx context.Context, d *schema.ResourceData, selectedMethod := 1 if selectedMethod == 1 { log.Printf("[DEBUG] Selected method 1: RetrieveRfProfiles") - queryParams1 := catalystcentersdkgo.RetrieveRfProfilesQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveRfProfilesV1QueryParams{} if okRfProfileName { queryParams1.RfProfileName = vRfProfileName @@ -663,14 +663,14 @@ func resourceWirelessRfProfileRead(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) - vItem1 := flattenWirelessRetrieveRfProfilesItem(response1) + vItem1 := flattenWirelessRetrieveRfProfilesV1Item(response1) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting RetrieveRfProfiles search response", err)) return diags } - vParameters1 := flattenWirelessRetrieveRfProfilesItem(response1) + vParameters1 := flattenWirelessRetrieveRfProfilesV1Item(response1) log.Printf("[DEBUG] parameters set sent => %v", responseInterfaceToString(vParameters1)) if err := d.Set("parameters", vParameters1); err != nil { diags = append(diags, diagError( @@ -689,7 +689,7 @@ func resourceWirelessRfProfileUpdate(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics if d.HasChange("parameters") { // log.Printf("[DEBUG] Name used for update operation %v", queryParams1) - request1 := expandRequestWirelessRfProfileCreateOrUpdateRfProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1(ctx, "parameters.0", d) if request1 != nil { log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) } @@ -756,7 +756,7 @@ func resourceWirelessRfProfileDelete(ctx context.Context, d *schema.ResourceData resourceMap := separateResourceID(resourceID) vRfProfileName := resourceMap["name"] - queryParams1 := catalystcentersdkgo.RetrieveRfProfilesQueryParams{} + queryParams1 := catalystcentersdkgo.RetrieveRfProfilesV1QueryParams{} queryParams1.RfProfileName = vRfProfileName item, err := searchWirelessRetrieveRfProfiles(m, queryParams1) var vvRfProfileName string @@ -820,8 +820,8 @@ func resourceWirelessRfProfileDelete(ctx context.Context, d *schema.ResourceData return diags } -func expandRequestWirelessRfProfileCreateOrUpdateRfProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfile { - request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfile{} +func expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1 { + request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".name")))) { request.Name = interfaceToString(v) } @@ -844,13 +844,13 @@ func expandRequestWirelessRfProfileCreateOrUpdateRfProfile(ctx context.Context, request.EnableBrownField = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_a_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_a_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_a_properties")))) { - request.RadioTypeAProperties = expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeAProperties(ctx, key+".radio_type_a_properties.0", d) + request.RadioTypeAProperties = expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1RadioTypeAProperties(ctx, key+".radio_type_a_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_b_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_b_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_b_properties")))) { - request.RadioTypeBProperties = expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeBProperties(ctx, key+".radio_type_b_properties.0", d) + request.RadioTypeBProperties = expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1RadioTypeBProperties(ctx, key+".radio_type_b_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_c_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_c_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_c_properties")))) { - request.RadioTypeCProperties = expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeCProperties(ctx, key+".radio_type_c_properties.0", d) + request.RadioTypeCProperties = expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1RadioTypeCProperties(ctx, key+".radio_type_c_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".enable_radio_type_c")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".enable_radio_type_c")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".enable_radio_type_c")))) { request.EnableRadioTypeC = interfaceToBoolPtr(v) @@ -861,8 +861,8 @@ func expandRequestWirelessRfProfileCreateOrUpdateRfProfile(ctx context.Context, return &request } -func expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeAProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileRadioTypeAProperties { - request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileRadioTypeAProperties{} +func expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1RadioTypeAProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1RadioTypeAProperties { + request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1RadioTypeAProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -893,8 +893,8 @@ func expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeAProperties(c return &request } -func expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeBProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileRadioTypeBProperties { - request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileRadioTypeBProperties{} +func expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1RadioTypeBProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1RadioTypeBProperties { + request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1RadioTypeBProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -925,8 +925,8 @@ func expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeBProperties(c return &request } -func expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeCProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileRadioTypeCProperties { - request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileRadioTypeCProperties{} +func expandRequestWirelessRfProfileCreateOrUpdateRfProfileV1RadioTypeCProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1RadioTypeCProperties { + request := catalystcentersdkgo.RequestWirelessCreateOrUpdateRfProfileV1RadioTypeCProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -957,11 +957,11 @@ func expandRequestWirelessRfProfileCreateOrUpdateRfProfileRadioTypeCProperties(c return &request } -func searchWirelessRetrieveRfProfiles(m interface{}, queryParams catalystcentersdkgo.RetrieveRfProfilesQueryParams) (*catalystcentersdkgo.ResponseWirelessRetrieveRfProfiles, error) { +func searchWirelessRetrieveRfProfiles(m interface{}, queryParams catalystcentersdkgo.RetrieveRfProfilesV1QueryParams) (*catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseWirelessRetrieveRfProfiles - var ite *catalystcentersdkgo.ResponseWirelessRetrieveRfProfiles + var foundItem *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1 + var ite *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1 ite, _, err = client.Wireless.RetrieveRfProfiles(&queryParams) if err != nil { return foundItem, err @@ -976,7 +976,7 @@ func searchWirelessRetrieveRfProfiles(m interface{}, queryParams catalystcenters // Call get by _ method and set value to foundItem and return if ite.Name == queryParams.RfProfileName { - var getItem *catalystcentersdkgo.ResponseWirelessRetrieveRfProfiles + var getItem *catalystcentersdkgo.ResponseWirelessRetrieveRfProfilesV1 getItem = ite foundItem = getItem return foundItem, err diff --git a/catalystcenter/resource_wireless_settings_dot11be_profiles.go b/catalystcenter/resource_wireless_settings_dot11be_profiles.go index 9ee3b75..60470a4 100644 --- a/catalystcenter/resource_wireless_settings_dot11be_profiles.go +++ b/catalystcenter/resource_wireless_settings_dot11be_profiles.go @@ -182,7 +182,7 @@ func resourceWirelessSettingsDot11BeProfilesCreate(ctx context.Context, d *schem var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessSettingsDot11BeProfilesCreateA80211BeProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessSettingsDot11BeProfilesCreateA80211BeProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID, okID := resourceItem["id"] @@ -198,7 +198,7 @@ func resourceWirelessSettingsDot11BeProfilesCreate(ctx context.Context, d *schem return resourceWirelessSettingsDot11BeProfilesRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.GetAll80211BeProfilesQueryParams{} + queryParamImport := catalystcentersdkgo.GetAll80211BeProfilesV1QueryParams{} response2, err := searchWirelessGetAll80211BeProfiles(m, queryParamImport, vvName) if response2 != nil && err == nil { @@ -247,7 +247,7 @@ func resourceWirelessSettingsDot11BeProfilesCreate(ctx context.Context, d *schem return diags } } - queryParamValidate := catalystcentersdkgo.GetAll80211BeProfilesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetAll80211BeProfilesV1QueryParams{} item3, err := searchWirelessGetAll80211BeProfiles(m, queryParamValidate, vvName) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( @@ -290,7 +290,7 @@ func resourceWirelessSettingsDot11BeProfilesRead(ctx context.Context, d *schema. log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) // Review flatten function used - vItem1 := flattenWirelessGet80211BeProfileByIDItem(response1.Response) + vItem1 := flattenWirelessGet80211BeProfileByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetAll80211BeProfiles search response", @@ -312,7 +312,7 @@ func resourceWirelessSettingsDot11BeProfilesUpdate(ctx context.Context, d *schem vvID := resourceMap["id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestWirelessSettingsDot11BeProfilesUpdate80211BeProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessSettingsDot11BeProfilesUpdate80211BeProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Wireless.Update80211BeProfile(vvID, request1) if err != nil || response1 == nil { @@ -424,8 +424,8 @@ func resourceWirelessSettingsDot11BeProfilesDelete(ctx context.Context, d *schem return diags } -func expandRequestWirelessSettingsDot11BeProfilesCreateA80211BeProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateA80211BeProfile { - request := catalystcentersdkgo.RequestWirelessCreateA80211BeProfile{} +func expandRequestWirelessSettingsDot11BeProfilesCreateA80211BeProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateA80211BeProfileV1 { + request := catalystcentersdkgo.RequestWirelessCreateA80211BeProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) } @@ -450,8 +450,8 @@ func expandRequestWirelessSettingsDot11BeProfilesCreateA80211BeProfile(ctx conte return &request } -func expandRequestWirelessSettingsDot11BeProfilesUpdate80211BeProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdate80211BeProfile { - request := catalystcentersdkgo.RequestWirelessUpdate80211BeProfile{} +func expandRequestWirelessSettingsDot11BeProfilesUpdate80211BeProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdate80211BeProfileV1 { + request := catalystcentersdkgo.RequestWirelessUpdate80211BeProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".profile_name")))) { request.ProfileName = interfaceToString(v) } @@ -476,10 +476,10 @@ func expandRequestWirelessSettingsDot11BeProfilesUpdate80211BeProfile(ctx contex return &request } -func searchWirelessGetAll80211BeProfiles(m interface{}, queryParams catalystcentersdkgo.GetAll80211BeProfilesQueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetAll80211BeProfilesResponse, error) { +func searchWirelessGetAll80211BeProfiles(m interface{}, queryParams catalystcentersdkgo.GetAll80211BeProfilesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetAll80211BeProfilesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseWirelessGetAll80211BeProfilesResponse + var foundItem *catalystcentersdkgo.ResponseWirelessGetAll80211BeProfilesV1Response // var ite *catalystcentersdkgo.ResponseWirelessGetAll80211BeProfiles queryParams.Offset = 1 diff --git a/catalystcenter/resource_wireless_settings_interfaces.go b/catalystcenter/resource_wireless_settings_interfaces.go index 33146ff..0b7352c 100644 --- a/catalystcenter/resource_wireless_settings_interfaces.go +++ b/catalystcenter/resource_wireless_settings_interfaces.go @@ -105,7 +105,7 @@ func resourceWirelessSettingsInterfacesCreate(ctx context.Context, d *schema.Res var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessSettingsInterfacesCreateInterface(ctx, "parameters.0", d) + request1 := expandRequestWirelessSettingsInterfacesCreateInterfaceV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID, okID := resourceItem["id"] @@ -121,7 +121,7 @@ func resourceWirelessSettingsInterfacesCreate(ctx context.Context, d *schema.Res return resourceWirelessSettingsInterfacesRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.GetInterfacesQueryParams{} + queryParamImport := catalystcentersdkgo.GetInterfacesV1QueryParams{} response2, err := searchWirelessGetInterfaces(m, queryParamImport, vvName) if response2 != nil && err == nil { @@ -170,7 +170,7 @@ func resourceWirelessSettingsInterfacesCreate(ctx context.Context, d *schema.Res return diags } } - queryParamValidate := catalystcentersdkgo.GetInterfacesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetInterfacesV1QueryParams{} item3, err := searchWirelessGetInterfaces(m, queryParamValidate, vvName) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( @@ -210,7 +210,7 @@ func resourceWirelessSettingsInterfacesRead(ctx context.Context, d *schema.Resou return diags } // Review flatten function used - vItem1 := flattenWirelessGetInterfaceByIDItem(response1.Response) + vItem1 := flattenWirelessGetInterfaceByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetInterfaces search response", @@ -232,7 +232,7 @@ func resourceWirelessSettingsInterfacesUpdate(ctx context.Context, d *schema.Res vvID := resourceMap["id"] if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestWirelessSettingsInterfacesUpdateInterface(ctx, "parameters.0", d) + request1 := expandRequestWirelessSettingsInterfacesUpdateInterfaceV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Wireless.UpdateInterface(vvID, request1) if err != nil || response1 == nil { @@ -342,8 +342,8 @@ func resourceWirelessSettingsInterfacesDelete(ctx context.Context, d *schema.Res return diags } -func expandRequestWirelessSettingsInterfacesCreateInterface(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateInterface { - request := catalystcentersdkgo.RequestWirelessCreateInterface{} +func expandRequestWirelessSettingsInterfacesCreateInterfaceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateInterfaceV1 { + request := catalystcentersdkgo.RequestWirelessCreateInterfaceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) } @@ -356,8 +356,8 @@ func expandRequestWirelessSettingsInterfacesCreateInterface(ctx context.Context, return &request } -func expandRequestWirelessSettingsInterfacesUpdateInterface(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateInterface { - request := catalystcentersdkgo.RequestWirelessUpdateInterface{} +func expandRequestWirelessSettingsInterfacesUpdateInterfaceV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateInterfaceV1 { + request := catalystcentersdkgo.RequestWirelessUpdateInterfaceV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".interface_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".interface_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".interface_name")))) { request.InterfaceName = interfaceToString(v) } @@ -370,10 +370,10 @@ func expandRequestWirelessSettingsInterfacesUpdateInterface(ctx context.Context, return &request } -func searchWirelessGetInterfaces(m interface{}, queryParams catalystcentersdkgo.GetInterfacesQueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetInterfacesResponse, error) { +func searchWirelessGetInterfaces(m interface{}, queryParams catalystcentersdkgo.GetInterfacesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetInterfacesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseWirelessGetInterfacesResponse + var foundItem *catalystcentersdkgo.ResponseWirelessGetInterfacesV1Response queryParams.Offset = 1 nResponse, _, err := client.Wireless.GetInterfaces(nil) diff --git a/catalystcenter/resource_wireless_settings_rf_profiles.go b/catalystcenter/resource_wireless_settings_rf_profiles.go index 9403597..b4ca2c1 100644 --- a/catalystcenter/resource_wireless_settings_rf_profiles.go +++ b/catalystcenter/resource_wireless_settings_rf_profiles.go @@ -3,11 +3,10 @@ package catalystcenter import ( "context" "errors" + "log" "reflect" "time" - "log" - catalystcentersdkgo "github.com/cisco-en-programmability/catalystcenter-go-sdk/sdk" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -852,7 +851,7 @@ func resourceWirelessSettingsRfProfilesCreate(ctx context.Context, d *schema.Res var diags diag.Diagnostics resourceItem := *getResourceItem(d.Get("parameters")) - request1 := expandRequestWirelessSettingsRfProfilesCreateRfProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessSettingsRfProfilesCreateRfProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) vID, okID := resourceItem["id"] @@ -868,7 +867,7 @@ func resourceWirelessSettingsRfProfilesCreate(ctx context.Context, d *schema.Res return resourceWirelessSettingsRfProfilesRead(ctx, d, m) } } else { - queryParamImport := catalystcentersdkgo.GetRfProfilesQueryParams{} + queryParamImport := catalystcentersdkgo.GetRfProfilesV1QueryParams{} response2, err := searchWirelessGetRfProfiles(m, queryParamImport, vvName) if response2 != nil && err == nil { @@ -917,7 +916,7 @@ func resourceWirelessSettingsRfProfilesCreate(ctx context.Context, d *schema.Res return diags } } - queryParamValidate := catalystcentersdkgo.GetRfProfilesQueryParams{} + queryParamValidate := catalystcentersdkgo.GetRfProfilesV1QueryParams{} item3, err := searchWirelessGetRfProfiles(m, queryParamValidate, vvName) if err != nil || item3 == nil { diags = append(diags, diagErrorWithAlt( @@ -959,7 +958,7 @@ func resourceWirelessSettingsRfProfilesRead(ctx context.Context, d *schema.Resou log.Printf("[DEBUG] Retrieved response %+v", responseInterfaceToString(*response1)) // Review flatten function used - vItem1 := flattenWirelessGetRfProfileByIDItem(response1.Response) + vItem1 := flattenWirelessGetRfProfileByIDV1Item(response1.Response) if err := d.Set("item", vItem1); err != nil { diags = append(diags, diagError( "Failure when setting GetRfProfiles search response", @@ -983,7 +982,7 @@ func resourceWirelessSettingsRfProfilesUpdate(ctx context.Context, d *schema.Res if d.HasChange("parameters") { log.Printf("[DEBUG] ID used for update operation %s", vvID) - request1 := expandRequestWirelessSettingsRfProfilesUpdateRfProfile(ctx, "parameters.0", d) + request1 := expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1(ctx, "parameters.0", d) log.Printf("[DEBUG] request sent => %v", responseInterfaceToString(*request1)) response1, restyResp1, err := client.Wireless.UpdateRfProfile(vvID, request1) if err != nil || response1 == nil { @@ -1093,8 +1092,8 @@ func resourceWirelessSettingsRfProfilesDelete(ctx context.Context, d *schema.Res return diags } -func expandRequestWirelessSettingsRfProfilesCreateRfProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfile { - request := catalystcentersdkgo.RequestWirelessCreateRfProfile{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1 { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rf_profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rf_profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rf_profile_name")))) { request.RfProfileName = interfaceToString(v) } @@ -1111,13 +1110,13 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfile(ctx context.Context, request.EnableRadioType6GHz = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_a_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_a_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_a_properties")))) { - request.RadioTypeAProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioTypeAProperties(ctx, key+".radio_type_a_properties.0", d) + request.RadioTypeAProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioTypeAProperties(ctx, key+".radio_type_a_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_b_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_b_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_b_properties")))) { - request.RadioTypeBProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioTypeBProperties(ctx, key+".radio_type_b_properties.0", d) + request.RadioTypeBProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioTypeBProperties(ctx, key+".radio_type_b_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type6_g_hz_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type6_g_hz_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type6_g_hz_properties")))) { - request.RadioType6GHzProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperties(ctx, key+".radio_type6_g_hz_properties.0", d) + request.RadioType6GHzProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzProperties(ctx, key+".radio_type6_g_hz_properties.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1125,8 +1124,8 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfile(ctx context.Context, return &request } -func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioTypeAProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileRadioTypeAProperties { - request := catalystcentersdkgo.RequestWirelessCreateRfProfileRadioTypeAProperties{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioTypeAProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioTypeAProperties { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioTypeAProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -1163,8 +1162,8 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioTypeAProperties( return &request } -func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioTypeBProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileRadioTypeBProperties { - request := catalystcentersdkgo.RequestWirelessCreateRfProfileRadioTypeBProperties{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioTypeBProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioTypeBProperties { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioTypeBProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -1195,8 +1194,8 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioTypeBProperties( return &request } -func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzProperties { - request := catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzProperties{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzProperties { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -1225,7 +1224,7 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperti request.EnableStandardPowerService = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multi_bssid_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multi_bssid_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multi_bssid_properties")))) { - request.MultiBssidProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzPropertiesMultiBssidProperties(ctx, key+".multi_bssid_properties.0", d) + request.MultiBssidProperties = expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties(ctx, key+".multi_bssid_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".preamble_puncture")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".preamble_puncture")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".preamble_puncture")))) { request.PreamblePuncture = interfaceToBoolPtr(v) @@ -1242,13 +1241,13 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzPropertiesMultiBssidProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzPropertiesMultiBssidProperties { - request := catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzPropertiesMultiBssidProperties{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".dot11ax_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dot11ax_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dot11ax_parameters")))) { - request.Dot11AxParameters = expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx, key+".dot11ax_parameters.0", d) + request.Dot11AxParameters = expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx, key+".dot11ax_parameters.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dot11be_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dot11be_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dot11be_parameters")))) { - request.Dot11BeParameters = expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx, key+".dot11be_parameters.0", d) + request.Dot11BeParameters = expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx, key+".dot11be_parameters.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".target_wake_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".target_wake_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".target_wake_time")))) { request.TargetWakeTime = interfaceToBoolPtr(v) @@ -1262,8 +1261,8 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters { - request := catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ofdma_down_link")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ofdma_down_link")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ofdma_down_link")))) { request.OfdmaDownLink = interfaceToBoolPtr(v) } @@ -1282,8 +1281,8 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters { - request := catalystcentersdkgo.RequestWirelessCreateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters{} +func expandRequestWirelessSettingsRfProfilesCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters { + request := catalystcentersdkgo.RequestWirelessCreateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ofdma_down_link")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ofdma_down_link")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ofdma_down_link")))) { request.OfdmaDownLink = interfaceToBoolPtr(v) } @@ -1305,8 +1304,8 @@ func expandRequestWirelessSettingsRfProfilesCreateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfile(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfile { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfile{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1 { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".rf_profile_name")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".rf_profile_name")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".rf_profile_name")))) { request.RfProfileName = interfaceToString(v) } @@ -1323,13 +1322,13 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfile(ctx context.Context, request.EnableRadioType6GHz = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_a_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_a_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_a_properties")))) { - request.RadioTypeAProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioTypeAProperties(ctx, key+".radio_type_a_properties.0", d) + request.RadioTypeAProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioTypeAProperties(ctx, key+".radio_type_a_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type_b_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type_b_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type_b_properties")))) { - request.RadioTypeBProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioTypeBProperties(ctx, key+".radio_type_b_properties.0", d) + request.RadioTypeBProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioTypeBProperties(ctx, key+".radio_type_b_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".radio_type6_g_hz_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".radio_type6_g_hz_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".radio_type6_g_hz_properties")))) { - request.RadioType6GHzProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperties(ctx, key+".radio_type6_g_hz_properties.0", d) + request.RadioType6GHzProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzProperties(ctx, key+".radio_type6_g_hz_properties.0", d) } if isEmptyValue(reflect.ValueOf(request)) { return nil @@ -1337,8 +1336,8 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfile(ctx context.Context, return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioTypeAProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioTypeAProperties { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioTypeAProperties{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioTypeAProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioTypeAProperties { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioTypeAProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -1375,8 +1374,8 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioTypeAProperties( return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioTypeBProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioTypeBProperties { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioTypeBProperties{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioTypeBProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioTypeBProperties { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioTypeBProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -1407,8 +1406,8 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioTypeBProperties( return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzProperties { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzProperties{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzProperties { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".parent_profile")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".parent_profile")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".parent_profile")))) { request.ParentProfile = interfaceToString(v) } @@ -1437,7 +1436,7 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperti request.EnableStandardPowerService = interfaceToBoolPtr(v) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".multi_bssid_properties")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".multi_bssid_properties")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".multi_bssid_properties")))) { - request.MultiBssidProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzPropertiesMultiBssidProperties(ctx, key+".multi_bssid_properties.0", d) + request.MultiBssidProperties = expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties(ctx, key+".multi_bssid_properties.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".preamble_puncture")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".preamble_puncture")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".preamble_puncture")))) { request.PreamblePuncture = interfaceToBoolPtr(v) @@ -1454,13 +1453,13 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzPropertiesMultiBssidProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzPropertiesMultiBssidProperties { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzPropertiesMultiBssidProperties{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidProperties{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".dot11ax_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dot11ax_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dot11ax_parameters")))) { - request.Dot11AxParameters = expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx, key+".dot11ax_parameters.0", d) + request.Dot11AxParameters = expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx, key+".dot11ax_parameters.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".dot11be_parameters")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".dot11be_parameters")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".dot11be_parameters")))) { - request.Dot11BeParameters = expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx, key+".dot11be_parameters.0", d) + request.Dot11BeParameters = expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx, key+".dot11be_parameters.0", d) } if v, ok := d.GetOkExists(fixKeyAccess(key + ".target_wake_time")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".target_wake_time")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".target_wake_time")))) { request.TargetWakeTime = interfaceToBoolPtr(v) @@ -1474,8 +1473,8 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11AxParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ofdma_down_link")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ofdma_down_link")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ofdma_down_link")))) { request.OfdmaDownLink = interfaceToBoolPtr(v) } @@ -1494,8 +1493,8 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperti return &request } -func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters { - request := catalystcentersdkgo.RequestWirelessUpdateRfProfileRadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters{} +func expandRequestWirelessSettingsRfProfilesUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters(ctx context.Context, key string, d *schema.ResourceData) *catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters { + request := catalystcentersdkgo.RequestWirelessUpdateRfProfileV1RadioType6GHzPropertiesMultiBssidPropertiesDot11BeParameters{} if v, ok := d.GetOkExists(fixKeyAccess(key + ".ofdma_down_link")); !isEmptyValue(reflect.ValueOf(d.Get(fixKeyAccess(key+".ofdma_down_link")))) && (ok || !reflect.DeepEqual(v, d.Get(fixKeyAccess(key+".ofdma_down_link")))) { request.OfdmaDownLink = interfaceToBoolPtr(v) } @@ -1517,10 +1516,10 @@ func expandRequestWirelessSettingsRfProfilesUpdateRfProfileRadioType6GHzProperti return &request } -func searchWirelessGetRfProfiles(m interface{}, queryParams catalystcentersdkgo.GetRfProfilesQueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetRfProfilesResponse, error) { +func searchWirelessGetRfProfiles(m interface{}, queryParams catalystcentersdkgo.GetRfProfilesV1QueryParams, vID string) (*catalystcentersdkgo.ResponseWirelessGetRfProfilesV1Response, error) { client := m.(*catalystcentersdkgo.Client) var err error - var foundItem *catalystcentersdkgo.ResponseWirelessGetRfProfilesResponse + var foundItem *catalystcentersdkgo.ResponseWirelessGetRfProfilesV1Response queryParams.Offset = 1 nResponse, _, err := client.Wireless.GetRfProfiles(nil) diff --git a/docs/data-sources/analytics_anc_policies.md b/docs/data-sources/analytics_anc_policies.md new file mode 100644 index 0000000..eaf6473 --- /dev/null +++ b/docs/data-sources/analytics_anc_policies.md @@ -0,0 +1,41 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_anc_policies Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + Fetches the list of ANC policies available in ISE. +--- + +# catalystcenter_analytics_anc_policies (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- Fetches the list of ANC policies available in ISE. + +## Example Usage + +```terraform +data "catalystcenter_analytics_anc_policies" "example" { + provider = catalystcenter +} + +output "catalystcenter_analytics_anc_policies_example" { + value = data.catalystcenter_analytics_anc_policies.example.items +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `name` (String) diff --git a/docs/data-sources/analytics_dictionaries.md b/docs/data-sources/analytics_dictionaries.md new file mode 100644 index 0000000..f642425 --- /dev/null +++ b/docs/data-sources/analytics_dictionaries.md @@ -0,0 +1,56 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_dictionaries Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + Fetches the list of attribute dictionaries. +--- + +# catalystcenter_analytics_dictionaries (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- Fetches the list of attribute dictionaries. + +## Example Usage + +```terraform +data "catalystcenter_analytics_dictionaries" "example" { + provider = catalystcenter + include_attributes = "false" +} + +output "catalystcenter_analytics_dictionaries_example" { + value = data.catalystcenter_analytics_dictionaries.example.items +} +``` + + +## Schema + +### Optional + +- `include_attributes` (Boolean) includeAttributes query parameter. Flag to indicate whether attribute list for each dictionary should be included in response. + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `attributes` (List of Object) (see [below for nested schema](#nestedobjatt--items--attributes)) +- `description` (String) +- `name` (String) + + +### Nested Schema for `items.attributes` + +Read-Only: + +- `description` (String) +- `name` (String) diff --git a/docs/data-sources/analytics_endpoints.md b/docs/data-sources/analytics_endpoints.md new file mode 100644 index 0000000..582a608 --- /dev/null +++ b/docs/data-sources/analytics_endpoints.md @@ -0,0 +1,115 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_endpoints Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + Query the endpoints, optionally using various filter and pagination criteria. 'GET /endpoints/count' API can be used + to find out the total number of endpoints matching the filter criteria.Fetches details of the endpoint for the given unique identifier 'epId'. +--- + +# catalystcenter_analytics_endpoints (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- Query the endpoints, optionally using various filter and pagination criteria. 'GET /endpoints/count' API can be used +to find out the total number of endpoints matching the filter criteria. + +- Fetches details of the endpoint for the given unique identifier 'epId'. + +## Example Usage + +```terraform +data "catalystcenter_analytics_endpoints" "example" { + provider = catalystcenter + ep_id = "string" + include = "string" +} + +output "catalystcenter_analytics_endpoints_example" { + value = data.catalystcenter_analytics_endpoints.example.item +} +``` + + +## Schema + +### Optional + +- `ai_spoofing_trust_level` (String) aiSpoofingTrustLevel query parameter. Trust level of the endpoint due to AI spoofing. Possible values are 'low', 'medium', 'high'. +- `anc_policy` (String) ancPolicy query parameter. ANC policy. Only exact match will be returned. +- `auth_method` (String) authMethod query parameter. Authentication method. Partial string is allowed. +- `changed_profile_trust_level` (String) changedProfileTrustLevel query parameter. Trust level of the endpoint due to changing profile labels. Possible values are 'low', 'medium', 'high'. +- `concurrent_mac_trust_level` (String) concurrentMacTrustLevel query parameter. Trust level of the endpoint due to concurrent MAC address. Possible values are 'low', 'medium', 'high'. +- `device_type` (String) deviceType query parameter. Type of device to search for. Partial string is allowed. +- `ep_id` (String) epId path parameter. Unique identifier for the endpoint. +- `hardware_manufacturer` (String) hardwareManufacturer query parameter. Hardware manufacturer to search for. Partial string is allowed. +- `hardware_model` (String) hardwareModel query parameter. Hardware model to search for. Partial string is allowed. +- `include` (String) include query parameter. The datasets that should be included in the response. By default, value of this parameter is blank, and the response will include only basic details of the endpoint. To include other datasets or dictionaries, send comma separated list of following values: 'ALL' Include all attributes. 'CDP', 'DHCP', etc. Include attributes from given dictionaries. To get full list of dictionaries, use corresponding GET API. 'ANC' Include ANC policy related details. 'TRUST' Include trust score details. +- `ip` (String) ip query parameter. IP address to search for. Partial string is allowed. +- `ip_blocklist_detected` (Boolean) ipBlocklistDetected query parameter. Flag to fetch endpoints hitting IP blocklist or not. +- `limit` (Number) limit query parameter. Maximum number of records to be fetched. If not provided, 50 records will be fetched by default. Maximum 1000 records can be fetched at a time. Use pagination if more records need to be fetched. +- `mac_address` (String) macAddress query parameter. MAC address to search for. Partial string is allowed. +- `mac_addresses` (List of String) macAddresses query parameter. List of MAC addresses to filter on. Only exact matches will be returned. +- `nat_trust_level` (String) natTrustLevel query parameter. Trust level of the endpoint due to NAT access. Possible values are 'low', 'medium', 'high'. +- `offset` (Number) offset query parameter. Record offset to start data fetch at. Offset starts at zero. +- `operating_system` (String) operatingSystem query parameter. Operating system to search for. Partial string is allowed. +- `order` (String) order query parameter. Order to be used for sorting. Possible values are 'asc', 'desc'. +- `posture_status` (String) postureStatus query parameter. Posture status. +- `profiling_status` (String) profilingStatus query parameter. Profiling status of the endpoint. Possible values are 'profiled', 'partialProfiled', 'notProfiled'. +- `random_mac` (Boolean) randomMac query parameter. Flag to fetch endpoints having randomized MAC or not. +- `registered` (Boolean) registered query parameter. Flag to fetch manually registered or non-registered endpoints. +- `sort_by` (String) sortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more time if sorting is requested. Possible values are 'macAddress', 'ip'. +- `trust_score` (String) trustScore query parameter. Overall trust score of the endpoint. It can be provided either as a number value (e.g. 5), or as a range (e.g. 3-7). Provide value as '-' if you want to search for all endpoints where trust score is not assigned. +- `unauth_port_detected` (Boolean) unauthPortDetected query parameter. Flag to fetch endpoints exposing unauthorized ports or not. +- `weak_cred_detected` (Boolean) weakCredDetected query parameter. Flag to fetch endpoints having weak credentials or not. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `anc_policy` (String) +- `attributes` (String) +- `device_type` (List of String) +- `duid` (String) +- `granular_anc_policy` (List of Object) (see [below for nested schema](#nestedobjatt--item--granular_anc_policy)) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `id` (String) +- `last_probe_collection_timestamp` (Number) +- `mac_address` (String) +- `operating_system` (List of String) +- `random_mac` (String) +- `registered` (String) +- `trust_data` (List of Object) (see [below for nested schema](#nestedobjatt--item--trust_data)) + + +### Nested Schema for `item.granular_anc_policy` + +Read-Only: + +- `name` (String) +- `nas_ip_address` (String) + + + +### Nested Schema for `item.trust_data` + +Read-Only: + +- `ai_spoofing_trust_level` (String) +- `auth_method` (String) +- `changed_profile_trust_level` (String) +- `concurrent_mac_trust_level` (String) +- `ip_blocklist_detected` (String) +- `nat_trust_level` (String) +- `posture_status` (String) +- `trust_score` (Number) +- `unauth_port_detected` (String) +- `weak_cred_detected` (String) diff --git a/docs/data-sources/analytics_endpoints_count.md b/docs/data-sources/analytics_endpoints_count.md new file mode 100644 index 0000000..95dcfd8 --- /dev/null +++ b/docs/data-sources/analytics_endpoints_count.md @@ -0,0 +1,86 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_endpoints_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + Fetch the total count of endpoints that match the given filter criteria. +--- + +# catalystcenter_analytics_endpoints_count (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- Fetch the total count of endpoints that match the given filter criteria. + +## Example Usage + +```terraform +data "catalystcenter_analytics_endpoints_count" "example" { + provider = catalystcenter + ai_spoofing_trust_level = "string" + anc_policy = "string" + auth_method = "string" + changed_profile_trust_level = "string" + concurrent_mac_trust_level = "string" + device_type = "string" + hardware_manufacturer = "string" + hardware_model = "string" + ip = "string" + ip_blocklist_detected = "false" + mac_address = "string" + mac_addresses = ["string"] + nat_trust_level = "string" + operating_system = "string" + posture_status = "string" + profiling_status = "string" + random_mac = "false" + registered = "false" + trust_score = "string" + unauth_port_detected = "false" + weak_cred_detected = "false" +} + +output "catalystcenter_analytics_endpoints_count_example" { + value = data.catalystcenter_analytics_endpoints_count.example.item +} +``` + + +## Schema + +### Optional + +- `ai_spoofing_trust_level` (String) aiSpoofingTrustLevel query parameter. Trust level of the endpoint due to AI spoofing. Possible values are 'low', 'medium', 'high'. +- `anc_policy` (String) ancPolicy query parameter. ANC policy. Only exact match will be returned. +- `auth_method` (String) authMethod query parameter. Authentication method. Partial string is allowed. +- `changed_profile_trust_level` (String) changedProfileTrustLevel query parameter. Trust level of the endpoint due to changing profile labels. Possible values are 'low', 'medium', 'high'. +- `concurrent_mac_trust_level` (String) concurrentMacTrustLevel query parameter. Trust level of the endpoint due to concurrent MAC address. Possible values are 'low', 'medium', 'high'. +- `device_type` (String) deviceType query parameter. Type of device to search for. Partial string is allowed. +- `hardware_manufacturer` (String) hardwareManufacturer query parameter. Hardware manufacturer to search for. Partial string is allowed. +- `hardware_model` (String) hardwareModel query parameter. Hardware model to search for. Partial string is allowed. +- `ip` (String) ip query parameter. IP address to search for. Partial string is allowed. +- `ip_blocklist_detected` (Boolean) ipBlocklistDetected query parameter. Flag to fetch endpoints hitting IP blocklist or not. +- `mac_address` (String) macAddress query parameter. MAC address to search for. Partial string is allowed. +- `mac_addresses` (List of String) macAddresses query parameter. List of MAC addresses to filter on. Only exact matches will be returned. +- `nat_trust_level` (String) natTrustLevel query parameter. Trust level of the endpoint due to NAT access. Possible values are 'low', 'medium', 'high'. +- `operating_system` (String) operatingSystem query parameter. Operating system to search for. Partial string is allowed. +- `posture_status` (String) postureStatus query parameter. Posture status. +- `profiling_status` (String) profilingStatus query parameter. Profiling status of the endpoint. Possible values are 'profiled', 'partialProfiled', 'notProfiled'. +- `random_mac` (Boolean) randomMac query parameter. Flag to fetch endpoints having randomized MAC or not. +- `registered` (Boolean) registered query parameter. Flag to fetch manually registered or non-registered endpoints. +- `trust_score` (String) trustScore query parameter. Overall trust score of the endpoint. It can be provided either as a number value (e.g. 5), or as a range (e.g. 3-7). Provide value as '-' if you want to search for all endpoints where trust score is not assigned. +- `unauth_port_detected` (Boolean) unauthPortDetected query parameter. Flag to fetch endpoints exposing unauthorized ports or not. +- `weak_cred_detected` (Boolean) weakCredDetected query parameter. Flag to fetch endpoints having weak credentials or not. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `count` (Number) diff --git a/docs/data-sources/analytics_profiling_rules.md b/docs/data-sources/analytics_profiling_rules.md new file mode 100644 index 0000000..89ab23e --- /dev/null +++ b/docs/data-sources/analytics_profiling_rules.md @@ -0,0 +1,182 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_profiling_rules Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + This data source fetches the list of profiling rules. It can be used to show profiling rules in client applications, + or export those from an environment. 'POST /profiling-rules/bulk' API can be used to import such exported rules into + another environment. If this API is used to export rules to be imported into another Cisco DNA Center system, then + ensure that 'includeDeleted' parameter is 'true', so that deleted rules get synchronized correctly. Use query parameters + to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the + response. By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, + if required. 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system.Fetches details of the profiling rule for the given 'ruleId'. +--- + +# catalystcenter_analytics_profiling_rules (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- This data source fetches the list of profiling rules. It can be used to show profiling rules in client applications, +or export those from an environment. 'POST /profiling-rules/bulk' API can be used to import such exported rules into +another environment. If this API is used to export rules to be imported into another Cisco DNA Center system, then +ensure that 'includeDeleted' parameter is 'true', so that deleted rules get synchronized correctly. Use query parameters +to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the +response. By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, +if required. 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system. + +- Fetches details of the profiling rule for the given 'ruleId'. + +## Example Usage + +```terraform +data "catalystcenter_analytics_profiling_rules" "example" { + provider = catalystcenter + include_deleted = "false" + limit = 1 + offset = 1 + order = "string" + rule_type = "string" + sort_by = "string" +} + +output "catalystcenter_analytics_profiling_rules_example" { + value = data.catalystcenter_analytics_profiling_rules.example.items +} + +data "catalystcenter_analytics_profiling_rules" "example" { + provider = catalystcenter + rule_id = "string" +} + +output "catalystcenter_analytics_profiling_rules_example" { + value = data.catalystcenter_analytics_profiling_rules.example.item +} +``` + + +## Schema + +### Optional + +- `include_deleted` (Boolean) includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +- `limit` (Number) limit query parameter. Maximum number of records to be fetched. If not provided, 500 records will be fetched by default. To fetch all the records in the system, provide a large value for this parameter. +- `offset` (Number) offset query parameter. Record offset to start data fetch at. Offset starts at zero. +- `order` (String) order query parameter. Order to be used for sorting. +- `rule_id` (String) ruleId path parameter. Unique rule identifier +- `rule_type` (String) ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. +- `sort_by` (String) sortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more time if sorting is requested. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `item` + +Read-Only: + +- `cluster_id` (String) +- `condition_groups` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups)) +- `is_deleted` (String) +- `last_modified_by` (String) +- `last_modified_on` (Number) +- `plugin_id` (String) +- `rejected` (String) +- `result` (List of Object) (see [below for nested schema](#nestedobjatt--item--result)) +- `rule_id` (String) +- `rule_name` (String) +- `rule_priority` (Number) +- `rule_type` (String) +- `rule_version` (Number) +- `source_priority` (Number) +- `used_attributes` (List of String) + + +### Nested Schema for `item.condition_groups` + +Read-Only: + +- `condition` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `item.condition_groups.condition` + +Read-Only: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `item.result` + +Read-Only: + +- `device_type` (List of String) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `operating_system` (List of String) + + + + +### Nested Schema for `items` + +Read-Only: + +- `cluster_id` (String) +- `condition_groups` (List of Object) (see [below for nested schema](#nestedobjatt--items--condition_groups)) +- `is_deleted` (String) +- `last_modified_by` (String) +- `last_modified_on` (Number) +- `plugin_id` (String) +- `rejected` (String) +- `result` (List of Object) (see [below for nested schema](#nestedobjatt--items--result)) +- `rule_id` (String) +- `rule_name` (String) +- `rule_priority` (Number) +- `rule_type` (String) +- `rule_version` (Number) +- `source_priority` (Number) +- `used_attributes` (List of String) + + +### Nested Schema for `items.condition_groups` + +Read-Only: + +- `condition` (List of Object) (see [below for nested schema](#nestedobjatt--items--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `items.condition_groups.condition` + +Read-Only: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `items.result` + +Read-Only: + +- `device_type` (List of String) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `operating_system` (List of String) diff --git a/docs/data-sources/analytics_profiling_rules_count.md b/docs/data-sources/analytics_profiling_rules_count.md new file mode 100644 index 0000000..96ec5d3 --- /dev/null +++ b/docs/data-sources/analytics_profiling_rules_count.md @@ -0,0 +1,50 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_profiling_rules_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + This data source fetches the count of profiling rules based on the filter values provided in the query parameters. The + filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. +--- + +# catalystcenter_analytics_profiling_rules_count (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- This data source fetches the count of profiling rules based on the filter values provided in the query parameters. The +filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. + +## Example Usage + +```terraform +data "catalystcenter_analytics_profiling_rules_count" "example" { + provider = catalystcenter + include_deleted = "false" + rule_type = "string" +} + +output "catalystcenter_analytics_profiling_rules_count_example" { + value = data.catalystcenter_analytics_profiling_rules_count.example.item +} +``` + + +## Schema + +### Optional + +- `include_deleted` (Boolean) includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +- `rule_type` (String) ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `count` (Number) diff --git a/docs/data-sources/analytics_tasks.md b/docs/data-sources/analytics_tasks.md new file mode 100644 index 0000000..bcdf218 --- /dev/null +++ b/docs/data-sources/analytics_tasks.md @@ -0,0 +1,65 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_tasks Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AI Endpoint Analytics. + Fetches the details of backend task. Task is typically created by making call to some other API that takes longer time + to execute. +--- + +# catalystcenter_analytics_tasks (Data Source) + +It performs read operation on AI Endpoint Analytics. + +- Fetches the details of backend task. Task is typically created by making call to some other API that takes longer time +to execute. + +## Example Usage + +```terraform +data "catalystcenter_analytics_tasks" "example" { + provider = catalystcenter + task_id = "string" +} + +output "catalystcenter_analytics_tasks_example" { + value = data.catalystcenter_analytics_tasks.example.item +} +``` + + +## Schema + +### Required + +- `task_id` (String) taskId path parameter. Unique identifier for the task. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `additional_info` (String) +- `created_by` (String) +- `created_on` (Number) +- `errors` (List of Object) (see [below for nested schema](#nestedobjatt--item--errors)) +- `id` (String) +- `last_updated_on` (Number) +- `name` (String) +- `status` (String) + + +### Nested Schema for `item.errors` + +Read-Only: + +- `code` (Number) +- `details` (String) +- `index` (Number) +- `message` (String) diff --git a/docs/data-sources/application_policy_application_set.md b/docs/data-sources/application_policy_application_set.md deleted file mode 100644 index a4fdd4b..0000000 --- a/docs/data-sources/application_policy_application_set.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_application_policy_application_set Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Application Policy. - Get application set/s by offset/limit or by name ---- - -# catalystcenter_application_policy_application_set (Data Source) - -It performs read operation on Application Policy. - -- Get application set/s by offset/limit or by name - -## Example Usage - -```terraform -data "catalystcenter_application_policy_application_set" "example" { - provider = catalystcenter - attributes = "string" - limit = 1 - name = "string" - offset = 1 -} - -output "catalystcenter_application_policy_application_set_example" { - value = data.catalystcenter_application_policy_application_set.example.items -} -``` - - -## Schema - -### Optional - -- `attributes` (String) attributes query parameter. Attributes to retrieve, valid value applicationSet -- `limit` (Number) limit query parameter. The limit which is the maximum number of items to include in a single page of results, max value 500 -- `name` (String) name query parameter. Application set name -- `offset` (Number) offset query parameter. The starting point or index from where the paginated results should begin. - -### Read-Only - -- `id` (String) The ID of this resource. -- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - - -### Nested Schema for `items` - -Read-Only: - -- `default_business_relevance` (String) -- `display_name` (String) -- `id` (String) -- `identity_source` (List of Object) (see [below for nested schema](#nestedobjatt--items--identity_source)) -- `instance_id` (Number) -- `instance_version` (Number) -- `name` (String) -- `namespace` (String) -- `scalable_group_external_handle` (String) -- `scalable_group_type` (String) -- `type` (String) - - -### Nested Schema for `items.identity_source` - -Read-Only: - -- `id` (String) -- `type` (String) diff --git a/docs/data-sources/application_policy_application_set_count.md b/docs/data-sources/application_policy_application_set_count.md deleted file mode 100644 index e94d54d..0000000 --- a/docs/data-sources/application_policy_application_set_count.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_application_policy_application_set_count Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Application Policy. - Get the number of all existing application sets ---- - -# catalystcenter_application_policy_application_set_count (Data Source) - -It performs read operation on Application Policy. - -- Get the number of all existing application sets - -## Example Usage - -```terraform -data "catalystcenter_application_policy_application_set_count" "example" { - provider = catalystcenter - scalable_group_type = "string" -} - -output "catalystcenter_application_policy_application_set_count_example" { - value = data.catalystcenter_application_policy_application_set_count.example.item -} -``` - - -## Schema - -### Required - -- `scalable_group_type` (String) scalableGroupType query parameter. Scalable group type to retrieve, valid value APPLICATION_GROUP - -### Read-Only - -- `id` (String) The ID of this resource. -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - - -### Nested Schema for `item` - -Read-Only: - -- `response` (Number) -- `version` (String) diff --git a/docs/data-sources/applications.md b/docs/data-sources/applications.md index 36c4a6b..551bd72 100644 --- a/docs/data-sources/applications.md +++ b/docs/data-sources/applications.md @@ -49,7 +49,6 @@ Read-Only: - `application_set` (List of Object) (see [below for nested schema](#nestedobjatt--items--application_set)) - `id` (String) -- `indicative_network_identity` (List of Object) (see [below for nested schema](#nestedobjatt--items--indicative_network_identity)) - `name` (String) - `network_applications` (List of Object) (see [below for nested schema](#nestedobjatt--items--network_applications)) - `network_identity` (List of Object) (see [below for nested schema](#nestedobjatt--items--network_identity)) @@ -62,19 +61,6 @@ Read-Only: - `id_ref` (String) - -### Nested Schema for `items.indicative_network_identity` - -Read-Only: - -- `display_name` (String) -- `id` (String) -- `lower_port` (Number) -- `ports` (String) -- `protocol` (String) -- `upper_port` (Number) - - ### Nested Schema for `items.network_applications` diff --git a/docs/data-sources/applications_count_v2.md b/docs/data-sources/applications_count_v2.md deleted file mode 100644 index 1f8863f..0000000 --- a/docs/data-sources/applications_count_v2.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_applications_count_v2 Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Application Policy. - Get the number of all existing applications ---- - -# catalystcenter_applications_count_v2 (Data Source) - -It performs read operation on Application Policy. - -- Get the number of all existing applications - -## Example Usage - -```terraform -data "catalystcenter_applications_count_v2" "example" { - provider = catalystcenter - scalable_group_type = "string" -} - -output "catalystcenter_applications_count_v2_example" { - value = data.catalystcenter_applications_count_v2.example.item -} -``` - - -## Schema - -### Required - -- `scalable_group_type` (String) scalableGroupType query parameter. scalable group type to retrieve, valid value APPLICATION - -### Read-Only - -- `id` (String) The ID of this resource. -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - - -### Nested Schema for `item` - -Read-Only: - -- `response` (Number) -- `version` (String) diff --git a/docs/data-sources/applications_v2.md b/docs/data-sources/applications_v2.md deleted file mode 100644 index 0d87f23..0000000 --- a/docs/data-sources/applications_v2.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_applications_v2 Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Application Policy. - Get application/s by offset/limit or by name ---- - -# catalystcenter_applications_v2 (Data Source) - -It performs read operation on Application Policy. - -- Get application/s by offset/limit or by name - -## Example Usage - -```terraform -data "catalystcenter_applications_v2" "example" { - provider = catalystcenter - attributes = "string" - limit = 1 - name = "string" - offset = 1 -} - -output "catalystcenter_applications_v2_example" { - value = data.catalystcenter_applications_v2.example.items -} -``` - - -## Schema - -### Required - -- `attributes` (String) attributes query parameter. Attributes to retrieve, valid value application -- `limit` (Number) limit query parameter. The limit which is the maximum number of items to include in a single page of results, max value 500 -- `offset` (Number) offset query parameter. The starting point or index from where the paginated results should begin. - -### Optional - -- `name` (String) name query parameter. The application name - -### Read-Only - -- `id` (String) The ID of this resource. -- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - - -### Nested Schema for `items` - -Read-Only: - -- `display_name` (String) -- `id` (String) -- `identity_source` (List of Object) (see [below for nested schema](#nestedobjatt--items--identity_source)) -- `indicative_network_identity` (List of Object) (see [below for nested schema](#nestedobjatt--items--indicative_network_identity)) -- `instance_id` (Number) -- `instance_version` (Number) -- `name` (String) -- `namespace` (String) -- `network_applications` (List of Object) (see [below for nested schema](#nestedobjatt--items--network_applications)) -- `network_identity` (List of Object) (see [below for nested schema](#nestedobjatt--items--network_identity)) -- `parent_scalable_group` (List of Object) (see [below for nested schema](#nestedobjatt--items--parent_scalable_group)) -- `qualifier` (String) -- `scalable_group_external_handle` (String) -- `scalable_group_type` (String) -- `type` (String) - - -### Nested Schema for `items.identity_source` - -Read-Only: - -- `id` (String) -- `type` (String) - - - -### Nested Schema for `items.indicative_network_identity` - -Read-Only: - -- `display_name` (String) -- `id` (String) -- `lower_port` (Number) -- `ports` (String) -- `protocol` (String) -- `upper_port` (Number) - - - -### Nested Schema for `items.network_applications` - -Read-Only: - -- `app_protocol` (String) -- `application_sub_type` (String) -- `application_type` (String) -- `category_id` (String) -- `display_name` (String) -- `dscp` (String) -- `engine_id` (String) -- `help_string` (String) -- `id` (String) -- `long_description` (String) -- `name` (String) -- `popularity` (Number) -- `rank` (Number) -- `selector_id` (String) -- `server_name` (String) -- `traffic_class` (String) -- `url` (String) - - - -### Nested Schema for `items.network_identity` - -Read-Only: - -- `display_name` (String) -- `id` (String) -- `ipv4_subnet` (List of String) -- `ipv6_subnet` (List of String) -- `lower_port` (Number) -- `ports` (String) -- `protocol` (String) -- `upper_port` (Number) - - - -### Nested Schema for `items.parent_scalable_group` - -Read-Only: - -- `id` (String) -- `id_ref` (String) diff --git a/docs/data-sources/assurance_events.md b/docs/data-sources/assurance_events.md index 3bf35c8..a3adc6f 100644 --- a/docs/data-sources/assurance_events.md +++ b/docs/data-sources/assurance_events.md @@ -7,7 +7,7 @@ description: |- Returns the list of events discovered by Catalyst Center, determined by the complex filters. Please refer to the 'API Support Documentation' section to understand which fields are supported. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- - api-specs/blob/main/Assurance/CECatCenter_Org-AssuranceEvents-1.0.0-resolved.yamlAPI to fetch the details of an assurance event using event 'id'. For detailed information about the usage of the API, + api-specs/blob/main/Assurance/CECatCenter_Org-AssuranceEvents-1.0.0-resolved.yamlAPI to fetch the details of an assurance event using event id. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CECatCenter_Org-AssuranceEvents-1.0.0-resolved.yaml --- @@ -21,7 +21,7 @@ Support Documentation' section to understand which fields are supported. For det API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- api-specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml -- API to fetch the details of an assurance event using event 'id'. For detailed information about the usage of the API, +- API to fetch the details of an assurance event using event *id*. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml @@ -72,63 +72,63 @@ output "catalystcenter_assurance_events_example" { ### Optional -- `ap_mac` (String) apMac query parameter. MAC address of the access point. This parameter is applicable for 'Unified AP' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*50:0F*' or '50:0F*' or '*50:0F' +- `ap_mac` (String) apMac query parameter. MAC address of the access point. This parameter is applicable for *Unified AP* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **50:0F** or *50:0F** or **50:0F* Examples: -'apMac=50:0F:80:0F:F7:E0' (single apMac requested) -'apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0' (multiple apMac requested) -- `attribute` (String) attribute query parameter. The list of attributes that needs to be included in the response. If this parameter is not provided, then basic attributes ('id', 'name', 'timestamp', 'details', 'messageType', 'siteHierarchyId', 'siteHierarchy', 'deviceFamily', 'networkDeviceId', 'networkDeviceName', 'managementIpAddress') would be part of the response. +*apMac=50:0F:80:0F:F7:E0* (single apMac requested) +*apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0* (multiple apMac requested) +- `attribute` (String) attribute query parameter. The list of attributes that needs to be included in the response. If this parameter is not provided, then basic attributes (*id*, *name*, *timestamp*, *details*, *messageType*, *siteHierarchyId*, *siteHierarchy*, *deviceFamily*, *networkDeviceId*, *networkDeviceName*, *managementIpAddress*) would be part of the response. Examples: -'attribute=name' (single attribute requested) -'attribute=name&attribute=networkDeviceName' (multiple attribute requested) -- `client_mac` (String) clientMac query parameter. MAC address of the client. This parameter is applicable for 'Wired Client' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*66:2B*' or '66:2B*' or '*66:2B' +*attribute=name* (single attribute requested) +*attribute=name&attribute=networkDeviceName* (multiple attribute requested) +- `client_mac` (String) clientMac query parameter. MAC address of the client. This parameter is applicable for *Wired Client* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **66:2B** or *66:2B** or **66:2B* Examples: -'clientMac=66:2B:B8:D2:01:56' (single clientMac requested) -'clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89' (multiple clientMac requested) -- `device_family` (String) deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing 'Routers' along with 'Wireless Client' or 'Unified AP' is not supported. Examples: -'deviceFamily=Switches and Hubs' (single deviceFamily requested) -'deviceFamily=Switches and Hubs&deviceFamily=Routers' (multiple deviceFamily requested) +*clientMac=66:2B:B8:D2:01:56* (single clientMac requested) +*clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89* (multiple clientMac requested) +- `device_family` (String) deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing *Routers* along with *Wireless Client* or *Unified AP* is not supported. Examples: +*deviceFamily=Switches and Hubs* (single deviceFamily requested) +*deviceFamily=Switches and Hubs&deviceFamily=Routers* (multiple deviceFamily requested) - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'endTime' is not provided, API will default to current time. +If *endTime* is not provided, API will default to current time. - `id` (String) id path parameter. Unique identifier for the event - `limit` (Number) limit query parameter. Maximum number of records to return - `message_type` (String) messageType query parameter. Message type for the event. Examples: -'messageType=Syslog' (single messageType requested) -'messageType=Trap&messageType=Syslog' (multiple messageType requested) -- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +*messageType=Syslog* (single messageType requested) +*messageType=Trap&messageType=Syslog* (multiple messageType requested) +- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceId with & separator) -- `network_device_name` (String) networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard ('*') character-based search. Ex: '*Branch*' or 'Branch*' or '*Branch' Examples: -'networkDeviceName=Branch-3-Gateway' (single networkDeviceName requested) -'networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch' (multiple networkDeviceName requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceId with & separator) +- `network_device_name` (String) networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard (***) character-based search. Ex: **Branch** or *Branch** or **Branch* Examples: +*networkDeviceName=Branch-3-Gateway* (single networkDeviceName requested) +*networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch* (multiple networkDeviceName requested) - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. -- `severity` (Number) severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and 'Wired Client' events. +- `severity` (Number) severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and *Wired Client* events. | Value | Severity | | ----| ----------| | 0 | Emergency | | 1 | Alert | | 2 | Critical | | 3 | Error | | 4 | Warning | | 5 | Notice | | 6 | Info | Examples: -'severity=0' (single severity requested) -'severity=0&severity=1' (multiple severity requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*severity=0* (single severity requested) +*severity=0&severity=1* (multiple severity requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyId requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyId requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single siteId requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple siteId requested) +*?siteId=id1* (single siteId requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple siteId requested) - `sort_by` (String) sortBy query parameter. A field within the response to sort by. - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time minus 24 hours. -- `view` (String) view query parameter. The list of events views. Please refer to 'EventViews' for the supported list +If *startTime* is not provided, API will default to current time minus 24 hours. +- `view` (String) view query parameter. The list of events views. Please refer to *EventViews* for the supported list Examples: -'view=network' (single view requested) -'view=network&view=ap' (multiple view requested) +*view=network* (single view requested) +*view=network&view=ap* (multiple view requested) - `xca_lle_rid` (String) X-CALLER-ID header parameter. Caller ID is used to trace the origin of API calls and their associated queries executed on the database. It's an optional header parameter that can be added to an API request. ### Read-Only diff --git a/docs/data-sources/assurance_events_child_events.md b/docs/data-sources/assurance_events_child_events.md index 67c45d6..e3d77f4 100644 --- a/docs/data-sources/assurance_events_child_events.md +++ b/docs/data-sources/assurance_events_child_events.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_assurance_events_child_events Data Source - terrafor subcategory: "" description: |- It performs read operation on Devices. - Wireless client event could have child events and this API can be used to fetch the same using parent event 'id' as + Wireless client event could have child events and this API can be used to fetch the same using parent event id as the input. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CECatCenter_Org- AssuranceEvents-1.0.0-resolved.yaml @@ -14,7 +14,7 @@ description: |- It performs read operation on Devices. -- Wireless client event could have child events and this API can be used to fetch the same using parent event 'id' as +- Wireless client event could have child events and this API can be used to fetch the same using parent event *id* as the input. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- AssuranceEvents-1.0.0-resolved.yaml diff --git a/docs/data-sources/assurance_events_count.md b/docs/data-sources/assurance_events_count.md index 8b4dcc4..c4f66af 100644 --- a/docs/data-sources/assurance_events_count.md +++ b/docs/data-sources/assurance_events_count.md @@ -48,52 +48,52 @@ output "catalystcenter_assurance_events_count_example" { ### Required -- `device_family` (String) deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing 'Routers' along with 'Wireless Client' or 'Unified AP' is not supported. Examples: -'deviceFamily=Switches and Hubs' (single deviceFamily requested) -'deviceFamily=Switches and Hubs&deviceFamily=Routers' (multiple deviceFamily requested) +- `device_family` (String) deviceFamily query parameter. Device family. Please note that multiple families across network device type and client type is not allowed. For example, choosing *Routers* along with *Wireless Client* or *Unified AP* is not supported. Examples: +*deviceFamily=Switches and Hubs* (single deviceFamily requested) +*deviceFamily=Switches and Hubs&deviceFamily=Routers* (multiple deviceFamily requested) - `xca_lle_rid` (String) X-CALLER-ID header parameter. Caller ID is used to trace the origin of API calls and their associated queries executed on the database. It's an optional header parameter that can be added to an API request. ### Optional -- `ap_mac` (String) apMac query parameter. MAC address of the access point. This parameter is applicable for 'Unified AP' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*50:0F*' or '50:0F*' or '*50:0F' +- `ap_mac` (String) apMac query parameter. MAC address of the access point. This parameter is applicable for *Unified AP* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **50:0F** or *50:0F** or **50:0F* Examples: -'apMac=50:0F:80:0F:F7:E0' (single apMac requested) -'apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0' (multiple apMac requested) -- `client_mac` (String) clientMac query parameter. MAC address of the client. This parameter is applicable for 'Wired Client' and 'Wireless Client' events. -This field supports wildcard ('*') character-based search. Ex: '*66:2B*' or '66:2B*' or '*66:2B' +*apMac=50:0F:80:0F:F7:E0* (single apMac requested) +*apMac=50:0F:80:0F:F7:E0&apMac=18:80:90:AB:7E:A0* (multiple apMac requested) +- `client_mac` (String) clientMac query parameter. MAC address of the client. This parameter is applicable for *Wired Client* and *Wireless Client* events. +This field supports wildcard (***) character-based search. Ex: **66:2B** or *66:2B** or **66:2B* Examples: -'clientMac=66:2B:B8:D2:01:56' (single clientMac requested) -'clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89' (multiple clientMac requested) +*clientMac=66:2B:B8:D2:01:56* (single clientMac requested) +*clientMac=66:2B:B8:D2:01:56&clientMac=DC:A6:32:F5:5A:89* (multiple clientMac requested) - `end_time` (String) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'endTime' is not provided, API will default to current time. +If *endTime* is not provided, API will default to current time. - `message_type` (String) messageType query parameter. Message type for the event. Examples: -'messageType=Syslog' (single messageType requested) -'messageType=Trap&messageType=Syslog' (multiple messageType requested) -- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +*messageType=Syslog* (single messageType requested) +*messageType=Trap&messageType=Syslog* (multiple messageType requested) +- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceId requested) -- `network_device_name` (String) networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard ('*') character-based search. Ex: '*Branch*' or 'Branch*' or '*Branch' Examples: -'networkDeviceName=Branch-3-Gateway' (single networkDeviceName requested) -'networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch' (multiple networkDeviceName requested) -- `severity` (String) severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and 'Wired Client' events. +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceId requested) +- `network_device_name` (String) networkDeviceName query parameter. Network device name. This parameter is applicable for network device related families. This field supports wildcard (***) character-based search. Ex: **Branch** or *Branch** or **Branch* Examples: +*networkDeviceName=Branch-3-Gateway* (single networkDeviceName requested) +*networkDeviceName=Branch-3-Gateway&networkDeviceName=Branch-3-Switch* (multiple networkDeviceName requested) +- `severity` (String) severity query parameter. Severity of the event between 0 and 6. This is applicable only for events related to network devices (other than AP) and *Wired Client* events. | Value | Severity | | ----| ----------| | 0 | Emergency | | 1 | Alert | | 2 | Critical | | 3 | Error | | 4 | Warning | | 5 | Notice | | 6 | Info | Examples: -'severity=0' (single severity requested) -'severity=0&severity=1' (multiple severity requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*severity=0* (single severity requested) +*severity=0&severity=1* (multiple severity requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyId requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyId requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single siteId requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple siteId requested) +*?siteId=id1* (single siteId requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple siteId requested) - `start_time` (String) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time minus 24 hours. +If *startTime* is not provided, API will default to current time minus 24 hours. ### Read-Only diff --git a/docs/data-sources/assurance_issues.md b/docs/data-sources/assurance_issues.md index d395f94..eac7ac6 100644 --- a/docs/data-sources/assurance_issues.md +++ b/docs/data-sources/assurance_issues.md @@ -95,7 +95,7 @@ output "catalystcenter_assurance_issues_example" { - `accept_language` (String) Accept-Language header parameter. This header parameter can be used to specify the language in which issue description and suggested actions need to be returned. Available options are 'en' (English), 'ja' (Japanese), 'ko' (Korean), 'zh' (Chinese). If this parameter is not present the issue details are returned in English language. - `ai_driven` (Boolean) aiDriven query parameter. Flag whether the issue is AI driven issue -- `attribute` (String) attribute query parameter. List of attributes related to the issue. If these are provided, then only those attributes will be part of response along with the default attributes. Please refer to the 'IssuesResponseAttribute' Model for supported attributes. Examples: 'attribute=deviceType' (single attribute requested) 'attribute=deviceType&attribute=updatedBy' (multiple attributes requested) +- `attribute` (String) attribute query parameter. List of attributes related to the issue. If these are provided, then only those attributes will be part of response along with the default attributes. Please refer to the *IssuesResponseAttribute* Model for supported attributes. Examples: *attribute=deviceType* (single attribute requested) *attribute=deviceType&attribute=updatedBy* (multiple attributes requested) - `category` (String) category query parameter. Categories of the issue. Supports single category and multiple categories. Examples: category=availability (single status requested) category=availability&category=onboarding (multiple categories requested) - `device_type` (String) deviceType query parameter. Device Type of the device to which this issue belongs to. Supports single device type and multiple device types. Examples: deviceType=wireless controller (single device type requested) deviceType=wireless controller&deviceType=core (multiple device types requested) - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. @@ -115,50 +115,50 @@ Examples: entityId=68:ca:e4:79:3f:20 (single entity id requested) entityId=68:ca - `is_global` (Boolean) isGlobal query parameter. Global issues are those issues which impacts across many devices, sites. They are also displayed on Issue Dashboard in Catalyst Center UI. Non-Global issues are displayed only on Client 360 or Device 360 pages. If this flag is 'true', only global issues are returned. If it if 'false', all issues are returned. - `issue_id` (String) issueId query parameter. UUID of the issue Examples: issueId=e52aecfe-b142-4287-a587-11a16ba6dd26 (single issue id requested) issueId=e52aecfe-b142-4287-a587-11a16ba6dd26&issueId=864d0421-02c0-43a6-9c52-81cad45f66d8 (multiple issue ids requested) - `limit` (Number) limit query parameter. Maximum number of issues to return -- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) +- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) - `name` (String) name query parameter. The name of the issue Examples: name=ap_down (single issue name requested) name=ap_down&name=wlc_monitor (multiple issue names requested) Issue names can be retrieved using the API /data/api/v1/assuranceIssueConfigurations -- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) -- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) +- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. - `priority` (String) priority query parameter. Priority of the issue. Supports single priority and multiple priorities Examples: priority=P1 (single priority requested) priority=P1&priority=P2&priority=P3 (multiple priorities requested) - `severity` (String) severity query parameter. Severity of the issue. Supports single severity and multiple severities. Examples: severity=high (single severity requested) severity=high&severity=medium (multiple severities requested) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) -- `site_name` (String) siteName query parameter. The name of the site. (Ex. 'FloorName') +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) +- `site_name` (String) siteName query parameter. The name of the site. (Ex. *FloorName*) This field supports wildcard asterisk (*) character search support. E.g. *San*, *San, San* Examples: -'?siteName=building1' (single siteName requested) -'?siteName=building1&siteName=building2&siteName=building3' (multiple siteNames requested) +*?siteName=building1* (single siteName requested) +*?siteName=building1&siteName=building2&siteName=building3* (multiple siteNames requested) - `sort_by` (String) sortBy query parameter. - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `status` (String) status query parameter. Status of the issue. Supports single status and multiple statuses. Examples: status=active (single status requested) status=active&status=resolved (multiple statuses requested) - `updated_by` (String) updatedBy query parameter. The user who last updated this issue. Examples: updatedBy=admin (single updatedBy requested) updatedBy=admin&updatedBy=john (multiple updatedBy requested) -- `view` (String) view query parameter. The name of the View. Each view represents a specific data set. Please refer to the 'IssuesView' Model for supported views. View is predefined set of attributes supported by the API. Only the attributes related to the given view will be part of the API response along with default attributes. If multiple views are provided, then response will contain attributes from all those views. If no views are specified, all attributes will be returned. -| View Name | Included Attributes | | --| --| | 'update' | updatedTime, updatedBy | | 'site' | siteName, siteHierarchy, siteId, siteHierarchyId | Examples: 'view=update' (single view requested) 'view=update&view=site' (multiple views requested) +- `view` (String) view query parameter. The name of the View. Each view represents a specific data set. Please refer to the *IssuesView* Model for supported views. View is predefined set of attributes supported by the API. Only the attributes related to the given view will be part of the API response along with default attributes. If multiple views are provided, then response will contain attributes from all those views. If no views are specified, all attributes will be returned. +| View Name | Included Attributes | | --| --| | *update* | updatedTime, updatedBy | | *site* | siteName, siteHierarchy, siteId, siteHierarchyId | Examples: *view=update* (single view requested) *view=update&view=site* (multiple views requested) - `xca_lle_rid` (String) X-CALLER-ID header parameter. Caller ID can be used to trace the caller for queries executed on database. The caller id is like a optional attribute which can be added to API invocation like ui, python, postman, test-automation etc ### Read-Only diff --git a/docs/data-sources/assurance_issues_count.md b/docs/data-sources/assurance_issues_count.md index d21b431..8edf3d8 100644 --- a/docs/data-sources/assurance_issues_count.md +++ b/docs/data-sources/assurance_issues_count.md @@ -85,43 +85,43 @@ Examples: entityId=68:ca:e4:79:3f:20 (single entity id requested) entityId=68:ca - `fabric_vn_name` (String) fabricVnName query parameter. The name of the fabric virtual network Examples: fabricVnName=name1 (single fabric virtual network name requested) fabricVnName=name1&fabricVnName=name2&fabricVnName=name3 (multiple fabric virtual network names requested) - `is_global` (Boolean) isGlobal query parameter. Global issues are those issues which impacts across many devices, sites. They are also displayed on Issue Dashboard in Catalyst Center UI. Non-Global issues are displayed only on Client 360 or Device 360 pages. If this flag is 'true', only global issues are returned. If it if 'false', all issues are returned. - `issue_id` (String) issueId query parameter. UUID of the issue Examples: issueId=e52aecfe-b142-4287-a587-11a16ba6dd26 (single issue id requested) issueId=e52aecfe-b142-4287-a587-11a16ba6dd26&issueId=864d0421-02c0-43a6-9c52-81cad45f66d8 (multiple issue ids requested) -- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) +- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) - `name` (String) name query parameter. The name of the issue Examples: name=ap_down (single issue name requested) name=ap_down&name=wlc_monitor (multiple issue names requested) Issue names can be retrieved using the API /data/api/v1/assuranceIssueConfigurations -- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) -- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) +- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) - `priority` (String) priority query parameter. Priority of the issue. Supports single priority and multiple priorities Examples: priority=P1 (single priority requested) priority=P1&priority=P2&priority=P3 (multiple priorities requested) - `severity` (String) severity query parameter. Severity of the issue. Supports single severity and multiple severities. Examples: severity=high (single severity requested) severity=high&severity=medium (multiple severities requested) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) -- `site_name` (String) siteName query parameter. The name of the site. (Ex. 'FloorName') +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) +- `site_name` (String) siteName query parameter. The name of the site. (Ex. *FloorName*) This field supports wildcard asterisk (*) character search support. E.g. *San*, *San, San* Examples: -'?siteName=building1' (single siteName requested) -'?siteName=building1&siteName=building2&siteName=building3' (multiple siteNames requested) +*?siteName=building1* (single siteName requested) +*?siteName=building1&siteName=building2&siteName=building3* (multiple siteNames requested) - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `status` (String) status query parameter. Status of the issue. Supports single status and multiple statuses. Examples: status=active (single status requested) status=active&status=resolved (multiple statuses requested) - `updated_by` (String) updatedBy query parameter. The user who last updated this issue. Examples: updatedBy=admin (single updatedBy requested) updatedBy=admin&updatedBy=john (multiple updatedBy requested) diff --git a/docs/data-sources/clients.md b/docs/data-sources/clients.md index 664b382..db535d8 100644 --- a/docs/data-sources/clients.md +++ b/docs/data-sources/clients.md @@ -76,54 +76,54 @@ output "catalystcenter_clients_example" { ### Optional -- `attribute` (String) attribute query parameter. List of attributes related to resource that can be requested to only be part of the response along with the required attributes. Refer to ClientAttribute schema for list of attributes supported Examples: 'attribute=band' (single attribute requested) 'attribute=band&attribute=ssid&attribute=overallScore' (multiple attribute requested) +- `attribute` (String) attribute query parameter. List of attributes related to resource that can be requested to only be part of the response along with the required attributes. Refer to ClientAttribute schema for list of attributes supported Examples: *attribute=band* (single attribute requested) *attribute=band&attribute=ssid&attribute=overallScore* (multiple attribute requested) - `band` (String) band query parameter. WiFi frequency band that client or Access Point operates. Band value is represented in Giga Hertz GHz Examples: -'band=5GHZ' (single band requested) -'band=2.4GHZ&band=6GHZ' (multiple band requested) -- `connected_network_device_name` (String) connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*ap-25*' or 'ap-25*' or '*ap-25' +*band=5GHZ* (single band requested) +*band=2.4GHZ&band=6GHZ* (multiple band requested) +- `connected_network_device_name` (String) connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **ap-25** or *ap-25** or **ap-25* Examples: -'connectedNetworkDeviceName=ap-25' (single connectedNetworkDeviceName requested) -'connectedNetworkDeviceName=ap-25&ap-34' (multiple connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25* (single connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25&ap-34* (multiple connectedNetworkDeviceName requested) - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. - `id` (String) id path parameter. id is the client mac address. It can be specified is any notational conventions 01:23:45:67:89:AB or 01-23-45-67-89-AB or 0123.4567.89AB and is case insensitive -- `ipv4_address` (String) ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +- `ipv4_address` (String) ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'ipv4Address=1.1.1.1' (single ipv4Address requested) -'ipv4Address=1.1.1.1&ipv4Address=2.2.2.2' (multiple ipv4Address requested) -- `ipv6_address` (String) ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*2001:db8*' or '2001:db8*' or '*2001:db8' +*ipv4Address=1.1.1.1* (single ipv4Address requested) +*ipv4Address=1.1.1.1&ipv4Address=2.2.2.2* (multiple ipv4Address requested) +- `ipv6_address` (String) ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **2001:db8** or *2001:db8** or **2001:db8* Examples: -'ipv6Address=2001:db8:0:0:0:0:2:1' (single ipv6Address requested) -'ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348' (multiple ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1* (single ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348* (multiple ipv6Address requested) - `limit` (Number) limit query parameter. Maximum number of records to return -- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) +- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. -- `os_type` (String) osType query parameter. Client device operating system type. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*iOS*' or 'iOS*' or '*iOS' Examples: -'osType=iOS' (single osType requested) -'osType=iOS&osType=Android' (multiple osType requested) -- `os_version` (String) osVersion query parameter. Client device operating system version This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*14.3*' or '14.3*' or '*14.3' Examples: -'osVersion=14.3' (single osVersion requested) -'osVersion=14.3&osVersion=10.1' (multiple osVersion requested) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*BuildingName*' or 'BuildingName*' or '*BuildingName' Examples: 'siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) 'siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2' (multiple siteHierarchy requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard ('*') character-based search. Ex: '*buildingUuid*' or 'buildingUuid*' or '*buildingUuid' Examples: 'siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid' (single siteHierarchyId requested) 'siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2' (multiple siteHierarchyId requested) -- `site_id` (String) siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: 'siteId=floorUuid' (single siteId requested) 'siteId=floorUuid1&siteId=floorUuid2' (multiple siteId requested) +- `os_type` (String) osType query parameter. Client device operating system type. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **iOS** or *iOS** or **iOS* Examples: +*osType=iOS* (single osType requested) +*osType=iOS&osType=Android* (multiple osType requested) +- `os_version` (String) osVersion query parameter. Client device operating system version This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **14.3** or *14.3** or **14.3* Examples: +*osVersion=14.3* (single osVersion requested) +*osVersion=14.3&osVersion=10.1* (multiple osVersion requested) +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **BuildingName** or *BuildingName** or **BuildingName* Examples: *siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) *siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2* (multiple siteHierarchy requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard (***) character-based search. Ex: **buildingUuid** or *buildingUuid** or **buildingUuid* Examples: *siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid* (single siteHierarchyId requested) *siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2* (multiple siteHierarchyId requested) +- `site_id` (String) siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: *siteId=floorUuid* (single siteId requested) *siteId=floorUuid1&siteId=floorUuid2* (multiple siteId requested) - `sort_by` (String) sortBy query parameter. A field within the response to sort by. -- `ssid` (String) ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*Alpha*' or 'Alpha*' or '*Alpha' +- `ssid` (String) ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **Alpha** or *Alpha** or **Alpha* Examples: -'ssid=Alpha' (single ssid requested) -'ssid=Alpha&ssid=Guest' (multiple ssid requested) +*ssid=Alpha* (single ssid requested) +*ssid=Alpha&ssid=Guest* (multiple ssid requested) - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `type` (String) type query parameter. The client device type whether client is connected to network through Wired or Wireless medium. - `view` (String) view query parameter. Client related Views Refer to ClientView schema for list of views supported Examples: -'view=Wireless' (single view requested) -'view=WirelessHealth&view=WirelessTraffic' (multiple view requested) -- `wlc_name` (String) wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*wlc-25*' or 'wlc-25*' or '*wlc-25' +*view=Wireless* (single view requested) +*view=WirelessHealth&view=WirelessTraffic* (multiple view requested) +- `wlc_name` (String) wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **wlc-25** or *wlc-25** or **wlc-25* Examples: -'wlcName=wlc-25' (single wlcName requested) -'wlcName=wlc-25&wlc-34' (multiple wlcName requested) +*wlcName=wlc-25* (single wlcName requested) +*wlcName=wlc-25&wlc-34* (multiple wlcName requested) - `xca_lle_rid` (String) X-CALLER-ID header parameter. Caller ID is used to trace the origin of API calls and their associated queries executed on the database. It's an optional header parameter that can be added to an API request. ### Read-Only diff --git a/docs/data-sources/clients_count.md b/docs/data-sources/clients_count.md index ab105c0..d76c083 100644 --- a/docs/data-sources/clients_count.md +++ b/docs/data-sources/clients_count.md @@ -55,44 +55,44 @@ output "catalystcenter_clients_count_example" { ### Optional - `band` (String) band query parameter. WiFi frequency band that client or Access Point operates. Band value is represented in Giga Hertz GHz Examples: -'band=5GHZ' (single band requested) -'band=2.4GHZ&band=6GHZ' (multiple band requested) -- `connected_network_device_name` (String) connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*ap-25*' or 'ap-25*' or '*ap-25' +*band=5GHZ* (single band requested) +*band=2.4GHZ&band=6GHZ* (multiple band requested) +- `connected_network_device_name` (String) connectedNetworkDeviceName query parameter. Name of the neighbor network device that client is connected to. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **ap-25** or *ap-25** or **ap-25* Examples: -'connectedNetworkDeviceName=ap-25' (single connectedNetworkDeviceName requested) -'connectedNetworkDeviceName=ap-25&ap-34' (multiple connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25* (single connectedNetworkDeviceName requested) +*connectedNetworkDeviceName=ap-25&ap-34* (multiple connectedNetworkDeviceName requested) - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -- `ipv4_address` (String) ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +- `ipv4_address` (String) ipv4Address query parameter. IPv4 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'ipv4Address=1.1.1.1' (single ipv4Address requested) -'ipv4Address=1.1.1.1&ipv4Address=2.2.2.2' (multiple ipv4Address requested) -- `ipv6_address` (String) ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard ('*') character-based search. Ex: '*2001:db8*' or '2001:db8*' or '*2001:db8' +*ipv4Address=1.1.1.1* (single ipv4Address requested) +*ipv4Address=1.1.1.1&ipv4Address=2.2.2.2* (multiple ipv4Address requested) +- `ipv6_address` (String) ipv6Address query parameter. IPv6 Address of the network entity either network device or client This field supports wildcard (***) character-based search. Ex: **2001:db8** or *2001:db8** or **2001:db8* Examples: -'ipv6Address=2001:db8:0:0:0:0:2:1' (single ipv6Address requested) -'ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348' (multiple ipv6Address requested) -- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) -- `os_type` (String) osType query parameter. Client device operating system type. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*iOS*' or 'iOS*' or '*iOS' Examples: -'osType=iOS' (single osType requested) -'osType=iOS&osType=Android' (multiple osType requested) -- `os_version` (String) osVersion query parameter. Client device operating system version This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*14.3*' or '14.3*' or '*14.3' Examples: -'osVersion=14.3' (single osVersion requested) -'osVersion=14.3&osVersion=10.1' (multiple osVersion requested) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*BuildingName*' or 'BuildingName*' or '*BuildingName' Examples: 'siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) 'siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2' (multiple siteHierarchy requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard ('*') character-based search. Ex: '*buildingUuid*' or 'buildingUuid*' or '*buildingUuid' Examples: 'siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid' (single siteHierarchyId requested) 'siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2' (multiple siteHierarchyId requested) -- `site_id` (String) siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: 'siteId=floorUuid' (single siteId requested) 'siteId=floorUuid1&siteId=floorUuid2' (multiple siteId requested) -- `ssid` (String) ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*Alpha*' or 'Alpha*' or '*Alpha' +*ipv6Address=2001:db8:0:0:0:0:2:1* (single ipv6Address requested) +*ipv6Address=2001:db8:0:0:0:0:2:1&ipv6Address=2001:db8:85a3:8d3:1319:8a2e:370:7348* (multiple ipv6Address requested) +- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) +- `os_type` (String) osType query parameter. Client device operating system type. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **iOS** or *iOS** or **iOS* Examples: +*osType=iOS* (single osType requested) +*osType=iOS&osType=Android* (multiple osType requested) +- `os_version` (String) osVersion query parameter. Client device operating system version This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **14.3** or *14.3** or **14.3* Examples: +*osVersion=14.3* (single osVersion requested) +*osVersion=14.3&osVersion=10.1* (multiple osVersion requested) +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. "Global/AreaName/BuildingName/FloorName") This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **BuildingName** or *BuildingName** or **BuildingName* Examples: *siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) *siteHierarchy=Global/AreaName/BuildingName1/FloorName1&siteHierarchy=Global/AreaName/BuildingName1/FloorName2* (multiple siteHierarchy requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. "globalUuid/areaUuid/buildingUuid/floorUuid") This field supports wildcard (***) character-based search. Ex: **buildingUuid** or *buildingUuid** or **buildingUuid* Examples: *siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid* (single siteHierarchyId requested) *siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid1&siteHierarchyId=globalUuid/areaUuid/buildingUuid1/floorUuid2* (multiple siteHierarchyId requested) +- `site_id` (String) siteId query parameter. The site UUID without the top level hierarchy. (Ex."floorUuid") Examples: *siteId=floorUuid* (single siteId requested) *siteId=floorUuid1&siteId=floorUuid2* (multiple siteId requested) +- `ssid` (String) ssid query parameter. SSID is the name of wireless network to which client connects to. It is also referred to as WLAN ID Wireless Local Area Network Identifier. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **Alpha** or *Alpha** or **Alpha* Examples: -'ssid=Alpha' (single ssid requested) -'ssid=Alpha&ssid=Guest' (multiple ssid requested) +*ssid=Alpha* (single ssid requested) +*ssid=Alpha&ssid=Guest* (multiple ssid requested) - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `type` (String) type query parameter. The client device type whether client is connected to network through Wired or Wireless medium. -- `wlc_name` (String) wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard ('*') character-based search. If the value contains the ('*') character, please use the /query API for regex search. Ex: '*wlc-25*' or 'wlc-25*' or '*wlc-25' +- `wlc_name` (String) wlcName query parameter. Wireless Controller name that reports the wireless client. This field supports wildcard (***) character-based search. If the value contains the (***) character, please use the /query API for regex search. Ex: **wlc-25** or *wlc-25** or **wlc-25* Examples: -'wlcName=wlc-25' (single wlcName requested) -'wlcName=wlc-25&wlc-34' (multiple wlcName requested) +*wlcName=wlc-25* (single wlcName requested) +*wlcName=wlc-25&wlc-34* (multiple wlcName requested) ### Read-Only diff --git a/docs/data-sources/compliance_device_by_id_detail.md b/docs/data-sources/compliance_device_by_id_detail.md index 6409a5a..857b195 100644 --- a/docs/data-sources/compliance_device_by_id_detail.md +++ b/docs/data-sources/compliance_device_by_id_detail.md @@ -38,8 +38,8 @@ output "catalystcenter_compliance_device_by_id_detail_example" { ### Optional -- `category` (String) category query parameter. category can have any value among 'INTENT', 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'DESIGN_OOD' , 'EOX' , 'NETWORK_SETTINGS' -- `compliance_type` (String) complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EOX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. +- `category` (String) category query parameter. category can have any value among 'INTENT', 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'DESIGN_OOD' , 'EoX' , 'NETWORK_SETTINGS' +- `compliance_type` (String) complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EoX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. - `diff_list` (Boolean) diffList query parameter. diff list [ pass true to fetch the diff list ] ### Read-Only diff --git a/docs/data-sources/compliance_device_details.md b/docs/data-sources/compliance_device_details.md index 2c95cf0..9ec4d9b 100644 --- a/docs/data-sources/compliance_device_details.md +++ b/docs/data-sources/compliance_device_details.md @@ -36,7 +36,7 @@ output "catalystcenter_compliance_device_details_example" { ### Optional - `compliance_status` (String) complianceStatus query parameter. Specify "Compliance status(es)" in commas. The Compliance status can be 'COMPLIANT', 'NON_COMPLIANT', 'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'. -- `compliance_type` (String) complianceType query parameter. Specify "Compliance type(s)" in commas. The Compliance type can be 'NETWORK_PROFILE', 'IMAGE', 'FABRIC', 'APPLICATION_VISIBILITY', 'FABRIC', RUNNING_CONFIG', 'NETWORK_SETTINGS', 'WORKFLOW' , 'EOX'. +- `compliance_type` (String) complianceType query parameter. Specify "Compliance type(s)" in commas. The Compliance type can be 'NETWORK_PROFILE', 'IMAGE', 'FABRIC', 'APPLICATION_VISIBILITY', 'FABRIC', RUNNING_CONFIG', 'NETWORK_SETTINGS', 'WORKFLOW' , 'EoX'. - `device_uuid` (String) deviceUuid query parameter. Comma separated "Device Id(s)" - `limit` (Number) limit query parameter. Number of records to be retrieved - `offset` (Number) offset query parameter. offset/starting row diff --git a/docs/data-sources/compliance_device_details_count.md b/docs/data-sources/compliance_device_details_count.md index cf1985a..839f383 100644 --- a/docs/data-sources/compliance_device_details_count.md +++ b/docs/data-sources/compliance_device_details_count.md @@ -33,7 +33,7 @@ output "catalystcenter_compliance_device_details_count_example" { ### Optional - `compliance_status` (String) complianceStatus query parameter. Specify "Compliance status(es)" separated by commas. The Compliance status can be 'COMPLIANT', 'NON_COMPLIANT', 'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'. -- `compliance_type` (String) complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EOX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. +- `compliance_type` (String) complianceType query parameter. Specify "Compliance type(s)" separated by commas. The Compliance type can be 'APPLICATION_VISIBILITY', 'EoX', 'FABRIC', 'IMAGE', 'NETWORK_PROFILE', 'NETWORK_SETTINGS', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. ### Read-Only diff --git a/docs/data-sources/configuration_template_version.md b/docs/data-sources/configuration_template_version.md index e8c1b57..7be7377 100644 --- a/docs/data-sources/configuration_template_version.md +++ b/docs/data-sources/configuration_template_version.md @@ -12,6 +12,9 @@ description: |- It performs read operation on Configuration Templates. - Get all the versions of template by its id +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. ## Example Usage diff --git a/docs/data-sources/diagnostic_validation_sets.md b/docs/data-sources/diagnostic_validation_sets.md index f385df5..283d275 100644 --- a/docs/data-sources/diagnostic_validation_sets.md +++ b/docs/data-sources/diagnostic_validation_sets.md @@ -43,7 +43,7 @@ output "catalystcenter_diagnostic_validation_sets_example" { ### Optional - `id` (String) id path parameter. Validation set id -- `view` (String) view query parameter. When the query parameter 'view=DETAIL' is passed, all validation sets and associated validations will be returned. When the query parameter 'view=DEFAULT' is passed, only validation sets metadata will be returned. +- `view` (String) view query parameter. When the query parameter *view=DETAIL* is passed, all validation sets and associated validations will be returned. When the query parameter *view=DEFAULT* is passed, only validation sets metadata will be returned. ### Read-Only diff --git a/docs/data-sources/diagnostic_validation_workflows.md b/docs/data-sources/diagnostic_validation_workflows.md index bfd815a..867a775 100644 --- a/docs/data-sources/diagnostic_validation_workflows.md +++ b/docs/data-sources/diagnostic_validation_workflows.md @@ -5,7 +5,7 @@ subcategory: "" description: |- It performs read operation on Health and Performance. Retrieves the workflows that have been successfully submitted and are currently available. This is sorted by - 'submitTime'Retrieves workflow details for a workflow id + submitTimeRetrieves workflow details for a workflow id --- # catalystcenter_diagnostic_validation_workflows (Data Source) @@ -13,7 +13,7 @@ description: |- It performs read operation on Health and Performance. - Retrieves the workflows that have been successfully submitted and are currently available. This is sorted by -'submitTime' +*submitTime* - Retrieves workflow details for a workflow id @@ -52,7 +52,7 @@ output "catalystcenter_diagnostic_validation_workflows_example" { - `id` (String) id path parameter. Workflow id - `limit` (Number) limit query parameter. The number of records to show for this page. - `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. -- `run_status` (String) runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is 'PENDING'. If the workflow execution has started, runStatus is 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus is 'COMPLETED'. If the workflow execution fails while running validations, runStatus is 'FAILED'. +- `run_status` (String) runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is *PENDING*. If the workflow execution has started, runStatus is *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus is *COMPLETED*. If the workflow execution fails while running validations, runStatus is *FAILED*. - `start_time` (Number) startTime query parameter. Workflows started after the given time (as milliseconds since UNIX epoch). ### Read-Only diff --git a/docs/data-sources/diagnostic_validation_workflows_count.md b/docs/data-sources/diagnostic_validation_workflows_count.md index 3ef13df..e260b96 100644 --- a/docs/data-sources/diagnostic_validation_workflows_count.md +++ b/docs/data-sources/diagnostic_validation_workflows_count.md @@ -34,7 +34,7 @@ output "catalystcenter_diagnostic_validation_workflows_count_example" { ### Optional - `end_time` (Number) endTime query parameter. Workflows started before the given time (as milliseconds since UNIX epoch). -- `run_status` (String) runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is 'PENDING'. If the workflow execution has started, runStatus is 'IN_PROGRESS'. If the workflow executed is completed with all validations executed, runStatus is 'COMPLETED'. If the workflow execution fails while running validations, runStatus is 'FAILED'. +- `run_status` (String) runStatus query parameter. Execution status of the workflow. If the workflow is successfully submitted, runStatus is *PENDING*. If the workflow execution has started, runStatus is *IN_PROGRESS*. If the workflow executed is completed with all validations executed, runStatus is *COMPLETED*. If the workflow execution fails while running validations, runStatus is *FAILED*. - `start_time` (Number) startTime query parameter. Workflows started after the given time (as milliseconds since UNIX epoch). ### Read-Only diff --git a/docs/data-sources/disasterrecovery_system_operationstatus.md b/docs/data-sources/disasterrecovery_system_operationstatus.md new file mode 100644 index 0000000..6f700b3 --- /dev/null +++ b/docs/data-sources/disasterrecovery_system_operationstatus.md @@ -0,0 +1,82 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_disasterrecovery_system_operationstatus Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Disaster Recovery. + Returns the status of Disaster Recovery operation performed on the system. +--- + +# catalystcenter_disasterrecovery_system_operationstatus (Data Source) + +It performs read operation on Disaster Recovery. + +- Returns the status of Disaster Recovery operation performed on the system. + +## Example Usage + +```terraform +data "catalystcenter_disasterrecovery_system_operationstatus" "example" { + provider = catalystcenter +} + +output "catalystcenter_disasterrecovery_system_operationstatus_example" { + value = data.catalystcenter_disasterrecovery_system_operationstatus.example.item +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `end_timestamp` (String) +- `initiated_by` (String) +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--ipconfig)) +- `message` (String) +- `severity` (String) +- `site` (String) +- `start_timestamp` (String) +- `status` (String) +- `tasks` (List of Object) (see [below for nested schema](#nestedobjatt--item--tasks)) +- `title` (String) + + +### Nested Schema for `item.ipconfig` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + +### Nested Schema for `item.tasks` + +Read-Only: + +- `end_timestamp` (String) +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--tasks--ipconfig)) +- `message` (String) +- `site` (String) +- `start_timestamp` (String) +- `status` (String) +- `title` (String) + + +### Nested Schema for `item.tasks.ipconfig` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) diff --git a/docs/data-sources/disasterrecovery_system_status.md b/docs/data-sources/disasterrecovery_system_status.md new file mode 100644 index 0000000..4f330cb --- /dev/null +++ b/docs/data-sources/disasterrecovery_system_status.md @@ -0,0 +1,184 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_disasterrecovery_system_status Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Disaster Recovery. + Detailed and Summarized status of DR components (Active, Standby and Witness system's health). +--- + +# catalystcenter_disasterrecovery_system_status (Data Source) + +It performs read operation on Disaster Recovery. + +- Detailed and Summarized status of DR components (Active, Standby and Witness system's health). + +## Example Usage + +```terraform +data "catalystcenter_disasterrecovery_system_status" "example" { + provider = catalystcenter +} + +output "catalystcenter_disasterrecovery_system_status_example" { + value = data.catalystcenter_disasterrecovery_system_status.example.item +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--ipconfig)) +- `ipsec_tunnel` (List of Object) (see [below for nested schema](#nestedobjatt--item--ipsec_tunnel)) +- `main` (List of Object) (see [below for nested schema](#nestedobjatt--item--main)) +- `recovery` (List of Object) (see [below for nested schema](#nestedobjatt--item--recovery)) +- `site` (String) +- `state` (String) +- `witness` (List of Object) (see [below for nested schema](#nestedobjatt--item--witness)) + + +### Nested Schema for `item.ipconfig` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + +### Nested Schema for `item.ipsec_tunnel` + +Read-Only: + +- `side_a` (String) +- `side_b` (String) +- `status` (String) + + + +### Nested Schema for `item.main` + +Read-Only: + +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--main--ipconfig)) +- `nodes` (List of Object) (see [below for nested schema](#nestedobjatt--item--main--nodes)) +- `state` (String) + + +### Nested Schema for `item.main.ipconfig` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + +### Nested Schema for `item.main.nodes` + +Read-Only: + +- `hostname` (String) +- `ipaddresses` (List of Object) (see [below for nested schema](#nestedobjatt--item--main--nodes--ipaddresses)) +- `state` (String) + + +### Nested Schema for `item.main.nodes.state` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + + + +### Nested Schema for `item.recovery` + +Read-Only: + +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--recovery--ipconfig)) +- `nodes` (List of Object) (see [below for nested schema](#nestedobjatt--item--recovery--nodes)) +- `state` (String) + + +### Nested Schema for `item.recovery.ipconfig` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + +### Nested Schema for `item.recovery.nodes` + +Read-Only: + +- `hostname` (String) +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--recovery--nodes--ipconfig)) +- `state` (String) + + +### Nested Schema for `item.recovery.nodes.state` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + + + +### Nested Schema for `item.witness` + +Read-Only: + +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--witness--ipconfig)) +- `nodes` (List of Object) (see [below for nested schema](#nestedobjatt--item--witness--nodes)) +- `state` (String) + + +### Nested Schema for `item.witness.ipconfig` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) + + + +### Nested Schema for `item.witness.nodes` + +Read-Only: + +- `hostname` (String) +- `ipconfig` (List of Object) (see [below for nested schema](#nestedobjatt--item--witness--nodes--ipconfig)) +- `state` (String) + + +### Nested Schema for `item.witness.nodes.state` + +Read-Only: + +- `interface` (String) +- `ip` (String) +- `vip` (String) diff --git a/docs/data-sources/dnac_packages.md b/docs/data-sources/dnac_packages.md index 2c943a7..6d15aab 100644 --- a/docs/data-sources/dnac_packages.md +++ b/docs/data-sources/dnac_packages.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_dnac_packages Data Source - terraform-provider-catal subcategory: "" description: |- It performs read operation on Platform. - Provides information such as name, version of packages installed on the Catalyst Center. + Provides information such as name, version of packages installed on the DNA center. --- # catalystcenter_dnac_packages (Data Source) It performs read operation on Platform. -- Provides information such as name, version of packages installed on the Catalyst Center. +- Provides information such as name, version of packages installed on the DNA center. ## Example Usage diff --git a/docs/data-sources/endpoint_analytics_profiling_rules.md b/docs/data-sources/endpoint_analytics_profiling_rules.md new file mode 100644 index 0000000..c624e15 --- /dev/null +++ b/docs/data-sources/endpoint_analytics_profiling_rules.md @@ -0,0 +1,182 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_endpoint_analytics_profiling_rules Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AIEndpointAnalytics. + This data source fetches the list of profiling rules. It can be used to show profiling rules in client applications, + or export those from an environment. 'POST /profiling-rules/bulk' API can be used to import such exported rules into + another environment. If this API is used to export rules to be imported into another Cisco DNA Center system, then + ensure that 'includeDeleted' parameter is 'true', so that deleted rules get synchronized correctly. Use query parameters + to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the + response. By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, + if required. 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system.Fetches details of the profiling rule for the given 'ruleId'. +--- + +# catalystcenter_endpoint_analytics_profiling_rules (Data Source) + +It performs read operation on AIEndpointAnalytics. + +- This data source fetches the list of profiling rules. It can be used to show profiling rules in client applications, +or export those from an environment. 'POST /profiling-rules/bulk' API can be used to import such exported rules into +another environment. If this API is used to export rules to be imported into another Cisco DNA Center system, then +ensure that 'includeDeleted' parameter is 'true', so that deleted rules get synchronized correctly. Use query parameters +to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the +response. By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, +if required. 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system. + +- Fetches details of the profiling rule for the given 'ruleId'. + +## Example Usage + +```terraform +data "catalystcenter_endpoint_analytics_profiling_rules" "example" { + provider = catalystcenter + include_deleted = "false" + limit = 1 + offset = 1 + order = "string" + rule_type = "string" + sort_by = "string" +} + +output "catalystcenter_endpoint_analytics_profiling_rules_example" { + value = data.catalystcenter_endpoint_analytics_profiling_rules.example.items +} + +data "catalystcenter_endpoint_analytics_profiling_rules" "example" { + provider = catalystcenter + rule_id = "string" +} + +output "catalystcenter_endpoint_analytics_profiling_rules_example" { + value = data.catalystcenter_endpoint_analytics_profiling_rules.example.item +} +``` + + +## Schema + +### Optional + +- `include_deleted` (Boolean) includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +- `limit` (Number) limit query parameter. Maximum number of records to be fetched. If not provided, 500 records will be fetched by default. To fetch all the records in the system, provide a large value for this parameter. +- `offset` (Number) offset query parameter. Record offset to start data fetch at. Offset starts at zero. +- `order` (String) order query parameter. Order to be used for sorting. +- `rule_id` (String) ruleId path parameter. Unique rule identifier +- `rule_type` (String) ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. +- `sort_by` (String) sortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more time if sorting is requested. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `item` + +Read-Only: + +- `cluster_id` (String) +- `condition_groups` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups)) +- `is_deleted` (String) +- `last_modified_by` (String) +- `last_modified_on` (Number) +- `plugin_id` (String) +- `rejected` (String) +- `result` (List of Object) (see [below for nested schema](#nestedobjatt--item--result)) +- `rule_id` (String) +- `rule_name` (String) +- `rule_priority` (Number) +- `rule_type` (String) +- `rule_version` (Number) +- `source_priority` (Number) +- `used_attributes` (List of String) + + +### Nested Schema for `item.condition_groups` + +Read-Only: + +- `condition` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `item.condition_groups.condition` + +Read-Only: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `item.result` + +Read-Only: + +- `device_type` (List of String) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `operating_system` (List of String) + + + + +### Nested Schema for `items` + +Read-Only: + +- `cluster_id` (String) +- `condition_groups` (List of Object) (see [below for nested schema](#nestedobjatt--items--condition_groups)) +- `is_deleted` (String) +- `last_modified_by` (String) +- `last_modified_on` (Number) +- `plugin_id` (String) +- `rejected` (String) +- `result` (List of Object) (see [below for nested schema](#nestedobjatt--items--result)) +- `rule_id` (String) +- `rule_name` (String) +- `rule_priority` (Number) +- `rule_type` (String) +- `rule_version` (Number) +- `source_priority` (Number) +- `used_attributes` (List of String) + + +### Nested Schema for `items.condition_groups` + +Read-Only: + +- `condition` (List of Object) (see [below for nested schema](#nestedobjatt--items--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `items.condition_groups.condition` + +Read-Only: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `items.result` + +Read-Only: + +- `device_type` (List of String) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `operating_system` (List of String) diff --git a/docs/data-sources/file.md b/docs/data-sources/file.md index 64bf401..1e508cc 100644 --- a/docs/data-sources/file.md +++ b/docs/data-sources/file.md @@ -18,7 +18,6 @@ It performs read operation on File. ```terraform data "catalystcenter_file" "example" { provider = catalystcenter - dirpath = "string" file_id = "string" } diff --git a/docs/data-sources/floors_settings.md b/docs/data-sources/floors_settings.md deleted file mode 100644 index 6df456e..0000000 --- a/docs/data-sources/floors_settings.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_floors_settings Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Site Design. - Gets UI user preference for floor unit system. ---- - -# catalystcenter_floors_settings (Data Source) - -It performs read operation on Site Design. - -- Gets UI user preference for floor unit system. - -## Example Usage - -```terraform -data "catalystcenter_floors_settings" "example" { - provider = catalystcenter -} - -output "catalystcenter_floors_settings_example" { - value = data.catalystcenter_floors_settings.example.item -} -``` - - -## Schema - -### Read-Only - -- `id` (String) The ID of this resource. -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - - -### Nested Schema for `item` - -Read-Only: - -- `units_of_measure` (String) diff --git a/docs/data-sources/images.md b/docs/data-sources/images.md index 0f5a08a..cc269c4 100644 --- a/docs/data-sources/images.md +++ b/docs/data-sources/images.md @@ -44,17 +44,17 @@ output "catalystcenter_images_example" { ### Optional -- `golden` (Boolean) golden query parameter. When set to 'true', it will retrieve the images marked as tagged golden. When set to 'false', it will retrieve the images marked as not tagged golden. -- `has_addon_images` (Boolean) hasAddonImages query parameter. When set to 'true', it will retrieve the images which have add-on images. When set to 'false', it will retrieve the images which do not have add-on images. -- `imported` (Boolean) imported query parameter. When the value is set to 'true', it will include physically imported images. Conversely, when the value is set to 'false', it will include image records from the cloud. The identifier for cloud images can be utilized to download images from Cisco.com to the disk. +- `golden` (Boolean) golden query parameter. When set to *true*, it will retrieve the images marked as tagged golden. When set to *false*, it will retrieve the images marked as not tagged golden. +- `has_addon_images` (Boolean) hasAddonImages query parameter. When set to *true*, it will retrieve the images which have add-on images. When set to *false*, it will retrieve the images which do not have add-on images. +- `imported` (Boolean) imported query parameter. When the value is set to *true*, it will include physically imported images. Conversely, when the value is set to *false*, it will include image records from the cloud. The identifier for cloud images can be utilized to download images from Cisco.com to the disk. - `integrity` (String) integrity query parameter. Filter with verified images using Integrity Verification Available values: UNKNOWN, VERIFIED -- `is_addon_images` (Boolean) isAddonImages query parameter. When set to 'true', it will retrieve the images that an add-on image. When set to 'false', it will retrieve the images that are not add-on images +- `is_addon_images` (Boolean) isAddonImages query parameter. When set to *true*, it will retrieve the images that an add-on image. When set to *false*, it will retrieve the images that are not add-on images - `limit` (Number) limit query parameter. The number of records to show for this page. The minimum and maximum values are 1 and 500, respectively. - `name` (String) name query parameter. Filter with software image or add-on name. Supports partial case-insensitive search. A minimum of 3 characters is required for the search. - `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. The minimum value is 1. -- `product_name_ordinal` (Number) productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of API '/dna/intent/api/v1/siteWiseProductNames' -- `site_id` (String) siteId query parameter. Site identifier to get the list of all available products under the site. The default value is the global site. See https://developer.cisco.com/docs/dna-center/get-site for 'siteId' -- `supervisor_product_name_ordinal` (Number) supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The 'supervisorProductNameOrdinal' can be obtained from the response of API '/dna/intent/api/v1/siteWiseProductNames' +- `product_name_ordinal` (Number) productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of API */dna/intent/api/v1/siteWiseProductNames* +- `site_id` (String) siteId query parameter. Site identifier to get the list of all available products under the site. The default value is the global site. See https://developer.cisco.com/docs/dna-center/get-site for *siteId* +- `supervisor_product_name_ordinal` (Number) supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The *supervisorProductNameOrdinal* can be obtained from the response of API */dna/intent/api/v1/siteWiseProductNames* - `version` (String) version query parameter. Filter with image version. Supports partial case-insensitive search. A minimum of 3 characters is required for the search. ### Read-Only diff --git a/docs/data-sources/images_addon_images.md b/docs/data-sources/images_addon_images.md index 7eef01c..76ca775 100644 --- a/docs/data-sources/images_addon_images.md +++ b/docs/data-sources/images_addon_images.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_images_addon_images Data Source - terraform-provider subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). - Retrieves the list of applicable add-on images if available for the given software image. 'id' can be obtained from + Retrieves the list of applicable add-on images if available for the given software image. id can be obtained from the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. --- @@ -12,7 +12,7 @@ description: |- It performs read operation on Software Image Management (SWIM). -- Retrieves the list of applicable add-on images if available for the given software image. 'id' can be obtained from +- Retrieves the list of applicable add-on images if available for the given software image. *id* can be obtained from the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. ## Example Usage @@ -33,7 +33,7 @@ output "catalystcenter_images_addon_images_example" { ### Required -- `id` (String) id path parameter. Software image identifier. Check '/dna/intent/api/v1/images?hasAddonImages=true' API to get the same. +- `id` (String) id path parameter. Software image identifier. Check */dna/intent/api/v1/images?hasAddonImages=true* API to get the same. ### Read-Only diff --git a/docs/data-sources/images_addon_images_count.md b/docs/data-sources/images_addon_images_count.md index 80ed9f4..9b80289 100644 --- a/docs/data-sources/images_addon_images_count.md +++ b/docs/data-sources/images_addon_images_count.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_images_addon_images_count Data Source - terraform-pr subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). - Count of add-on images available for the given software image identifier, 'id' can be obtained from the response of + Count of add-on images available for the given software image identifier, id can be obtained from the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. --- @@ -12,7 +12,7 @@ description: |- It performs read operation on Software Image Management (SWIM). -- Count of add-on images available for the given software image identifier, 'id' can be obtained from the response of +- Count of add-on images available for the given software image identifier, *id* can be obtained from the response of API [ /dna/intent/api/v1/images?hasAddonImages=true ]. ## Example Usage @@ -33,7 +33,7 @@ output "catalystcenter_images_addon_images_count_example" { ### Required -- `id` (String) id path parameter. Software image identifier. Check API '/dna/intent/api/v1/images' for id from response. +- `id` (String) id path parameter. Software image identifier. Check API */dna/intent/api/v1/images* for id from response. ### Read-Only diff --git a/docs/data-sources/images_count.md b/docs/data-sources/images_count.md index 59173b7..050888d 100644 --- a/docs/data-sources/images_count.md +++ b/docs/data-sources/images_count.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_images_count Data Source - terraform-provider-cataly subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). - Returns the count of software images for given 'siteId'. The default value of siteId is global + Returns the count of software images for given siteId. The default value of siteId is global --- # catalystcenter_images_count (Data Source) It performs read operation on Software Image Management (SWIM). -- Returns the count of software images for given 'siteId'. The default value of siteId is global +- Returns the count of software images for given *siteId*. The default value of siteId is global ## Example Usage @@ -40,15 +40,15 @@ output "catalystcenter_images_count_example" { ### Optional -- `golden` (String) golden query parameter. When set to 'true', it will retrieve the images marked tagged golden. When set to 'false', it will retrieve the images marked not tagged golden. -- `has_addon_images` (Boolean) hasAddonImages query parameter. When set to 'true', it will retrieve the images which have add-on images. When set to 'false', it will retrieve the images which do not have add-on images. -- `imported` (Boolean) imported query parameter. When the value is set to 'true', it will include physically imported images. Conversely, when the value is set to 'false', it will include image records from the cloud. The identifier for cloud images can be utilised to download images from Cisco.com to the disk. +- `golden` (String) golden query parameter. When set to *true*, it will retrieve the images marked tagged golden. When set to *false*, it will retrieve the images marked not tagged golden. +- `has_addon_images` (Boolean) hasAddonImages query parameter. When set to *true*, it will retrieve the images which have add-on images. When set to *false*, it will retrieve the images which do not have add-on images. +- `imported` (Boolean) imported query parameter. When the value is set to *true*, it will include physically imported images. Conversely, when the value is set to *false*, it will include image records from the cloud. The identifier for cloud images can be utilised to download images from Cisco.com to the disk. - `integrity` (String) integrity query parameter. Filter with verified images using Integrity Verification Available values: UNKNOWN, VERIFIED -- `is_addon_images` (Boolean) isAddonImages query parameter. When set to 'true', it will retrieve the images that an add-on image. When set to 'false', it will retrieve the images that are not add-on images +- `is_addon_images` (Boolean) isAddonImages query parameter. When set to *true*, it will retrieve the images that an add-on image. When set to *false*, it will retrieve the images that are not add-on images - `name` (String) name query parameter. Filter with software image or add-on name. Supports partial case-insensitive search. A minimum of 3 characters is required for the search -- `product_name_ordinal` (Number) productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of the API '/dna/intent/api/v1/siteWiseProductNames'. +- `product_name_ordinal` (Number) productNameOrdinal query parameter. The product name ordinal is a unique value for each network device product. The productNameOrdinal can be obtained from the response of the API */dna/intent/api/v1/siteWiseProductNames*. - `site_id` (String) siteId query parameter. Site identifier to get the list of all available products under the site. The default value is the global site. See https://developer.cisco.com/docs/dna-center/get-site for siteId -- `supervisor_product_name_ordinal` (Number) supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The 'supervisorProductNameOrdinal' can be obtained from the response of API '/dna/intent/api/v1/siteWiseProductNames' +- `supervisor_product_name_ordinal` (Number) supervisorProductNameOrdinal query parameter. The supervisor engine module ordinal is a unique value for each supervisor module. The *supervisorProductNameOrdinal* can be obtained from the response of API */dna/intent/api/v1/siteWiseProductNames* - `version` (String) version query parameter. Filter with image version. Supports partial case-insensitive search. A minimum of 3 characters is required for the search ### Read-Only diff --git a/docs/data-sources/images_site_wise_product_names.md b/docs/data-sources/images_site_wise_product_names.md index 935128a..db7667c 100644 --- a/docs/data-sources/images_site_wise_product_names.md +++ b/docs/data-sources/images_site_wise_product_names.md @@ -5,7 +5,7 @@ subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). Returns a list of network device product names and associated sites for a given image identifier. Refer - '/dna/intent/api/v1/images' API for obtaining 'imageId'. + /dna/intent/api/v1/images API for obtaining imageId. --- # catalystcenter_images_site_wise_product_names (Data Source) @@ -13,7 +13,7 @@ description: |- It performs read operation on Software Image Management (SWIM). - Returns a list of network device product names and associated sites for a given image identifier. Refer -'/dna/intent/api/v1/images' API for obtaining 'imageId'. +*/dna/intent/api/v1/images* API for obtaining *imageId*. ## Example Usage @@ -39,16 +39,16 @@ output "catalystcenter_images_site_wise_product_names_example" { ### Required -- `image_id` (String) imageId path parameter. Software image identifier. Refer '/dna/intent/api/v1/images' API for obtaining 'imageId' +- `image_id` (String) imageId path parameter. Software image identifier. Refer */dna/intent/api/v1/images* API for obtaining *imageId* ### Optional -- `assigned` (String) assigned query parameter. Filter with the assigned/unassigned, 'ASSIGNED' option will filter network device products that are associated with the given image. The 'NOT_ASSIGNED' option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED +- `assigned` (String) assigned query parameter. Filter with the assigned/unassigned, *ASSIGNED* option will filter network device products that are associated with the given image. The *NOT_ASSIGNED* option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED - `limit` (Number) limit query parameter. The number of records to show for this page. The minimum and maximum values are 1 and 500, respectively - `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. The minimum value is 1 - `product_id` (String) productId query parameter. Filter with product ID (PID) - `product_name` (String) productName query parameter. Filter with network device product name. Supports partial case-insensitive search. A minimum of 3 characters is required for the search. -- `recommended` (String) recommended query parameter. Filter with recommended source. If 'CISCO' then the network device product assigned was recommended by Cisco and 'USER' then the user has manually assigned. Available values: CISCO, USER +- `recommended` (String) recommended query parameter. Filter with recommended source. If *CISCO* then the network device product assigned was recommended by Cisco and *USER* then the user has manually assigned. Available values: CISCO, USER ### Read-Only diff --git a/docs/data-sources/images_site_wise_product_names_count.md b/docs/data-sources/images_site_wise_product_names_count.md index 4f70c2e..355f9e8 100644 --- a/docs/data-sources/images_site_wise_product_names_count.md +++ b/docs/data-sources/images_site_wise_product_names_count.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_images_site_wise_product_names_count Data Source - t subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). - Returns count of assigned network device product for a given image identifier. Refer '/dna/intent/api/v1/images' API - for obtaining 'imageId' + Returns count of assigned network device product for a given image identifier. Refer /dna/intent/api/v1/images API + for obtaining imageId --- # catalystcenter_images_site_wise_product_names_count (Data Source) It performs read operation on Software Image Management (SWIM). -- Returns count of assigned network device product for a given image identifier. Refer '/dna/intent/api/v1/images' API -for obtaining 'imageId' +- Returns count of assigned network device product for a given image identifier. Refer */dna/intent/api/v1/images* API +for obtaining *imageId* ## Example Usage @@ -37,14 +37,14 @@ output "catalystcenter_images_site_wise_product_names_count_example" { ### Required -- `image_id` (String) imageId path parameter. Software image identifier. Refer '/dna/intent/api/v/images' API for obtaining 'imageId' +- `image_id` (String) imageId path parameter. Software image identifier. Refer */dna/intent/api/v/images* API for obtaining *imageId* ### Optional -- `assigned` (String) assigned query parameter. Filter with the assigned/unassigned, 'ASSIGNED' option will filter network device products that are associated with the given image. The 'NOT_ASSIGNED' option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED +- `assigned` (String) assigned query parameter. Filter with the assigned/unassigned, *ASSIGNED* option will filter network device products that are associated with the given image. The *NOT_ASSIGNED* option will filter network device products that have not yet been associated with the given image but apply to it. Available values: ASSIGNED, NOT_ASSIGNED - `product_id` (String) productId query parameter. Filter with product ID (PID) - `product_name` (String) productName query parameter. Filter with network device product name. Supports partial case-insensitive search. A minimum of 3 characters are required for search. -- `recommended` (String) recommended query parameter. Filter with recommended source. If 'CISCO' then the network device product assigned was recommended by Cisco and 'USER' then the user has manually assigned. Available values : CISCO, USER +- `recommended` (String) recommended query parameter. Filter with recommended source. If *CISCO* then the network device product assigned was recommended by Cisco and *USER* then the user has manually assigned. Available values : CISCO, USER ### Read-Only diff --git a/docs/data-sources/interfaces.md b/docs/data-sources/interfaces.md index db44a76..e5a3a05 100644 --- a/docs/data-sources/interfaces.md +++ b/docs/data-sources/interfaces.md @@ -97,48 +97,48 @@ attributes=name (single attribute requested) attributes=name,description,duplexOper (multiple attributes with comma separator) - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. - `id` (String) id path parameter. The interface Uuid -- `interface_id` (String) interfaceId query parameter. The list of Interface Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +- `interface_id` (String) interfaceId query parameter. The list of Interface Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c' (single interface uuid ) -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple Interface uuid with & separator) -- `interface_name` (String) interfaceName query parameter. The list of Interface name (Ex. 'GigabitEthernet1/0/1') This field supports wildcard ('*') character-based search. Ex: '*1/0/1*' or '1/0/1*' or '*1/0/1' +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c* (single interface uuid ) +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple Interface uuid with & separator) +- `interface_name` (String) interfaceName query parameter. The list of Interface name (Ex. *GigabitEthernet1/0/1*) This field supports wildcard (***) character-based search. Ex: **1/0/1** or *1/0/1** or **1/0/1* Examples: -'interfaceNames=GigabitEthernet1/0/1' (single interface name) -'interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1' (multiple interface names with & separator) +*interfaceNames=GigabitEthernet1/0/1* (single interface name) +*interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1* (multiple interface names with & separator) - `limit` (Number) limit query parameter. Maximum number of records to return -- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) -- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) +- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) -- `network_device_mac_address` (String) networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. '64:f6:9d:07:9a:00') -This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) +- `network_device_mac_address` (String) networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. *64:f6:9d:07:9a:00*) +This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: -'networkDeviceMacAddress=64:f6:9d:07:9a:00' -'networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77' (multiple networkDevice MAC addresses with & separator) +*networkDeviceMacAddress=64:f6:9d:07:9a:00* +*networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77* (multiple networkDevice MAC addresses with & separator) - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) - `sort_by` (String) sortBy query parameter. A field within the response to sort by. - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `view` (String) view query parameter. Interface data model views ### Read-Only diff --git a/docs/data-sources/interfaces_count.md b/docs/data-sources/interfaces_count.md index c93649f..3eca42b 100644 --- a/docs/data-sources/interfaces_count.md +++ b/docs/data-sources/interfaces_count.md @@ -45,44 +45,44 @@ output "catalystcenter_interfaces_count_example" { ### Optional - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -- `interface_id` (String) interfaceId query parameter. The list of Interface Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +- `interface_id` (String) interfaceId query parameter. The list of Interface Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c' (single interface uuid ) -'interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple Interface uuid with & separator) -- `interface_name` (String) interfaceName query parameter. The list of Interface name (Ex. 'GigabitEthernet1/0/1') This field supports wildcard ('*') character-based search. Ex: '*1/0/1*' or '1/0/1*' or '*1/0/1' +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c* (single interface uuid ) +*interfaceId=6bef213c-19ca-4170-8375-b694e251101c&32219612-819e-4b5e-a96b-cf22aca13dd9&2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple Interface uuid with & separator) +- `interface_name` (String) interfaceName query parameter. The list of Interface name (Ex. *GigabitEthernet1/0/1*) This field supports wildcard (***) character-based search. Ex: **1/0/1** or *1/0/1** or **1/0/1* Examples: -'interfaceNames=GigabitEthernet1/0/1' (single interface name) -'interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1' (multiple interface names with & separator) -- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. '6bef213c-19ca-4170-8375-b694e251101c') +*interfaceNames=GigabitEthernet1/0/1* (single interface name) +*interfaceNames=GigabitEthernet1/0/1&GigabitEthernet2/0/1&GigabitEthernet3/0/1* (multiple interface names with & separator) +- `network_device_id` (String) networkDeviceId query parameter. The list of Network Device Uuids. (Ex. *6bef213c-19ca-4170-8375-b694e251101c*) Examples: -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c' (single networkDeviceId requested) -'networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0' (multiple networkDeviceIds with & separator) -- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. '121.1.1.10') -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c* (single networkDeviceId requested) +*networkDeviceId=6bef213c-19ca-4170-8375-b694e251101c&networkDeviceId=32219612-819e-4b5e-a96b-cf22aca13dd9&networkDeviceId=2541e9a7-b80d-4955-8aa2-79b233318ba0* (multiple networkDeviceIds with & separator) +- `network_device_ip_address` (String) networkDeviceIpAddress query parameter. The list of Network Device management IP Address. (Ex. *121.1.1.10*) +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: -'networkDeviceIpAddress=121.1.1.10' -'networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10' (multiple networkDevice IP Address with & separator) -- `network_device_mac_address` (String) networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. '64:f6:9d:07:9a:00') -This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' +*networkDeviceIpAddress=121.1.1.10* +*networkDeviceIpAddress=121.1.1.10&networkDeviceIpAddress=172.20.1.10&networkDeviceIpAddress=10.10.20.10* (multiple networkDevice IP Address with & separator) +- `network_device_mac_address` (String) networkDeviceMacAddress query parameter. The list of Network Device MAC Address. (Ex. *64:f6:9d:07:9a:00*) +This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: -'networkDeviceMacAddress=64:f6:9d:07:9a:00' -'networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77' (multiple networkDevice MAC addresses with & separator) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' +*networkDeviceMacAddress=64:f6:9d:07:9a:00* +*networkDeviceMacAddress=64:f6:9d:07:9a:00&networkDeviceMacAddress=70:56:9d:07:ac:77* (multiple networkDevice MAC addresses with & separator) +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. ### Read-Only diff --git a/docs/data-sources/interfaces_members_associations.md b/docs/data-sources/interfaces_members_associations.md index 1df23f0..fb58445 100644 --- a/docs/data-sources/interfaces_members_associations.md +++ b/docs/data-sources/interfaces_members_associations.md @@ -17,19 +17,7 @@ It performs read operation on Tag. in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is tagged, it is called a member of the tag. -## Example Usage - -```terraform -data "catalystcenter_interfaces_members_associations" "example" { - provider = catalystcenter - limit = 1 - offset = 1 -} - -output "catalystcenter_interfaces_members_associations_example" { - value = data.catalystcenter_interfaces_members_associations.example.items -} -``` + ## Schema diff --git a/docs/data-sources/interfaces_members_associations_count.md b/docs/data-sources/interfaces_members_associations_count.md index 9957375..6df6017 100644 --- a/docs/data-sources/interfaces_members_associations_count.md +++ b/docs/data-sources/interfaces_members_associations_count.md @@ -15,17 +15,7 @@ It performs read operation on Tag. - Fetches the count of interfaces that are associated with at least one tag. A tag is a user-defined or system-defined construct to group resources. When an interface is tagged, it is called a member of the tag. -## Example Usage -```terraform -data "catalystcenter_interfaces_members_associations_count" "example" { - provider = catalystcenter -} - -output "catalystcenter_interfaces_members_associations_count_example" { - value = data.catalystcenter_interfaces_members_associations_count.example.item -} -``` ## Schema diff --git a/docs/data-sources/ipam_server_setting.md b/docs/data-sources/ipam_server_setting.md index 6912e12..c4e5953 100644 --- a/docs/data-sources/ipam_server_setting.md +++ b/docs/data-sources/ipam_server_setting.md @@ -15,17 +15,7 @@ It performs read operation on System Settings. - Retrieves configuration details of the external IPAM server. If an external IPAM server has not been created, this resource will return a '404' response. -## Example Usage -```terraform -data "catalystcenter_ipam_server_setting" "example" { - provider = catalystcenter -} - -output "catalystcenter_ipam_server_setting_example" { - value = data.catalystcenter_ipam_server_setting.example.item -} -``` ## Schema diff --git a/docs/data-sources/network_device_config.md b/docs/data-sources/network_device_config.md index 6b8c7c5..974f248 100644 --- a/docs/data-sources/network_device_config.md +++ b/docs/data-sources/network_device_config.md @@ -3,17 +3,19 @@ page_title: "catalystcenter_network_device_config Data Source - terraform-provider-catalystcenter" subcategory: "" description: |- - It performs read operation on Configuration Archive. - Returns the historical device configurations (running configuration , startup configuration , vlan if applicable) by - specified criteria + It performs read operation on Devices. + Returns the config for all devices. This data source has been deprecated and will not be available in a Cisco Catalyst + Center release after Nov 1st 2024 23:59:59 GMT.Returns the device config by specified device ID --- # catalystcenter_network_device_config (Data Source) -It performs read operation on Configuration Archive. +It performs read operation on Devices. -- Returns the historical device configurations (running configuration , startup configuration , vlan if applicable) by -specified criteria +- Returns the config for all devices. This data source has been deprecated and will not be available in a Cisco Catalyst +Center release after Nov 1st 2024 23:59:59 GMT. + +- Returns the device config by specified device ID ## Example Usage @@ -41,63 +43,36 @@ output "catalystcenter_network_device_config_example" { ### Optional -- `created_by` (String) createdBy query parameter. Comma separated values for createdBy SCHEDULED, USER, CONFIG_CHANGE_EVENT, SCHEDULED_FIRST_TIME, DR_CALL_BACK, PRE_DEPLOY -- `created_time` (String) createdTime query parameter. Supported with logical filters GT,GTE,LT,LTE & BT : time in milliseconds (epoc format) -- `device_id` (String) deviceId query parameter. comma separated device id for example cf35b0a1-407f-412f-b2f4-f0c3156695f9,aaa38191-0c22-4158-befd-779a09d7cec1 . if device id is not provided it will fetch for all devices -- `file_type` (String) fileType query parameter. Config File Type can be RUNNINGCONFIG or STARTUPCONFIG -- `limit` (Number) limit query parameter. -- `offset` (Number) offset query parameter. +- `network_device_id` (String) networkDeviceId path parameter. ### Read-Only - `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - -### Nested Schema for `items` - -Read-Only: - -- `device_id` (String) -- `device_name` (String) -- `ip_address` (String) -- `versions` (List of Object) (see [below for nested schema](#nestedobjatt--items--versions)) - - -### Nested Schema for `items.versions` + +### Nested Schema for `item` Read-Only: -- `config_change_type` (String) -- `created_by` (String) -- `created_time` (Number) -- `files` (List of Object) (see [below for nested schema](#nestedobjatt--items--versions--files)) -- `id` (String) -- `last_updated_time` (Number) -- `startup_running_status` (String) -- `syslog_config_event_dto` (List of Object) (see [below for nested schema](#nestedobjatt--items--versions--syslog_config_event_dto)) -- `tags` (List of String) +- `response` (String) +- `version` (String) - -### Nested Schema for `items.versions.files` -Read-Only: - -- `download_path` (String) -- `file_id` (String) -- `file_type` (String) - - - -### Nested Schema for `items.versions.syslog_config_event_dto` + +### Nested Schema for `items` Read-Only: -- `config_method` (String) -- `device_uuid` (String) -- `login_ip_address` (String) -- `out_of_band` (String) -- `process_name` (String) -- `syslog_time` (Number) -- `terminal_name` (String) -- `user_name` (String) +- `attribute_info` (String) +- `cdp_neighbors` (String) +- `health_monitor` (String) +- `id` (String) +- `intf_description` (String) +- `inventory` (String) +- `ip_intf_brief` (String) +- `mac_address_table` (String) +- `running_config` (String) +- `snmp` (String) +- `version` (String) diff --git a/docs/data-sources/network_device_config_.md b/docs/data-sources/network_device_config_.md index 15523c1..c6e7117 100644 --- a/docs/data-sources/network_device_config_.md +++ b/docs/data-sources/network_device_config_.md @@ -3,17 +3,19 @@ page_title: "catalystcenter_network_device_config_ Data Source - terraform-provider-catalystcenter" subcategory: "" description: |- - It performs read operation on Configuration Archive. - Returns the historical device configurations (running configuration , startup configuration , vlan if applicable) by - specified criteria + It performs read operation on Devices. + Returns the config for all devices. This data source has been deprecated and will not be available in a Cisco Catalyst + Center release after Nov 1st 2024 23:59:59 GMT.Returns the device config by specified device ID --- # catalystcenter_network_device_config_ (Data Source) -It performs read operation on Configuration Archive. +It performs read operation on Devices. -- Returns the historical device configurations (running configuration , startup configuration , vlan if applicable) by -specified criteria +- Returns the config for all devices. This data source has been deprecated and will not be available in a Cisco Catalyst +Center release after Nov 1st 2024 23:59:59 GMT. + +- Returns the device config by specified device ID ## Example Usage @@ -38,63 +40,36 @@ output "catalystcenter_network_device_config__example" { ### Optional -- `created_by` (String) createdBy query parameter. Comma separated values for createdBy SCHEDULED, USER, CONFIG_CHANGE_EVENT, SCHEDULED_FIRST_TIME, DR_CALL_BACK, PRE_DEPLOY -- `created_time` (String) createdTime query parameter. Supported with logical filters GT,GTE,LT,LTE & BT : time in milliseconds (epoc format) -- `device_id` (String) deviceId query parameter. comma separated device id for example cf35b0a1-407f-412f-b2f4-f0c3156695f9,aaa38191-0c22-4158-befd-779a09d7cec1 . if device id is not provided it will fetch for all devices -- `file_type` (String) fileType query parameter. Config File Type can be RUNNINGCONFIG or STARTUPCONFIG -- `limit` (Number) limit query parameter. -- `offset` (Number) offset query parameter. +- `network_device_id` (String) networkDeviceId path parameter. ### Read-Only - `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - -### Nested Schema for `items` - -Read-Only: - -- `device_id` (String) -- `device_name` (String) -- `ip_address` (String) -- `versions` (List of Object) (see [below for nested schema](#nestedobjatt--items--versions)) - - -### Nested Schema for `items.versions` + +### Nested Schema for `item` Read-Only: -- `config_change_type` (String) -- `created_by` (String) -- `created_time` (Number) -- `files` (List of Object) (see [below for nested schema](#nestedobjatt--items--versions--files)) -- `id` (String) -- `last_updated_time` (Number) -- `startup_running_status` (String) -- `syslog_config_event_dto` (List of Object) (see [below for nested schema](#nestedobjatt--items--versions--syslog_config_event_dto)) -- `tags` (List of String) +- `response` (String) +- `version` (String) - -### Nested Schema for `items.versions.files` -Read-Only: - -- `download_path` (String) -- `file_id` (String) -- `file_type` (String) - - - -### Nested Schema for `items.versions.syslog_config_event_dto` + +### Nested Schema for `items` Read-Only: -- `config_method` (String) -- `device_uuid` (String) -- `login_ip_address` (String) -- `out_of_band` (String) -- `process_name` (String) -- `syslog_time` (Number) -- `terminal_name` (String) -- `user_name` (String) +- `attribute_info` (String) +- `cdp_neighbors` (String) +- `health_monitor` (String) +- `id` (String) +- `intf_description` (String) +- `inventory` (String) +- `ip_intf_brief` (String) +- `mac_address_table` (String) +- `running_config` (String) +- `snmp` (String) +- `version` (String) diff --git a/docs/data-sources/network_device_custom_prompt.md b/docs/data-sources/network_device_custom_prompt.md new file mode 100644 index 0000000..5cf8589 --- /dev/null +++ b/docs/data-sources/network_device_custom_prompt.md @@ -0,0 +1,44 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_network_device_custom_prompt Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on System Settings. + Returns supported custom prompts by Catalyst Center +--- + +# catalystcenter_network_device_custom_prompt (Data Source) + +It performs read operation on System Settings. + +- Returns supported custom prompts by Catalyst Center + +## Example Usage + +```terraform +data "catalystcenter_network_device_custom_prompt" "example" { + provider = catalystcenter +} + +output "catalystcenter_network_device_custom_prompt_example" { + value = data.catalystcenter_network_device_custom_prompt.example.item +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `custom_password_prompt` (String) +- `custom_username_prompt` (String) +- `default_password_prompt` (String) +- `default_username_prompt` (String) diff --git a/docs/data-sources/network_devices.md b/docs/data-sources/network_devices.md index 7777232..8f84847 100644 --- a/docs/data-sources/network_devices.md +++ b/docs/data-sources/network_devices.md @@ -86,38 +86,38 @@ Examples: healthScore=good, healthScore=good&healthScore=fair (multiple entity healthscore values with & separator). This field is not case sensitive. - `id` (String) id path parameter. The device Uuid - `limit` (Number) limit query parameter. Maximum number of records to return -- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) +- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) - `maintenance_mode` (Boolean) maintenanceMode query parameter. The device maintenanceMode status true or false - `management_ip_address` (String) managementIpAddress query parameter. The list of entity management IP Address. It can be either Ipv4 or Ipv6 address or combination of both(Ex. "121.1.1.10") -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: managementIpAddresses=121.1.1.10 managementIpAddresses=121.1.1.10&managementIpAddresses=172.20.1.10&managementIpAddresses=200:10&=managementIpAddresses172.20.3.4 (multiple entity IP Address with & separator) - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. - `role` (String) role query parameter. The list of network device role. Examples:role=CORE, role=CORE&role=ACCESS&role=ROUTER (multiple Network device roles with & separator). This field is not case sensitive. -- `serial_number` (String) serialNumber query parameter. The list of network device serial numbers. This field supports wildcard ('*') character-based search. Ex: '*MS1SV*' or 'MS1SV*' or '*MS1SV' Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') +- `serial_number` (String) serialNumber query parameter. The list of network device serial numbers. This field supports wildcard (***) character-based search. Ex: **MS1SV** or *MS1SV** or **MS1SV* Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) -- `software_version` (String) softwareVersion query parameter. The list of network device software version This field supports wildcard ('*') character-based search. Ex: '*17.8*' or '*17.8' or '17.8*' Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) +- `software_version` (String) softwareVersion query parameter. The list of network device software version This field supports wildcard (***) character-based search. Ex: **17.8** or **17.8* or *17.8** Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) - `sort_by` (String) sortBy query parameter. A field within the response to sort by. - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. -- `type` (String) type query parameter. The list of network device type This field supports wildcard ('*') character-based search. Ex: '*9407R*' or '*9407R' or '9407R*' Examples: type=SwitchesCisco Catalyst 9407R Switch (single network device types ) type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) -- `view` (String) view query parameter. The List of Network Device model views. Please refer to '''NetworkDeviceView''' for the supported list +If *startTime* is not provided, API will default to current time. +- `type` (String) type query parameter. The list of network device type This field supports wildcard (***) character-based search. Ex: **9407R** or **9407R* or *9407R** Examples: type=SwitchesCisco Catalyst 9407R Switch (single network device types ) type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) +- `view` (String) view query parameter. The List of Network Device model views. Please refer to ***NetworkDeviceView*** for the supported list ### Read-Only diff --git a/docs/data-sources/network_devices_count.md b/docs/data-sources/network_devices_count.md index 61c4464..87e7562 100644 --- a/docs/data-sources/network_devices_count.md +++ b/docs/data-sources/network_devices_count.md @@ -58,35 +58,35 @@ output "catalystcenter_network_devices_count_example" { - `family` (String) family query parameter. The list of network device family names Examples:family=Switches and Hubs (single network device family name )family=Switches and Hubs&family=Router&family=Wireless Controller (multiple Network device family names with & separator). This field is not case sensitive. - `health_score` (String) healthScore query parameter. The list of entity health score categories Examples:healthScore=good,healthScore=good&healthScore=fair (multiple entity healthscore values with & separator). This field is not case sensitive. - `id` (String) id query parameter. The list of entity Uuids. (Ex."6bef213c-19ca-4170-8375-b694e251101c") Examples: id=6bef213c-19ca-4170-8375-b694e251101c (single entity uuid requested) id=6bef213c-19ca-4170-8375-b694e251101c&id=32219612-819e-4b5e-a96b-cf22aca13dd9&id=2541e9a7-b80d-4955-8aa2-79b233318ba0 (multiple entity uuid with '&' separator) -- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard ('*') character-based search. Ex: '*AB:AB:AB*' or 'AB:AB:AB*' or '*AB:AB:AB' Examples: -'macAddress=AB:AB:AB:CD:CD:CD' (single macAddress requested) -'macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE' (multiple macAddress requested) +- `mac_address` (String) macAddress query parameter. The macAddress of the network device or client This field supports wildcard (***) character-based search. Ex: **AB:AB:AB** or *AB:AB:AB** or **AB:AB:AB* Examples: +*macAddress=AB:AB:AB:CD:CD:CD* (single macAddress requested) +*macAddress=AB:AB:AB:CD:CD:DC&macAddress=AB:AB:AB:CD:CD:FE* (multiple macAddress requested) - `maintenance_mode` (Boolean) maintenanceMode query parameter. The device maintenanceMode status true or false - `management_ip_address` (String) managementIpAddress query parameter. The list of entity management IP Address. It can be either Ipv4 or Ipv6 address or combination of both(Ex. "121.1.1.10") -This field supports wildcard ('*') character-based search. Ex: '*1.1*' or '1.1*' or '*1.1' +This field supports wildcard (***) character-based search. Ex: **1.1** or *1.1** or **1.1* Examples: managementIpAddresses=121.1.1.10 managementIpAddresses=121.1.1.10&managementIpAddresses=172.20.1.10&managementIpAddresses=200:10&=managementIpAddresses172.20.3.4 (multiple entity IP Address with & separator) - `role` (String) role query parameter. The list of network device role. Examples:role=CORE, role=CORE&role=ACCESS&role=ROUTER (multiple Network device roles with & separator). This field is not case sensitive. -- `serial_number` (String) serialNumber query parameter. The list of network device serial numbers. This field supports wildcard ('*') character-based search. Ex: '*MS1SV*' or 'MS1SV*' or '*MS1SV' Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') +- `serial_number` (String) serialNumber query parameter. The list of network device serial numbers. This field supports wildcard (***) character-based search. Ex: **MS1SV** or *MS1SV** or **MS1SV* Examples: serialNumber=9FUFMS1SVAX serialNumber=9FUFMS1SVAX&FCW2333Q0BY&FJC240617JX(multiple Network device serial number with & separator) +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) This field supports wildcard asterisk (*) character search support. E.g. */San*, */San, /San* Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk (*) character search support. E.g. '*uuid*, *uuid, uuid* +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (*) character search support. E.g. **uuid*, *uuid, uuid* Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) -- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. 'flooruuid') +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) +- `site_id` (String) siteId query parameter. The UUID of the site. (Ex. *flooruuid*) This field supports wildcard asterisk (*) character search support. E.g.*flooruuid*, *flooruuid, flooruuid* Examples: -'?siteId=id1' (single id requested) -'?siteId=id1&siteId=id2&siteId=id3' (multiple ids requested) -- `software_version` (String) softwareVersion query parameter. The list of network device software version This field supports wildcard ('*') character-based search. Ex: '*17.8*' or '*17.8' or '17.8*' Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) +*?siteId=id1* (single id requested) +*?siteId=id1&siteId=id2&siteId=id3* (multiple ids requested) +- `software_version` (String) softwareVersion query parameter. The list of network device software version This field supports wildcard (***) character-based search. Ex: **17.8** or **17.8* or *17.8** Examples: softwareVersion=2.3.4.0 (single network device software version ) softwareVersion=17.9.3.23&softwareVersion=17.7.1.2&softwareVersion=*.17.7 (multiple Network device software versions with & separator) - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. -- `type` (String) type query parameter. The list of network device type This field supports wildcard ('*') character-based search. Ex: '*9407R*' or '*9407R' or '9407R*'Examples:type=SwitchesCisco Catalyst 9407R Switch (single network device types )type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) -- `view` (String) view query parameter. The List of Network Device model views. Please refer to '''NetworkDeviceView''' for the supported list +If *startTime* is not provided, API will default to current time. +- `type` (String) type query parameter. The list of network device type This field supports wildcard (***) character-based search. Ex: **9407R** or **9407R* or *9407R**Examples:type=SwitchesCisco Catalyst 9407R Switch (single network device types )type=Cisco Catalyst 38xx stack-able ethernet switch&type=Cisco 3945 Integrated Services Router G2 (multiple Network device types with & separator) +- `view` (String) view query parameter. The List of Network Device model views. Please refer to ***NetworkDeviceView*** for the supported list ### Read-Only diff --git a/docs/data-sources/network_devices_members_associations.md b/docs/data-sources/network_devices_members_associations.md index c7b8ce7..e0619fe 100644 --- a/docs/data-sources/network_devices_members_associations.md +++ b/docs/data-sources/network_devices_members_associations.md @@ -17,19 +17,7 @@ It performs read operation on Tag. the response. A tag is a user-defined or system-defined construct to group resources. When a device is tagged, it is called a member of the tag. -## Example Usage - -```terraform -data "catalystcenter_network_devices_members_associations" "example" { - provider = catalystcenter - limit = 1 - offset = 1 -} - -output "catalystcenter_network_devices_members_associations_example" { - value = data.catalystcenter_network_devices_members_associations.example.items -} -``` + ## Schema diff --git a/docs/data-sources/network_devices_members_associations_count.md b/docs/data-sources/network_devices_members_associations_count.md index fdef199..7bec5c1 100644 --- a/docs/data-sources/network_devices_members_associations_count.md +++ b/docs/data-sources/network_devices_members_associations_count.md @@ -15,17 +15,7 @@ It performs read operation on Tag. - Fetches the count of network devices that are associated with at least one tag. A tag is a user-defined or system- defined construct to group resources. When a device is tagged, it is called a member of the tag. -## Example Usage -```terraform -data "catalystcenter_network_devices_members_associations_count" "example" { - provider = catalystcenter -} - -output "catalystcenter_network_devices_members_associations_count_example" { - value = data.catalystcenter_network_devices_members_associations_count.example.item -} -``` ## Schema diff --git a/docs/data-sources/network_devices_network_profiles_for_sites.md b/docs/data-sources/network_devices_network_profiles_for_sites.md index 04a61e3..71c5b45 100644 --- a/docs/data-sources/network_devices_network_profiles_for_sites.md +++ b/docs/data-sources/network_devices_network_profiles_for_sites.md @@ -46,7 +46,7 @@ output "catalystcenter_network_devices_network_profiles_for_sites_example" { ### Optional -- `id` (String) id path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' +- `id` (String) id path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* - `limit` (Number) limit query parameter. The number of records to show for this page. - `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. - `order` (String) order query parameter. Whether ascending or descending order should be used to sort the response. diff --git a/docs/data-sources/network_profiles_for_sites_site_assignments.md b/docs/data-sources/network_profiles_for_sites_site_assignments.md index 25f2c18..7119bbc 100644 --- a/docs/data-sources/network_profiles_for_sites_site_assignments.md +++ b/docs/data-sources/network_profiles_for_sites_site_assignments.md @@ -37,7 +37,7 @@ output "catalystcenter_network_profiles_for_sites_site_assignments_example" { ### Required -- `profile_id` (String) profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' +- `profile_id` (String) profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* ### Optional diff --git a/docs/data-sources/network_profiles_for_sites_site_assignments_count.md b/docs/data-sources/network_profiles_for_sites_site_assignments_count.md index aa796b6..fb3eccd 100644 --- a/docs/data-sources/network_profiles_for_sites_site_assignments_count.md +++ b/docs/data-sources/network_profiles_for_sites_site_assignments_count.md @@ -31,7 +31,7 @@ output "catalystcenter_network_profiles_for_sites_site_assignments_count_example ### Required -- `profile_id` (String) profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' +- `profile_id` (String) profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* ### Read-Only diff --git a/docs/data-sources/network_v2.md b/docs/data-sources/network_v2.md deleted file mode 100644 index 22caa80..0000000 --- a/docs/data-sources/network_v2.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_network_v2 Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Network Settings. - API to get SNMP, NTP, Network AAA, Client and Endpoint AAA, and/or DNS center server settings. ---- - -# catalystcenter_network_v2 (Data Source) - -It performs read operation on Network Settings. - -- API to get SNMP, NTP, Network AAA, Client and Endpoint AAA, and/or DNS center server settings. - -## Example Usage - -```terraform -data "catalystcenter_network_v2" "example" { - provider = catalystcenter - site_id = "string" -} - -output "catalystcenter_network_v2_example" { - value = data.catalystcenter_network_v2.example.items -} -``` - - -## Schema - -### Required - -- `site_id` (String) siteId query parameter. Site Id to get the network settings associated with the site. - -### Read-Only - -- `id` (String) The ID of this resource. -- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - - -### Nested Schema for `items` - -Read-Only: - -- `group_uuid` (String) -- `inherited_group_name` (String) -- `inherited_group_uuid` (String) -- `instance_type` (String) -- `instance_uuid` (String) -- `key` (String) -- `namespace` (String) -- `type` (String) -- `value` (List of String) -- `version` (Number) diff --git a/docs/data-sources/platform_nodes_configuration_summary.md b/docs/data-sources/platform_nodes_configuration_summary.md index 592ae25..1ee500d 100644 --- a/docs/data-sources/platform_nodes_configuration_summary.md +++ b/docs/data-sources/platform_nodes_configuration_summary.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_platform_nodes_configuration_summary Data Source - t subcategory: "" description: |- It performs read operation on Platform Configuration. - Provides details about the current Cisco Catalyst Center node configuration, such as API version, node name, NTP server, + Provides details about the current Cisco DNA Center node configuration, such as API version, node name, NTP server, intracluster link, LACP mode, network static routes, DNS server, subnet mask, host IP, default gateway, and interface information. --- @@ -13,7 +13,7 @@ description: |- It performs read operation on Platform Configuration. -- Provides details about the current Cisco Catalyst Center node configuration, such as API version, node name, NTP server, +- Provides details about the current Cisco DNA Center node configuration, such as API version, node name, NTP server, intracluster link, LACP mode, network static routes, DNS server, subnet mask, host IP, default gateway, and interface information. diff --git a/docs/data-sources/platform_release_summary.md b/docs/data-sources/platform_release_summary.md index b825573..2560885 100644 --- a/docs/data-sources/platform_release_summary.md +++ b/docs/data-sources/platform_release_summary.md @@ -5,7 +5,7 @@ subcategory: "" description: |- It performs read operation on Platform Configuration. Provides information such as API version, mandatory core packages for installation or upgrade, optional packages, - Cisco Catalyst Center name and version, supported direct updates, and tenant ID. + Cisco DNA Center name and version, supported direct updates, and tenant ID. --- # catalystcenter_platform_release_summary (Data Source) @@ -13,7 +13,7 @@ description: |- It performs read operation on Platform Configuration. - Provides information such as API version, mandatory core packages for installation or upgrade, optional packages, -Cisco Catalyst Center name and version, supported direct updates, and tenant ID. +Cisco DNA Center name and version, supported direct updates, and tenant ID. ## Example Usage diff --git a/docs/data-sources/profiling_rules_count.md b/docs/data-sources/profiling_rules_count.md new file mode 100644 index 0000000..660b7e8 --- /dev/null +++ b/docs/data-sources/profiling_rules_count.md @@ -0,0 +1,50 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_profiling_rules_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on AIEndpointAnalytics. + This data source fetches the count of profiling rules based on the filter values provided in the query parameters. The + filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. +--- + +# catalystcenter_profiling_rules_count (Data Source) + +It performs read operation on AIEndpointAnalytics. + +- This data source fetches the count of profiling rules based on the filter values provided in the query parameters. The +filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. + +## Example Usage + +```terraform +data "catalystcenter_profiling_rules_count" "example" { + provider = catalystcenter + include_deleted = "false" + rule_type = "string" +} + +output "catalystcenter_profiling_rules_count_example" { + value = data.catalystcenter_profiling_rules_count.example.item +} +``` + + +## Schema + +### Optional + +- `include_deleted` (Boolean) includeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. +- `rule_type` (String) ruleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `count` (Number) diff --git a/docs/data-sources/projects_details.md b/docs/data-sources/projects_details.md deleted file mode 100644 index 8110f7d..0000000 --- a/docs/data-sources/projects_details.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_projects_details Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Configuration Templates. - Get project(s) details ---- - -# catalystcenter_projects_details (Data Source) - -It performs read operation on Configuration Templates. - -- Get project(s) details - -## Example Usage - -```terraform -data "catalystcenter_projects_details" "example" { - provider = catalystcenter - id = "string" - limit = 1 - name = "string" - offset = 1 - sort_order = "string" -} - -output "catalystcenter_projects_details_example" { - value = data.catalystcenter_projects_details.example.item -} -``` - - -## Schema - -### Optional - -- `id` (String) id query parameter. Id of project to be searched -- `limit` (Number) limit query parameter. Limits number of results -- `name` (String) name query parameter. Name of project to be searched -- `offset` (Number) offset query parameter. Index of first result -- `sort_order` (String) sortOrder query parameter. Sort Order Ascending (asc) or Descending (dsc) - -### Read-Only - -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - - -### Nested Schema for `item` - -Read-Only: - -- `create_time` (Number) -- `description` (String) -- `id` (String) -- `is_deletable` (String) -- `last_update_time` (Number) -- `name` (String) -- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--item--tags)) -- `templates` (String) - - -### Nested Schema for `item.tags` - -Read-Only: - -- `id` (String) -- `name` (String) diff --git a/docs/data-sources/reports_executions_download.md b/docs/data-sources/reports_executions_download.md index 9c8fa71..04f91d9 100644 --- a/docs/data-sources/reports_executions_download.md +++ b/docs/data-sources/reports_executions_download.md @@ -20,10 +20,13 @@ format available from content-disposition response header. ```terraform data "catalystcenter_reports_executions_download" "example" { provider = catalystcenter - dirpath = "string" execution_id = "string" report_id = "string" } + +output "catalystcenter_reports_executions_download_example" { + value = data.catalystcenter_reports_executions_download.example.item +} ``` @@ -38,3 +41,4 @@ data "catalystcenter_reports_executions_download" "example" { ### Read-Only - `id` (String) The ID of this resource. +- `item` (String) diff --git a/docs/data-sources/role_permissions.md b/docs/data-sources/role_permissions.md index 969a566..2ddedc4 100644 --- a/docs/data-sources/role_permissions.md +++ b/docs/data-sources/role_permissions.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_role_permissions Data Source - terraform-provider-ca subcategory: "" description: |- It performs read operation on User and Roles. - Get permissions for a role from Cisco Catalyst Center System. + Get permissions for a role from Cisco DNA Center System. --- # catalystcenter_role_permissions (Data Source) It performs read operation on User and Roles. -- Get permissions for a role from Cisco Catalyst Center System. +- Get permissions for a role from Cisco DNA Center System. ## Example Usage diff --git a/docs/data-sources/roles.md b/docs/data-sources/roles.md index 85e07a8..102500c 100644 --- a/docs/data-sources/roles.md +++ b/docs/data-sources/roles.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_roles Data Source - terraform-provider-catalystcente subcategory: "" description: |- It performs read operation on User and Roles. - Get all roles for the Cisco Catalyst Center System. + Get all roles for the Cisco DNA Center System. --- # catalystcenter_roles (Data Source) It performs read operation on User and Roles. -- Get all roles for the Cisco Catalyst Center System. +- Get all roles for the Cisco DNA Center System. ## Example Usage diff --git a/docs/data-sources/sda_multicast_v1.md b/docs/data-sources/sda_multicast_v1.md deleted file mode 100644 index 01a2cdd..0000000 --- a/docs/data-sources/sda_multicast_v1.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_sda_multicast_v1 Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on SDA. - Returns a list of multicast configurations at a fabric site level that match the provided query parameters. ---- - -# catalystcenter_sda_multicast_v1 (Data Source) - -It performs read operation on SDA. - -- Returns a list of multicast configurations at a fabric site level that match the provided query parameters. - -## Example Usage - -```terraform -data "catalystcenter_sda_multicast_v1" "example" { - provider = catalystcenter - fabric_id = "string" - limit = 1 - offset = 1 -} - -output "catalystcenter_sda_multicast_v1_example" { - value = data.catalystcenter_sda_multicast_v1.example.items -} -``` - - -## Schema - -### Optional - -- `fabric_id` (String) fabricId query parameter. ID of the fabric site where multicast is configured. -- `limit` (Number) limit query parameter. Maximum number of records to return. -- `offset` (Number) offset query parameter. Starting record for pagination. - -### Read-Only - -- `id` (String) The ID of this resource. -- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - - -### Nested Schema for `items` - -Read-Only: - -- `fabric_id` (String) -- `replication_mode` (String) diff --git a/docs/data-sources/sda_virtual_network.md b/docs/data-sources/sda_virtual_network.md index c044ad7..1a305c0 100644 --- a/docs/data-sources/sda_virtual_network.md +++ b/docs/data-sources/sda_virtual_network.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_sda_virtual_network Data Source - terraform-provider subcategory: "" description: |- It performs read operation on SDA. - Get virtual network (VN) from SDA Fabric + Get virtual network with scalable groups --- # catalystcenter_sda_virtual_network (Data Source) It performs read operation on SDA. -- Get virtual network (VN) from SDA Fabric +- Get virtual network with scalable groups ## Example Usage @@ -32,7 +32,6 @@ output "catalystcenter_sda_virtual_network_example" { ### Required -- `site_name_hierarchy` (String) siteNameHierarchy query parameter. - `virtual_network_name` (String) virtualNetworkName query parameter. ### Read-Only @@ -47,11 +46,9 @@ Read-Only: - `description` (String) - `execution_id` (String) -- `fabric_name` (String) -- `is_default_vn` (String) -- `is_infra_vn` (String) -- `site_name_hierarchy` (String) +- `is_guest_virtual_network` (String) +- `scalable_group_names` (List of String) - `status` (String) +- `v_manage_vpn_id` (String) - `virtual_network_context_id` (String) -- `virtual_network_id` (String) - `virtual_network_name` (String) diff --git a/docs/data-sources/sda_virtual_network_v2.md b/docs/data-sources/sda_virtual_network_v2.md deleted file mode 100644 index dd3606d..0000000 --- a/docs/data-sources/sda_virtual_network_v2.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_sda_virtual_network_v2 Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on SDA. - Get virtual network with scalable groups ---- - -# catalystcenter_sda_virtual_network_v2 (Data Source) - -It performs read operation on SDA. - -- Get virtual network with scalable groups - -## Example Usage - -```terraform -data "catalystcenter_sda_virtual_network_v2" "example" { - provider = catalystcenter - virtual_network_name = "string" -} - -output "catalystcenter_sda_virtual_network_v2_example" { - value = data.catalystcenter_sda_virtual_network_v2.example.item -} -``` - - -## Schema - -### Required - -- `virtual_network_name` (String) virtualNetworkName query parameter. - -### Read-Only - -- `id` (String) The ID of this resource. -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) - - -### Nested Schema for `item` - -Read-Only: - -- `description` (String) -- `execution_id` (String) -- `is_guest_virtual_network` (String) -- `scalable_group_names` (List of String) -- `status` (String) -- `v_manage_vpn_id` (String) -- `virtual_network_context_id` (String) -- `virtual_network_name` (String) diff --git a/docs/data-sources/security_rogue_wireless_containment_status.md b/docs/data-sources/security_rogue_wireless_containment_status.md new file mode 100644 index 0000000..745c4de --- /dev/null +++ b/docs/data-sources/security_rogue_wireless_containment_status.md @@ -0,0 +1,83 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_rogue_wireless_containment_status Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Devices. + Intent API to check the wireless rogue access point containment status. The response includes all the details like + containment status, contained by WLC, containment status of each BSSID etc. This data source also includes the + information of strongest detecting WLC for this rogue access point. +--- + +# catalystcenter_security_rogue_wireless_containment_status (Data Source) + +It performs read operation on Devices. + +- Intent API to check the wireless rogue access point containment status. The response includes all the details like +containment status, contained by WLC, containment status of each BSSID etc. This data source also includes the +information of strongest detecting WLC for this rogue access point. + +## Example Usage + +```terraform +data "catalystcenter_security_rogue_wireless_containment_status" "example" { + provider = catalystcenter + mac_address = "string" +} + +output "catalystcenter_security_rogue_wireless_containment_status_example" { + value = data.catalystcenter_security_rogue_wireless_containment_status.example.items +} +``` + + +## Schema + +### Required + +- `mac_address` (String) macAddress path parameter. MAC Address of the Wireless Rogue AP + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `bssid_containment_status` (List of Object) (see [below for nested schema](#nestedobjatt--items--bssid_containment_status)) +- `classification` (String) +- `contained_by_wlc_ip` (List of String) +- `containment_status` (String) +- `last_seen` (Number) +- `last_task_detail` (List of Object) (see [below for nested schema](#nestedobjatt--items--last_task_detail)) +- `mac_address` (String) +- `strongest_detecting_wlc_ip` (String) +- `type` (Number) + + +### Nested Schema for `items.bssid_containment_status` + +Read-Only: + +- `bssid` (String) +- `contained_by_wlc_ip` (String) +- `containment_status` (String) +- `is_adhoc` (String) +- `radio_type` (String) +- `ssid` (String) + + + +### Nested Schema for `items.last_task_detail` + +Read-Only: + +- `initiated_on_bssid` (List of String) +- `initiated_on_wlc_ip` (String) +- `task_id` (String) +- `task_start_time` (Number) +- `task_state` (String) +- `task_type` (String) diff --git a/docs/data-sources/security_threats_level.md b/docs/data-sources/security_threats_level.md new file mode 100644 index 0000000..0ecce14 --- /dev/null +++ b/docs/data-sources/security_threats_level.md @@ -0,0 +1,42 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_level Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Devices. + Intent API to fetch all threat levels defined. +--- + +# catalystcenter_security_threats_level (Data Source) + +It performs read operation on Devices. + +- Intent API to fetch all threat levels defined. + +## Example Usage + +```terraform +data "catalystcenter_security_threats_level" "example" { + provider = catalystcenter +} + +output "catalystcenter_security_threats_level_example" { + value = data.catalystcenter_security_threats_level.example.items +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `name` (String) +- `value` (Number) diff --git a/docs/data-sources/security_threats_rogue_allowed_list.md b/docs/data-sources/security_threats_rogue_allowed_list.md new file mode 100644 index 0000000..83a806a --- /dev/null +++ b/docs/data-sources/security_threats_rogue_allowed_list.md @@ -0,0 +1,50 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_rogue_allowed_list Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Devices. + Intent API to fetch all the allowed mac addresses in the system. +--- + +# catalystcenter_security_threats_rogue_allowed_list (Data Source) + +It performs read operation on Devices. + +- Intent API to fetch all the allowed mac addresses in the system. + +## Example Usage + +```terraform +data "catalystcenter_security_threats_rogue_allowed_list" "example" { + provider = catalystcenter + limit = 1 + offset = 1 +} + +output "catalystcenter_security_threats_rogue_allowed_list_example" { + value = data.catalystcenter_security_threats_rogue_allowed_list.example.items +} +``` + + +## Schema + +### Optional + +- `limit` (Number) limit query parameter. The maximum number of entries to return. If the value exceeds the total count, then the maximum entries will be returned. +- `offset` (Number) offset query parameter. The offset of the first item in the collection to return. + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `category` (Number) +- `last_modified` (Number) +- `mac_address` (String) diff --git a/docs/data-sources/security_threats_rogue_allowed_list_count.md b/docs/data-sources/security_threats_rogue_allowed_list_count.md new file mode 100644 index 0000000..b9d36f9 --- /dev/null +++ b/docs/data-sources/security_threats_rogue_allowed_list_count.md @@ -0,0 +1,42 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_rogue_allowed_list_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Devices. + Intent API to fetch the count of allowed mac addresses in the system. +--- + +# catalystcenter_security_threats_rogue_allowed_list_count (Data Source) + +It performs read operation on Devices. + +- Intent API to fetch the count of allowed mac addresses in the system. + +## Example Usage + +```terraform +data "catalystcenter_security_threats_rogue_allowed_list_count" "example" { + provider = catalystcenter +} + +output "catalystcenter_security_threats_rogue_allowed_list_count_example" { + value = data.catalystcenter_security_threats_rogue_allowed_list_count.example.item +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `response` (Number) +- `version` (String) diff --git a/docs/data-sources/security_threats_type.md b/docs/data-sources/security_threats_type.md new file mode 100644 index 0000000..c7b7c53 --- /dev/null +++ b/docs/data-sources/security_threats_type.md @@ -0,0 +1,45 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_type Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Devices. + Intent API to fetch all threat types defined. +--- + +# catalystcenter_security_threats_type (Data Source) + +It performs read operation on Devices. + +- Intent API to fetch all threat types defined. + +## Example Usage + +```terraform +data "catalystcenter_security_threats_type" "example" { + provider = catalystcenter +} + +output "catalystcenter_security_threats_type_example" { + value = data.catalystcenter_security_threats_type.example.items +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `is_custom` (String) +- `is_deleted` (String) +- `label` (String) +- `name` (String) +- `value` (Number) diff --git a/docs/data-sources/service_provider_v2.md b/docs/data-sources/service_provider_v2.md deleted file mode 100644 index a4fc649..0000000 --- a/docs/data-sources/service_provider_v2.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_service_provider_v2 Data Source - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It performs read operation on Network Settings. - API to get Service Provider details (QoS). ---- - -# catalystcenter_service_provider_v2 (Data Source) - -It performs read operation on Network Settings. - -- API to get Service Provider details (QoS). - -## Example Usage - -```terraform -data "catalystcenter_service_provider_v2" "example" { - provider = catalystcenter -} - -output "catalystcenter_service_provider_v2_example" { - value = data.catalystcenter_service_provider_v2.example.items -} -``` - - -## Schema - -### Read-Only - -- `id` (String) The ID of this resource. -- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) - - -### Nested Schema for `items` - -Read-Only: - -- `group_uuid` (String) -- `inherited_group_name` (String) -- `inherited_group_uuid` (String) -- `instance_type` (String) -- `instance_uuid` (String) -- `key` (String) -- `namespace` (String) -- `type` (String) -- `value` (List of Object) (see [below for nested schema](#nestedobjatt--items--value)) -- `version` (Number) - - -### Nested Schema for `items.value` - -Read-Only: - -- `sla_profile_name` (String) -- `sp_profile_name` (String) -- `wan_provider` (String) diff --git a/docs/data-sources/site.md b/docs/data-sources/site.md index 92ebcc5..8b1711e 100644 --- a/docs/data-sources/site.md +++ b/docs/data-sources/site.md @@ -51,41 +51,10 @@ output "catalystcenter_site_example" { Read-Only: -- `additional_info` (List of Object) (see [below for nested schema](#nestedobjatt--items--additional_info)) +- `additional_info` (List of String) - `id` (String) - `instance_tenant_id` (String) - `name` (String) - `parent_id` (String) - `site_hierarchy` (String) - `site_name_hierarchy` (String) - - -### Nested Schema for `items.additional_info` - -Read-Only: - -- `attributes` (List of Object) (see [below for nested schema](#nestedobjatt--items--additional_info--attributes)) -- `name_space` (String) - - -### Nested Schema for `items.additional_info.attributes` - -Read-Only: - -- `address` (String) -- `addressinheritedfrom` (String) -- `country` (String) -- `floor_number` (String) -- `floorindex` (String) -- `height` (String) -- `latitude` (String) -- `length` (String) -- `longitude` (String) -- `name` (String) -- `offsetx` (String) -- `offsety` (String) -- `parent_name` (String) -- `rf_model` (String) -- `rfmodel` (String) -- `type` (String) -- `width` (String) diff --git a/docs/data-sources/site_health_summaries.md b/docs/data-sources/site_health_summaries.md index 641ff71..60d5b06 100644 --- a/docs/data-sources/site_health_summaries.md +++ b/docs/data-sources/site_health_summaries.md @@ -5,22 +5,22 @@ subcategory: "" description: |- It performs read operation on Sites. Get a paginated list of site health summaries. Use the available query parameters to identify a subset of sites you - want health summaries for. This data source provides the latest health data from a given 'endTime' If data is not ready + want health summaries for. This data source provides the latest health data from a given endTime If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, since we are not a real time - system. When 'endTime' is not provided, the API returns the latest data. This data source also provides issue data. The - 'startTime' query param can be used to specify the beginning point of time range to retrieve the active issue counts in. - When this param is not provided, the default 'startTime' will be 24 hours before endTime. Valid values for 'sortBy' - param in this API are limited to the attributes provided in the 'site' view. Default sortBy is 'siteHierarchy' in order + system. When endTime is not provided, the API returns the latest data. This data source also provides issue data. The + startTime query param can be used to specify the beginning point of time range to retrieve the active issue counts in. + When this param is not provided, the default startTime will be 24 hours before endTime. Valid values for sortBy + param in this API are limited to the attributes provided in the site view. Default sortBy is 'siteHierarchy' in order 'asc' (ascending). For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CECatCenter_Org- siteHealthSummaries-1.0.3-resolved.yamlGet a health summary for a specific site by providing the unique site id in the url path. This data source provides - the latest health data from a given 'endTime' If data is not ready for the provided endTime, the request will fail, and + the latest health data from a given endTime If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur - if the provided endTime=currentTime, since we are not a real time system. When 'endTime' is not provided, the API - returns the latest data. This data source also provides issue data. The 'startTime' query param can be used to specify + if the provided endTime=currentTime, since we are not a real time system. When endTime is not provided, the API + returns the latest data. This data source also provides issue data. The startTime query param can be used to specify the beginning point of time range to retrieve the active issue counts in. When this param is not provided, the default - 'startTime' will be 24 hours before endTime. For detailed information about the usage of the API, please refer to the + startTime will be 24 hours before endTime. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CECatCenter_Org-siteHealthSummaries-1.0.3-resolved.yaml --- @@ -30,24 +30,24 @@ description: |- It performs read operation on Sites. - Get a paginated list of site health summaries. Use the available query parameters to identify a subset of sites you -want health summaries for. This data source provides the latest health data from a given 'endTime' If data is not ready +want health summaries for. This data source provides the latest health data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, since we are not a real time -system. When 'endTime' is not provided, the API returns the latest data. This data source also provides issue data. The -'startTime' query param can be used to specify the beginning point of time range to retrieve the active issue counts in. -When this param is not provided, the default 'startTime' will be 24 hours before endTime. Valid values for 'sortBy' -param in this API are limited to the attributes provided in the 'site' view. Default sortBy is 'siteHierarchy' in order +system. When *endTime* is not provided, the API returns the latest data. This data source also provides issue data. The +*startTime* query param can be used to specify the beginning point of time range to retrieve the active issue counts in. +When this param is not provided, the default *startTime* will be 24 hours before endTime. Valid values for *sortBy* +param in this API are limited to the attributes provided in the *site* view. Default sortBy is 'siteHierarchy' in order 'asc' (ascending). For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- siteHealthSummaries-1.0.3-resolved.yaml - Get a health summary for a specific site by providing the unique site id in the url path. This data source provides -the latest health data from a given 'endTime' If data is not ready for the provided endTime, the request will fail, and +the latest health data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur -if the provided endTime=currentTime, since we are not a real time system. When 'endTime' is not provided, the API -returns the latest data. This data source also provides issue data. The 'startTime' query param can be used to specify +if the provided endTime=currentTime, since we are not a real time system. When *endTime* is not provided, the API +returns the latest data. This data source also provides issue data. The *startTime* query param can be used to specify the beginning point of time range to retrieve the active issue counts in. When this param is not provided, the default -'startTime' will be 24 hours before endTime. For detailed information about the usage of the API, please refer to the +*startTime* will be 24 hours before endTime. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.yaml @@ -106,24 +106,24 @@ attribute=siteHierarchy&attribute=clientCount (multiple attributes requested) - `limit` (Number) limit query parameter. Maximum number of records to return - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) - `site_type` (String) siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) - `sort_by` (String) sortBy query parameter. A field within the response to sort by. - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `view` (String) view query parameter. The specific summary view being requested. This is an optional parameter which can be passed to get one or more of the specific health data summaries associated with sites. ### Response data proviced by each view: 1. **site** [id, siteHierarchy, siteHierarchyId, siteType, latitude, longitude] diff --git a/docs/data-sources/site_health_summaries_count.md b/docs/data-sources/site_health_summaries_count.md index 854d0f9..a941d6d 100644 --- a/docs/data-sources/site_health_summaries_count.md +++ b/docs/data-sources/site_health_summaries_count.md @@ -5,9 +5,9 @@ subcategory: "" description: |- It performs read operation on Sites. Get a count of sites. Use the available query parameters to get the count of a subset of sites. This data source - provides the latest data from a given 'endTime' If data is not ready for the provided endTime, the request will fail, + provides the latest data from a given endTime If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may - occur if the provided endTime=currentTime, since we are not a real time system. When 'endTime' is not provided, the API + occur if the provided endTime=currentTime, since we are not a real time system. When endTime is not provided, the API returns the latest data. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CECatCenter_Org- siteHealthSummaries-1.0.3-resolved.yaml @@ -18,9 +18,9 @@ description: |- It performs read operation on Sites. - Get a count of sites. Use the available query parameters to get the count of a subset of sites. This data source -provides the latest data from a given 'endTime' If data is not ready for the provided endTime, the request will fail, +provides the latest data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may -occur if the provided endTime=currentTime, since we are not a real time system. When 'endTime' is not provided, the API +occur if the provided endTime=currentTime, since we are not a real time system. When *endTime* is not provided, the API returns the latest data. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- siteHealthSummaries-1.0.3-resolved.yaml @@ -54,21 +54,21 @@ output "catalystcenter_site_health_summaries_count_example" { - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. - `id` (String) id query parameter. The list of entity Uuids. (Ex."6bef213c-19ca-4170-8375-b694e251101c") Examples: id=6bef213c-19ca-4170-8375-b694e251101c (single entity uuid requested) id=6bef213c-19ca-4170-8375-b694e251101c&id=32219612-819e-4b5e-a96b-cf22aca13dd9&id=2541e9a7-b80d-4955-8aa2-79b233318ba0 (multiple entity uuid with '&' separator) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) - `site_type` (String) siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) ### Read-Only diff --git a/docs/data-sources/site_health_summaries_summary_analytics.md b/docs/data-sources/site_health_summaries_summary_analytics.md index dcd0d90..f06fb8e 100644 --- a/docs/data-sources/site_health_summaries_summary_analytics.md +++ b/docs/data-sources/site_health_summaries_summary_analytics.md @@ -5,14 +5,14 @@ subcategory: "" description: |- It performs read operation on Sites. Get an aggregated summary of all site health or use the query params to get an aggregated summary of health for a - subset of sites. This data source provides the latest health data from a given 'endTime' If data is not ready for the + subset of sites. This data source provides the latest health data from a given endTime If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, since we are not a real time system. - When 'endTime' is not provided, the API returns the latest data. This data source also provides issue data. The - 'startTime' query param can be used to specify the beginning point of time range to retrieve the active issue counts in. - When this param is not provided, the default 'startTime' will be 24 hours before endTime. Aggregated response data will - NOT have unique identifier data populated. List of unique identifier data: ['id', 'siteHierarchy', 'siteHierarchyId', - 'siteType', 'latitude', 'longitude']. For detailed information about the usage of the API, please refer to the Open API + When endTime is not provided, the API returns the latest data. This data source also provides issue data. The + startTime query param can be used to specify the beginning point of time range to retrieve the active issue counts in. + When this param is not provided, the default startTime will be 24 hours before endTime. Aggregated response data will + NOT have unique identifier data populated. List of unique identifier data: [id, siteHierarchy, siteHierarchyId, + siteType, latitude, longitude]. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CECatCenter_Org-siteHealthSummaries-1.0.3-resolved.yaml --- @@ -22,14 +22,14 @@ description: |- It performs read operation on Sites. - Get an aggregated summary of all site health or use the query params to get an aggregated summary of health for a -subset of sites. This data source provides the latest health data from a given 'endTime' If data is not ready for the +subset of sites. This data source provides the latest health data from a given *endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, since we are not a real time system. -When 'endTime' is not provided, the API returns the latest data. This data source also provides issue data. The -'startTime' query param can be used to specify the beginning point of time range to retrieve the active issue counts in. -When this param is not provided, the default 'startTime' will be 24 hours before endTime. Aggregated response data will -NOT have unique identifier data populated. List of unique identifier data: ['id', 'siteHierarchy', 'siteHierarchyId', -'siteType', 'latitude', 'longitude']. For detailed information about the usage of the API, please refer to the Open API +When *endTime* is not provided, the API returns the latest data. This data source also provides issue data. The +*startTime* query param can be used to specify the beginning point of time range to retrieve the active issue counts in. +When this param is not provided, the default *startTime* will be 24 hours before endTime. Aggregated response data will +NOT have unique identifier data populated. List of unique identifier data: [*id*, *siteHierarchy*, *siteHierarchyId*, +*siteType*, *latitude*, *longitude*]. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.yaml @@ -71,23 +71,23 @@ attribute=siteHierarchy (single attribute requested) attribute=siteHierarchy&attribute=clientCount (multiple attributes requested) - `end_time` (Number) endTime query parameter. End time to which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. - `id` (String) id query parameter. The list of entity Uuids. (Ex."6bef213c-19ca-4170-8375-b694e251101c") Examples: id=6bef213c-19ca-4170-8375-b694e251101c (single entity uuid requested) id=6bef213c-19ca-4170-8375-b694e251101c&id=32219612-819e-4b5e-a96b-cf22aca13dd9&id=2541e9a7-b80d-4955-8aa2-79b233318ba0 (multiple entity uuid with '&' separator) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) - `site_type` (String) siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) - `start_time` (Number) startTime query parameter. Start time from which API queries the data set related to the resource. It must be specified in UNIX epochtime in milliseconds. Value is inclusive. -If 'startTime' is not provided, API will default to current time. +If *startTime* is not provided, API will default to current time. - `view` (String) view query parameter. The specific summary view being requested. This is an optional parameter which can be passed to get one or more of the specific health data summaries associated with sites. ### Response data proviced by each view: 1. **site** [id, siteHierarchy, siteHierarchyId, siteType, latitude, longitude] diff --git a/docs/data-sources/site_wise_product_names.md b/docs/data-sources/site_wise_product_names.md index 084abc2..e00fcdc 100644 --- a/docs/data-sources/site_wise_product_names.md +++ b/docs/data-sources/site_wise_product_names.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_site_wise_product_names Data Source - terraform-prov subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). - Provides network device product names for a site. The default value of 'siteId' is global. The response will include + Provides network device product names for a site. The default value of siteId is global. The response will include the network device count and image summary. --- @@ -12,7 +12,7 @@ description: |- It performs read operation on Software Image Management (SWIM). -- Provides network device product names for a site. The default value of 'siteId' is global. The response will include +- Provides network device product names for a site. The default value of *siteId* is global. The response will include the network device count and image summary. ## Example Usage diff --git a/docs/data-sources/site_wise_product_names_count.md b/docs/data-sources/site_wise_product_names_count.md index 0ce9190..23901b8 100644 --- a/docs/data-sources/site_wise_product_names_count.md +++ b/docs/data-sources/site_wise_product_names_count.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_site_wise_product_names_count Data Source - terrafor subcategory: "" description: |- It performs read operation on Software Image Management (SWIM). - Returns the count of network device product names for given filters. The default value of 'siteId' is global. + Returns the count of network device product names for given filters. The default value of siteId is global. --- # catalystcenter_site_wise_product_names_count (Data Source) It performs read operation on Software Image Management (SWIM). -- Returns the count of network device product names for given filters. The default value of 'siteId' is global. +- Returns the count of network device product names for given filters. The default value of *siteId* is global. ## Example Usage diff --git a/docs/data-sources/sites_aaa_settings.md b/docs/data-sources/sites_aaa_settings.md index 4ffc35f..50d40d1 100644 --- a/docs/data-sources/sites_aaa_settings.md +++ b/docs/data-sources/sites_aaa_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_aaa_settings Data Source - terraform-provider- subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve AAA settings for a site; 'null' values indicate that the setting will be inherited from the parent site; - empty objects ('{}') indicate that the setting is unset at a site. + Retrieve AAA settings for a site; null values indicate that the setting will be inherited from the parent site; + empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_aaa_settings (Data Source) It performs read operation on Network Settings. -- Retrieve AAA settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve AAA settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_aaa_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_banner_settings.md b/docs/data-sources/sites_banner_settings.md index fe57b06..834f92a 100644 --- a/docs/data-sources/sites_banner_settings.md +++ b/docs/data-sources/sites_banner_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_banner_settings Data Source - terraform-provid subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve banner settings for a site; 'null' values indicate that the setting will be inherited from the parent site; - empty objects ('{}') indicate that the setting is unset at a site. + Retrieve banner settings for a site; null values indicate that the setting will be inherited from the parent site; + empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_banner_settings (Data Source) It performs read operation on Network Settings. -- Retrieve banner settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve banner settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_banner_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_device_credentials.md b/docs/data-sources/sites_device_credentials.md index a21b23c..1334af9 100644 --- a/docs/data-sources/sites_device_credentials.md +++ b/docs/data-sources/sites_device_credentials.md @@ -4,8 +4,8 @@ page_title: "catalystcenter_sites_device_credentials Data Source - terraform-pro subcategory: "" description: |- It performs read operation on Network Settings. - Gets device credential settings for a site; 'null' values indicate that the setting will be inherited from the parent - site; empty objects ('{}') indicate that the credential is unset, and that no credential of that type will be used for + Gets device credential settings for a site; null values indicate that the setting will be inherited from the parent + site; empty objects ({}) indicate that the credential is unset, and that no credential of that type will be used for the site. --- @@ -13,8 +13,8 @@ description: |- It performs read operation on Network Settings. -- Gets device credential settings for a site; 'null' values indicate that the setting will be inherited from the parent -site; empty objects ('{}') indicate that the credential is unset, and that no credential of that type will be used for +- Gets device credential settings for a site; *null* values indicate that the setting will be inherited from the parent +site; empty objects (*{}*) indicate that the credential is unset, and that no credential of that type will be used for the site. ## Example Usage @@ -36,11 +36,11 @@ output "catalystcenter_sites_device_credentials_example" { ### Required -- `id` (String) id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' +- `id` (String) id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_dhcp_settings.md b/docs/data-sources/sites_dhcp_settings.md index c9a4e23..645613c 100644 --- a/docs/data-sources/sites_dhcp_settings.md +++ b/docs/data-sources/sites_dhcp_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_dhcp_settings Data Source - terraform-provider subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve DHCP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; - empty objects ('{}') indicate that the setting is unset at a site. + Retrieve DHCP settings for a site; null values indicate that the setting will be inherited from the parent site; + empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_dhcp_settings (Data Source) It performs read operation on Network Settings. -- Retrieve DHCP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve DHCP settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_dhcp_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_dns_settings.md b/docs/data-sources/sites_dns_settings.md index 6bb06ac..6a573e6 100644 --- a/docs/data-sources/sites_dns_settings.md +++ b/docs/data-sources/sites_dns_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_dns_settings Data Source - terraform-provider- subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve DNS settings for a site; 'null' values indicate that the setting will be inherited from the parent site; - empty objects ('{}') indicate that the setting is unset at a site. + Retrieve DNS settings for a site; null values indicate that the setting will be inherited from the parent site; + empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_dns_settings (Data Source) It performs read operation on Network Settings. -- Retrieve DNS settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve DNS settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_dns_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_image_distribution_settings.md b/docs/data-sources/sites_image_distribution_settings.md index be7bfc2..bd38a17 100644 --- a/docs/data-sources/sites_image_distribution_settings.md +++ b/docs/data-sources/sites_image_distribution_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_image_distribution_settings Data Source - terr subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve image distribution settings for a site; 'null' values indicate that the setting will be inherited from the - parent site; empty objects ('{}') indicate that the setting is unset at a site. + Retrieve image distribution settings for a site; null values indicate that the setting will be inherited from the + parent site; empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_image_distribution_settings (Data Source) It performs read operation on Network Settings. -- Retrieve image distribution settings for a site; 'null' values indicate that the setting will be inherited from the -parent site; empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve image distribution settings for a site; *null* values indicate that the setting will be inherited from the +parent site; empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_image_distribution_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_ntp_settings.md b/docs/data-sources/sites_ntp_settings.md index a899bbf..b47c389 100644 --- a/docs/data-sources/sites_ntp_settings.md +++ b/docs/data-sources/sites_ntp_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_ntp_settings Data Source - terraform-provider- subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve NTP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; - empty objects ('{}') indicate that the setting is unset at a site. + Retrieve NTP settings for a site; null values indicate that the setting will be inherited from the parent site; + empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_ntp_settings (Data Source) It performs read operation on Network Settings. -- Retrieve NTP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve NTP settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_ntp_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_profile_assignments.md b/docs/data-sources/sites_profile_assignments.md index e0908a6..9a34b3a 100644 --- a/docs/data-sources/sites_profile_assignments.md +++ b/docs/data-sources/sites_profile_assignments.md @@ -6,7 +6,7 @@ description: |- It performs read operation on Site Design. Retrieves the list of profiles that the given site has been assigned. These profiles may either be directly assigned to this site, or were assigned to a parent site and have been inherited. - These assigments can be modified via the '/dna/intent/api/v1/networkProfilesForSites/{profileId}/siteAssignments' + These assigments can be modified via the /dna/intent/api/v1/networkProfilesForSites/{profileId}/siteAssignments resources. --- @@ -16,7 +16,7 @@ It performs read operation on Site Design. - Retrieves the list of profiles that the given site has been assigned. These profiles may either be directly assigned to this site, or were assigned to a parent site and have been inherited. -These assigments can be modified via the '/dna/intent/api/v1/networkProfilesForSites/{profileId}/siteAssignments' +These assigments can be modified via the */dna/intent/api/v1/networkProfilesForSites/{profileId}/siteAssignments* resources. ## Example Usage @@ -39,7 +39,7 @@ output "catalystcenter_sites_profile_assignments_example" { ### Required -- `site_id` (String) siteId path parameter. The 'id' of the site, retrievable from '/dna/intent/api/v1/sites' +- `site_id` (String) siteId path parameter. The *id* of the site, retrievable from */dna/intent/api/v1/sites* ### Optional diff --git a/docs/data-sources/sites_profile_assignments_count.md b/docs/data-sources/sites_profile_assignments_count.md index 5890521..922c8aa 100644 --- a/docs/data-sources/sites_profile_assignments_count.md +++ b/docs/data-sources/sites_profile_assignments_count.md @@ -33,7 +33,7 @@ output "catalystcenter_sites_profile_assignments_count_example" { ### Required -- `site_id` (String) siteId path parameter. The 'id' of the site, retrievable from '/dna/intent/api/v1/sites' +- `site_id` (String) siteId path parameter. The *id* of the site, retrievable from */dna/intent/api/v1/sites* ### Read-Only diff --git a/docs/data-sources/sites_telemetry_settings.md b/docs/data-sources/sites_telemetry_settings.md index 4fb2bef..3fae5a8 100644 --- a/docs/data-sources/sites_telemetry_settings.md +++ b/docs/data-sources/sites_telemetry_settings.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_sites_telemetry_settings Data Source - terraform-pro subcategory: "" description: |- It performs read operation on Network Settings. - Retrieves telemetry settings for the given site. 'null' values indicate that the setting will be inherited from the + Retrieves telemetry settings for the given site. null values indicate that the setting will be inherited from the parent site. --- @@ -12,7 +12,7 @@ description: |- It performs read operation on Network Settings. -- Retrieves telemetry settings for the given site. 'null' values indicate that the setting will be inherited from the +- Retrieves telemetry settings for the given site. *null* values indicate that the setting will be inherited from the parent site. ## Example Usage @@ -34,11 +34,11 @@ output "catalystcenter_sites_telemetry_settings_example" { ### Required -- `id` (String) id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' +- `id` (String) id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/sites_time_zone_settings.md b/docs/data-sources/sites_time_zone_settings.md index 4329f5e..5872c4a 100644 --- a/docs/data-sources/sites_time_zone_settings.md +++ b/docs/data-sources/sites_time_zone_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_time_zone_settings Data Source - terraform-pro subcategory: "" description: |- It performs read operation on Network Settings. - Retrieve time zone settings for a site; 'null' values indicate that the setting will be inherited from the parent - site; empty objects ('{}') indicate that the setting is unset at a site. + Retrieve time zone settings for a site; null values indicate that the setting will be inherited from the parent + site; empty objects ({}) indicate that the setting is unset at a site. --- # catalystcenter_sites_time_zone_settings (Data Source) It performs read operation on Network Settings. -- Retrieve time zone settings for a site; 'null' values indicate that the setting will be inherited from the parent -site; empty objects ('{}') indicate that the setting is unset at a site. +- Retrieve time zone settings for a site; *null* values indicate that the setting will be inherited from the parent +site; empty objects (*{}*) indicate that the setting is unset at a site. ## Example Usage @@ -38,7 +38,7 @@ output "catalystcenter_sites_time_zone_settings_example" { ### Optional -- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when 'false', 'null' values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. +- `inherited` (Boolean) _inherited query parameter. Include settings explicitly set for this site and settings inherited from sites higher in the site hierarchy; when *false*, *null* values indicate that the site inherits that setting from the parent site or a site higher in the site hierarchy. ### Read-Only diff --git a/docs/data-sources/system_issue_definitions.md b/docs/data-sources/system_issue_definitions.md index d0a085f..968a268 100644 --- a/docs/data-sources/system_issue_definitions.md +++ b/docs/data-sources/system_issue_definitions.md @@ -5,7 +5,7 @@ subcategory: "" description: |- It performs read operation on Issues. Get all system issue defintions. The supported filters are id, name, profileId and definition enable status. An issue - trigger definition can be different across the profile and device type. So, 'profileId' and 'deviceType' in the query + trigger definition can be different across the profile and device type. So, profileId and deviceType in the query param is important and default is global profile and all device type. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- api-specs/blob/main/Assurance/CECatCenter_Org-issueAndHealthDefinitions-1.0.0-resolved.yamlGet system issue defintion for the given id. Definition includes all properties from IssueTriggerDefinition schema by @@ -19,7 +19,7 @@ description: |- It performs read operation on Issues. - Get all system issue defintions. The supported filters are id, name, profileId and definition enable status. An issue -trigger definition can be different across the profile and device type. So, 'profileId' and 'deviceType' in the query +trigger definition can be different across the profile and device type. So, *profileId* and *deviceType* in the query param is important and default is global profile and all device type. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- api-specs/blob/main/Assurance/CE_Cat_Center_Org-issueAndHealthDefinitions-1.0.0-resolved.yaml @@ -80,11 +80,11 @@ name=BGP_Down&name=BGP_Flap (multiple issue names separated by & operator) - `offset` (Number) offset query parameter. Specifies the starting point within all records returned by the API. It's one based offset. The starting value is 1. - `order` (String) order query parameter. The sort order of the field ascending or descending. - `priority` (String) priority query parameter. Issue priority, possible values are P1, P2, P3, P4. -'P1': A critical issue that needs immediate attention and can have a wide impact on network operations. -'P2': A major issue that can potentially impact multiple devices or clients. -'P3': A minor issue that has a localized or minimal impact. -'P4': A warning issue that may not be an immediate problem but addressing it can optimize the network performance. -- `profile_id` (String) profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is 'global'. Please refer Network design profiles documentation for more details. +*P1*: A critical issue that needs immediate attention and can have a wide impact on network operations. +*P2*: A major issue that can potentially impact multiple devices or clients. +*P3*: A minor issue that has a localized or minimal impact. +*P4*: A warning issue that may not be an immediate problem but addressing it can optimize the network performance. +- `profile_id` (String) profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is *global*. Please refer Network design profiles documentation for more details. - `sort_by` (String) sortBy query parameter. A field within the response to sort by. - `xca_lle_rid` (String) X-CALLER-ID header parameter. Caller ID is used to trace the origin of API calls and their associated queries executed on the database. It's an optional header parameter that can be added to an API request. diff --git a/docs/data-sources/system_issue_definitions_count.md b/docs/data-sources/system_issue_definitions_count.md index ac49067..9598ae8 100644 --- a/docs/data-sources/system_issue_definitions_count.md +++ b/docs/data-sources/system_issue_definitions_count.md @@ -58,11 +58,11 @@ Examples: name=BGP_Down (single entity uuid requested) name=BGP_Down&name=BGP_Flap (multiple issue names separated by & operator) - `priority` (String) priority query parameter. Issue priority, possible values are P1, P2, P3, P4. -'P1': A critical issue that needs immediate attention and can have a wide impact on network operations. -'P2': A major issue that can potentially impact multiple devices or clients. -'P3': A minor issue that has a localized or minimal impact. -'P4': A warning issue that may not be an immediate problem but addressing it can optimize the network performance. -- `profile_id` (String) profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is 'global'. Please refer Network design profiles documentation for more details. +*P1*: A critical issue that needs immediate attention and can have a wide impact on network operations. +*P2*: A major issue that can potentially impact multiple devices or clients. +*P3*: A minor issue that has a localized or minimal impact. +*P4*: A warning issue that may not be an immediate problem but addressing it can optimize the network performance. +- `profile_id` (String) profileId query parameter. The profile identier to fetch the profile associated issue defintions. The default is *global*. Please refer Network design profiles documentation for more details. ### Read-Only diff --git a/docs/data-sources/tags_interfaces_members_associations.md b/docs/data-sources/tags_interfaces_members_associations.md new file mode 100644 index 0000000..7b47685 --- /dev/null +++ b/docs/data-sources/tags_interfaces_members_associations.md @@ -0,0 +1,61 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_tags_interfaces_members_associations Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Tag. + Fetches the tags associated with the interfaces. Interfaces that don't have any tags associated will not be included + in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is tagged, it + is called a member of the tag. +--- + +# catalystcenter_tags_interfaces_members_associations (Data Source) + +It performs read operation on Tag. + +- Fetches the tags associated with the interfaces. Interfaces that don't have any tags associated will not be included +in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is tagged, it +is called a member of the tag. + +## Example Usage + +```terraform +data "catalystcenter_tags_interfaces_members_associations" "example" { + provider = catalystcenter + limit = 1 + offset = 1 +} + +output "catalystcenter_tags_interfaces_members_associations_example" { + value = data.catalystcenter_tags_interfaces_members_associations.example.items +} +``` + + +## Schema + +### Optional + +- `limit` (Number) limit query parameter. The number of records to show for this page. minimum: 1, maximum: 500 +- `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. minimum: 1 + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `id` (String) +- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--items--tags)) + + +### Nested Schema for `items.tags` + +Read-Only: + +- `id` (String) +- `name` (String) diff --git a/docs/data-sources/tags_interfaces_members_associations_count.md b/docs/data-sources/tags_interfaces_members_associations_count.md new file mode 100644 index 0000000..763bf1c --- /dev/null +++ b/docs/data-sources/tags_interfaces_members_associations_count.md @@ -0,0 +1,43 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_tags_interfaces_members_associations_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Tag. + Fetches the count of interfaces that are associated with at least one tag. A tag is a user-defined or system-defined + construct to group resources. When an interface is tagged, it is called a member of the tag. +--- + +# catalystcenter_tags_interfaces_members_associations_count (Data Source) + +It performs read operation on Tag. + +- Fetches the count of interfaces that are associated with at least one tag. A tag is a user-defined or system-defined +construct to group resources. When an interface is tagged, it is called a member of the tag. + +## Example Usage + +```terraform +data "catalystcenter_tags_interfaces_members_associations_count" "example" { + provider = catalystcenter +} + +output "catalystcenter_tags_interfaces_members_associations_count_example" { + value = data.catalystcenter_tags_interfaces_members_associations_count.example.item +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `count` (Number) diff --git a/docs/data-sources/tags_network_devices_members_associations.md b/docs/data-sources/tags_network_devices_members_associations.md new file mode 100644 index 0000000..ba55cfa --- /dev/null +++ b/docs/data-sources/tags_network_devices_members_associations.md @@ -0,0 +1,61 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_tags_network_devices_members_associations Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Tag. + Fetches the tags associated with network devices. Devices that don't have any tags associated will not be included in + the response. A tag is a user-defined or system-defined construct to group resources. When a device is tagged, it is + called a member of the tag. +--- + +# catalystcenter_tags_network_devices_members_associations (Data Source) + +It performs read operation on Tag. + +- Fetches the tags associated with network devices. Devices that don't have any tags associated will not be included in +the response. A tag is a user-defined or system-defined construct to group resources. When a device is tagged, it is +called a member of the tag. + +## Example Usage + +```terraform +data "catalystcenter_tags_network_devices_members_associations" "example" { + provider = catalystcenter + limit = 1 + offset = 1 +} + +output "catalystcenter_tags_network_devices_members_associations_example" { + value = data.catalystcenter_tags_network_devices_members_associations.example.items +} +``` + + +## Schema + +### Optional + +- `limit` (Number) limit query parameter. The number of records to show for this page. minimum: 1, maximum: 500 +- `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. minimum: 1 + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `id` (String) +- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--items--tags)) + + +### Nested Schema for `items.tags` + +Read-Only: + +- `id` (String) +- `name` (String) diff --git a/docs/data-sources/tags_network_devices_members_associations_count.md b/docs/data-sources/tags_network_devices_members_associations_count.md new file mode 100644 index 0000000..ef9a4ad --- /dev/null +++ b/docs/data-sources/tags_network_devices_members_associations_count.md @@ -0,0 +1,43 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_tags_network_devices_members_associations_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs read operation on Tag. + Fetches the count of network devices that are associated with at least one tag. A tag is a user-defined or system- + defined construct to group resources. When a device is tagged, it is called a member of the tag. +--- + +# catalystcenter_tags_network_devices_members_associations_count (Data Source) + +It performs read operation on Tag. + +- Fetches the count of network devices that are associated with at least one tag. A tag is a user-defined or system- +defined construct to group resources. When a device is tagged, it is called a member of the tag. + +## Example Usage + +```terraform +data "catalystcenter_tags_network_devices_members_associations_count" "example" { + provider = catalystcenter +} + +output "catalystcenter_tags_network_devices_members_associations_count_example" { + value = data.catalystcenter_tags_network_devices_members_associations_count.example.item +} +``` + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `count` (Number) diff --git a/docs/data-sources/tasks.md b/docs/data-sources/tasks.md index d72a690..78e7645 100644 --- a/docs/data-sources/tasks.md +++ b/docs/data-sources/tasks.md @@ -51,7 +51,7 @@ output "catalystcenter_tasks_example" { ### Optional - `end_time` (Number) endTime query parameter. This is the epoch millisecond end time upto which task records need to be fetched -- `id` (String) id path parameter. the 'id' of the task to retrieve +- `id` (String) id path parameter. the *id* of the task to retrieve - `limit` (Number) limit query parameter. The number of records to show for this page. - `offset` (Number) offset query parameter. The first record to show for this page; the first record is numbered 1. - `order` (String) order query parameter. Whether ascending or descending order should be used to sort the response. diff --git a/docs/data-sources/tasks_detail.md b/docs/data-sources/tasks_detail.md index b666c42..3f43ae2 100644 --- a/docs/data-sources/tasks_detail.md +++ b/docs/data-sources/tasks_detail.md @@ -31,7 +31,7 @@ output "catalystcenter_tasks_detail_example" { ### Required -- `id` (String) id path parameter. the 'id' of the task to retrieve details for +- `id` (String) id path parameter. the *id* of the task to retrieve details for ### Read-Only diff --git a/docs/data-sources/threat_detail.md b/docs/data-sources/threat_detail.md new file mode 100644 index 0000000..d653365 --- /dev/null +++ b/docs/data-sources/threat_detail.md @@ -0,0 +1,69 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_threat_detail Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + The details for the Rogue and aWIPS threats +--- + +# catalystcenter_threat_detail (Data Source) + +It performs create operation on Devices. + +- The details for the Rogue and aWIPS threats + +## Example Usage + +```terraform +data "catalystcenter_threat_detail" "example" { + provider = catalystcenter + end_time = 1 + is_new_threat = "false" + + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] +} +``` + + +## Schema + +### Optional + +- `end_time` (Number) End Time +- `is_new_threat` (String) Is New Threat +- `limit` (Number) Limit +- `offset` (Number) Offset +- `site_id` (List of String) Site Id +- `start_time` (Number) Start Time +- `threat_level` (List of String) Threat Level +- `threat_type` (List of String) Threat Type + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `ap_name` (String) +- `containment` (String) +- `detecting_apmac` (String) +- `mac_address` (String) +- `rssi` (String) +- `site_id` (String) +- `site_name_hierarchy` (String) +- `ssid` (String) +- `state` (String) +- `threat_level` (String) +- `threat_type` (String) +- `updated_time` (Number) +- `vendor` (String) diff --git a/docs/data-sources/threat_detail_count.md b/docs/data-sources/threat_detail_count.md new file mode 100644 index 0000000..6111820 --- /dev/null +++ b/docs/data-sources/threat_detail_count.md @@ -0,0 +1,58 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_threat_detail_count Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + The details count for the Rogue and aWIPS threats +--- + +# catalystcenter_threat_detail_count (Data Source) + +It performs create operation on Devices. + +- The details count for the Rogue and aWIPS threats + +## Example Usage + +```terraform +data "catalystcenter_threat_detail_count" "example" { + provider = catalystcenter + end_time = 1 + is_new_threat = "false" + + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] +} +``` + + +## Schema + +### Optional + +- `end_time` (Number) End Time +- `is_new_threat` (String) Is New Threat +- `limit` (Number) Limit +- `offset` (Number) Offset +- `site_id` (List of String) Site Id +- `start_time` (Number) Start Time +- `threat_level` (List of String) Threat Level +- `threat_type` (List of String) Threat Type + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) + + +### Nested Schema for `item` + +Read-Only: + +- `response` (Number) +- `version` (String) diff --git a/docs/data-sources/threat_summary.md b/docs/data-sources/threat_summary.md new file mode 100644 index 0000000..77e2549 --- /dev/null +++ b/docs/data-sources/threat_summary.md @@ -0,0 +1,70 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_threat_summary Data Source - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + The Threat Summary for the Rogues and aWIPS +--- + +# catalystcenter_threat_summary (Data Source) + +It performs create operation on Devices. + +- The Threat Summary for the Rogues and aWIPS + +## Example Usage + +```terraform +data "catalystcenter_threat_summary" "example" { + provider = catalystcenter + end_time = 1 + items { + + threat_data { + + + + + } + + } + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] +} +``` + + +## Schema + +### Optional + +- `end_time` (Number) End Time +- `site_id` (List of String) Site Id +- `start_time` (Number) Start Time +- `threat_level` (List of String) Threat Level +- `threat_type` (List of String) Threat Type + +### Read-Only + +- `id` (String) The ID of this resource. +- `items` (List of Object) (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- `threat_data` (List of Object) (see [below for nested schema](#nestedobjatt--items--threat_data)) +- `timestamp` (Number) + + +### Nested Schema for `items.threat_data` + +Read-Only: + +- `threat_count` (Number) +- `threat_level` (String) +- `threat_type` (String) diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md index bc725f0..487c6cd 100644 --- a/docs/data-sources/user.md +++ b/docs/data-sources/user.md @@ -4,14 +4,14 @@ page_title: "catalystcenter_user Data Source - terraform-provider-catalystcenter subcategory: "" description: |- It performs read operation on User and Roles. - Get all users for the Cisco Catalyst Center System. + Get all users for the Cisco DNA Center System. --- # catalystcenter_user (Data Source) It performs read operation on User and Roles. -- Get all users for the Cisco Catalyst Center System. +- Get all users for the Cisco DNA Center System. ## Example Usage diff --git a/docs/resources/analytics_cmdb_endpoints.md b/docs/resources/analytics_cmdb_endpoints.md new file mode 100644 index 0000000..df91b99 --- /dev/null +++ b/docs/resources/analytics_cmdb_endpoints.md @@ -0,0 +1,78 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_cmdb_endpoints Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on AI Endpoint Analytics. + Processes incoming CMDB endpoints data and imports the same in AI Endpoint Analytics. +--- + +# catalystcenter_analytics_cmdb_endpoints (Resource) + +It performs create operation on AI Endpoint Analytics. + +- Processes incoming CMDB endpoints data and imports the same in AI Endpoint Analytics. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_analytics_cmdb_endpoints" "example" { + provider = meraki + parameters { + + asset_tag = "string" + department = "string" + display_name = "string" + last_update_timestamp = 1 + location = "string" + mac_address = "string" + managed_by = "string" + model = "string" + model_category = "string" + serial_number = "string" + } +} + +output "catalystcenter_analytics_cmdb_endpoints_example" { + value = catalystcenter_analytics_cmdb_endpoints.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (String) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `payload` (Block List) Array of RequestAIEndpointAnalyticsProcessCMDBEndpointsV1 (see [below for nested schema](#nestedblock--parameters--payload)) + + +### Nested Schema for `parameters.payload` + +Optional: + +- `asset_tag` (String) Asset tag. +- `department` (String) Department that asset belongs to. +- `display_name` (String) Display name of the asset. +- `last_update_timestamp` (Number) Last update timestamp in epoch milliseconds. +- `location` (String) Location of the asset. +- `mac_address` (String) MAC address of the endpoint. +- `managed_by` (String) Asset managed by. +- `model` (String) Asset model. +- `model_category` (String) Category of the model. +- `serial_number` (String) Serial number of the endpoint. diff --git a/docs/resources/analytics_endpoints.md b/docs/resources/analytics_endpoints.md new file mode 100644 index 0000000..0d2ea37 --- /dev/null +++ b/docs/resources/analytics_endpoints.md @@ -0,0 +1,120 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_endpoints Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It manages create, read, update and delete operations on AI Endpoint Analytics. + Register a new endpoint in the system.Update attributes of a registered endpoint.Deletes the endpoint for the given unique identifier 'epId'. +--- + +# catalystcenter_analytics_endpoints (Resource) + +It manages create, read, update and delete operations on AI Endpoint Analytics. + +- Register a new endpoint in the system. + +- Update attributes of a registered endpoint. + +- Deletes the endpoint for the given unique identifier 'epId'. + +## Example Usage + +```terraform +resource "catalystcenter_analytics_endpoints" "example" { + provider = catalystcenter + + parameters { + + device_type = "string" + ep_id = "string" + hardware_manufacturer = "string" + hardware_model = "string" + mac_address = "string" + } +} + +output "catalystcenter_analytics_endpoints_example" { + value = catalystcenter_analytics_endpoints.example +} +``` + + +## Schema + +### Optional + +- `parameters` (Block List) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Required: + +- `ep_id` (String) epId path parameter. Unique identifier for the endpoint. + +Optional: + +- `device_type` (String) Type of the device represented by this endpoint. +- `hardware_manufacturer` (String) Hardware manufacturer for the endpoint. +- `hardware_model` (String) Hardware model of the endpoint. +- `mac_address` (String) MAC address of the endpoint. + + + +### Nested Schema for `item` + +Read-Only: + +- `anc_policy` (String) +- `attributes` (String) +- `device_type` (List of String) +- `duid` (String) +- `granular_anc_policy` (List of Object) (see [below for nested schema](#nestedobjatt--item--granular_anc_policy)) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `id` (String) +- `last_probe_collection_timestamp` (Number) +- `mac_address` (String) +- `operating_system` (List of String) +- `random_mac` (String) +- `registered` (String) +- `trust_data` (List of Object) (see [below for nested schema](#nestedobjatt--item--trust_data)) + + +### Nested Schema for `item.granular_anc_policy` + +Read-Only: + +- `name` (String) +- `nas_ip_address` (String) + + + +### Nested Schema for `item.trust_data` + +Read-Only: + +- `ai_spoofing_trust_level` (String) +- `auth_method` (String) +- `changed_profile_trust_level` (String) +- `concurrent_mac_trust_level` (String) +- `ip_blocklist_detected` (String) +- `nat_trust_level` (String) +- `posture_status` (String) +- `trust_score` (Number) +- `unauth_port_detected` (String) +- `weak_cred_detected` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import catalystcenter_analytics_endpoints.example "ep_id:=string" +``` diff --git a/docs/resources/analytics_endpoints_anc_policy_delete.md b/docs/resources/analytics_endpoints_anc_policy_delete.md new file mode 100644 index 0000000..77e810a --- /dev/null +++ b/docs/resources/analytics_endpoints_anc_policy_delete.md @@ -0,0 +1,53 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_endpoints_anc_policy_delete Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs delete operation on AI Endpoint Analytics. + Revokes given ANC policy from the endpoint. +--- + +# catalystcenter_analytics_endpoints_anc_policy_delete (Resource) + +It performs delete operation on AI Endpoint Analytics. + +- Revokes given ANC policy from the endpoint. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_analytics_endpoints_anc_policy_delete" "example" { + provider = meraki + ep_id = "string" + parameters { + + } +} + +output "catalystcenter_analytics_endpoints_anc_policy_delete_example" { + value = catalystcenter_analytics_endpoints_anc_policy_delete.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (String) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Required: + +- `ep_id` (String) epId path parameter. Unique identifier for the endpoint. diff --git a/docs/resources/analytics_endpoints_anc_policy_update.md b/docs/resources/analytics_endpoints_anc_policy_update.md new file mode 100644 index 0000000..80a6bb8 --- /dev/null +++ b/docs/resources/analytics_endpoints_anc_policy_update.md @@ -0,0 +1,72 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_endpoints_anc_policy_update Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs update operation on AI Endpoint Analytics. + Applies given ANC policy to the endpoint. +--- + +# catalystcenter_analytics_endpoints_anc_policy_update (Resource) + +It performs update operation on AI Endpoint Analytics. + +- Applies given ANC policy to the endpoint. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_analytics_endpoints_anc_policy_update" "example" { + provider = meraki + ep_id = "string" + parameters { + + anc_policy = "string" + granular_anc_policy { + + name = "string" + nas_ip_address = "string" + } + } +} + +output "catalystcenter_analytics_endpoints_anc_policy_update_example" { + value = catalystcenter_analytics_endpoints_anc_policy_update.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (String) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Required: + +- `ep_id` (String) epId path parameter. Unique identifier for the endpoint. + +Optional: + +- `anc_policy` (String) ANC policy name. +- `granular_anc_policy` (Block List) (see [below for nested schema](#nestedblock--parameters--granular_anc_policy)) + + +### Nested Schema for `parameters.granular_anc_policy` + +Optional: + +- `name` (String) Name of the granular ANC policy. +- `nas_ip_address` (String) IP address of the network device where endpoint is attached. diff --git a/docs/resources/analytics_profiling_rules.md b/docs/resources/analytics_profiling_rules.md new file mode 100644 index 0000000..908748e --- /dev/null +++ b/docs/resources/analytics_profiling_rules.md @@ -0,0 +1,196 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_profiling_rules Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It manages create, read, update and delete operations on AI Endpoint Analytics. + Creates profiling rule from the request body.Updates the profiling rule for the given 'ruleId'.Deletes the profiling rule for the given 'ruleId'. +--- + +# catalystcenter_analytics_profiling_rules (Resource) + +It manages create, read, update and delete operations on AI Endpoint Analytics. + +- Creates profiling rule from the request body. + +- Updates the profiling rule for the given 'ruleId'. + +- Deletes the profiling rule for the given 'ruleId'. + +## Example Usage + +```terraform +resource "catalystcenter_analytics_profiling_rules" "example" { + provider = catalystcenter + + parameters { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } +} + +output "catalystcenter_analytics_profiling_rules_example" { + value = catalystcenter_analytics_profiling_rules.example +} +``` + + +## Schema + +### Optional + +- `parameters` (Block List) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `cluster_id` (String) Unique identifier for ML cluster. Only applicable for 'ML Rule'. +- `condition_groups` (Block List) (see [below for nested schema](#nestedblock--parameters--condition_groups)) +- `is_deleted` (String) Flag to indicate whether the rule was deleted. +- `last_modified_by` (String) User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +- `last_modified_on` (Number) Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +- `plugin_id` (String) Plugin for the rule. Only applicable for 'Cisco Default' rules. +- `rejected` (String) Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +- `result` (Block List) (see [below for nested schema](#nestedblock--parameters--result)) +- `rule_id` (String) Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +- `rule_name` (String) Human readable name for the rule. +- `rule_priority` (Number) Priority for the rule. +- `rule_type` (String) Type of the rule. +- `rule_version` (Number) Version of the rule. +- `source_priority` (Number) Source priority for the rule. +- `used_attributes` (List of String) List of attributes used in the rule. Only applicable for 'Cisco Default' rules. + + +### Nested Schema for `parameters.condition_groups` + +Optional: + +- `condition` (Block List) (see [below for nested schema](#nestedblock--parameters--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `parameters.condition_groups.condition` + +Optional: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `parameters.result` + +Optional: + +- `device_type` (List of String) List of device types determined by the current rule. +- `hardware_manufacturer` (List of String) List of hardware manufacturers determined by the current rule. +- `hardware_model` (List of String) List of hardware models determined by the current rule. +- `operating_system` (List of String) List of operating systems determined by the current rule. + + + + +### Nested Schema for `item` + +Read-Only: + +- `cluster_id` (String) +- `condition_groups` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups)) +- `is_deleted` (String) +- `last_modified_by` (String) +- `last_modified_on` (Number) +- `plugin_id` (String) +- `rejected` (String) +- `result` (List of Object) (see [below for nested schema](#nestedobjatt--item--result)) +- `rule_id` (String) +- `rule_name` (String) +- `rule_priority` (Number) +- `rule_type` (String) +- `rule_version` (Number) +- `source_priority` (Number) +- `used_attributes` (List of String) + + +### Nested Schema for `item.condition_groups` + +Read-Only: + +- `condition` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `item.condition_groups.condition` + +Read-Only: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `item.result` + +Read-Only: + +- `device_type` (List of String) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `operating_system` (List of String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import catalystcenter_analytics_profiling_rules.example "rule_id:=string" +``` diff --git a/docs/resources/analytics_profiling_rules_bulk.md b/docs/resources/analytics_profiling_rules_bulk.md new file mode 100644 index 0000000..e291593 --- /dev/null +++ b/docs/resources/analytics_profiling_rules_bulk.md @@ -0,0 +1,151 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_analytics_profiling_rules_bulk Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on AI Endpoint Analytics. + This data source action imports the given list of profiling rules. For each record, 1) If 'ruleType' for a record is + not 'Custom Rule', then it is rejected. 2) If 'ruleId' is provided in the input record, + 2a) Record with same 'ruleId' exists in the system, then it is replaced with new data. + 2b) Record with same 'ruleId' does not exist, then it is inserted in the database. + 3) If 'ruleId' is not provided in the input record, then new 'ruleId' is generated by the system, and record is + inserted. +--- + +# catalystcenter_analytics_profiling_rules_bulk (Resource) + +It performs create operation on AI Endpoint Analytics. + +- This data source action imports the given list of profiling rules. For each record, 1) If 'ruleType' for a record is +not 'Custom Rule', then it is rejected. 2) If 'ruleId' is provided in the input record, + 2a) Record with same 'ruleId' exists in the system, then it is replaced with new data. + 2b) Record with same 'ruleId' does not exist, then it is inserted in the database. +3) If 'ruleId' is not provided in the input record, then new 'ruleId' is generated by the system, and record is +inserted. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_analytics_profiling_rules_bulk" "example" { + provider = meraki + parameters { + + profiling_rules { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } + } +} + +output "catalystcenter_analytics_profiling_rules_bulk_example" { + value = catalystcenter_analytics_profiling_rules_bulk.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (String) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `profiling_rules` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules)) + + +### Nested Schema for `parameters.profiling_rules` + +Optional: + +- `cluster_id` (String) Unique identifier for ML cluster. Only applicable for 'ML Rule'. +- `condition_groups` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules--condition_groups)) +- `is_deleted` (String) Flag to indicate whether the rule was deleted. +- `last_modified_by` (String) User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +- `last_modified_on` (Number) Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +- `plugin_id` (String) Plugin for the rule. Only applicable for 'Cisco Default' rules. +- `rejected` (String) Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +- `result` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules--result)) +- `rule_id` (String) Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +- `rule_name` (String) Human readable name for the rule. +- `rule_priority` (Number) Priority for the rule. +- `rule_type` (String) Type of the rule. +- `rule_version` (Number) Version of the rule. +- `source_priority` (Number) Source priority for the rule. +- `used_attributes` (List of String) List of attributes used in the rule. Only applicable for 'Cisco Default' rules. + + +### Nested Schema for `parameters.profiling_rules.condition_groups` + +Optional: + +- `condition` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `parameters.profiling_rules.condition_groups.condition` + +Optional: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `parameters.profiling_rules.result` + +Optional: + +- `device_type` (List of String) List of device types determined by the current rule. +- `hardware_manufacturer` (List of String) List of hardware manufacturers determined by the current rule. +- `hardware_model` (List of String) List of hardware models determined by the current rule. +- `operating_system` (List of String) List of operating systems determined by the current rule. diff --git a/docs/resources/app_policy_intent_create.md b/docs/resources/app_policy_intent_create.md index 63a6533..23dd337 100644 --- a/docs/resources/app_policy_intent_create.md +++ b/docs/resources/app_policy_intent_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Application Policy. - Create/Update/Delete application policy - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_app_policy_intent_create" "example" { - provider = catalystcenter + provider = meraki parameters { create_list { diff --git a/docs/resources/app_policy_queuing_profile.md b/docs/resources/app_policy_queuing_profile.md index 1f93bb5..46dd0e8 100644 --- a/docs/resources/app_policy_queuing_profile.md +++ b/docs/resources/app_policy_queuing_profile.md @@ -22,9 +22,8 @@ It manages create, read, update and delete operations on Application Policy. ```terraform resource "catalystcenter_app_policy_queuing_profile" "example" { provider = catalystcenter - parameters { - payload { + parameters { clause { @@ -43,16 +42,15 @@ resource "catalystcenter_app_policy_queuing_profile" "example" { is_common_between_all_interface_speeds = "false" tc_dscp_settings { - dscp = "string" - instance_id = 1 - traffic_class = "string" - } - type = "string" + dscp = "string" + instance_id = 1 + traffic_class = "string" } - description = "string" - id = "string" - name = "string" + type = "string" } + description = "string" + id = "string" + name = "string" } } @@ -66,7 +64,7 @@ output "catalystcenter_app_policy_queuing_profile_example" { ### Optional -- `parameters` (Block List) Array of RequestApplicationPolicyCreateApplicationPolicyQueuingProfile (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestApplicationPolicyCreateApplicationPolicyQueuingProfileV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/application_policy_application_set.md b/docs/resources/application_set_v2.md similarity index 73% rename from docs/resources/application_policy_application_set.md rename to docs/resources/application_set_v2.md index bc367b1..adaf2c0 100644 --- a/docs/resources/application_policy_application_set.md +++ b/docs/resources/application_set_v2.md @@ -1,13 +1,13 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_application_policy_application_set Resource - terraform-provider-catalystcenter" +page_title: "catalystcenter_application_set_v2 Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It manages create, read and delete operations on Application Policy. Create new custom application set/sDelete existing custom application set by id --- -# catalystcenter_application_policy_application_set (Resource) +# catalystcenter_application_set_v2 (Resource) It manages create, read and delete operations on Application Policy. @@ -18,24 +18,24 @@ It manages create, read and delete operations on Application Policy. ## Example Usage ```terraform -resource "catalystcenter_application_policy_application_set" "example" { +resource "catalystcenter_application_set_v2" "example" { provider = catalystcenter + parameters { - payload { - default_business_relevance = "string" - id = "string" - name = "string" - namespace = "string" - qualifier = "string" - scalable_group_external_handle = "string" - scalable_group_type = "string" - type = "string" - } + + default_business_relevance = "string" + id = "string" + name = "string" + namespace = "string" + qualifier = "string" + scalable_group_external_handle = "string" + scalable_group_type = "string" + type = "string" } } -output "catalystcenter_application_policy_application_set_example" { - value = catalystcenter_application_policy_application_set.example +output "catalystcenter_application_set_v2_example" { + value = catalystcenter_application_set_v2.example } ``` @@ -62,10 +62,13 @@ Optional: ### Nested Schema for `parameters.payload` +Required: + +- `id` (String) id path parameter. Id of custom application set to delete + Optional: - `default_business_relevance` (String) Default business relevance -- `id` (String) id path parameter. Id of custom application set to delete - `name` (String) Application Set name - `namespace` (String) Namespace, should be set to scalablegroup:application - `qualifier` (String) Qualifier, should be set to application @@ -105,5 +108,5 @@ Read-Only: Import is supported using the following syntax: ```shell -terraform import catalystcenter_application_policy_application_set.example "id:=string" +terraform import catalystcenter_application_set_v2.example "id:=string" ``` diff --git a/docs/resources/application_sets.md b/docs/resources/application_sets.md index bc89ea0..ddff8f3 100644 --- a/docs/resources/application_sets.md +++ b/docs/resources/application_sets.md @@ -22,9 +22,8 @@ resource "catalystcenter_application_sets" "example" { provider = catalystcenter parameters { - payload { - name = "string" - } + + name = "string" } } @@ -38,7 +37,7 @@ output "catalystcenter_application_sets_example" { ### Optional -- `parameters` (Block List) Array of RequestApplicationPolicyCreateApplicationSet (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestApplicationPolicyCreateApplicationSetV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/applications.md b/docs/resources/applications.md index 66b3b2d..39bfc8f 100644 --- a/docs/resources/applications.md +++ b/docs/resources/applications.md @@ -23,8 +23,8 @@ It manages create, read, update and delete operations on Application Policy. resource "catalystcenter_applications" "example" { provider = catalystcenter + parameters { - payload { application_set { @@ -54,13 +54,12 @@ resource "catalystcenter_applications" "example" { } network_identity { - display_name = "string" - id = "string" - lower_port = "string" - ports = "string" - protocol = "string" - upper_port = "string" - } + display_name = "string" + id = "string" + lower_port = "string" + ports = "string" + protocol = "string" + upper_port = "string" } } } @@ -75,7 +74,7 @@ output "catalystcenter_applications_example" { ### Optional -- `parameters` (Block List) Array of RequestApplicationPolicyCreateApplication (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestApplicationPolicyCreateApplicationV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only @@ -88,7 +87,7 @@ output "catalystcenter_applications_example" { Optional: -- `payload` (Block List) Array of RequestApplicationPolicyCreateApplication (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestApplicationPolicyCreateApplicationV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/applications_v2.md b/docs/resources/applications_v2.md index 9ba1c51..ee85bd3 100644 --- a/docs/resources/applications_v2.md +++ b/docs/resources/applications_v2.md @@ -24,66 +24,65 @@ resource "catalystcenter_applications_v2" "example" { provider = catalystcenter parameters { - payload { + + display_name = "string" + id = "string" + indicative_network_identity { + display_name = "string" id = "string" - indicative_network_identity { - - display_name = "string" - id = "string" - ipv4_subnet = ["string"] - ipv6_subnet = ["string"] - lower_port = 1.0 - ports = "string" - protocol = "string" - upper_port = 1.0 - } - instance_id = 1 - instance_version = 1.0 - name = "string" - namespace = "string" - network_applications { - - app_protocol = "string" - application_sub_type = "string" - application_type = "string" - category_id = "string" - display_name = "string" - dscp = "string" - engine_id = 1 - help_string = "string" - id = "string" - ignore_conflict = "false" - long_description = "string" - name = "string" - popularity = 1.0 - rank = 1 - selector_id = "string" - server_name = "string" - traffic_class = "string" - type = "string" - url = "string" - } - network_identity { - - display_name = "string" - id = "string" - ipv4_subnet = ["string"] - ipv6_subnet = ["string"] - lower_port = 1.0 - ports = "string" - protocol = "string" - upper_port = 1.0 - } - parent_scalable_group { - - id_ref = "string" - } - qualifier = "string" - scalable_group_external_handle = "string" - scalable_group_type = "string" - type = "string" + ipv4_subnet = ["string"] + ipv6_subnet = ["string"] + lower_port = 1.0 + ports = "string" + protocol = "string" + upper_port = 1.0 + } + instance_id = 1 + instance_version = 1.0 + name = "string" + namespace = "string" + network_applications { + + app_protocol = "string" + application_sub_type = "string" + application_type = "string" + category_id = "string" + display_name = "string" + dscp = "string" + engine_id = 1 + help_string = "string" + id = "string" + ignore_conflict = "false" + long_description = "string" + name = "string" + popularity = 1.0 + rank = 1 + selector_id = "string" + server_name = "string" + traffic_class = "string" + type = "string" + url = "string" + } + network_identity { + + display_name = "string" + id = "string" + ipv4_subnet = ["string"] + ipv6_subnet = ["string"] + lower_port = 1.0 + ports = "string" + protocol = "string" + upper_port = 1.0 + } + parent_scalable_group { + + id_ref = "string" } + qualifier = "string" + scalable_group_external_handle = "string" + scalable_group_type = "string" + type = "string" } } diff --git a/docs/resources/area.md b/docs/resources/area.md index b741a2d..ac14aa2 100644 --- a/docs/resources/area.md +++ b/docs/resources/area.md @@ -17,31 +17,7 @@ It manages create, read, update and delete operations on Sites. - Delete site with area by siteId. -## Example Usage -```terraform -resource "catalystcenter_area" "example" { - provider = catalystcenter - parameters { - - site { - - area { - - name = "string" - parent_name = "string" - } - - } - site_id = "string" - type = "string" - } -} - -output "catalystcenter_area_example" { - value = catalystcenter_area.example -} -``` ## Schema @@ -113,11 +89,3 @@ Read-Only: - `name` (String) - `parent_name` (String) - `type` (String) - -## Import - -Import is supported using the following syntax: - -```shell -terraform import catalystcenter_site.example "id:=string" -``` diff --git a/docs/resources/assign_device_to_site.md b/docs/resources/assign_device_to_site.md index 7d28934..17fdf93 100644 --- a/docs/resources/assign_device_to_site.md +++ b/docs/resources/assign_device_to_site.md @@ -12,8 +12,6 @@ description: |- It performs create operation on Site Design. - Assigns unassigned devices to a site. This data source action does not move assigned devices to other sites. - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -22,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assign_device_to_site" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/docs/resources/assign_to_site_apply.md b/docs/resources/assign_to_site_apply.md index 6f7cfe3..c8b077f 100644 --- a/docs/resources/assign_to_site_apply.md +++ b/docs/resources/assign_to_site_apply.md @@ -7,7 +7,7 @@ description: |- Assign unprovisioned network devices to a site. Along with that it can also be used to assign unprovisioned network devices to a different site. If device controllability is enabled, it will be triggered once device assigned to site successfully. Device Controllability can be enabled/disabled using - '/dna/intent/api/v1/networkDevices/deviceControllability/settings'. + /dna/intent/api/v1/networkDevices/deviceControllability/settings. --- # catalystcenter_assign_to_site_apply (Resource) @@ -17,10 +17,7 @@ It performs create operation on Site Design. - Assign unprovisioned network devices to a site. Along with that it can also be used to assign unprovisioned network devices to a different site. If device controllability is enabled, it will be triggered once device assigned to site successfully. Device Controllability can be enabled/disabled using -'/dna/intent/api/v1/networkDevices/deviceControllability/settings'. - - - +*/dna/intent/api/v1/networkDevices/deviceControllability/settings*. ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assign_to_site_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_ids = ["string"] diff --git a/docs/resources/associate_site_to_network_profile.md b/docs/resources/associate_site_to_network_profile.md index 88dd8a1..33c8530 100644 --- a/docs/resources/associate_site_to_network_profile.md +++ b/docs/resources/associate_site_to_network_profile.md @@ -12,8 +12,6 @@ description: |- It performs create operation on SiteDesign. - Associate Site to a Network Profile - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -22,11 +20,11 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_associate_site_to_network_profile" "example" { - provider = catalystcenter + provider = meraki + network_profile_id = "string" + site_id = "string" parameters { - network_profile_id = "string" - site_id = "string" } } diff --git a/docs/resources/assurance_events_query.md b/docs/resources/assurance_events_query.md index 45655c2..1ee8137 100644 --- a/docs/resources/assurance_events_query.md +++ b/docs/resources/assurance_events_query.md @@ -18,9 +18,6 @@ It performs create operation on Devices. Support Documentation' section to understand which fields are supported. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center- api-specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_events_query" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_events_query_count.md b/docs/resources/assurance_events_query_count.md index ffa54c8..3b1677a 100644 --- a/docs/resources/assurance_events_query_count.md +++ b/docs/resources/assurance_events_query_count.md @@ -18,9 +18,6 @@ It performs create operation on Devices. Documentation' section to understand which fields are supported. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceEvents-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_events_query_count" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_ignore.md b/docs/resources/assurance_issues_ignore.md index 461efc5..39becfb 100644 --- a/docs/resources/assurance_issues_ignore.md +++ b/docs/resources/assurance_issues_ignore.md @@ -18,9 +18,6 @@ It performs create operation on Issues. the issues which are failed to ignore. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesLifecycle-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_ignore" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_query.md b/docs/resources/assurance_issues_query.md index b7ea3cd..905034a 100644 --- a/docs/resources/assurance_issues_query.md +++ b/docs/resources/assurance_issues_query.md @@ -18,9 +18,6 @@ It performs create operation on Issues. there is no start and/or end time, then end time will be defaulted to current time and start time will be defaulted to 24-hours ago from end time. https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesList-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_query" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_query_count.md b/docs/resources/assurance_issues_query_count.md index f2326ce..5695da3 100644 --- a/docs/resources/assurance_issues_query_count.md +++ b/docs/resources/assurance_issues_query_count.md @@ -18,9 +18,6 @@ It performs create operation on Issues. defaulted to current time and start time will be defaulted to 24-hours ago from end time. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesList-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_query_count" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_resolve.md b/docs/resources/assurance_issues_resolve.md index 7666d5c..18274ad 100644 --- a/docs/resources/assurance_issues_resolve.md +++ b/docs/resources/assurance_issues_resolve.md @@ -18,9 +18,6 @@ It performs create operation on Issues. as the issues which are failed to resolve. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesLifecycle-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_resolve" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_summary_analytics.md b/docs/resources/assurance_issues_summary_analytics.md index 2953cbc..ae8f013 100644 --- a/docs/resources/assurance_issues_summary_analytics.md +++ b/docs/resources/assurance_issues_summary_analytics.md @@ -16,9 +16,6 @@ It performs create operation on Issues. - Gets the summary analytics data related to issues based on given filters and group by field. This data can be used to find issue counts grouped by different keys. https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesList-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_summary_analytics" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_top_n_analytics.md b/docs/resources/assurance_issues_top_n_analytics.md index c4c6b2b..5ba6373 100644 --- a/docs/resources/assurance_issues_top_n_analytics.md +++ b/docs/resources/assurance_issues_top_n_analytics.md @@ -16,12 +16,15 @@ It performs create operation on Issues. - Gets the Top N analytics data related to issues based on given filters and group by field. This data can be used to find top sites which has most issues or top device types with most issue etc,. https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesList-1.0.0-resolved.yaml +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. ## Example Usage ```terraform resource "catalystcenter_assurance_issues_top_n_analytics" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_trend_analytics.md b/docs/resources/assurance_issues_trend_analytics.md index 0e210ab..93066e4 100644 --- a/docs/resources/assurance_issues_trend_analytics.md +++ b/docs/resources/assurance_issues_trend_analytics.md @@ -18,9 +18,6 @@ It performs create operation on Issues. find issue counts in different intervals over a period of time. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-IssuesList-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_trend_analytics" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/docs/resources/assurance_issues_update.md b/docs/resources/assurance_issues_update.md index 276edc4..47eb562 100644 --- a/docs/resources/assurance_issues_update.md +++ b/docs/resources/assurance_issues_update.md @@ -18,9 +18,6 @@ It performs create operation on Issues. detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- IssuesLifecycle-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_assurance_issues_update" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" id = "string" xca_lle_rid = "string" diff --git a/docs/resources/building.md b/docs/resources/building.md index bf538f1..c7cf5bb 100644 --- a/docs/resources/building.md +++ b/docs/resources/building.md @@ -17,34 +17,7 @@ It manages create, read, update and delete operations on Sites. - Delete site with building by siteId. -## Example Usage - -```terraform -resource "catalystcenter_building" "example" { - provider = catalystcenter - parameters { - - site { - - building { - - address = "string" - country = "string" - latitude = 1.0 - longitude = 1.0 - name = "string" - parent_name = "string" - } - } - site_id = "string" - type = "string" - } -} - -output "catalystcenter_building_example" { - value = catalystcenter_building.example -} -``` + ## Schema diff --git a/docs/resources/business_sda_wireless_controller_create.md b/docs/resources/business_sda_wireless_controller_create.md index 1ddf7fa..65c0959 100644 --- a/docs/resources/business_sda_wireless_controller_create.md +++ b/docs/resources/business_sda_wireless_controller_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Fabric Wireless. - Add WLC to Fabric Domain - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_business_sda_wireless_controller_create" "example" { - provider = catalystcenter + provider = meraki parameters { device_name = "string" diff --git a/docs/resources/business_sda_wireless_controller_delete.md b/docs/resources/business_sda_wireless_controller_delete.md index 412b1e3..89a2280 100644 --- a/docs/resources/business_sda_wireless_controller_delete.md +++ b/docs/resources/business_sda_wireless_controller_delete.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on Fabric Wireless. - Remove WLC from Fabric Domain - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_business_sda_wireless_controller_delete" "example" { - provider = catalystcenter + provider = meraki device_ipaddress = "string" } diff --git a/docs/resources/clients_query.md b/docs/resources/clients_query.md index 6d6bb15..aa8fcae 100644 --- a/docs/resources/clients_query.md +++ b/docs/resources/clients_query.md @@ -16,9 +16,6 @@ It performs create operation on Clients. - Retrieves the list of clients by applying complex filters while also supporting aggregate attributes. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_clients_query" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/clients_query_count.md b/docs/resources/clients_query_count.md index d787123..4290bde 100644 --- a/docs/resources/clients_query_count.md +++ b/docs/resources/clients_query_count.md @@ -16,9 +16,6 @@ It performs create operation on Clients. - Retrieves the number of clients by applying complex filters. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_clients_query_count" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/clients_summary_analytics.md b/docs/resources/clients_summary_analytics.md index 1bbdd89..93f57e2 100644 --- a/docs/resources/clients_summary_analytics.md +++ b/docs/resources/clients_summary_analytics.md @@ -20,9 +20,6 @@ grouping. This data source action facilitates obtaining consolidated insights in clients. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- clients1-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -31,7 +28,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_clients_summary_analytics" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/clients_top_n_analytics.md b/docs/resources/clients_top_n_analytics.md index 9c4ccdd..30d1a6b 100644 --- a/docs/resources/clients_top_n_analytics.md +++ b/docs/resources/clients_top_n_analytics.md @@ -18,12 +18,15 @@ It performs create operation on Clients. facilitates obtaining insights into the top-performing or most impacted clients. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. ## Example Usage ```terraform resource "catalystcenter_clients_top_n_analytics" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/clients_trend_analytics.md b/docs/resources/clients_trend_analytics.md index 149a9dd..f74f73f 100644 --- a/docs/resources/clients_trend_analytics.md +++ b/docs/resources/clients_trend_analytics.md @@ -20,9 +20,6 @@ trend time interval. This data source action facilitates obtaining consolidated of the clients over the specified start and end time. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -31,7 +28,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_clients_trend_analytics" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/docs/resources/clients_trend_analytics_id.md b/docs/resources/clients_trend_analytics_id.md index 9d93fb6..5946376 100644 --- a/docs/resources/clients_trend_analytics_id.md +++ b/docs/resources/clients_trend_analytics_id.md @@ -18,9 +18,6 @@ It performs create operation on Clients. grouping. The data will be grouped based on the specified trend time interval. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst- center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-clients1-1.0.0-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_clients_trend_analytics_id" "example" { - provider = catalystcenter + provider = meraki id = "string" xca_lle_rid = "string" parameters { diff --git a/docs/resources/command_runner_run_command.md b/docs/resources/command_runner_run_command.md index 2f5e008..c16141a 100644 --- a/docs/resources/command_runner_run_command.md +++ b/docs/resources/command_runner_run_command.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Command Runner. - Submit request for read-only CLIs - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_command_runner_run_command" "example" { - provider = catalystcenter + provider = meraki parameters { commands = ["string"] diff --git a/docs/resources/compliance.md b/docs/resources/compliance.md index 5a2469a..aca7064 100644 --- a/docs/resources/compliance.md +++ b/docs/resources/compliance.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Compliance. - Run compliance check for device(s). - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_compliance" "example" { - provider = catalystcenter + provider = meraki parameters { categories = ["string"] @@ -55,7 +52,7 @@ output "catalystcenter_compliance_example" { Optional: -- `categories` (List of String) Category can have any value among 'INTENT'(mapped to compliance types: NETWORK_SETTINGS,NETWORK_PROFILEWORKFLOW,FABRIC,APPLICATION_VISIBILITY), 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'EOX' , 'NETWORK_SETTINGS' +- `categories` (List of String) Category can have any value among 'INTENT'(mapped to compliance types: NETWORK_SETTINGS,NETWORK_PROFILE,WORKFLOW,FABRIC,APPLICATION_VISIBILITY), 'RUNNING_CONFIG' , 'IMAGE' , 'PSIRT' , 'EOX' , 'NETWORK_SETTINGS' - `device_uuids` (List of String) UUID of the device. - `trigger_full` (String) if it is true then compliance will be triggered for all categories. If it is false then compliance will be triggered for categories mentioned in categories section . diff --git a/docs/resources/configuration_template.md b/docs/resources/configuration_template.md index dc574f4..edfbcc4 100644 --- a/docs/resources/configuration_template.md +++ b/docs/resources/configuration_template.md @@ -22,7 +22,197 @@ It manages create, read, update and delete operations on Configuration Templates ```terraform resource "catalystcenter_configuration_template" "example" { provider = catalystcenter + item { + + + containing_templates { + + + + device_types { + + + + + } + + + + + rollback_template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + tags { + + + + } + + template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + + } + + + + device_types { + + + + + } + + + + + + + + + + + rollback_template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + + + + tags { + + + + } + + template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + validation_errors { + + + + + + } + + } parameters { author = "string" @@ -70,7 +260,7 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } tags { @@ -108,7 +298,7 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } version = "string" @@ -161,7 +351,7 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } software_type = "string" @@ -203,13 +393,13 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } validation_errors { - rollback_template_errors = "string" - template_errors = "string" + rollback_template_errors = "------" + template_errors = "------" template_id = "string" template_version = "string" } @@ -238,10 +428,6 @@ output "catalystcenter_configuration_template_example" { ### Nested Schema for `parameters` -Required: - -- `project_id` (String) Project UUID - Optional: - `author` (String) Author of template @@ -258,6 +444,7 @@ Optional: - `latest_version_time` (Number) Latest versioned template time - `name` (String) Name of template - `parent_template_id` (String) Parent templateID +- `project_id` (String) Project UUID - `project_name` (String) Project name - `rollback_template_content` (String) Rollback template content - `rollback_template_params` (Block List) (see [below for nested schema](#nestedblock--parameters--rollback_template_params)) diff --git a/docs/resources/configuration_template_clone.md b/docs/resources/configuration_template_clone.md index b4a6cd8..4f17fbf 100644 --- a/docs/resources/configuration_template_clone.md +++ b/docs/resources/configuration_template_clone.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Templates. - API to clone template - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_configuration_template_clone" "example" { - provider = catalystcenter + provider = meraki name = "string" project_id = "string" template_id = "string" diff --git a/docs/resources/configuration_template_export_project.md b/docs/resources/configuration_template_export_project.md index e7228ad..9e62d25 100644 --- a/docs/resources/configuration_template_export_project.md +++ b/docs/resources/configuration_template_export_project.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Templates. - Exports the projects for given projectNames. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,10 +20,8 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_configuration_template_export_project" "example" { - provider = catalystcenter - parameters { - payload = ["string"] - } + provider = meraki + parameters = ["string"] } output "catalystcenter_configuration_template_export_project_example" { @@ -52,7 +47,7 @@ output "catalystcenter_configuration_template_export_project_example" { Optional: -- `payload` (List of String) Array of RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteria +- `payload` (List of String) Array of RequestConfigurationTemplatesExportsTheProjectsForAGivenCriteriaV1 diff --git a/docs/resources/configuration_template_export_template.md b/docs/resources/configuration_template_export_template.md index 911e750..428b420 100644 --- a/docs/resources/configuration_template_export_template.md +++ b/docs/resources/configuration_template_export_template.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Templates. - Exports the templates for given templateIds. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,10 +20,8 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_configuration_template_export_template" "example" { - provider = catalystcenter - parameters { - payload = ["string"] - } + provider = meraki + parameters = ["string"] } output "catalystcenter_configuration_template_export_template_example" { @@ -52,7 +47,7 @@ output "catalystcenter_configuration_template_export_template_example" { Optional: -- `payload` (List of String) Array of RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteria +- `payload` (List of String) Array of RequestConfigurationTemplatesExportsTheTemplatesForAGivenCriteriaV1 diff --git a/docs/resources/configuration_template_import_project.md b/docs/resources/configuration_template_import_project.md index ea6a724..77c51fa 100644 --- a/docs/resources/configuration_template_import_project.md +++ b/docs/resources/configuration_template_import_project.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Templates. - Imports the Projects provided in the DTO - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_configuration_template_import_project" "example" { - provider = catalystcenter + provider = meraki do_version = "false" } diff --git a/docs/resources/configuration_template_import_template.md b/docs/resources/configuration_template_import_template.md index a848d7f..84fe87b 100644 --- a/docs/resources/configuration_template_import_template.md +++ b/docs/resources/configuration_template_import_template.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Templates. - Imports the templates provided in the DTO by project Name - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,118 +20,27 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_configuration_template_import_template" "example" { - provider = catalystcenter + provider = meraki do_version = "false" project_name = "string" parameters { - payload{ - author = "string" - composite = "false" - containing_templates { - - composite = "false" - description = "string" - device_types { - - product_family = "string" - product_series = "string" - product_type = "string" - } - id = "string" - language = "string" - name = "string" - project_name = "string" - rollback_template_params { - - binding = "string" - custom_order = 1 - data_type = "string" - default_value = "string" - description = "string" - display_name = "string" - group = "string" - id = "string" - instruction_text = "string" - key = "string" - not_param = "false" - order = 1 - param_array = "false" - parameter_name = "string" - provider = "string" - range { - - id = "string" - max_value = 1 - min_value = 1 - } - required = "false" - selection { - - default_selected_values = ["string"] - id = "string" - selection_type = "string" - selection_values = "string" - } - } - tags { - id = "string" - name = "string" - } - template_content = "string" - template_params { - - binding = "string" - custom_order = 1 - data_type = "string" - default_value = "string" - description = "string" - display_name = "string" - group = "string" - id = "string" - instruction_text = "string" - key = "string" - not_param = "false" - order = 1 - param_array = "false" - parameter_name = "string" - provider = "string" - range { - - id = "string" - max_value = 1 - min_value = 1 - } - required = "false" - selection { - - default_selected_values = ["string"] - id = "string" - selection_type = "string" - selection_values = "string" - } - } - version = "string" - } - create_time = 1 - custom_params_order = "false" - description = "string" + author = "string" + composite = "false" + containing_templates { + + composite = "false" + description = "string" device_types { product_family = "string" product_series = "string" product_type = "string" } - failure_policy = "string" - id = "string" - language = "string" - last_update_time = 1 - latest_version_time = 1 - name = "string" - parent_template_id = "string" - project_id = "string" - project_name = "string" - rollback_template_content = "string" + id = "string" + language = "string" + name = "string" + project_name = "string" rollback_template_params { binding = "string" @@ -164,12 +70,9 @@ resource "catalystcenter_configuration_template_import_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } - software_type = "string" - software_variant = "string" - software_version = "string" tags { id = "string" @@ -205,18 +108,111 @@ resource "catalystcenter_configuration_template_import_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } - validation_errors { + version = "string" + } + create_time = 1 + custom_params_order = "false" + description = "string" + device_types { + + product_family = "string" + product_series = "string" + product_type = "string" + } + failure_policy = "string" + id = "string" + language = "string" + last_update_time = 1 + latest_version_time = 1 + name = "string" + parent_template_id = "string" + project_id = "string" + project_name = "string" + rollback_template_content = "string" + rollback_template_params { + + binding = "string" + custom_order = 1 + data_type = "string" + default_value = "string" + description = "string" + display_name = "string" + group = "string" + id = "string" + instruction_text = "string" + key = "string" + not_param = "false" + order = 1 + param_array = "false" + parameter_name = "string" + provider = "string" + range { + + id = "string" + max_value = 1 + min_value = 1 + } + required = "false" + selection { - rollback_template_errors = "string" - template_errors = "string" - template_id = "string" - template_version = "string" + default_selected_values = ["string"] + id = "string" + selection_type = "string" + selection_values = "------" } - version = "string" } + software_type = "string" + software_variant = "string" + software_version = "string" + tags { + + id = "string" + name = "string" + } + template_content = "string" + template_params { + + binding = "string" + custom_order = 1 + data_type = "string" + default_value = "string" + description = "string" + display_name = "string" + group = "string" + id = "string" + instruction_text = "string" + key = "string" + not_param = "false" + order = 1 + param_array = "false" + parameter_name = "string" + provider = "string" + range { + + id = "string" + max_value = 1 + min_value = 1 + } + required = "false" + selection { + + default_selected_values = ["string"] + id = "string" + selection_type = "string" + selection_values = "------" + } + } + validation_errors { + + rollback_template_errors = "------" + template_errors = "------" + template_id = "string" + template_version = "string" + } + version = "string" } } @@ -248,7 +244,7 @@ Required: Optional: - `do_version` (Boolean) doVersion query parameter. If this flag is true then it creates a new version of the template with the imported contents in case if the templates already exists. " If this flag is false and if template already exists, then operation fails with 'Template already exists' error -- `payload` (Block List) Array of RequestConfigurationTemplatesImportsTheTemplatesProvided (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestConfigurationTemplatesImportsTheTemplatesProvidedV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/credential_to_site_by_siteid_create_v2.md b/docs/resources/credential_to_site_by_siteid_create_v2.md index d0dde0a..b481017 100644 --- a/docs/resources/credential_to_site_by_siteid_create_v2.md +++ b/docs/resources/credential_to_site_by_siteid_create_v2.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Network Settings. - API to assign Device Credential to a site. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_credential_to_site_by_siteid_create_v2" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/docs/resources/deploy_template.md b/docs/resources/deploy_template_v2.md similarity index 88% rename from docs/resources/deploy_template.md rename to docs/resources/deploy_template_v2.md index 9745f36..5abc5c3 100644 --- a/docs/resources/deploy_template.md +++ b/docs/resources/deploy_template_v2.md @@ -1,20 +1,17 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_deploy_template Resource - terraform-provider-catalystcenter" +page_title: "catalystcenter_deploy_template_v2 Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It performs create operation on Configuration Templates. V2 API to deploy a template. --- -# catalystcenter_deploy_template (Resource) +# catalystcenter_deploy_template_v2 (Resource) It performs create operation on Configuration Templates. - V2 API to deploy a template. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -22,8 +19,8 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ## Example Usage ```terraform -resource "catalystcenter_deploy_template" "example" { - provider = catalystcenter +resource "catalystcenter_deploy_template_v2" "example" { + provider = meraki parameters { force_push_template = "false" @@ -34,7 +31,7 @@ resource "catalystcenter_deploy_template" "example" { host_name = "string" id = "string" - params = "string" + params = "------" resource_params = ["string"] type = "string" versioned_template_id = "string" @@ -43,8 +40,8 @@ resource "catalystcenter_deploy_template" "example" { } } -output "catalystcenter_deploy_template_example" { - value = catalystcenter_deploy_template.example +output "catalystcenter_deploy_template_v2_example" { + value = catalystcenter_deploy_template_v2.example } ``` diff --git a/docs/resources/device_configurations_export.md b/docs/resources/device_configurations_export.md index d5ea265..798e3f5 100644 --- a/docs/resources/device_configurations_export.md +++ b/docs/resources/device_configurations_export.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Archive. - Export Device configurations to an encrypted zip file - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_device_configurations_export" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = "string" diff --git a/docs/resources/device_replacement.md b/docs/resources/device_replacement.md index 5046462..2bd3de1 100644 --- a/docs/resources/device_replacement.md +++ b/docs/resources/device_replacement.md @@ -22,22 +22,21 @@ resource "catalystcenter_device_replacement" "example" { provider = catalystcenter parameters { - payload{ - creation_time = 1 - family = "string" - faulty_device_id = "string" - faulty_device_name = "string" - faulty_device_platform = "string" - faulty_device_serial_number = "string" - id = "string" - neighbour_device_id = "string" - network_readiness_task_id = "string" - replacement_device_platform = "string" - replacement_device_serial_number = "string" - replacement_status = "string" - replacement_time = 1 - workflow_id = "string" - } + + creation_time = 1 + family = "string" + faulty_device_id = "string" + faulty_device_name = "string" + faulty_device_platform = "string" + faulty_device_serial_number = "string" + id = "string" + neighbour_device_id = "string" + network_readiness_task_id = "string" + replacement_device_platform = "string" + replacement_device_serial_number = "string" + replacement_status = "string" + replacement_time = 1 + workflow_id = "string" } } diff --git a/docs/resources/device_replacement_deploy.md b/docs/resources/device_replacement_deploy.md index aa6cbe9..b7e3bed 100644 --- a/docs/resources/device_replacement_deploy.md +++ b/docs/resources/device_replacement_deploy.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Device Replacement. - API to trigger RMA workflow that will replace faulty device with replacement device with same configuration and images - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_device_replacement_deploy" "example" { - provider = catalystcenter + provider = meraki parameters { faulty_device_serial_number = "string" diff --git a/docs/resources/disassociate_site_to_network_profile.md b/docs/resources/disassociate_site_to_network_profile.md index c99d63e..7ece768 100644 --- a/docs/resources/disassociate_site_to_network_profile.md +++ b/docs/resources/disassociate_site_to_network_profile.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on Site Design. - Disassociate a Site from a Network Profile - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_disassociate_site_to_network_profile" "example" { - provider = catalystcenter + provider = meraki network_profile_id = "string" site_id = "string" parameters { diff --git a/docs/resources/discovery.md b/docs/resources/discovery.md index 8365a49..2308aee 100644 --- a/docs/resources/discovery.md +++ b/docs/resources/discovery.md @@ -26,10 +26,72 @@ by range" API. ```terraform resource "catalystcenter_discovery" "example" { provider = catalystcenter + item { + + + + + + + + + http_read_credential { + + + + + + + + + + + + } + http_write_credential { + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + } parameters { - attribute_info = "string" + attribute_info = "------" cdp_level = 1 device_ids = "string" discovery_condition = "string" @@ -156,7 +218,7 @@ ERROR: Different types for param passwordList schema.TypeList schema.TypeString - `snmp_ro_community` (String) SNMP RO community of the devices to be discovered - `snmp_ro_community_desc` (String) Description for SNMP RO community - `snmp_rw_community` (String) SNMP RW community of the devices to be discovered -- `snmp_rw_community_desc` (String) Description for Snmp RW community +- `snmp_rw_community_desc` (String) Description for SNMP RW community - `snmp_user_name` (String) SNMP username of the device - `snmp_version` (String) Version of SNMP. v2 or v3 - `time_out` (Number) Time to wait for device response. diff --git a/docs/resources/discovery_range_delete.md b/docs/resources/discovery_range_delete.md index 6adb31c..0ccc50e 100644 --- a/docs/resources/discovery_range_delete.md +++ b/docs/resources/discovery_range_delete.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on Discovery. - Stops discovery for the given range and removes them - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_discovery_range_delete" "example" { - provider = catalystcenter + provider = meraki records_to_delete = 1 start_index = 1 parameters { diff --git a/docs/resources/endpoint_analytics_profiling_rules.md b/docs/resources/endpoint_analytics_profiling_rules.md new file mode 100644 index 0000000..da0c3c2 --- /dev/null +++ b/docs/resources/endpoint_analytics_profiling_rules.md @@ -0,0 +1,196 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_endpoint_analytics_profiling_rules Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It manages create, read, update and delete operations on AIEndpointAnalytics. + Creates profiling rule from the request body.Updates the profiling rule for the given 'ruleId'.Deletes the profiling rule for the given 'ruleId'. +--- + +# catalystcenter_endpoint_analytics_profiling_rules (Resource) + +It manages create, read, update and delete operations on AIEndpointAnalytics. + +- Creates profiling rule from the request body. + +- Updates the profiling rule for the given 'ruleId'. + +- Deletes the profiling rule for the given 'ruleId'. + +## Example Usage + +```terraform +resource "catalystcenter_endpoint_analytics_profiling_rules" "example" { + provider = catalystcenter + + parameters { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } +} + +output "catalystcenter_endpoint_analytics_profiling_rules_example" { + value = catalystcenter_endpoint_analytics_profiling_rules.example +} +``` + + +## Schema + +### Optional + +- `parameters` (Block List) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `cluster_id` (String) Unique identifier for ML cluster. Only applicable for 'ML Rule'. +- `condition_groups` (Block List) (see [below for nested schema](#nestedblock--parameters--condition_groups)) +- `is_deleted` (String) Flag to indicate whether the rule was deleted. +- `last_modified_by` (String) User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +- `last_modified_on` (Number) Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +- `plugin_id` (String) Plugin for the rule. Only applicable for 'Cisco Default' rules. +- `rejected` (String) Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +- `result` (Block List) (see [below for nested schema](#nestedblock--parameters--result)) +- `rule_id` (String) Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +- `rule_name` (String) Human readable name for the rule. +- `rule_priority` (Number) Priority for the rule. +- `rule_type` (String) Type of the rule. +- `rule_version` (Number) Version of the rule. +- `source_priority` (Number) Source priority for the rule. +- `used_attributes` (List of String) List of attributes used in the rule. Only applicable for 'Cisco Default' rules. + + +### Nested Schema for `parameters.condition_groups` + +Optional: + +- `condition` (Block List) (see [below for nested schema](#nestedblock--parameters--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `parameters.condition_groups.condition` + +Optional: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `parameters.result` + +Optional: + +- `device_type` (List of String) List of device types determined by the current rule. +- `hardware_manufacturer` (List of String) List of hardware manufacturers determined by the current rule. +- `hardware_model` (List of String) List of hardware models determined by the current rule. +- `operating_system` (List of String) List of operating systems determined by the current rule. + + + + +### Nested Schema for `item` + +Read-Only: + +- `cluster_id` (String) +- `condition_groups` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups)) +- `is_deleted` (String) +- `last_modified_by` (String) +- `last_modified_on` (Number) +- `plugin_id` (String) +- `rejected` (String) +- `result` (List of Object) (see [below for nested schema](#nestedobjatt--item--result)) +- `rule_id` (String) +- `rule_name` (String) +- `rule_priority` (Number) +- `rule_type` (String) +- `rule_version` (Number) +- `source_priority` (Number) +- `used_attributes` (List of String) + + +### Nested Schema for `item.condition_groups` + +Read-Only: + +- `condition` (List of Object) (see [below for nested schema](#nestedobjatt--item--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `item.condition_groups.condition` + +Read-Only: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `item.result` + +Read-Only: + +- `device_type` (List of String) +- `hardware_manufacturer` (List of String) +- `hardware_model` (List of String) +- `operating_system` (List of String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import catalystcenter_endpoint_analytics_profiling_rules.example "rule_id:=string" +``` diff --git a/docs/resources/event_email_config_create.md b/docs/resources/event_email_config_create.md index 8fcb3c1..066b3ee 100644 --- a/docs/resources/event_email_config_create.md +++ b/docs/resources/event_email_config_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Event Management. - Create Email Destination - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_event_email_config_create" "example" { - provider = catalystcenter + provider = meraki parameters { email_config_id = "string" diff --git a/docs/resources/event_email_config_update.md b/docs/resources/event_email_config_update.md index 348b59b..26e3bbc 100644 --- a/docs/resources/event_email_config_update.md +++ b/docs/resources/event_email_config_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Event Management. - Update Email Destination - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_event_email_config_update" "example" { - provider = catalystcenter + provider = meraki parameters { email_config_id = "string" diff --git a/docs/resources/event_snmp_config_create.md b/docs/resources/event_snmp_config_create.md index 2b822bc..ccfa2f1 100644 --- a/docs/resources/event_snmp_config_create.md +++ b/docs/resources/event_snmp_config_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Event Management. - Create SNMP Destination - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_event_snmp_config_create" "example" { - provider = catalystcenter + provider = meraki parameters { auth_password = "string" diff --git a/docs/resources/event_snmp_config_update.md b/docs/resources/event_snmp_config_update.md index 3d68df5..8dc8830 100644 --- a/docs/resources/event_snmp_config_update.md +++ b/docs/resources/event_snmp_config_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Event Management. - Update SNMP Destination - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_event_snmp_config_update" "example" { - provider = catalystcenter + provider = meraki parameters { auth_password = "string" diff --git a/docs/resources/event_subscription.md b/docs/resources/event_subscription.md index 7f7d10c..7495335 100644 --- a/docs/resources/event_subscription.md +++ b/docs/resources/event_subscription.md @@ -24,34 +24,33 @@ resource "catalystcenter_event_subscription" "example" { provider = catalystcenter parameters { - payload { - description = "string" - filter { - - categories = ["string"] - domains_subdomains { - - domain = "string" - sub_domains = ["string"] - } - event_ids = ["string"] - severities = ["string"] - site_ids = ["string"] - sources = ["string"] - types = ["string"] + + description = "string" + filter { + + categories = ["string"] + domains_subdomains { + + domain = "string" + sub_domains = ["string"] } - name = "string" - subscription_endpoints { + event_ids = ["string"] + severities = ["string"] + site_ids = ["string"] + sources = ["string"] + types = ["string"] + } + name = "string" + subscription_endpoints { - instance_id = "string" - subscription_details { + instance_id = "string" + subscription_details { - connector_type = "string" - } + connector_type = "string" } - subscription_id = "string" - version = "string" } + subscription_id = "string" + version = "string" } } @@ -65,7 +64,7 @@ output "catalystcenter_event_subscription_example" { ### Optional -- `parameters` (Block List) Array of RequestEventManagementCreateEventSubscriptions (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestEventManagementCreateEventSubscriptionsV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/event_subscription_email.md b/docs/resources/event_subscription_email.md index 708e59e..dbba3ff 100644 --- a/docs/resources/event_subscription_email.md +++ b/docs/resources/event_subscription_email.md @@ -22,39 +22,38 @@ resource "catalystcenter_event_subscription_email" "example" { provider = catalystcenter parameters { - payload { - description = "string" - filter { - - categories = ["string"] - domains_subdomains { - - domain = "string" - sub_domains = ["string"] - } - event_ids = ["string"] - severities = [1] - site_ids = ["string"] - sources = ["string"] - types = ["string"] + + description = "string" + filter { + + categories = ["string"] + domains_subdomains { + + domain = "string" + sub_domains = ["string"] } - name = "string" - subscription_endpoints { - - instance_id = "string" - subscription_details { - - connector_type = "string" - description = "string" - from_email_address = "string" - name = "string" - subject = "string" - to_email_addresses = ["string"] - } + event_ids = ["string"] + severities = [1] + site_ids = ["string"] + sources = ["string"] + types = ["string"] + } + name = "string" + subscription_endpoints { + + instance_id = "string" + subscription_details { + + connector_type = "string" + description = "string" + from_email_address = "string" + name = "string" + subject = "string" + to_email_addresses = ["string"] } - subscription_id = "string" - version = "string" } + subscription_id = "string" + version = "string" } } @@ -68,7 +67,7 @@ output "catalystcenter_event_subscription_email_example" { ### Optional -- `parameters` (Block List) Array of RequestEventManagementCreateEmailEventSubscription (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestEventManagementCreateEmailEventSubscriptionV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/event_subscription_rest.md b/docs/resources/event_subscription_rest.md index f73bb9a..1da59f3 100644 --- a/docs/resources/event_subscription_rest.md +++ b/docs/resources/event_subscription_rest.md @@ -22,34 +22,33 @@ resource "catalystcenter_event_subscription_rest" "example" { provider = catalystcenter parameters { - payload { - description = "string" - filter { - - categories = ["string"] - domains_subdomains { - - domain = "string" - sub_domains = ["string"] - } - event_ids = ["string"] - severities = ["string"] - site_ids = ["string"] - sources = ["string"] - types = ["string"] + + description = "string" + filter { + + categories = ["string"] + domains_subdomains { + + domain = "string" + sub_domains = ["string"] } - name = "string" - subscription_endpoints { + event_ids = ["string"] + severities = ["string"] + site_ids = ["string"] + sources = ["string"] + types = ["string"] + } + name = "string" + subscription_endpoints { - instance_id = "string" - subscription_details { + instance_id = "string" + subscription_details { - connector_type = "string" - } + connector_type = "string" } - subscription_id = "string" - version = "string" } + subscription_id = "string" + version = "string" } } @@ -63,7 +62,7 @@ output "catalystcenter_event_subscription_rest_example" { ### Optional -- `parameters` (Block List) Array of RequestEventManagementCreateRestWebhookEventSubscription (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestEventManagementCreateRestWebhookEventSubscriptionV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/event_subscription_syslog.md b/docs/resources/event_subscription_syslog.md index 9e231e6..5af70da 100644 --- a/docs/resources/event_subscription_syslog.md +++ b/docs/resources/event_subscription_syslog.md @@ -22,8 +22,6 @@ resource "catalystcenter_event_subscription_syslog" "example" { provider = catalystcenter parameters { - payload { - description = "string" filter { @@ -46,12 +44,11 @@ resource "catalystcenter_event_subscription_syslog" "example" { instance_id = "string" subscription_details { - connector_type = "string" - } + connector_type = "string" } - subscription_id = "string" - version = "string" } + subscription_id = "string" + version = "string" } } @@ -65,7 +62,7 @@ output "catalystcenter_event_subscription_syslog_example" { ### Optional -- `parameters` (Block List) Array of RequestEventManagementCreateSyslogEventSubscription (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestEventManagementCreateSyslogEventSubscriptionV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/event_webhook_create.md b/docs/resources/event_webhook_create.md index a995d57..5100630 100644 --- a/docs/resources/event_webhook_create.md +++ b/docs/resources/event_webhook_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Event Management. - Create Webhook Destination - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_event_webhook_create" "example" { - provider = catalystcenter + provider = meraki parameters { description = "string" diff --git a/docs/resources/event_webhook_update.md b/docs/resources/event_webhook_update.md index f44f75e..ec0f189 100644 --- a/docs/resources/event_webhook_update.md +++ b/docs/resources/event_webhook_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Event Management. - Update Webhook Destination - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_event_webhook_update" "example" { - provider = catalystcenter + provider = meraki parameters { description = "string" diff --git a/docs/resources/execute_suggested_actions_commands.md b/docs/resources/execute_suggested_actions_commands.md index beb5071..1ee7ea2 100644 --- a/docs/resources/execute_suggested_actions_commands.md +++ b/docs/resources/execute_suggested_actions_commands.md @@ -20,9 +20,6 @@ return an execution Id. At the completion of the execution, the output of the co actions will be provided Invoking this API would provide the execution id. Execute the 'Get Business API Execution Details' API with this execution id, to receive the suggested actions commands output. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -31,7 +28,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_execute_suggested_actions_commands" "example" { - provider = catalystcenter + provider = meraki parameters { entity_type = "string" diff --git a/docs/resources/file_import.md b/docs/resources/file_import.md index db897e0..ac290d9 100644 --- a/docs/resources/file_import.md +++ b/docs/resources/file_import.md @@ -12,9 +12,6 @@ description: |- It performs create operation on File. - Uploads a new file within a specific nameSpace - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,9 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_file_import" "example" { - provider = catalystcenter - file_name = "string" - file_path = "string" + provider = meraki name_space = "string" parameters { diff --git a/docs/resources/flexible_report_execute.md b/docs/resources/flexible_report_execute.md index 0f8886f..167c7f3 100644 --- a/docs/resources/flexible_report_execute.md +++ b/docs/resources/flexible_report_execute.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Reports. - This data source action is used for executing the report - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_flexible_report_execute" "example" { - provider = catalystcenter + provider = meraki report_id = "string" parameters { @@ -64,7 +61,6 @@ Read-Only: - `end_time` (Number) - `errors` (List of String) - `execution_id` (String) -- `process_status` (String) - `request_status` (String) - `start_time` (Number) - `warnings` (List of String) diff --git a/docs/resources/flexible_report_schedule.md b/docs/resources/flexible_report_schedule.md index ee9f6d1..c7a0e69 100644 --- a/docs/resources/flexible_report_schedule.md +++ b/docs/resources/flexible_report_schedule.md @@ -21,7 +21,7 @@ resource "catalystcenter_flexible_report_schedule" "example" { parameters { report_id = "string" - schedule = "string" + schedule = "------" } } diff --git a/docs/resources/floors_settings.md b/docs/resources/floors_settings_v2.md similarity index 76% rename from docs/resources/floors_settings.md rename to docs/resources/floors_settings_v2.md index ed319f5..fc5f2b2 100644 --- a/docs/resources/floors_settings.md +++ b/docs/resources/floors_settings_v2.md @@ -1,13 +1,13 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_floors_settings Resource - terraform-provider-catalystcenter" +page_title: "catalystcenter_floors_settings_v2 Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It manages create, read, update and delete operations on Site Design. Updates UI user preference for floor unit system. Unit sytem change will effect for all floors across all sites. --- -# catalystcenter_floors_settings (Resource) +# catalystcenter_floors_settings_v2 (Resource) It manages create, read, update and delete operations on Site Design. @@ -16,7 +16,7 @@ It manages create, read, update and delete operations on Site Design. ## Example Usage ```terraform -resource "catalystcenter_floors_settings" "example" { +resource "catalystcenter_floors_settings_v2" "example" { provider = catalystcenter parameters { @@ -25,8 +25,8 @@ resource "catalystcenter_floors_settings" "example" { } } -output "catalystcenter_floors_settings_example" { - value = catalystcenter_floors_settings.example +output "catalystcenter_floors_settings_v2_example" { + value = catalystcenter_floors_settings_v2.example } ``` @@ -63,5 +63,5 @@ Read-Only: Import is supported using the following syntax: ```shell -terraform import catalystcenter_floors_settings.example "id:=string" +terraform import catalystcenter_floors_settings_v2.example "id:=string" ``` diff --git a/docs/resources/floors_upload_image.md b/docs/resources/floors_upload_image_v2.md similarity index 77% rename from docs/resources/floors_upload_image.md rename to docs/resources/floors_upload_image_v2.md index 6347839..6b0f02d 100644 --- a/docs/resources/floors_upload_image.md +++ b/docs/resources/floors_upload_image_v2.md @@ -1,20 +1,17 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_floors_upload_image Resource - terraform-provider-catalystcenter" +page_title: "catalystcenter_floors_upload_image_v2 Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It performs create operation on Site Design. Uploads floor image. --- -# catalystcenter_floors_upload_image (Resource) +# catalystcenter_floors_upload_image_v2 (Resource) It performs create operation on Site Design. - Uploads floor image. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -22,16 +19,16 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ## Example Usage ```terraform -resource "catalystcenter_floors_upload_image" "example" { - provider = catalystcenter +resource "catalystcenter_floors_upload_image_v2" "example" { + provider = meraki id = "string" parameters { } } -output "catalystcenter_floors_upload_image_example" { - value = catalystcenter_floors_upload_image.example +output "catalystcenter_floors_upload_image_v2_example" { + value = catalystcenter_floors_upload_image_v2.example } ``` diff --git a/docs/resources/global_credential_update.md b/docs/resources/global_credential_update.md index 65aa939..37632a1 100644 --- a/docs/resources/global_credential_update.md +++ b/docs/resources/global_credential_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Discovery. - Update global credential for network devices in site(s) - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_global_credential_update" "example" { - provider = catalystcenter + provider = meraki global_credential_id = "string" parameters { diff --git a/docs/resources/image_device_activation.md b/docs/resources/image_device_activation.md index 65346f7..11557c2 100644 --- a/docs/resources/image_device_activation.md +++ b/docs/resources/image_device_activation.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Software Image Management (SWIM). - Activates a software image on a given device. Software image must be present in the device flash - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,19 +20,18 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_image_device_activation" "example" { - provider = catalystcenter + provider = meraki client_type = "string" client_url = "string" schedule_validate = "false" parameters { - payload { - activate_lower_image_version = "false" - device_upgrade_mode = "string" - device_uuid = "string" - distribute_if_needed = "false" - image_uuid_list = ["string"] - smu_image_uuid_list = ["string"] - } + + activate_lower_image_version = "false" + device_upgrade_mode = "string" + device_uuid = "string" + distribute_if_needed = "false" + image_uuid_list = ["string"] + smu_image_uuid_list = ["string"] } } @@ -67,7 +63,7 @@ Required: Optional: -- `payload` (Block List) Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageActivation (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageActivationV1 (see [below for nested schema](#nestedblock--parameters--payload)) - `schedule_validate` (Boolean) scheduleValidate query parameter. scheduleValidate, validates data before schedule (Optional) diff --git a/docs/resources/image_distribution.md b/docs/resources/image_distribution.md index 0be6c11..dee82b5 100644 --- a/docs/resources/image_distribution.md +++ b/docs/resources/image_distribution.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_image_distribution Resource - terraform-provider-cat subcategory: "" description: |- It performs create operation on Software Image Management (SWIM). - Distributes a software image on a given device. Software image must be imported successfully into Catalyst Center before it + Distributes a software image on a given device. Software image must be imported successfully into DNA Center before it can be distributed --- @@ -12,11 +12,8 @@ description: |- It performs create operation on Software Image Management (SWIM). -- Distributes a software image on a given device. Software image must be imported successfully into Catalyst Center before it +- Distributes a software image on a given device. Software image must be imported successfully into DNA Center before it can be distributed - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,12 +22,11 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_image_distribution" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - device_uuid = "string" - image_uuid = "string" - } + + device_uuid = "string" + image_uuid = "string" } } @@ -57,7 +53,7 @@ output "catalystcenter_image_distribution_example" { Optional: -- `payload` (Block List) Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageDistribution (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSoftwareImageManagementSwimTriggerSoftwareImageDistributionV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/images_download.md b/docs/resources/images_download.md index 65ea15f..b5c16f4 100644 --- a/docs/resources/images_download.md +++ b/docs/resources/images_download.md @@ -4,19 +4,16 @@ page_title: "catalystcenter_images_download Resource - terraform-provider-cataly subcategory: "" description: |- It performs create operation on Software Image Management (SWIM). - Initiates download of the software image from Cisco.com on the disk for the given 'id'. Refer to - '/dna/intent/api/v1/images' for obtaining 'id'. + Initiates download of the software image from Cisco.com on the disk for the given id. Refer to + /dna/intent/api/v1/images for obtaining id. --- # catalystcenter_images_download (Resource) It performs create operation on Software Image Management (SWIM). -- Initiates download of the software image from Cisco.com on the disk for the given 'id'. Refer to -'/dna/intent/api/v1/images' for obtaining 'id'. - - - +- Initiates download of the software image from Cisco.com on the disk for the given *id*. Refer to +*/dna/intent/api/v1/images* for obtaining *id*. ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_images_download" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { @@ -55,7 +52,7 @@ output "catalystcenter_images_download_example" { Required: -- `id` (String) id path parameter. Software image identifier. Check API '/dna/intent/api/v1/images' for 'id' from response. +- `id` (String) id path parameter. Software image identifier. Check API */dna/intent/api/v1/images* for *id* from response. diff --git a/docs/resources/images_site_wise_product_names.md b/docs/resources/images_site_wise_product_names.md index 12b467a..7ad06f8 100644 --- a/docs/resources/images_site_wise_product_names.md +++ b/docs/resources/images_site_wise_product_names.md @@ -4,28 +4,28 @@ page_title: "catalystcenter_images_site_wise_product_names Resource - terraform- subcategory: "" description: |- It manages create, read, update and delete operations on Software Image Management (SWIM). - Assign network device product name and sites for the given image identifier. Refer '/dna/intent/api/v1/images' API for + Assign network device product name and sites for the given image identifier. Refer /dna/intent/api/v1/images API for obtaining imageIdThis resource unassigns the network device product name from all the sites for the given software image. - Refer to '/dna/intent/api/v1/images' and '/dna/intent/api/v1/images/{imageId}/siteWiseProductNames' GET APIs for - obtaining 'imageId' and 'productNameOrdinal' respectively.Update the list of sites for the network device product name assigned to the software image. Refer to - '/dna/intent/api/v1/images' and '/dna/intent/api/v1/images/{imageId}/siteWiseProductNames' GET APIs for obtaining - 'imageId' and 'productNameOrdinal' respectively. + Refer to /dna/intent/api/v1/images and /dna/intent/api/v1/images/{imageId}/siteWiseProductNames GET APIs for + obtaining imageId and productNameOrdinal respectively.Update the list of sites for the network device product name assigned to the software image. Refer to + /dna/intent/api/v1/images and /dna/intent/api/v1/images/{imageId}/siteWiseProductNames GET APIs for obtaining + imageId and productNameOrdinal respectively. --- # catalystcenter_images_site_wise_product_names (Resource) It manages create, read, update and delete operations on Software Image Management (SWIM). -- Assign network device product name and sites for the given image identifier. Refer '/dna/intent/api/v1/images' API for +- Assign network device product name and sites for the given image identifier. Refer */dna/intent/api/v1/images* API for obtaining imageId - This resource unassigns the network device product name from all the sites for the given software image. - Refer to '/dna/intent/api/v1/images' and '/dna/intent/api/v1/images/{imageId}/siteWiseProductNames' GET APIs for -obtaining 'imageId' and 'productNameOrdinal' respectively. + Refer to */dna/intent/api/v1/images* and */dna/intent/api/v1/images/{imageId}/siteWiseProductNames* GET APIs for +obtaining *imageId* and *productNameOrdinal* respectively. - Update the list of sites for the network device product name assigned to the software image. Refer to -'/dna/intent/api/v1/images' and '/dna/intent/api/v1/images/{imageId}/siteWiseProductNames' GET APIs for obtaining -'imageId' and 'productNameOrdinal' respectively. +*/dna/intent/api/v1/images* and */dna/intent/api/v1/images/{imageId}/siteWiseProductNames* GET APIs for obtaining +*imageId* and *productNameOrdinal* respectively. ## Example Usage @@ -64,7 +64,7 @@ output "catalystcenter_images_site_wise_product_names_example" { Required: -- `image_id` (String) imageId path parameter. Software image identifier. Refer '/dna/intent/api/v1/images' API for obtaining 'imageId' +- `image_id` (String) imageId path parameter. Software image identifier. Refer */dna/intent/api/v1/images* API for obtaining *imageId* Optional: diff --git a/docs/resources/integrate_ise.md b/docs/resources/integrate_ise.md index 769ceab..89e985b 100644 --- a/docs/resources/integrate_ise.md +++ b/docs/resources/integrate_ise.md @@ -14,9 +14,6 @@ It performs update operation on System Settings. - API to accept Cisco ISE server certificate for Cisco ISE server integration. Use ‘Cisco ISE Server Integration Status’ Intent API to check the integration status. This data source action can be used to retry the failed integration. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_integrate_ise" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/docs/resources/interface_operation_create.md b/docs/resources/interface_operation_create.md index 2d8f1b2..72b3ab5 100644 --- a/docs/resources/interface_operation_create.md +++ b/docs/resources/interface_operation_create.md @@ -14,9 +14,6 @@ It performs create operation on Devices. - Clear mac-address on an individual port. In request body, operation needs to be specified as 'ClearMacAddress'. In the future more possible operations will be added to this API - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,13 +22,13 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_interface_operation_create" "example" { - provider = catalystcenter + provider = meraki deployment_mode = "string" interface_uuid = "string" parameters { operation = "string" - payload = "string" + payload = "------" } } diff --git a/docs/resources/interface_update.md b/docs/resources/interface_update.md index 5ccac7a..209a3c1 100644 --- a/docs/resources/interface_update.md +++ b/docs/resources/interface_update.md @@ -14,9 +14,6 @@ It performs update operation on Devices. - Add/Update Interface description, VLAN membership, Voice VLAN and change Interface admin status ('UP'/'DOWN') from Request body. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_interface_update" "example" { - provider = catalystcenter + provider = meraki deployment_mode = "string" interface_uuid = "string" parameters { diff --git a/docs/resources/interfaces_members_associations_query.md b/docs/resources/interfaces_members_associations_query.md index f65b12c..7be91d0 100644 --- a/docs/resources/interfaces_members_associations_query.md +++ b/docs/resources/interfaces_members_associations_query.md @@ -19,26 +19,6 @@ tagged, it is called a member of the tag. 'ids' can be fetched via '/dna/intent/ -~>**Warning:** -This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. -Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. - -## Example Usage - -```terraform -resource "catalystcenter_interfaces_members_associations_query" "example" { - provider = catalystcenter - parameters { - - ids = ["string"] - } -} - -output "catalystcenter_interfaces_members_associations_query_example" { - value = catalystcenter_interfaces_members_associations_query.example -} -``` - ## Schema diff --git a/docs/resources/interfaces_query.md b/docs/resources/interfaces_query.md index 7dcffc0..8511ca4 100644 --- a/docs/resources/interfaces_query.md +++ b/docs/resources/interfaces_query.md @@ -26,9 +26,6 @@ interfaceIfIndex,interfaceType, macAddress,mediaType, operStatus, portChannelId, detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- interfaces-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -37,7 +34,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_interfaces_query" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { @@ -55,12 +52,12 @@ resource "catalystcenter_interfaces_query" "example" { key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } page { diff --git a/docs/resources/interfaces_query_count.md b/docs/resources/interfaces_query_count.md index fe28352..844240e 100644 --- a/docs/resources/interfaces_query_count.md +++ b/docs/resources/interfaces_query_count.md @@ -18,9 +18,6 @@ It performs create operation on Devices. functions. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- interfaces-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_interfaces_query_count" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { @@ -45,7 +42,7 @@ resource "catalystcenter_interfaces_query_count" "example" { key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } page { diff --git a/docs/resources/ipam_server_setting.md b/docs/resources/ipam_server_setting.md index 6276f39..6761ba1 100644 --- a/docs/resources/ipam_server_setting.md +++ b/docs/resources/ipam_server_setting.md @@ -19,28 +19,7 @@ existing external server before creating a new one. - Updates configuration details of the external IPAM server. -## Example Usage -```terraform -resource "catalystcenter_ipam_server_setting" "example" { - provider = catalystcenter - - parameters { - - password = "******" - provider = "string" - server_name = "string" - server_url = "string" - sync_view = "false" - user_name = "string" - view = "string" - } -} - -output "catalystcenter_ipam_server_setting_example" { - value = catalystcenter_ipam_server_setting.example -} -``` ## Schema @@ -80,11 +59,3 @@ Read-Only: - `state` (String) - `user_name` (String) - `view` (String) - -## Import - -Import is supported using the following syntax: - -```shell -terraform import catalystcenter_ipam_server_setting.example "id:=string" -``` diff --git a/docs/resources/itsm_integration_events_retry.md b/docs/resources/itsm_integration_events_retry.md index 059d1cb..30c6c4f 100644 --- a/docs/resources/itsm_integration_events_retry.md +++ b/docs/resources/itsm_integration_events_retry.md @@ -16,9 +16,6 @@ It performs create operation on ITSM. - Allows retry of multiple failed ITSM event instances. The retry request payload can be given as a list of strings: ["instance1","instance2","instance3",..] A minimum of one instance Id is mandatory. The list of failed event instance Ids can be retrieved using the 'Get Failed ITSM Events' API in the 'instanceId' attribute. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,10 +24,8 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_itsm_integration_events_retry" "example" { - provider = catalystcenter - parameters { - payload = ["string] - } + provider = meraki + parameters = ["string"] } output "catalystcenter_itsm_integration_events_retry_example" { @@ -56,7 +51,7 @@ output "catalystcenter_itsm_integration_events_retry_example" { Optional: -- `payload` (List of String) Array of RequestItsmRetryIntegrationEvents +- `payload` (List of String) Array of RequestItsmRetryIntegrationEventsV1 diff --git a/docs/resources/lan_automation_create.md b/docs/resources/lan_automation_create.md index 88be257..c15b7e5 100644 --- a/docs/resources/lan_automation_create.md +++ b/docs/resources/lan_automation_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on LAN Automation. - Invoke this API to start LAN Automation for the given site. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,24 +20,23 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_lan_automation_create" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - discovered_device_site_name_hierarchy = "string" - host_name_file_id = "string" - host_name_prefix = "string" - ip_pools { - - ip_pool_name = "string" - ip_pool_role = "string" - } - isis_domain_pwd = "string" - mulitcast_enabled = "false" - peer_device_managment_ipaddress = "string" - primary_device_interface_names = ["string"] - primary_device_managment_ipaddress = "string" - redistribute_isis_to_bgp = "false" + + discovered_device_site_name_hierarchy = "string" + host_name_file_id = "string" + host_name_prefix = "string" + ip_pools { + + ip_pool_name = "string" + ip_pool_role = "string" } + isis_domain_pwd = "string" + mulitcast_enabled = "false" + peer_device_managment_ipaddress = "string" + primary_device_interface_names = ["string"] + primary_device_managment_ipaddress = "string" + redistribute_isis_to_bgp = "false" } } @@ -67,7 +63,7 @@ output "catalystcenter_lan_automation_create_example" { Optional: -- `payload` (Block List) Array of RequestLanAutomationLANAutomationStart (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestLanAutomationLANAutomationStartV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/lan_automation_delete.md b/docs/resources/lan_automation_delete.md index 05b6a34..f082553 100644 --- a/docs/resources/lan_automation_delete.md +++ b/docs/resources/lan_automation_delete.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on LAN Automation. - Invoke this API to stop LAN Automation for the given site. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_lan_automation_delete" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/docs/resources/lan_automation_update_device.md b/docs/resources/lan_automation_update_device.md index 39f0f9c..072e739 100644 --- a/docs/resources/lan_automation_update_device.md +++ b/docs/resources/lan_automation_update_device.md @@ -14,9 +14,6 @@ It performs update operation on LAN Automation. - Invoke this API to perform a DAY-N update on LAN Automation-related devices. Supported features include Loopback0 IP update, hostname update, link addition, and link deletion. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_lan_automation_update_device" "example" { - provider = catalystcenter + provider = meraki feature = "string" parameters { @@ -73,7 +70,7 @@ output "catalystcenter_lan_automation_update_device_example" { Required: -- `feature` (String) feature query parameter. Feature ID for the update. Supported feature IDs include: LOOPBACK0_IPADDRESS_UPDATE, HOSTNAME_UPDATE, LINK_Add and LINK_DELETE. +- `feature` (String) feature query parameter. Feature ID for the update. Supported feature IDs include: LOOPBACK0_IPADDRESS_UPDATE, HOSTNAME_UPDATE, LINK_ADD, and LINK_DELETE. Optional: diff --git a/docs/resources/lan_automation_update_v2.md b/docs/resources/lan_automation_update_v2.md index c8b3e86..575249c 100644 --- a/docs/resources/lan_automation_update_v2.md +++ b/docs/resources/lan_automation_update_v2.md @@ -14,9 +14,6 @@ It performs update operation on LAN Automation. - Invoke this API to stop LAN Automation and update device parameters such as Loopback0 IP address and/or hostname discovered in the current session. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,14 +22,13 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_lan_automation_update_v2" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { - payload { - device_management_ipaddress = "string" - new_host_name = "string" - new_loopback0_ipaddress = "string" - } + + device_management_ipaddress = "string" + new_host_name = "string" + new_loopback0_ipaddress = "string" } } diff --git a/docs/resources/lan_automation_v2.md b/docs/resources/lan_automation_v2.md index d87c09e..56cae1a 100644 --- a/docs/resources/lan_automation_v2.md +++ b/docs/resources/lan_automation_v2.md @@ -20,9 +20,6 @@ or a specific device list, or both. The stop processing will be executed automat satisfied, without specifically calling the stop API. The V2 API behaves similarly to V1 if no timeout or device list is provided, and the user needs to call the stop API for LAN Automation stop processing. With the V2 API, the user can also specify the level up to which the devices can be LAN automated. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -31,33 +28,32 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_lan_automation_v2" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - discovered_device_site_name_hierarchy = "string" - discovery_devices { - - device_host_name = "string" - device_management_ipaddress = "string" - device_serial_number = "string" - device_site_name_hierarchy = "string" - } - discovery_level = 1 - discovery_timeout = 1 - host_name_file_id = "string" - host_name_prefix = "string" - ip_pools { - - ip_pool_name = "string" - ip_pool_role = "string" - } - isis_domain_pwd = "string" - multicast_enabled = "false" - peer_device_managment_ipaddress = "string" - primary_device_interface_names = ["string"] - primary_device_managment_ipaddress = "string" - redistribute_isis_to_bgp = "false" + + discovered_device_site_name_hierarchy = "string" + discovery_devices { + + device_host_name = "string" + device_management_ipaddress = "string" + device_serial_number = "string" + device_site_name_hierarchy = "string" + } + discovery_level = 1 + discovery_timeout = 1 + host_name_file_id = "string" + host_name_prefix = "string" + ip_pools { + + ip_pool_name = "string" + ip_pool_role = "string" } + isis_domain_pwd = "string" + multicast_enabled = "false" + peer_device_managment_ipaddress = "string" + primary_device_interface_names = ["string"] + primary_device_managment_ipaddress = "string" + redistribute_isis_to_bgp = "false" } } diff --git a/docs/resources/maps_export.md b/docs/resources/maps_export.md index 55acef7..2e7c8f6 100644 --- a/docs/resources/maps_export.md +++ b/docs/resources/maps_export.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Sites. - Allows exporting a Map archive in an XML interchange format along with the associated images. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_maps_export" "example" { - provider = catalystcenter + provider = meraki site_hierarchy_uuid = "string" parameters { diff --git a/docs/resources/maps_import.md b/docs/resources/maps_import.md index 1d0f6ed..bf70c3c 100644 --- a/docs/resources/maps_import.md +++ b/docs/resources/maps_import.md @@ -14,9 +14,6 @@ It performs delete operation on Sites. - Cancels a previously initatied import, allowing the system to cleanup cached resources about that import data, and ensures the import cannot accidentally be performed / approved at a later time. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_maps_import" "example" { - provider = catalystcenter + provider = meraki import_context_uuid = "string" parameters { @@ -47,7 +44,7 @@ output "catalystcenter_maps_import_example" { ### Read-Only - `id` (String) The ID of this resource. -- `item` (String) +- `item` (List of String) - `last_updated` (String) diff --git a/docs/resources/maps_import_perform.md b/docs/resources/maps_import_perform.md index 7bdeff5..9aa2a78 100644 --- a/docs/resources/maps_import_perform.md +++ b/docs/resources/maps_import_perform.md @@ -18,9 +18,6 @@ It performs create operation on Sites. import will fully replace existing Maps data for the site(s) defined in the archive. The Map Archive Import Status API /maps/import/${contextUuid}/status should always be checked to validate the pre-import validation output prior to performing the import. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_maps_import_perform" "example" { - provider = catalystcenter + provider = meraki import_context_uuid = "string" parameters { @@ -51,7 +48,7 @@ output "catalystcenter_maps_import_perform_example" { ### Read-Only - `id` (String) The ID of this resource. -- `item` (String) +- `item` (List of String) - `last_updated` (String) diff --git a/docs/resources/maps_import_start.md b/docs/resources/maps_import_start.md index 19b845b..f2a1299 100644 --- a/docs/resources/maps_import_start.md +++ b/docs/resources/maps_import_start.md @@ -14,9 +14,6 @@ It performs create operation on Sites. - Initiates a map archive import of a tar.gz file. The archive must consist of one xmlDir/MapsImportExport.xml map descriptor file, and 1 or more images for the map areas nested under /images folder. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_maps_import_start" "example" { - provider = catalystcenter + provider = meraki } output "catalystcenter_maps_import_start_example" { diff --git a/docs/resources/network_create.md b/docs/resources/network_create.md index 0a911d4..17751d5 100644 --- a/docs/resources/network_create.md +++ b/docs/resources/network_create.md @@ -14,9 +14,6 @@ It performs create operation on Network Settings. - API to create a network for DHCP, Syslog, SNMP, NTP, Network AAA, Client and EndPoint AAA, and/or DNS center server settings. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_create" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/docs/resources/network_device_config_write_memory.md b/docs/resources/network_device_config_write_memory.md index 5cf669c..e6a354b 100644 --- a/docs/resources/network_device_config_write_memory.md +++ b/docs/resources/network_device_config_write_memory.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Configuration Archive. - This operation would commit device running configuration to startup by issuing "write memory" to device - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_device_config_write_memory" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = ["string"] diff --git a/docs/resources/network_device_custom_prompt.md b/docs/resources/network_device_custom_prompt.md index 650cddc..ecf9448 100644 --- a/docs/resources/network_device_custom_prompt.md +++ b/docs/resources/network_device_custom_prompt.md @@ -51,7 +51,7 @@ output "catalystcenter_network_device_custom_prompt_example" { Optional: -- `password_prompt` (String, Sensitive) Password Prompt +- `password_prompt` (String, Sensitive) Password for Custom Prompt - `username_prompt` (String) Username for Custom Prompt diff --git a/docs/resources/network_device_export.md b/docs/resources/network_device_export.md index 5d910ee..7b8cc29 100644 --- a/docs/resources/network_device_export.md +++ b/docs/resources/network_device_export.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Devices. - Exports the selected network device to a file - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_device_export" "example" { - provider = catalystcenter + provider = meraki parameters { device_uuids = ["string"] diff --git a/docs/resources/network_device_management_address_update.md b/docs/resources/network_device_management_address_update.md index b0c640f..ba5cae5 100644 --- a/docs/resources/network_device_management_address_update.md +++ b/docs/resources/network_device_management_address_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Devices. - This is a simple PUT API to edit the management IP Address of the device. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_device_management_address_update" "example" { - provider = catalystcenter + provider = meraki deviceid = "string" parameters { diff --git a/docs/resources/network_device_sync.md b/docs/resources/network_device_sync.md index 4c1fa43..964a201 100644 --- a/docs/resources/network_device_sync.md +++ b/docs/resources/network_device_sync.md @@ -16,9 +16,6 @@ It performs update operation on Devices. - Synchronizes the devices. If forceSync param is false (default) then the sync would run in normal priority thread. If forceSync param is true then the sync would run in high priority thread if available, else the sync will fail. Result can be seen in the child task of each device - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,11 +24,9 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_device_sync" "example" { - provider = catalystcenter + provider = meraki force_sync = "false" - parameters { - payload = ["string"] - } + parameters = ["string"] } output "catalystcenter_network_device_sync_example" { @@ -58,7 +53,7 @@ output "catalystcenter_network_device_sync_example" { Optional: - `force_sync` (Boolean) forceSync query parameter. -- `payload` (List of String) Array of RequestDevicesSyncDevices +- `payload` (List of String) Array of RequestDevicesSyncDevicesV1 diff --git a/docs/resources/network_device_update_role.md b/docs/resources/network_device_update_role.md index c49b27a..07725e5 100644 --- a/docs/resources/network_device_update_role.md +++ b/docs/resources/network_device_update_role.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Devices. - Updates the role of the device as access, core, distribution, border router - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_device_update_role" "example" { - provider = catalystcenter + provider = meraki parameters { id = "string" diff --git a/docs/resources/network_device_user_defined_field.md b/docs/resources/network_device_user_defined_field.md deleted file mode 100644 index c05129a..0000000 --- a/docs/resources/network_device_user_defined_field.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_network_device_user_defined_field Resource - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It manages create, read, update and delete operations on Devices. - Creates a new global User Defined Field, which can be assigned to devicesUpdates an existing global User Defined Field, using it's id.Deletes an existing Global User-Defined-Field using it's id. ---- - -# catalystcenter_network_device_user_defined_field (Resource) - -It manages create, read, update and delete operations on Devices. - -- Creates a new global User Defined Field, which can be assigned to devices - -- Updates an existing global User Defined Field, using it's id. - -- Deletes an existing Global User-Defined-Field using it's id. - -## Example Usage - -```terraform -resource "catalystcenter_network_device_user_defined_field" "example" { - provider = catalystcenter - - parameters { - - description = "string" - id = "string" - name = "string" - } -} - -output "catalystcenter_network_device_user_defined_field_example" { - value = catalystcenter_network_device_user_defined_field.example -} -``` - - -## Schema - -### Optional - -- `parameters` (Block List) (see [below for nested schema](#nestedblock--parameters)) - -### Read-Only - -- `id` (String) The ID of this resource. -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) -- `last_updated` (String) - - -### Nested Schema for `parameters` - -Optional: - -- `description` (String) Description of UDF -- `id` (String) id path parameter. UDF id -- `name` (String) Name of UDF - - - -### Nested Schema for `item` - -Read-Only: - -- `description` (String) -- `id` (String) -- `name` (String) - -## Import - -Import is supported using the following syntax: - -```shell -terraform import catalystcenter_network_device_user_defined_field.example "id:=string" -``` diff --git a/docs/resources/network_device_user_defined_field_delete.md b/docs/resources/network_device_user_defined_field_delete.md new file mode 100644 index 0000000..465d1f6 --- /dev/null +++ b/docs/resources/network_device_user_defined_field_delete.md @@ -0,0 +1,66 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_network_device_user_defined_field_delete Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs delete operation on Devices. + Remove a User-Defined-Field from device. Name of UDF has to be passed as the query parameter. Please note that Global + UDF will not be deleted by this operation. +--- + +# catalystcenter_network_device_user_defined_field_delete (Resource) + +It performs delete operation on Devices. + +- Remove a User-Defined-Field from device. Name of UDF has to be passed as the query parameter. Please note that Global +UDF will not be deleted by this operation. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_network_device_user_defined_field_delete" "example" { + provider = meraki + device_id = "string" + name = "string" + parameters { + + } +} + +output "catalystcenter_network_device_user_defined_field_delete_example" { + value = catalystcenter_network_device_user_defined_field_delete.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Required: + +- `device_id` (String) deviceId path parameter. UUID of device from which UDF has to be removed +- `name` (String) name query parameter. Name of UDF to be removed + + + +### Nested Schema for `item` + +Read-Only: + +- `task_id` (String) +- `url` (String) diff --git a/docs/resources/network_device_user_defined_field_update.md b/docs/resources/network_device_user_defined_field_update.md new file mode 100644 index 0000000..ad81e41 --- /dev/null +++ b/docs/resources/network_device_user_defined_field_update.md @@ -0,0 +1,81 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_network_device_user_defined_field_update Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs update operation on Devices. + Assigns an existing Global User-Defined-Field to a device. If the UDF is already assigned to the specific device, then + it updates the device UDF value accordingly. Please note that the assigning UDF 'name' must be an existing global UDF. + Otherwise error shall be shown. +--- + +# catalystcenter_network_device_user_defined_field_update (Resource) + +It performs update operation on Devices. + +- Assigns an existing Global User-Defined-Field to a device. If the UDF is already assigned to the specific device, then +it updates the device UDF value accordingly. Please note that the assigning UDF 'name' must be an existing global UDF. +Otherwise error shall be shown. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_network_device_user_defined_field_update" "example" { + provider = meraki + device_id = "string" + parameters { + + name = "string" + value = "string" + } +} + +output "catalystcenter_network_device_user_defined_field_update_example" { + value = catalystcenter_network_device_user_defined_field_update.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Required: + +- `device_id` (String) deviceId path parameter. UUID of device to which UDF has to be added + +Optional: + +- `payload` (Block List) Array of RequestDevicesAddUserDefinedFieldToDeviceV1 (see [below for nested schema](#nestedblock--parameters--payload)) + + +### Nested Schema for `parameters.payload` + +Optional: + +- `name` (String) Name of the User Defined Field +- `value` (String) Value of the User Defined Field that will be assigned to the device + + + + +### Nested Schema for `item` + +Read-Only: + +- `task_id` (String) +- `url` (String) diff --git a/docs/resources/network_devices_interfaces_query.md b/docs/resources/network_devices_interfaces_query_v2.md similarity index 91% rename from docs/resources/network_devices_interfaces_query.md rename to docs/resources/network_devices_interfaces_query_v2.md index df38e41..012a699 100644 --- a/docs/resources/network_devices_interfaces_query.md +++ b/docs/resources/network_devices_interfaces_query_v2.md @@ -1,6 +1,6 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_network_devices_interfaces_query Resource - terraform-provider-catalystcenter" +page_title: "catalystcenter_network_devices_interfaces_query_v2 Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It performs create operation on Devices. @@ -8,15 +8,12 @@ description: |- Request Body usage and the API filtering support. --- -# catalystcenter_network_devices_interfaces_query (Resource) +# catalystcenter_network_devices_interfaces_query_v2 (Resource) It performs create operation on Devices. - This data source action returns the Interface Stats for the given Device Id. Please refer to the Feature tab for the Request Body usage and the API filtering support. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -24,8 +21,8 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ## Example Usage ```terraform -resource "catalystcenter_network_devices_interfaces_query" "example" { - provider = catalystcenter +resource "catalystcenter_network_devices_interfaces_query_v2" "example" { + provider = meraki device_id = "string" parameters { @@ -54,8 +51,8 @@ resource "catalystcenter_network_devices_interfaces_query" "example" { } } -output "catalystcenter_network_devices_interfaces_query_example" { - value = catalystcenter_network_devices_interfaces_query.example +output "catalystcenter_network_devices_interfaces_query_v2_example" { + value = catalystcenter_network_devices_interfaces_query_v2.example } ``` diff --git a/docs/resources/network_devices_issues_remediation_provision.md b/docs/resources/network_devices_issues_remediation_provision.md index 7268984..50d924c 100644 --- a/docs/resources/network_devices_issues_remediation_provision.md +++ b/docs/resources/network_devices_issues_remediation_provision.md @@ -18,9 +18,6 @@ It performs create operation on Compliance. Image', 'Securities Advisories', 'SD-Access Unsupported Configuration', 'Workflow', etc. will not be addressed by this API. Warning: Fixing compliance mismatches could result in a possible network flap. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_issues_remediation_provision" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/docs/resources/network_devices_members_associations_query.md b/docs/resources/network_devices_members_associations_query.md index d67447e..e89cbc0 100644 --- a/docs/resources/network_devices_members_associations_query.md +++ b/docs/resources/network_devices_members_associations_query.md @@ -19,26 +19,6 @@ tagged, it is called a member of the tag. 'ids' can be fetched via '/dna/intent/ -~>**Warning:** -This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. -Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. - -## Example Usage - -```terraform -resource "catalystcenter_network_devices_members_associations_query" "example" { - provider = catalystcenter - parameters { - - ids = ["string"] - } -} - -output "catalystcenter_network_devices_members_associations_query_example" { - value = catalystcenter_network_devices_members_associations_query.example -} -``` - ## Schema diff --git a/docs/resources/network_devices_network_profiles_for_sites.md b/docs/resources/network_devices_network_profiles_for_sites.md index c900325..492153c 100644 --- a/docs/resources/network_devices_network_profiles_for_sites.md +++ b/docs/resources/network_devices_network_profiles_for_sites.md @@ -48,7 +48,7 @@ output "catalystcenter_network_devices_network_profiles_for_sites_example" { Required: -- `id` (String) id path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' +- `id` (String) id path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* diff --git a/docs/resources/network_devices_query.md b/docs/resources/network_devices_query.md index d037732..7e23b5b 100644 --- a/docs/resources/network_devices_query.md +++ b/docs/resources/network_devices_query.md @@ -18,9 +18,6 @@ It performs create operation on Devices. information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- AssuranceNetworkDevices-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_query" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { diff --git a/docs/resources/network_devices_query_count.md b/docs/resources/network_devices_query_count.md index 334374f..43c9ab4 100644 --- a/docs/resources/network_devices_query_count.md +++ b/docs/resources/network_devices_query_count.md @@ -18,9 +18,6 @@ It performs create operation on Devices. information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- AssuranceNetworkDevices-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_query_count" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { diff --git a/docs/resources/network_devices_resync_interval_settings.md b/docs/resources/network_devices_resync_interval_settings.md index 26a56d7..c7d107d 100644 --- a/docs/resources/network_devices_resync_interval_settings.md +++ b/docs/resources/network_devices_resync_interval_settings.md @@ -14,9 +14,6 @@ It performs update operation on Devices. - Updates the resync interval (in minutes) globally for devices which do not have custom resync interval. To override this setting for all network devices refer to [/networkDevices/resyncIntervalSettings/override] - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_resync_interval_settings" "example" { - provider = catalystcenter + provider = meraki parameters { interval = 1 diff --git a/docs/resources/network_devices_resync_interval_settings_id.md b/docs/resources/network_devices_resync_interval_settings_id.md index 6acdfd1..e4d0d2c 100644 --- a/docs/resources/network_devices_resync_interval_settings_id.md +++ b/docs/resources/network_devices_resync_interval_settings_id.md @@ -5,8 +5,8 @@ subcategory: "" description: |- It manages read and update operations on Devices. Update the resync interval (in minutes) for the given network device id. - To disable periodic resync, set interval as '0'. - To use global settings, set interval as 'null'. + To disable periodic resync, set interval as 0. + To use global settings, set interval as null. --- # catalystcenter_network_devices_resync_interval_settings_id (Resource) @@ -14,8 +14,8 @@ description: |- It manages read and update operations on Devices. - Update the resync interval (in minutes) for the given network device id. -To disable periodic resync, set interval as '0'. -To use global settings, set interval as 'null'. +To disable periodic resync, set interval as *0*. +To use global settings, set interval as *null*. ## Example Usage @@ -57,7 +57,7 @@ Required: Optional: -- `interval` (Number) Resync interval in minutes. To disable periodic resync, set interval as '0'. To use global settings, set interval as 'null'. +- `interval` (Number) Resync interval in minutes. To disable periodic resync, set interval as *0*. To use global settings, set interval as *null*. diff --git a/docs/resources/network_devices_resync_interval_settings_override.md b/docs/resources/network_devices_resync_interval_settings_override.md index 1180689..511507c 100644 --- a/docs/resources/network_devices_resync_interval_settings_override.md +++ b/docs/resources/network_devices_resync_interval_settings_override.md @@ -14,9 +14,6 @@ It performs create operation on Devices. - Overrides the global resync interval on all network devices. This essentially removes device specific intervals if set. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_resync_interval_settings_override" "example" { - provider = catalystcenter + provider = meraki } output "catalystcenter_network_devices_resync_interval_settings_override_example" { diff --git a/docs/resources/network_devices_summary_analytics.md b/docs/resources/network_devices_summary_analytics.md index 95c470a..21b60cf 100644 --- a/docs/resources/network_devices_summary_analytics.md +++ b/docs/resources/network_devices_summary_analytics.md @@ -20,9 +20,6 @@ obtain the consolidated insights into the performance and status of the monitore information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en- programmability/catalyst-center-api-specs/blob/main/Assurance/CE_Cat_Center_Org- AssuranceNetworkDevices-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -31,7 +28,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_summary_analytics" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { diff --git a/docs/resources/network_devices_trend_analytics.md b/docs/resources/network_devices_trend_analytics.md index ed65358..614414b 100644 --- a/docs/resources/network_devices_trend_analytics.md +++ b/docs/resources/network_devices_trend_analytics.md @@ -5,7 +5,7 @@ subcategory: "" description: |- It performs create operation on Devices. Gets the Trend analytics Network device data for the given time range. The data will be grouped based on the given - trend time Interval. The required property for this API is 'trendInterval'. For detailed information about the usage of + trend time Interval. The required property for this API is trendInterval. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst- center-api-specs/blob/main/Assurance/CECatCenter_Org-AssuranceNetworkDevices-1.0.2-resolved.yaml --- @@ -15,12 +15,9 @@ description: |- It performs create operation on Devices. - Gets the Trend analytics Network device data for the given time range. The data will be grouped based on the given -trend time Interval. The required property for this API is 'trendInterval'. For detailed information about the usage of +trend time Interval. The required property for this API is *trendInterval*. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst- center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceNetworkDevices-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_trend_analytics" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes = ["string"] diff --git a/docs/resources/network_devices_trend_analytics_id.md b/docs/resources/network_devices_trend_analytics_id.md index 4f37e5f..9d53293 100644 --- a/docs/resources/network_devices_trend_analytics_id.md +++ b/docs/resources/network_devices_trend_analytics_id.md @@ -18,9 +18,6 @@ It performs create operation on Devices. time Interval, other input parameters like attribute and aggregate attributes. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst- center-api-specs/blob/main/Assurance/CE_Cat_Center_Org-AssuranceNetworkDevices-1.0.2-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_trend_analytics_id" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { @@ -46,7 +43,7 @@ resource "catalystcenter_network_devices_trend_analytics_id" "example" { key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } group_by = ["string"] page { diff --git a/docs/resources/network_devices_unassign_from_site_apply.md b/docs/resources/network_devices_unassign_from_site_apply.md index a023f6a..129ef03 100644 --- a/docs/resources/network_devices_unassign_from_site_apply.md +++ b/docs/resources/network_devices_unassign_from_site_apply.md @@ -6,7 +6,7 @@ description: |- It performs create operation on Site Design. Unassign unprovisioned network devices from their site. If device controllability is enabled, it will be triggered once device unassigned from site successfully. Device Controllability can be enabled/disabled using - '/dna/intent/api/v1/networkDevices/deviceControllability/settings'. + /dna/intent/api/v1/networkDevices/deviceControllability/settings. --- # catalystcenter_network_devices_unassign_from_site_apply (Resource) @@ -15,10 +15,7 @@ It performs create operation on Site Design. - Unassign unprovisioned network devices from their site. If device controllability is enabled, it will be triggered once device unassigned from site successfully. Device Controllability can be enabled/disabled using -'/dna/intent/api/v1/networkDevices/deviceControllability/settings'. - - - +*/dna/intent/api/v1/networkDevices/deviceControllability/settings*. ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_devices_unassign_from_site_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_ids = ["string"] diff --git a/docs/resources/network_profiles_for_sites_site_assignments.md b/docs/resources/network_profiles_for_sites_site_assignments.md index ff87868..0aaa713 100644 --- a/docs/resources/network_profiles_for_sites_site_assignments.md +++ b/docs/resources/network_profiles_for_sites_site_assignments.md @@ -53,7 +53,7 @@ output "catalystcenter_network_profiles_for_sites_site_assignments_example" { Required: -- `profile_id` (String) profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' +- `profile_id` (String) profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* Optional: diff --git a/docs/resources/network_profiles_for_sites_site_assignments_bulk_create.md b/docs/resources/network_profiles_for_sites_site_assignments_bulk_create.md index 0888a72..5f7cb47 100644 --- a/docs/resources/network_profiles_for_sites_site_assignments_bulk_create.md +++ b/docs/resources/network_profiles_for_sites_site_assignments_bulk_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Site Design. - Assign a network profile for sites to a list of sites. Also assigns the profile to child sites. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,11 +20,11 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_profiles_for_sites_site_assignments_bulk_create" "example" { - provider = catalystcenter + provider = meraki profile_id = "string" parameters { - items = [] + type = "------" } } @@ -54,11 +51,11 @@ output "catalystcenter_network_profiles_for_sites_site_assignments_bulk_create_e Required: -- `profile_id` (String) profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' +- `profile_id` (String) profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* Optional: -- `items` (List of String) Items +- `type` (String) diff --git a/docs/resources/network_profiles_for_sites_site_assignments_bulk_delete.md b/docs/resources/network_profiles_for_sites_site_assignments_bulk_delete.md index 5144b19..4fb156d 100644 --- a/docs/resources/network_profiles_for_sites_site_assignments_bulk_delete.md +++ b/docs/resources/network_profiles_for_sites_site_assignments_bulk_delete.md @@ -14,9 +14,6 @@ It performs delete operation on Site Design. - Unassigns a given network profile for sites from multiple sites. The profile must be removed from the containing building first if this site is a floor. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete" "example" { - provider = catalystcenter + provider = meraki profile_id = "string" site_id = "string" parameters { @@ -56,8 +53,8 @@ output "catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete_e Required: -- `profile_id` (String) profileId path parameter. The 'id' of the network profile, retrievable from 'GET /intent/api/v1/networkProfilesForSites' -- `site_id` (String) siteId query parameter. The 'id' of the site, retrievable from 'GET /intent/api/v1/sites' +- `profile_id` (String) profileId path parameter. The *id* of the network profile, retrievable from *GET /intent/api/v1/networkProfilesForSites* +- `site_id` (String) siteId query parameter. The *id* of the site, retrievable from *GET /intent/api/v1/sites* diff --git a/docs/resources/network_update.md b/docs/resources/network_update.md index bf8b453..d930e27 100644 --- a/docs/resources/network_update.md +++ b/docs/resources/network_update.md @@ -14,9 +14,6 @@ It performs update operation on Network Settings. - API to update network settings for DHCP, Syslog, SNMP, NTP, Network AAA, Client and EndPoint AAA, and/or DNS server settings. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_network_update" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/docs/resources/path_trace.md b/docs/resources/path_trace.md index f6a5209..79bba99 100644 --- a/docs/resources/path_trace.md +++ b/docs/resources/path_trace.md @@ -22,7 +22,855 @@ get results and follow progress. ```terraform resource "catalystcenter_path_trace" "example" { provider = catalystcenter + item { + detailed_status { + + + + } + + network_elements { + + accuracy_list { + + + + } + detailed_status { + + + + } + device_statistics { + + cpu_statistics { + + + + + + } + memory_statistics { + + + + + } + } + + + egress_physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + egress_virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + flex_connect { + + + + egress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + ingress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + + } + + ingress_physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + ingress_virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + + + + + + perf_mon_statistics { + + + + + + + + + + + + + + + + + + + + } + + + + + + } + network_elements_info { + + accuracy_list { + + + + } + detailed_status { + + + + } + device_statistics { + + cpu_statistics { + + + + + + } + memory_statistics { + + + + + } + } + + + egress_interface { + + physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + } + flex_connect { + + + + egress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + ingress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + + } + + ingress_interface { + + physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + } + + + + + + perf_monitor_statistics { + + + + + + + + + + + + + + + + + + + + } + + + + + + } + + request { + + + + + + + + + + + + + + + + } + } parameters { control_path = "false" diff --git a/docs/resources/pnp_device.md b/docs/resources/pnp_device.md index 231b800..fb3599a 100644 --- a/docs/resources/pnp_device.md +++ b/docs/resources/pnp_device.md @@ -22,8 +22,325 @@ It manages create, read, update and delete operations on Device Onboarding (PnP) ```terraform resource "catalystcenter_pnp_device" "example" { provider = catalystcenter + item { + day_zero_config { + + + } + + device_info { + + aaa_credentials { + + + + } + + + + + + + + + + + + + file_system_list { + + + + + + + + } + + + http_headers { + + + + } + + + ip_interfaces { + + + + + + + } + + + + location { + + + + + + + } + + + + neighbor_links { + + + + + + + + + + + } + + + pnp_profile_list { + + + + primary_endpoint { + + + + + + + + } + + secondary_endpoint { + + + + + + + + } + } + + pre_workflow_cli_ouputs { + + + + } + + + + + + + + + + stack_info { + + + stack_member_list { + + + + + + + + + + + + + + } + + + + + } + + + + + + + + + } + run_summary_list { + + + + history_task_info { + + addn_details { + + + + } + + + + work_item_list { + + + + + + + + } + } + + } + system_reset_workflow { + + + + + + + + + + + + + + + + tasks { + + + + + + + + + + work_item_list { + + + + + + + + } + } + + + + + } + system_workflow { + + + + + + + + + + + + + + + + tasks { + + + + + + + + + + work_item_list { + + + + + + + + } + } + + + + + } + + + workflow { + + + + + + + + + + + + + + + + tasks { + + + + + + + + + + work_item_list { + + + + + + + + } + } + + + + + } + workflow_parameters { + + config_list { + + + config_parameters { + + + + } + } + + + + } + } parameters { device_info { diff --git a/docs/resources/pnp_device_authorize.md b/docs/resources/pnp_device_authorize.md index deaa676..a2d5dcd 100644 --- a/docs/resources/pnp_device_authorize.md +++ b/docs/resources/pnp_device_authorize.md @@ -3,18 +3,15 @@ page_title: "catalystcenter_pnp_device_authorize Resource - terraform-provider-catalystcenter" subcategory: "" description: |- - It performs create operation on Cisco Catalyst Center System. + It performs create operation on Cisco DNA Center System. Authorizes one of more devices. A device can only be authorized if Authorization is set in Device Settings. --- # catalystcenter_pnp_device_authorize (Resource) -It performs create operation on Cisco Catalyst Center System. +It performs create operation on Cisco DNA Center System. - Authorizes one of more devices. A device can only be authorized if Authorization is set in Device Settings. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_authorize" "example" { - provider = catalystcenter + provider = meraki parameters { device_id_list = ["string"] diff --git a/docs/resources/pnp_device_claim.md b/docs/resources/pnp_device_claim.md index d4eebb3..e633f66 100644 --- a/docs/resources/pnp_device_claim.md +++ b/docs/resources/pnp_device_claim.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Device Onboarding (PnP). - Claims one of more devices with specified workflow - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_claim" "example" { - provider = catalystcenter + provider = meraki parameters { authorization_needed = "false" diff --git a/docs/resources/pnp_device_config_preview.md b/docs/resources/pnp_device_config_preview.md index 977880e..fffa094 100644 --- a/docs/resources/pnp_device_config_preview.md +++ b/docs/resources/pnp_device_config_preview.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Device Onboarding (PnP). - Triggers a preview for site-based Day 0 Configuration - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_config_preview" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = "string" diff --git a/docs/resources/pnp_device_import.md b/docs/resources/pnp_device_import.md index c743efd..6a51626 100644 --- a/docs/resources/pnp_device_import.md +++ b/docs/resources/pnp_device_import.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Device Onboarding (PnP). - Add devices to PnP in bulk - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,49 +20,48 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_import" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - id = "string" - device_info { - - description = "string" - device_sudi_serial_nos = ["string"] - hostname = "string" - mac_address = "string" - pid = "string" - serial_number = "string" - site_id = "string" - stack = "false" - stack_info { - - is_full_ring = "false" - stack_member_list { - - hardware_version = "string" - license_level = "string" - license_type = "string" - mac_address = "string" - pid = "string" - priority = 1.0 - role = "string" - serial_number = "string" - software_version = "string" - stack_number = 1.0 - state = "string" - sudi_serial_number = "string" - } - stack_ring_protocol = "string" - supports_stack_workflows = "false" - total_member_count = 1.0 - valid_license_levels = ["string"] + + id = "string" + device_info { + + description = "string" + device_sudi_serial_nos = ["string"] + hostname = "string" + mac_address = "string" + pid = "string" + serial_number = "string" + site_id = "string" + stack = "false" + stack_info { + + is_full_ring = "false" + stack_member_list { + + hardware_version = "string" + license_level = "string" + license_type = "string" + mac_address = "string" + pid = "string" + priority = 1.0 + role = "string" + serial_number = "string" + software_version = "string" + stack_number = 1.0 + state = "string" + sudi_serial_number = "string" } - sudi_required = "false" - user_mic_numbers = ["string"] - user_sudi_serial_nos = ["string"] - workflow_id = "string" - workflow_name = "string" + stack_ring_protocol = "string" + supports_stack_workflows = "false" + total_member_count = 1.0 + valid_license_levels = ["string"] } + sudi_required = "false" + user_mic_numbers = ["string"] + user_sudi_serial_nos = ["string"] + workflow_id = "string" + workflow_name = "string" } } } @@ -93,7 +89,7 @@ output "catalystcenter_pnp_device_import_example" { Optional: -- `payload` (Block List) Array of RequestDeviceOnboardingPnpImportDevicesInBulk (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestDeviceOnboardingPnpImportDevicesInBulkV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/pnp_device_reset.md b/docs/resources/pnp_device_reset.md index 3bc5bf4..7eda059 100644 --- a/docs/resources/pnp_device_reset.md +++ b/docs/resources/pnp_device_reset.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Device Onboarding (PnP). - Recovers a device from a Workflow Execution Error state - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_reset" "example" { - provider = catalystcenter + provider = meraki parameters { device_reset_list { diff --git a/docs/resources/pnp_device_site_claim.md b/docs/resources/pnp_device_site_claim.md index d02bf03..d0ed9b3 100644 --- a/docs/resources/pnp_device_site_claim.md +++ b/docs/resources/pnp_device_site_claim.md @@ -24,9 +24,6 @@ AccessPoints: rfProfile. Sensors: sensorProfile. CatalystWLC/MobilityExpress/EWC: staticIP, subnetMask, gateway. vlanId and ipInterfaceName are also allowed for Catalyst 9800 WLCs. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -35,7 +32,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_site_claim" "example" { - provider = catalystcenter + provider = meraki parameters { config_info { diff --git a/docs/resources/pnp_device_unclaim.md b/docs/resources/pnp_device_unclaim.md index 3ef08f7..39504b8 100644 --- a/docs/resources/pnp_device_unclaim.md +++ b/docs/resources/pnp_device_unclaim.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Device Onboarding (PnP). - Un-Claims one of more devices with specified workflow (Deprecated). - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_device_unclaim" "example" { - provider = catalystcenter + provider = meraki parameters { device_id_list = ["string"] diff --git a/docs/resources/pnp_server_profile_update.md b/docs/resources/pnp_server_profile_update.md index e6d952c..fc1b66e 100644 --- a/docs/resources/pnp_server_profile_update.md +++ b/docs/resources/pnp_server_profile_update.md @@ -14,9 +14,6 @@ It performs update operation on Device Onboarding (PnP). - Updates the PnP Server profile in a registered Virtual Account in the PnP database. The response payload returns the updated smart & virtual account info - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_server_profile_update" "example" { - provider = catalystcenter + provider = meraki parameters { cco_user = "string" diff --git a/docs/resources/pnp_virtual_account_add.md b/docs/resources/pnp_virtual_account_add.md index 22be871..8f11313 100644 --- a/docs/resources/pnp_virtual_account_add.md +++ b/docs/resources/pnp_virtual_account_add.md @@ -16,9 +16,6 @@ It performs create operation on Device Onboarding (PnP). - Registers a Smart Account, Virtual Account and the relevant server profile info with the PnP System & database. The devices present in the registered virtual account are synced with the PnP database as well. The response payload returns the new profile - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_virtual_account_add" "example" { - provider = catalystcenter + provider = meraki parameters { auto_sync_period = 1 diff --git a/docs/resources/pnp_virtual_account_deregister.md b/docs/resources/pnp_virtual_account_deregister.md index 8226f80..e97b218 100644 --- a/docs/resources/pnp_virtual_account_deregister.md +++ b/docs/resources/pnp_virtual_account_deregister.md @@ -16,9 +16,6 @@ It performs delete operation on Device Onboarding (PnP). - Deregisters the specified smart account & virtual account info and the associated device information from the PnP System & database. The devices associated with the deregistered virtual account are removed from the PnP database as well. The response payload contains the deregistered smart & virtual account information - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_virtual_account_deregister" "example" { - provider = catalystcenter + provider = meraki domain = "string" name = "string" } diff --git a/docs/resources/pnp_virtual_account_devices_sync.md b/docs/resources/pnp_virtual_account_devices_sync.md index 1bd8ecf..1c69df1 100644 --- a/docs/resources/pnp_virtual_account_devices_sync.md +++ b/docs/resources/pnp_virtual_account_devices_sync.md @@ -14,9 +14,6 @@ It performs create operation on Device Onboarding (PnP). - Synchronizes the device info from the given smart account & virtual account with the PnP database. The response payload returns a list of synced devices (Deprecated). - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_pnp_virtual_account_devices_sync" "example" { - provider = catalystcenter + provider = meraki parameters { auto_sync_period = 1 diff --git a/docs/resources/profiling_rules_in_bulk_create.md b/docs/resources/profiling_rules_in_bulk_create.md new file mode 100644 index 0000000..e098349 --- /dev/null +++ b/docs/resources/profiling_rules_in_bulk_create.md @@ -0,0 +1,151 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_profiling_rules_in_bulk_create Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on AIEndpointAnalytics. + This data source action imports the given list of profiling rules. For each record, 1) If 'ruleType' for a record is + not 'Custom Rule', then it is rejected. 2) If 'ruleId' is provided in the input record, + 2a) Record with same 'ruleId' exists in the system, then it is replaced with new data. + 2b) Record with same 'ruleId' does not exist, then it is inserted in the database. + 3) If 'ruleId' is not provided in the input record, then new 'ruleId' is generated by the system, and record is + inserted. +--- + +# catalystcenter_profiling_rules_in_bulk_create (Resource) + +It performs create operation on AIEndpointAnalytics. + +- This data source action imports the given list of profiling rules. For each record, 1) If 'ruleType' for a record is +not 'Custom Rule', then it is rejected. 2) If 'ruleId' is provided in the input record, + 2a) Record with same 'ruleId' exists in the system, then it is replaced with new data. + 2b) Record with same 'ruleId' does not exist, then it is inserted in the database. +3) If 'ruleId' is not provided in the input record, then new 'ruleId' is generated by the system, and record is +inserted. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_profiling_rules_in_bulk_create" "example" { + provider = meraki + parameters { + + profiling_rules { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } + } +} + +output "catalystcenter_profiling_rules_in_bulk_create_example" { + value = catalystcenter_profiling_rules_in_bulk_create.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (String) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `profiling_rules` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules)) + + +### Nested Schema for `parameters.profiling_rules` + +Optional: + +- `cluster_id` (String) Unique identifier for ML cluster. Only applicable for 'ML Rule'. +- `condition_groups` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules--condition_groups)) +- `is_deleted` (String) Flag to indicate whether the rule was deleted. +- `last_modified_by` (String) User that last modified the rule. It is read-only, and is ignored if provided as part of input request. +- `last_modified_on` (Number) Timestamp (in epoch milliseconds) of last modification. It is read-only, and is ignored if provided as part of input request. +- `plugin_id` (String) Plugin for the rule. Only applicable for 'Cisco Default' rules. +- `rejected` (String) Flag to indicate whether rule has been rejected by user or not. Only applicable for 'ML Rule'. +- `result` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules--result)) +- `rule_id` (String) Unique identifier for the rule. This is normally generated by the system, and client does not need to provide it for rules that need to be newly created. +- `rule_name` (String) Human readable name for the rule. +- `rule_priority` (Number) Priority for the rule. +- `rule_type` (String) Type of the rule. +- `rule_version` (Number) Version of the rule. +- `source_priority` (Number) Source priority for the rule. +- `used_attributes` (List of String) List of attributes used in the rule. Only applicable for 'Cisco Default' rules. + + +### Nested Schema for `parameters.profiling_rules.condition_groups` + +Optional: + +- `condition` (Block List) (see [below for nested schema](#nestedblock--parameters--profiling_rules--condition_groups--condition)) +- `condition_group` (List of String) +- `operator` (String) +- `type` (String) + + +### Nested Schema for `parameters.profiling_rules.condition_groups.condition` + +Optional: + +- `attribute` (String) +- `attribute_dictionary` (String) +- `operator` (String) +- `value` (String) + + + + +### Nested Schema for `parameters.profiling_rules.result` + +Optional: + +- `device_type` (List of String) List of device types determined by the current rule. +- `hardware_manufacturer` (List of String) List of hardware manufacturers determined by the current rule. +- `hardware_model` (List of String) List of hardware models determined by the current rule. +- `operating_system` (List of String) List of operating systems determined by the current rule. diff --git a/docs/resources/qos_device_interface.md b/docs/resources/qos_device_interface.md index fefe438..d3d0551 100644 --- a/docs/resources/qos_device_interface.md +++ b/docs/resources/qos_device_interface.md @@ -26,21 +26,20 @@ resource "catalystcenter_qos_device_interface" "example" { provider = catalystcenter parameters { - payload { - excluded_interfaces = ["string"] - id = "string" - name = "string" - network_device_id = "string" - qos_device_interface_info { - - dmvpn_remote_sites_bw = [1] - instance_id = 1 - interface_id = "string" - interface_name = "string" - label = "string" - role = "string" - upload_bw = 1 - } + + excluded_interfaces = ["string"] + id = "string" + name = "string" + network_device_id = "string" + qos_device_interface_info { + + dmvpn_remote_sites_bw = [1] + instance_id = 1 + interface_id = "string" + interface_name = "string" + label = "string" + role = "string" + upload_bw = 1 } } } diff --git a/docs/resources/reports.md b/docs/resources/reports.md index a4d8332..aa9f9cc 100644 --- a/docs/resources/reports.md +++ b/docs/resources/reports.md @@ -22,14 +22,66 @@ required to configure a report. ```terraform resource "catalystcenter_reports" "example" { provider = catalystcenter + item { + + + + executions { + + + + + + + + + } + + + + + + view { + + + field_groups { + + + + fields { + + + + } + } + filters { + + + + + + } + format { + + + + + } + + + + } + + + } parameters { data_category = "string" deliveries = ["string"] name = "string" report_id = "string" - schedule = "string" + schedule = "------" tags = ["string"] view { @@ -48,7 +100,7 @@ resource "catalystcenter_reports" "example" { display_name = "string" name = "string" type = "string" - value = "string" + value = "------" } format { diff --git a/docs/resources/reserve_ip_subpool.md b/docs/resources/reserve_ip_subpool.md index 43b59c0..1081721 100644 --- a/docs/resources/reserve_ip_subpool.md +++ b/docs/resources/reserve_ip_subpool.md @@ -23,31 +23,6 @@ It manages create, read, update and delete operations on Network Settings. resource "catalystcenter_reserve_ip_subpool" "example" { provider = catalystcenter - parameters { - - id = "string" - ipv4_dhcp_servers = ["string"] - ipv4_dns_servers = ["string"] - ipv4_gate_way = "string" - ipv4_global_pool = "string" - ipv4_prefix = "false" - ipv4_prefix_length = 1 - ipv4_subnet = "string" - ipv4_total_host = 1 - ipv6_address_space = "false" - ipv6_dhcp_servers = ["string"] - ipv6_dns_servers = ["string"] - ipv6_gate_way = "string" - ipv6_global_pool = "string" - ipv6_prefix = "false" - ipv6_prefix_length = 1 - ipv6_subnet = "string" - ipv6_total_host = 1 - name = "string" - site_id = "string" - slaac_support = "false" - type = "string" - } } output "catalystcenter_reserve_ip_subpool_example" { diff --git a/docs/resources/sda_anycast_gateways_create.md b/docs/resources/sda_anycast_gateways_create.md index 3908518..edecc9c 100644 --- a/docs/resources/sda_anycast_gateways_create.md +++ b/docs/resources/sda_anycast_gateways_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on SDA. - Adds anycast gateways based on user input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,28 +20,27 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_anycast_gateways_create" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - auto_generate_vlan_name = "false" - fabric_id = "string" - ip_pool_name = "string" - is_critical_pool = "false" - is_group_based_policy_enforcement_enabled = "false" - is_intra_subnet_routing_enabled = "false" - is_ip_directed_broadcast = "false" - is_layer2_flooding_enabled = "false" - is_multiple_ip_to_mac_addresses = "false" - is_supplicant_based_extended_node_onboarding = "false" - is_wireless_pool = "false" - pool_type = "string" - security_group_name = "string" - tcp_mss_adjustment = 1 - traffic_type = "string" - virtual_network_name = "string" - vlan_id = 1 - vlan_name = "string" - } + + auto_generate_vlan_name = "false" + fabric_id = "string" + ip_pool_name = "string" + is_critical_pool = "false" + is_group_based_policy_enforcement_enabled = "false" + is_intra_subnet_routing_enabled = "false" + is_ip_directed_broadcast = "false" + is_layer2_flooding_enabled = "false" + is_multiple_ip_to_mac_addresses = "false" + is_supplicant_based_extended_node_onboarding = "false" + is_wireless_pool = "false" + pool_type = "string" + security_group_name = "string" + tcp_mss_adjustment = 1 + traffic_type = "string" + virtual_network_name = "string" + vlan_id = 1 + vlan_name = "string" } } @@ -71,7 +67,7 @@ output "catalystcenter_sda_anycast_gateways_create_example" { Optional: -- `payload` (Block List) Array of RequestSdaAddAnycastGateways (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSdaAddAnycastGatewaysV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/sda_anycast_gateways_delete.md b/docs/resources/sda_anycast_gateways_delete.md index faa0522..b1243e1 100644 --- a/docs/resources/sda_anycast_gateways_delete.md +++ b/docs/resources/sda_anycast_gateways_delete.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on SDA. - Deletes an anycast gateway based on id. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_anycast_gateways_delete" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/docs/resources/sda_anycast_gateways_update.md b/docs/resources/sda_anycast_gateways_update.md index 62686d2..6f6b69a 100644 --- a/docs/resources/sda_anycast_gateways_update.md +++ b/docs/resources/sda_anycast_gateways_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on SDA. - Updates anycast gateways based on user input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,28 +20,27 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_anycast_gateways_update" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - fabric_id = "string" - id = "string" - ip_pool_name = "string" - is_critical_pool = "false" - is_group_based_policy_enforcement_enabled = "false" - is_intra_subnet_routing_enabled = "false" - is_ip_directed_broadcast = "false" - is_layer2_flooding_enabled = "false" - is_multiple_ip_to_mac_addresses = "false" - is_supplicant_based_extended_node_onboarding = "false" - is_wireless_pool = "false" - pool_type = "string" - security_group_name = "string" - tcp_mss_adjustment = 1 - traffic_type = "string" - virtual_network_name = "string" - vlan_id = 1 - vlan_name = "string" - } + + fabric_id = "string" + id = "string" + ip_pool_name = "string" + is_critical_pool = "false" + is_group_based_policy_enforcement_enabled = "false" + is_intra_subnet_routing_enabled = "false" + is_ip_directed_broadcast = "false" + is_layer2_flooding_enabled = "false" + is_multiple_ip_to_mac_addresses = "false" + is_supplicant_based_extended_node_onboarding = "false" + is_wireless_pool = "false" + pool_type = "string" + security_group_name = "string" + tcp_mss_adjustment = 1 + traffic_type = "string" + virtual_network_name = "string" + vlan_id = 1 + vlan_name = "string" } } @@ -71,7 +67,7 @@ output "catalystcenter_sda_anycast_gateways_update_example" { Optional: -- `payload` (Block List) Array of RequestSdaUpdateAnycastGateways (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSdaUpdateAnycastGatewaysV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/sda_authentication_profiles.md b/docs/resources/sda_authentication_profiles.md index 1e3e3c2..959c802 100644 --- a/docs/resources/sda_authentication_profiles.md +++ b/docs/resources/sda_authentication_profiles.md @@ -20,16 +20,15 @@ resource "catalystcenter_sda_authentication_profiles" "example" { provider = catalystcenter parameters { - payload { - authentication_order = "string" - authentication_profile_name = "string" - dot1x_to_mab_fallback_timeout = 1 - fabric_id = "string" - id = "string" - is_bpdu_guard_enabled = "false" - number_of_hosts = "string" - wake_on_lan = "false" - } + + authentication_order = "string" + authentication_profile_name = "string" + dot1x_to_mab_fallback_timeout = 1 + fabric_id = "string" + id = "string" + is_bpdu_guard_enabled = "false" + number_of_hosts = "string" + wake_on_lan = "false" } } diff --git a/docs/resources/sda_extranet_policies.md b/docs/resources/sda_extranet_policies.md index 72738b3..d1828ea 100644 --- a/docs/resources/sda_extranet_policies.md +++ b/docs/resources/sda_extranet_policies.md @@ -26,13 +26,12 @@ resource "catalystcenter_sda_extranet_policies" "example" { provider = catalystcenter parameters { - payload { - extranet_policy_name = "string" - fabric_ids = ["string"] - id = "string" - provider_virtual_network_name = "string" - subscriber_virtual_network_names = ["string"] - } + + extranet_policy_name = "string" + fabric_ids = ["string"] + id = "string" + provider_virtual_network_name = "string" + subscriber_virtual_network_names = ["string"] } } diff --git a/docs/resources/sda_fabric_authentication_profile.md b/docs/resources/sda_fabric_authentication_profile.md index c0214cf..e580425 100644 --- a/docs/resources/sda_fabric_authentication_profile.md +++ b/docs/resources/sda_fabric_authentication_profile.md @@ -24,14 +24,13 @@ resource "catalystcenter_sda_fabric_authentication_profile" "example" { provider = catalystcenter parameters { - payload { - authenticate_template_name = "string" - authentication_order = "string" - dot1x_to_mab_fallback_timeout = "string" - number_of_hosts = "string" - site_name_hierarchy = "string" - wake_on_lan = "false" - } + + authenticate_template_name = "string" + authentication_order = "string" + dot1x_to_mab_fallback_timeout = "string" + number_of_hosts = "string" + site_name_hierarchy = "string" + wake_on_lan = "false" } } @@ -45,7 +44,7 @@ output "catalystcenter_sda_fabric_authentication_profile_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddDefaultAuthenticationTemplateInSDAFabric (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddDefaultAuthenticationTemplateInSDAFabricV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only @@ -58,13 +57,6 @@ output "catalystcenter_sda_fabric_authentication_profile_example" { Optional: -- `payload` (Block List) Array of RequestApplicationPolicyCreateApplication (see [below for nested schema](#nestedblock--parameters--payload)) - - -### Nested Schema for `parameters.payload` - -Optional: - - `authenticate_template_name` (String) Authenticate Template Name - `authentication_order` (String) Authentication Order - `dot1x_to_mab_fallback_timeout` (String) Dot1x To MabFallback Timeout( Allowed range is [3-120]) @@ -73,7 +65,6 @@ Optional: - `wake_on_lan` (String) Wake On Lan - ### Nested Schema for `item` diff --git a/docs/resources/sda_fabric_border_device.md b/docs/resources/sda_fabric_border_device.md index 286bded..68a7bd8 100644 --- a/docs/resources/sda_fabric_border_device.md +++ b/docs/resources/sda_fabric_border_device.md @@ -20,41 +20,171 @@ It manages create, read and delete operations on SDA. ```terraform resource "catalystcenter_sda_fabric_border_device" "example" { provider = catalystcenter + item { + - parameters { payload { - border_priority = "string" - border_session_type = "string" - border_with_external_connectivity = "false" - connected_to_internet = "false" - device_management_ip_address = "string" - device_role = ["string"] - external_connectivity_ip_pool_name = "string" - external_connectivity_settings { - - external_autonomou_system_number = "string" - interface_description = "string" - interface_name = "string" - l2_handoff { - virtual_network_name = "string" - vlan_name = "string" + + + + + + + + + + + device_settings { + + + + + + + ext_connectivity_settings { + + + + + + + + + + + l3_handoff { + + + + + + + + + + virtual_network { + + + } + + } + + + } + + + + + + + + + + + } + + + + + + + + + + + + + network_widesettings { + + + + + dhcp { + + + ip_address { + + + + + + } } - l3_handoff { - virtual_network { + dns { + + + + ip { + + + + - virtual_network_name = "string" - vlan_id = "string" } } + + + + + + + + + + + } + + + + + + + + transit_networks { + + } - external_domain_routing_protocol_name = "string" - internal_autonomou_system_number = "string" - route_distribution_protocol = "string" - sda_transit_network_name = "string" - site_name_hierarchy = "string" + + + } + + } + parameters { + + border_priority = "string" + border_session_type = "string" + border_with_external_connectivity = "false" + connected_to_internet = "false" + device_management_ip_address = "string" + device_role = ["string"] + external_connectivity_ip_pool_name = "string" + external_connectivity_settings { + + external_autonomou_system_number = "string" + interface_description = "string" + interface_name = "string" + l2_handoff { + + virtual_network_name = "string" + vlan_name = "string" + } + l3_handoff { + + virtual_network { + + virtual_network_name = "string" + vlan_id = "string" + } + } + } + external_domain_routing_protocol_name = "string" + internal_autonomou_system_number = "string" + route_distribution_protocol = "string" + sda_transit_network_name = "string" + site_name_hierarchy = "string" } } @@ -68,7 +198,7 @@ output "catalystcenter_sda_fabric_border_device_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddBorderDeviceInSDAFabric (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddBorderDeviceInSDAFabricV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only @@ -81,13 +211,6 @@ output "catalystcenter_sda_fabric_border_device_example" { Optional: -- `payload` (Block List) Array of RequestApplicationPolicyCreateApplication (see [below for nested schema](#nestedblock--parameters--payload)) - - -### Nested Schema for `parameters.payload` - -Optional: - - `border_priority` (String) Border priority associated with a given device. Allowed range for Border Priority is [1-9]. A lower value indicates higher priority. E.g., a priority of 1 takes precedence over 5. Default priority would be set to 10. - `border_session_type` (String) Border Session Type - `border_with_external_connectivity` (String) Border With External Connectivity (Note: True for transit and False for non-transit border) @@ -95,26 +218,26 @@ Optional: - `device_management_ip_address` (String) Management Ip Address of the provisioned Device - `device_role` (List of String) Supported Device Roles in SD-Access fabric. Allowed roles are "Border_Node","Control_Plane_Node","Edge_Node". E.g. ["Border_Node"] or ["Border_Node", "Control_Plane_Node"] or ["Border_Node", "Control_Plane_Node","Edge_Node"] - `external_connectivity_ip_pool_name` (String) External Connectivity IpPool Name -- `external_connectivity_settings` (Block List) (see [below for nested schema](#nestedblock--parameters--payload--external_connectivity_settings)) +- `external_connectivity_settings` (Block List) (see [below for nested schema](#nestedblock--parameters--external_connectivity_settings)) - `external_domain_routing_protocol_name` (String) External Domain Routing Protocol Name - `internal_autonomou_system_number` (String) Internal Autonomous System Number - `route_distribution_protocol` (String) Route Distribution Protocol for Control Plane Device. Allowed values are "LISP_BGP" or "LISP_PUB_SUB". Default value is "LISP_BGP" - `sda_transit_network_name` (String) SD-Access Transit Network Name - `site_name_hierarchy` (String) Site Name Hierarchy of provisioned Device(site should be part of Fabric Site) - -### Nested Schema for `parameters.payload.external_connectivity_settings` + +### Nested Schema for `parameters.external_connectivity_settings` Optional: - `external_autonomou_system_number` (String) External Autonomous System Number peer (e.g.,1-65535) - `interface_description` (String) Interface Description - `interface_name` (String) Interface Name -- `l2_handoff` (Block List) (see [below for nested schema](#nestedblock--parameters--payload--external_connectivity_settings--l2_handoff)) -- `l3_handoff` (Block List) (see [below for nested schema](#nestedblock--parameters--payload--external_connectivity_settings--l3_handoff)) +- `l2_handoff` (Block List) (see [below for nested schema](#nestedblock--parameters--external_connectivity_settings--l2_handoff)) +- `l3_handoff` (Block List) (see [below for nested schema](#nestedblock--parameters--external_connectivity_settings--l3_handoff)) - -### Nested Schema for `parameters.payload.external_connectivity_settings.l2_handoff` + +### Nested Schema for `parameters.external_connectivity_settings.l2_handoff` Optional: @@ -122,15 +245,15 @@ Optional: - `vlan_name` (String) Vlan Name of L2 Handoff - -### Nested Schema for `parameters.payload.external_connectivity_settings.l3_handoff` + +### Nested Schema for `parameters.external_connectivity_settings.l3_handoff` Optional: -- `virtual_network` (Block List) (see [below for nested schema](#nestedblock--parameters--payload--external_connectivity_settings--l3_handoff--virtual_network)) +- `virtual_network` (Block List) (see [below for nested schema](#nestedblock--parameters--external_connectivity_settings--l3_handoff--virtual_network)) - -### Nested Schema for `parameters.payload.external_connectivity_settings.l3_handoff.virtual_network` + +### Nested Schema for `parameters.external_connectivity_settings.l3_handoff.virtual_network` Optional: @@ -141,7 +264,6 @@ Optional: - ### Nested Schema for `item` diff --git a/docs/resources/sda_fabric_devices.md b/docs/resources/sda_fabric_devices.md index 00a0e0c..170bae4 100644 --- a/docs/resources/sda_fabric_devices.md +++ b/docs/resources/sda_fabric_devices.md @@ -26,24 +26,23 @@ resource "catalystcenter_sda_fabric_devices" "example" { provider = catalystcenter parameters { - payload { - border_device_settings { - - border_types = ["string"] - layer3_settings { - - border_priority = 1 - import_external_routes = "false" - is_default_exit = "false" - local_autonomous_system_number = "string" - prepend_autonomous_system_count = 1 - } + + border_device_settings { + + border_types = ["string"] + layer3_settings { + + border_priority = 1 + import_external_routes = "false" + is_default_exit = "false" + local_autonomous_system_number = "string" + prepend_autonomous_system_count = 1 } - device_roles = ["string"] - fabric_id = "string" - id = "string" - network_device_id = "string" } + device_roles = ["string"] + fabric_id = "string" + id = "string" + network_device_id = "string" } } diff --git a/docs/resources/sda_fabric_devices_layer2_handoffs.md b/docs/resources/sda_fabric_devices_layer2_handoffs.md index cc08393..24d97f8 100644 --- a/docs/resources/sda_fabric_devices_layer2_handoffs.md +++ b/docs/resources/sda_fabric_devices_layer2_handoffs.md @@ -24,14 +24,13 @@ resource "catalystcenter_sda_fabric_devices_layer2_handoffs" "example" { provider = catalystcenter parameters { - payload { - external_vlan_id = 1 - fabric_id = "string" - id = "string" - interface_name = "string" - internal_vlan_id = 1 - network_device_id = "string" - } + + external_vlan_id = 1 + fabric_id = "string" + id = "string" + interface_name = "string" + internal_vlan_id = 1 + network_device_id = "string" } } @@ -45,7 +44,7 @@ output "catalystcenter_sda_fabric_devices_layer2_handoffs_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddFabricDevicesLayer2Handoffs (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddFabricDevicesLayer2HandoffsV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/sda_fabric_devices_layer2_handoffs_ip_transits.md b/docs/resources/sda_fabric_devices_layer2_handoffs_ip_transits.md index 02efd97..0aa4bc1 100644 --- a/docs/resources/sda_fabric_devices_layer2_handoffs_ip_transits.md +++ b/docs/resources/sda_fabric_devices_layer2_handoffs_ip_transits.md @@ -26,21 +26,20 @@ resource "catalystcenter_sda_fabric_devices_layer2_handoffs_ip_transits" "exampl provider = catalystcenter parameters { - payload { - external_connectivity_ip_pool_name = "string" - fabric_id = "string" - id = "string" - interface_name = "string" - local_ip_address = "string" - local_ipv6_address = "string" - network_device_id = "string" - remote_ip_address = "string" - remote_ipv6_address = "string" - tcp_mss_adjustment = 1 - transit_network_id = "string" - virtual_network_name = "string" - vlan_id = 1 - } + + external_connectivity_ip_pool_name = "string" + fabric_id = "string" + id = "string" + interface_name = "string" + local_ip_address = "string" + local_ipv6_address = "string" + network_device_id = "string" + remote_ip_address = "string" + remote_ipv6_address = "string" + tcp_mss_adjustment = 1 + transit_network_id = "string" + virtual_network_name = "string" + vlan_id = 1 } } diff --git a/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_create.md b/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_create.md index e5bc8b7..77d7e26 100644 --- a/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_create.md +++ b/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on SDA. - Adds layer 3 handoffs with sda transit in fabric devices based on user input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,17 +20,16 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - affinity_id_decider = 1 - affinity_id_prime = 1 - connected_to_internet = "false" - fabric_id = "string" - is_multicast_over_transit_enabled = "false" - network_device_id = "string" - transit_network_id = "string" - } + + affinity_id_decider = 1 + affinity_id_prime = 1 + connected_to_internet = "false" + fabric_id = "string" + is_multicast_over_transit_enabled = "false" + network_device_id = "string" + transit_network_id = "string" } } @@ -60,7 +56,7 @@ output "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create_ex Optional: -- `payload` (Block List) Array of RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransit (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSdaAddFabricDevicesLayer3HandoffsWithSdaTransitV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_delete.md b/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_delete.md index 7d32df6..1962a38 100644 --- a/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_delete.md +++ b/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_delete.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on SDA. - Deletes layer 3 handoffs with sda transit of a fabric device based on user input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete" "example" { - provider = catalystcenter + provider = meraki fabric_id = "string" network_device_id = "string" } diff --git a/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_update.md b/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_update.md index 485e925..01dfeae 100644 --- a/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_update.md +++ b/docs/resources/sda_fabric_devices_layer2_handoffs_sda_transits_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on SDA. - Updates layer 3 handoffs with sda transit of fabric devices based on user input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,17 +20,16 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - affinity_id_decider = 1 - affinity_id_prime = 1 - connected_to_internet = "false" - fabric_id = "string" - is_multicast_over_transit_enabled = "false" - network_device_id = "string" - transit_network_id = "string" - } + + affinity_id_decider = 1 + affinity_id_prime = 1 + connected_to_internet = "false" + fabric_id = "string" + is_multicast_over_transit_enabled = "false" + network_device_id = "string" + transit_network_id = "string" } } @@ -60,7 +56,7 @@ output "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update_ex Optional: -- `payload` (Block List) Array of RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransit (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSdaUpdateFabricDevicesLayer3HandoffsWithSdaTransitV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/sda_fabric_site.md b/docs/resources/sda_fabric_site.md index 0108570..a3e8e90 100644 --- a/docs/resources/sda_fabric_site.md +++ b/docs/resources/sda_fabric_site.md @@ -52,7 +52,7 @@ output "catalystcenter_sda_fabric_site_example" { Optional: -- `fabric_name` (String) Warning - Starting Catalyst Center 2.2.3.5 release, this field has been deprecated. SD-Access Fabric does not need it anymore. It will be removed in future Catalyst Center releases. +- `fabric_name` (String) Warning - Starting DNA Center 2.2.3.5 release, this field has been deprecated. SD-Access Fabric does not need it anymore. It will be removed in future DNA Center releases. - `fabric_type` (String) Type of SD-Access Fabric. Allowed values are "FABRIC_SITE" or "FABRIC_ZONE". Default value is "FABRIC_SITE". - `site_name_hierarchy` (String) Existing site name hierarchy available at global level. For Example "Global/Chicago/Building21/Floor1" diff --git a/docs/resources/sda_fabric_sites.md b/docs/resources/sda_fabric_sites.md index 250e08a..947c97a 100644 --- a/docs/resources/sda_fabric_sites.md +++ b/docs/resources/sda_fabric_sites.md @@ -24,12 +24,11 @@ resource "catalystcenter_sda_fabric_sites" "example" { provider = catalystcenter parameters { - payload { - authentication_profile_name = "string" - id = "string" - is_pub_sub_enabled = "false" - site_id = "string" - } + + authentication_profile_name = "string" + id = "string" + is_pub_sub_enabled = "false" + site_id = "string" } } @@ -43,7 +42,7 @@ output "catalystcenter_sda_fabric_sites_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddFabricSite (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddFabricSiteV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/sda_fabric_zones.md b/docs/resources/sda_fabric_zones.md index 76114c1..1bc75e8 100644 --- a/docs/resources/sda_fabric_zones.md +++ b/docs/resources/sda_fabric_zones.md @@ -24,11 +24,10 @@ resource "catalystcenter_sda_fabric_zones" "example" { provider = catalystcenter parameters { - payload { - authentication_profile_name = "string" - id = "string" - site_id = "string" - } + + authentication_profile_name = "string" + id = "string" + site_id = "string" } } diff --git a/docs/resources/sda_fabrics_vlan_to_ssids_fabric_id.md b/docs/resources/sda_fabrics_vlan_to_ssids_fabric_id.md index 1d56ce4..90773d0 100644 --- a/docs/resources/sda_fabrics_vlan_to_ssids_fabric_id.md +++ b/docs/resources/sda_fabrics_vlan_to_ssids_fabric_id.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_sda_fabrics_vlan_to_ssids_fabric_id Resource - terra subcategory: "" description: |- It manages read and update operations on Fabric Wireless. - Add update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping + Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared. The request must include all SSIDs currently mapped to a VLAN, as determined by the response from the GET operation for the same fabricId used in the request. If an already-mapped SSID is not included in the payload, its mapping will be removed by this API. Conversely, if a new SSID @@ -17,7 +17,7 @@ description: |- It manages read and update operations on Fabric Wireless. -- Add update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping +- Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared. The request must include all SSIDs currently mapped to a VLAN, as determined by the response from the GET operation for the same fabricId used in the request. If an already-mapped SSID is not included in the payload, its mapping will be removed by this API. Conversely, if a new SSID diff --git a/docs/resources/sda_layer2_virtual_networks.md b/docs/resources/sda_layer2_virtual_networks.md index 1ce608d..aaea455 100644 --- a/docs/resources/sda_layer2_virtual_networks.md +++ b/docs/resources/sda_layer2_virtual_networks.md @@ -26,15 +26,14 @@ resource "catalystcenter_sda_layer2_virtual_networks" "example" { provider = catalystcenter parameters { - payload { - associated_layer3_virtual_network_name = "string" - fabric_id = "string" - id = "string" - is_fabric_enabled_wireless = "false" - traffic_type = "string" - vlan_id = 1 - vlan_name = "string" - } + + associated_layer3_virtual_network_name = "string" + fabric_id = "string" + id = "string" + is_fabric_enabled_wireless = "false" + traffic_type = "string" + vlan_id = 1 + vlan_name = "string" } } @@ -48,7 +47,7 @@ output "catalystcenter_sda_layer2_virtual_networks_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddLayer2VirtualNetworks (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddLayer2VirtualNetworksV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/sda_layer3_virtual_networks.md b/docs/resources/sda_layer3_virtual_networks.md index 43bae17..5004a03 100644 --- a/docs/resources/sda_layer3_virtual_networks.md +++ b/docs/resources/sda_layer3_virtual_networks.md @@ -24,12 +24,11 @@ resource "catalystcenter_sda_layer3_virtual_networks" "example" { provider = catalystcenter parameters { - payload { - anchored_site_id = "string" - fabric_ids = ["string"] - id = "string" - virtual_network_name = "string" - } + + anchored_site_id = "string" + fabric_ids = ["string"] + id = "string" + virtual_network_name = "string" } } @@ -43,7 +42,7 @@ output "catalystcenter_sda_layer3_virtual_networks_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddLayer3VirtualNetworks (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddLayer3VirtualNetworksV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/sda_multicast.md b/docs/resources/sda_multicast.md index 64a2147..15e9ab0 100644 --- a/docs/resources/sda_multicast.md +++ b/docs/resources/sda_multicast.md @@ -20,6 +20,7 @@ It manages create, read and delete operations on SDA. ```terraform resource "catalystcenter_sda_multicast" "example" { provider = catalystcenter + parameters { multicast_method = "string" diff --git a/docs/resources/sda_multicast_v1_update.md b/docs/resources/sda_multicast_v1_update.md index 9bc0f47..b53a69b 100644 --- a/docs/resources/sda_multicast_v1_update.md +++ b/docs/resources/sda_multicast_v1_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on SDA. - Updates a multicast configuration at a fabric level based on user input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,12 +20,11 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sda_multicast_v1_update" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - fabric_id = "string" - replication_mode = "string" - } + + fabric_id = "string" + replication_mode = "string" } } @@ -55,7 +51,7 @@ output "catalystcenter_sda_multicast_v1_update_example" { Optional: -- `payload` (Block List) Array of RequestSdaUpdateMulticast (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSdaUpdateMulticastV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/sda_multicast_virtual_networks.md b/docs/resources/sda_multicast_virtual_networks.md index 8c1f83f..511851d 100644 --- a/docs/resources/sda_multicast_virtual_networks.md +++ b/docs/resources/sda_multicast_virtual_networks.md @@ -24,24 +24,23 @@ resource "catalystcenter_sda_multicast_virtual_networks" "example" { provider = catalystcenter parameters { - payload { - fabric_id = "string" - id = "string" - ip_pool_name = "string" - ipv4_ssm_ranges = ["string"] - multicast_r_ps { - - ipv4_address = "string" - ipv4_asm_ranges = ["string"] - ipv6_address = "string" - ipv6_asm_ranges = ["string"] - is_default_v4_rp = "false" - is_default_v6_rp = "false" - network_device_ids = ["string"] - rp_device_location = "string" - } - virtual_network_name = "string" + + fabric_id = "string" + id = "string" + ip_pool_name = "string" + ipv4_ssm_ranges = ["string"] + multicast_r_ps { + + ipv4_address = "string" + ipv4_asm_ranges = ["string"] + ipv6_address = "string" + ipv6_asm_ranges = ["string"] + is_default_v4_rp = "false" + is_default_v6_rp = "false" + network_device_ids = ["string"] + rp_device_location = "string" } + virtual_network_name = "string" } } diff --git a/docs/resources/sda_port_assignments.md b/docs/resources/sda_port_assignments.md index 9fc6083..3005cee 100644 --- a/docs/resources/sda_port_assignments.md +++ b/docs/resources/sda_port_assignments.md @@ -26,19 +26,18 @@ resource "catalystcenter_sda_port_assignments" "example" { provider = catalystcenter parameters { - payload { - authenticate_template_name = "string" - connected_device_type = "string" - data_vlan_name = "string" - fabric_id = "string" - id = "string" - interface_description = "string" - interface_name = "string" - network_device_id = "string" - scalable_group_name = "string" - security_group_name = "string" - voice_vlan_name = "string" - } + + authenticate_template_name = "string" + connected_device_type = "string" + data_vlan_name = "string" + fabric_id = "string" + id = "string" + interface_description = "string" + interface_name = "string" + network_device_id = "string" + scalable_group_name = "string" + security_group_name = "string" + voice_vlan_name = "string" } } @@ -52,7 +51,7 @@ output "catalystcenter_sda_port_assignments_example" { ### Optional -- `parameters` (Block List) Array of RequestSdaAddPortAssignments (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestSdaAddPortAssignmentsV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/sda_port_channels.md b/docs/resources/sda_port_channels.md index 426c285..311952d 100644 --- a/docs/resources/sda_port_channels.md +++ b/docs/resources/sda_port_channels.md @@ -26,16 +26,15 @@ resource "catalystcenter_sda_port_channels" "example" { provider = catalystcenter parameters { - payload { - connected_device_type = "string" - description = "string" - fabric_id = "string" - id = "string" - interface_names = ["string"] - network_device_id = "string" - port_channel_name = "string" - protocol = "string" - } + + connected_device_type = "string" + description = "string" + fabric_id = "string" + id = "string" + interface_names = ["string"] + network_device_id = "string" + port_channel_name = "string" + protocol = "string" } } diff --git a/docs/resources/sda_provision_devices.md b/docs/resources/sda_provision_devices.md index 47aaf08..74679e9 100644 --- a/docs/resources/sda_provision_devices.md +++ b/docs/resources/sda_provision_devices.md @@ -26,11 +26,10 @@ resource "catalystcenter_sda_provision_devices" "example" { provider = catalystcenter parameters { - payload { - id = "string" - network_device_id = "string" - site_id = "string" - } + + id = "string" + network_device_id = "string" + site_id = "string" } } diff --git a/docs/resources/sda_transit_networks.md b/docs/resources/sda_transit_networks.md index 0ad153d..818a532 100644 --- a/docs/resources/sda_transit_networks.md +++ b/docs/resources/sda_transit_networks.md @@ -22,21 +22,20 @@ resource "catalystcenter_sda_transit_networks" "example" { provider = catalystcenter parameters { - payload { - id = "string" - ip_transit_settings { - - autonomous_system_number = "string" - routing_protocol_name = "string" - } - name = "string" - sda_transit_settings { - - control_plane_network_device_ids = ["string"] - is_multicast_over_transit_enabled = "false" - } - type = "string" + + id = "string" + ip_transit_settings { + + autonomous_system_number = "string" + routing_protocol_name = "string" + } + name = "string" + sda_transit_settings { + + control_plane_network_device_ids = ["string"] + is_multicast_over_transit_enabled = "false" } + type = "string" } } diff --git a/docs/resources/sda_virtual_network_v2.md b/docs/resources/sda_virtual_network_v2.md deleted file mode 100644 index 241b08a..0000000 --- a/docs/resources/sda_virtual_network_v2.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_sda_virtual_network_v2 Resource - terraform-provider-catalystcenter" -subcategory: "" -description: |- - It manages create, read, update and delete operations on SDA. - Add virtual network with scalable groups at global levelDelete virtual network with scalable groupsUpdate virtual network with scalable groups ---- - -# catalystcenter_sda_virtual_network_v2 (Resource) - -It manages create, read, update and delete operations on SDA. - -- Add virtual network with scalable groups at global level - -- Delete virtual network with scalable groups - -- Update virtual network with scalable groups - -## Example Usage - -```terraform -resource "catalystcenter_sda_virtual_network_v2" "example" { - provider = catalystcenter - - parameters { - - is_guest_virtual_network = "false" - scalable_group_names = ["string"] - v_manage_vpn_id = "string" - virtual_network_name = "string" - } -} - -output "catalystcenter_sda_virtual_network_v2_example" { - value = catalystcenter_sda_virtual_network_v2.example -} -``` - - -## Schema - -### Optional - -- `parameters` (Block List) (see [below for nested schema](#nestedblock--parameters)) - -### Read-Only - -- `id` (String) The ID of this resource. -- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) -- `last_updated` (String) - - -### Nested Schema for `parameters` - -Optional: - -- `is_guest_virtual_network` (String) Guest Virtual Network enablement flag, default value is False. -- `scalable_group_names` (List of String) Scalable Group to be associated to virtual network -- `v_manage_vpn_id` (String) vManage vpn id for SD-WAN -- `virtual_network_name` (String) Virtual Network Name to be assigned at global level - - - -### Nested Schema for `item` - -Read-Only: - -- `description` (String) -- `execution_id` (String) -- `is_guest_virtual_network` (String) -- `scalable_group_names` (List of String) -- `status` (String) -- `v_manage_vpn_id` (String) -- `virtual_network_context_id` (String) -- `virtual_network_name` (String) - -## Import - -Import is supported using the following syntax: - -```shell -terraform import catalystcenter_sda_virtual_network_v2.example "id:=string" -``` diff --git a/docs/resources/security_rogue_additional_details.md b/docs/resources/security_rogue_additional_details.md new file mode 100644 index 0000000..ee859b4 --- /dev/null +++ b/docs/resources/security_rogue_additional_details.md @@ -0,0 +1,97 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_rogue_additional_details Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + This data source action provides additional information of the rogue threats with details at BSSID level. The + additional information includes Switch Port details in case of Rogue on Wire, first time when the rogue is seen in the + network etc. +--- + +# catalystcenter_security_rogue_additional_details (Resource) + +It performs create operation on Devices. + +- This data source action provides additional information of the rogue threats with details at BSSID level. The +additional information includes Switch Port details in case of Rogue on Wire, first time when the rogue is seen in the +network etc. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_rogue_additional_details" "example" { + provider = meraki + parameters { + + end_time = 1609459200 + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1609459200 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_rogue_additional_details_example" { + value = catalystcenter_security_rogue_additional_details.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `end_time` (Number) This is the epoch end time in milliseconds upto which data need to be fetched. Default value is current time +- `limit` (Number) The maximum number of entries to return. Default value is 1000 +- `offset` (Number) The offset of the first item in the collection to return. Default value is 1 +- `site_id` (List of String) Filter Rogues by location. Site IDs information can be fetched from "Get Site" API +- `start_time` (Number) This is the epoch start time in milliseconds from which data need to be fetched. Default value is 24 hours earlier to endTime +- `threat_level` (List of String) Filter Rogues by Threat Level. Threat Level information can be fetched from "Get Threat Levels" API +- `threat_type` (List of String) Filter Rogues by Threat Type. Threat Type information can be fetched from "Get Threat Types" API + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedatt--parameters--items)) + + +### Nested Schema for `parameters.items` + +Read-Only: + +- `ap_name` (String) +- `channel_number` (String) +- `containment` (String) +- `controller_ip` (String) +- `controller_name` (String) +- `created_time` (Number) +- `detecting_apmac` (String) +- `encryption` (String) +- `mac_address` (String) +- `mld_mac_address` (String) +- `port_description` (String) +- `radio_type` (String) +- `site_name_hierarchy` (String) +- `ssid` (String) +- `switch_ip` (String) +- `switch_name` (String) +- `threat_level` (String) +- `threat_type` (String) +- `updated_time` (Number) diff --git a/docs/resources/security_rogue_additional_details_count.md b/docs/resources/security_rogue_additional_details_count.md new file mode 100644 index 0000000..f234413 --- /dev/null +++ b/docs/resources/security_rogue_additional_details_count.md @@ -0,0 +1,70 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_rogue_additional_details_count Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + This data source action returns the count for the Rogue Additional Details. +--- + +# catalystcenter_security_rogue_additional_details_count (Resource) + +It performs create operation on Devices. + +- This data source action returns the count for the Rogue Additional Details. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_rogue_additional_details_count" "example" { + provider = meraki + parameters { + + end_time = 1609459200 + site_id = ["string"] + start_time = 1609459200 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_rogue_additional_details_count_example" { + value = catalystcenter_security_rogue_additional_details_count.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `end_time` (Number) This is the epoch end time in milliseconds upto which data need to be fetched. Default value is current time +- `site_id` (List of String) Filter Rogues by location. Site IDs information can be fetched from "Get Site" API +- `start_time` (Number) This is the epoch start time in milliseconds from which data need to be fetched. Default value is 24 hours earlier to endTime +- `threat_level` (List of String) This information can be fetched from "Get Threat Levels" API +- `threat_type` (List of String) This information can be fetched from "Get Threat Types" API + + + +### Nested Schema for `item` + +Read-Only: + +- `response` (Number) +- `version` (String) diff --git a/docs/resources/security_rogue_wireless_containment_start.md b/docs/resources/security_rogue_wireless_containment_start.md new file mode 100644 index 0000000..3fcf9d2 --- /dev/null +++ b/docs/resources/security_rogue_wireless_containment_start.md @@ -0,0 +1,72 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_rogue_wireless_containment_start Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + Intent API to start the wireless rogue access point containment. This data source action will initiate the containment + operation on the strongest detecting WLC for the given Rogue AP. This is a resource intensive operation which has legal + implications since the rogue access point on whom it is triggered, might be a valid neighbor access point. +--- + +# catalystcenter_security_rogue_wireless_containment_start (Resource) + +It performs create operation on Devices. + +- Intent API to start the wireless rogue access point containment. This data source action will initiate the containment +operation on the strongest detecting WLC for the given Rogue AP. This is a resource intensive operation which has legal +implications since the rogue access point on whom it is triggered, might be a valid neighbor access point. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_rogue_wireless_containment_start" "example" { + provider = meraki + parameters { + + mac_address = "string" + type = 1 + } +} + +output "catalystcenter_security_rogue_wireless_containment_start_example" { + value = catalystcenter_security_rogue_wireless_containment_start.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `mac_address` (String) Mac Address +- `type` (Number) Type + + + +### Nested Schema for `item` + +Read-Only: + +- `initiated_on_bssid` (List of String) +- `initiated_on_wlc_ip` (String) +- `mac_address` (String) +- `task_id` (String) +- `task_type` (String) +- `type` (Number) diff --git a/docs/resources/security_rogue_wireless_containment_stop.md b/docs/resources/security_rogue_wireless_containment_stop.md new file mode 100644 index 0000000..67c4893 --- /dev/null +++ b/docs/resources/security_rogue_wireless_containment_stop.md @@ -0,0 +1,74 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_rogue_wireless_containment_stop Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + Intent API to stop the wireless rogue access point containment. This data source action will stop the containment + through single WLC. The response includes the details like WLC and BSSID on which the stop containment has been + initiated. +--- + +# catalystcenter_security_rogue_wireless_containment_stop (Resource) + +It performs create operation on Devices. + +- Intent API to stop the wireless rogue access point containment. This data source action will stop the containment +through single WLC. The response includes the details like WLC and BSSID on which the stop containment has been +initiated. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_rogue_wireless_containment_stop" "example" { + provider = meraki + parameters { + + mac_address = "string" + type = 1 + wlc_ip = "string" + } +} + +output "catalystcenter_security_rogue_wireless_containment_stop_example" { + value = catalystcenter_security_rogue_wireless_containment_stop.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `mac_address` (String) Mac Address +- `type` (Number) Type +- `wlc_ip` (String) Wlc Ip + + + +### Nested Schema for `item` + +Read-Only: + +- `initiated_on_bssid` (List of String) +- `initiated_on_wlc_ip` (String) +- `mac_address` (String) +- `task_id` (String) +- `task_type` (String) +- `type` (Number) diff --git a/docs/resources/security_threats_details.md b/docs/resources/security_threats_details.md new file mode 100644 index 0000000..2a8bc66 --- /dev/null +++ b/docs/resources/security_threats_details.md @@ -0,0 +1,89 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_details Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + The details for the Rogue and aWIPS threats +--- + +# catalystcenter_security_threats_details (Resource) + +It performs create operation on Devices. + +- The details for the Rogue and aWIPS threats +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_threats_details" "example" { + provider = meraki + parameters { + + end_time = 1 + is_new_threat = "false" + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_threats_details_example" { + value = catalystcenter_security_threats_details.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `end_time` (Number) End Time +- `is_new_threat` (String) Is New Threat +- `limit` (Number) Limit +- `offset` (Number) Offset +- `site_id` (List of String) Site Id +- `start_time` (Number) Start Time +- `threat_level` (List of String) Threat Level +- `threat_type` (List of String) Threat Type + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedatt--parameters--items)) + + +### Nested Schema for `parameters.items` + +Read-Only: + +- `ap_name` (String) +- `containment` (String) +- `detecting_apmac` (String) +- `mac_address` (String) +- `rssi` (String) +- `site_id` (String) +- `site_name_hierarchy` (String) +- `ssid` (String) +- `state` (String) +- `threat_level` (String) +- `threat_type` (String) +- `updated_time` (Number) +- `vendor` (String) diff --git a/docs/resources/security_threats_details_count.md b/docs/resources/security_threats_details_count.md new file mode 100644 index 0000000..8f38e06 --- /dev/null +++ b/docs/resources/security_threats_details_count.md @@ -0,0 +1,76 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_details_count Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + The details count for the Rogue and aWIPS threats +--- + +# catalystcenter_security_threats_details_count (Resource) + +It performs create operation on Devices. + +- The details count for the Rogue and aWIPS threats +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_threats_details_count" "example" { + provider = meraki + parameters { + + end_time = 1 + is_new_threat = "false" + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_threats_details_count_example" { + value = catalystcenter_security_threats_details_count.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `end_time` (Number) End Time +- `is_new_threat` (String) Is New Threat +- `limit` (Number) Limit +- `offset` (Number) Offset +- `site_id` (List of String) Site Id +- `start_time` (Number) Start Time +- `threat_level` (List of String) Threat Level +- `threat_type` (List of String) Threat Type + + + +### Nested Schema for `item` + +Read-Only: + +- `response` (Number) +- `version` (String) diff --git a/docs/resources/security_threats_rogue_allowed_list.md b/docs/resources/security_threats_rogue_allowed_list.md new file mode 100644 index 0000000..f53ee22 --- /dev/null +++ b/docs/resources/security_threats_rogue_allowed_list.md @@ -0,0 +1,73 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_rogue_allowed_list Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It manages create, read and delete operations on Devices. + Intent API to add the threat mac address to allowed list.Intent API to remove the threat mac address from allowed list. +--- + +# catalystcenter_security_threats_rogue_allowed_list (Resource) + +It manages create, read and delete operations on Devices. + +- Intent API to add the threat mac address to allowed list. + +- Intent API to remove the threat mac address from allowed list. + +## Example Usage + +```terraform +resource "catalystcenter_security_threats_rogue_allowed_list" "example" { + provider = catalystcenter + + parameters { + + category = 1 + mac_address = "string" + } +} + +output "catalystcenter_security_threats_rogue_allowed_list_example" { + value = catalystcenter_security_threats_rogue_allowed_list.example +} +``` + + +## Schema + +### Optional + +- `parameters` (Block List) Array of RequestDevicesAddAllowedMacAddressV1 (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `item` (List of Object) (see [below for nested schema](#nestedatt--item)) +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `category` (Number) Category +- `mac_address` (String) Mac Address + + + +### Nested Schema for `item` + +Read-Only: + +- `category` (Number) +- `last_modified` (Number) +- `mac_address` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import catalystcenter_security_threats_rogue_allowed_list.example "id:=string" +``` diff --git a/docs/resources/security_threats_summary.md b/docs/resources/security_threats_summary.md new file mode 100644 index 0000000..f63b50d --- /dev/null +++ b/docs/resources/security_threats_summary.md @@ -0,0 +1,81 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_security_threats_summary Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Devices. + The Threat Summary for the Rogues and aWIPS +--- + +# catalystcenter_security_threats_summary (Resource) + +It performs create operation on Devices. + +- The Threat Summary for the Rogues and aWIPS +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_security_threats_summary" "example" { + provider = meraki + parameters { + + end_time = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_threats_summary_example" { + value = catalystcenter_security_threats_summary.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `end_time` (Number) End Time +- `site_id` (List of String) Site Id +- `start_time` (Number) Start Time +- `threat_level` (List of String) Threat Level +- `threat_type` (List of String) Threat Type + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedatt--parameters--items)) + + +### Nested Schema for `parameters.items` + +Read-Only: + +- `threat_data` (List of Object) (see [below for nested schema](#nestedobjatt--parameters--items--threat_data)) +- `timestamp` (Number) + + +### Nested Schema for `parameters.items.threat_data` + +Read-Only: + +- `threat_count` (Number) +- `threat_level` (String) +- `threat_type` (String) diff --git a/docs/resources/sensor.md b/docs/resources/sensor.md index 95efacb..af08bbe 100644 --- a/docs/resources/sensor.md +++ b/docs/resources/sensor.md @@ -20,7 +20,28 @@ It manages create, read and delete operations on Sensors. ```terraform resource "catalystcenter_sensor" "example" { provider = catalystcenter + item { + + + + + + + + + + ssh { + + + + + + } + + + + } parameters { ap_coverage { @@ -138,7 +159,7 @@ resource "catalystcenter_sensor" "example" { switch_serial_number = "string" switch_uuid = "string" target_a_ps = ["string"] - test_mac_addresses = "string" + test_mac_addresses = "------" wired_application_message = "string" wired_application_status = "string" xor_sensor = "false" diff --git a/docs/resources/sensor_test_create.md b/docs/resources/sensor_test_create.md index 28b762f..c96c889 100644 --- a/docs/resources/sensor_test_create.md +++ b/docs/resources/sensor_test_create.md @@ -12,12 +12,15 @@ description: |- It performs create operation on Sensors. - Intent API to create a SENSOR test template with a new SSID, existing SSID, or both new and existing SSID +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. ## Example Usage ```terraform resource "catalystcenter_sensor_test_create" "example" { - provider = catalystcenter + provider = meraki parameters { ap_coverage { @@ -135,7 +138,7 @@ resource "catalystcenter_sensor_test_create" "example" { switch_serial_number = "string" switch_uuid = "string" target_a_ps = ["string"] - test_mac_addresses = "string" + test_mac_addresses = "------" wired_application_message = "string" wired_application_status = "string" xor_sensor = "false" diff --git a/docs/resources/sensor_test_run.md b/docs/resources/sensor_test_run.md index d433445..bc096f7 100644 --- a/docs/resources/sensor_test_run.md +++ b/docs/resources/sensor_test_run.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Sensors. - Intent API to run a deployed SENSOR test - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sensor_test_run" "example" { - provider = catalystcenter + provider = meraki parameters { template_name = "string" diff --git a/docs/resources/sensor_test_template_duplicate.md b/docs/resources/sensor_test_template_duplicate.md index 88cc12a..7f8f029 100644 --- a/docs/resources/sensor_test_template_duplicate.md +++ b/docs/resources/sensor_test_template_duplicate.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Sensors. - Intent API to duplicate an existing SENSOR test template - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sensor_test_template_duplicate" "example" { - provider = catalystcenter + provider = meraki parameters { new_template_name = "string" diff --git a/docs/resources/sensor_test_template_edit.md b/docs/resources/sensor_test_template_edit.md index 468bda1..43f1c08 100644 --- a/docs/resources/sensor_test_template_edit.md +++ b/docs/resources/sensor_test_template_edit.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Sensors. - Intent API to deploy, schedule, or edit and existing SENSOR test template - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sensor_test_template_edit" "example" { - provider = catalystcenter + provider = meraki parameters { id = "string" @@ -155,7 +152,7 @@ resource "catalystcenter_sensor_test_template_edit" "example" { switch_serial_number = "string" switch_uuid = "string" target_a_ps = ["string"] - test_mac_addresses = "string" + test_mac_addresses = "------" wired_application_message = "string" wired_application_status = "string" xor_sensor = "false" diff --git a/docs/resources/site_assign_credential.md b/docs/resources/site_assign_credential.md index b441ad1..5c8b9a1 100644 --- a/docs/resources/site_assign_credential.md +++ b/docs/resources/site_assign_credential.md @@ -3,18 +3,15 @@ page_title: "catalystcenter_site_assign_credential Resource - terraform-provider-catalystcenter" subcategory: "" description: |- - It performs create operation on Sites. + It performs create operation on NetworkSettings. Assign Device Credential to a site. --- # catalystcenter_site_assign_credential (Resource) -It performs create operation on Sites. +It performs create operation on NetworkSettings. - Assign Device Credential to a site. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_site_assign_credential" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/docs/resources/site_health_summaries_summary_analytics_create.md b/docs/resources/site_health_summaries_summary_analytics_create.md index 1031cb2..ca59dfc 100644 --- a/docs/resources/site_health_summaries_summary_analytics_create.md +++ b/docs/resources/site_health_summaries_summary_analytics_create.md @@ -5,15 +5,15 @@ subcategory: "" description: |- It performs create operation on Sites. Query an aggregated summary of all site health This data source action provides the latest health data from a given - 'endTime' If data is not ready for the provided endTime, the request will fail, and the error message will indicate the + endTime If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, - since we are not a real time system. When 'endTime' is not provided, the API returns the latest data. This data source - action also provides issue data. The 'startTime' query param can be used to specify the beginning point of time range to - retrieve the active issue counts in. When this param is not provided, the default 'startTime' will be 24 hours before + since we are not a real time system. When endTime is not provided, the API returns the latest data. This data source + action also provides issue data. The startTime query param can be used to specify the beginning point of time range to + retrieve the active issue counts in. When this param is not provided, the default startTime will be 24 hours before endTime. Aggregated response data will NOT have unique identifier data populated. - List of unique identifier data: ['id', 'siteHierarchy', - 'siteHierarchyId', 'siteType', 'latitude', 'longitude'] Please refer to the 'API Support Documentation' section to + List of unique identifier data: [id, siteHierarchy, + siteHierarchyId, siteType, latitude, longitude] Please refer to the 'API Support Documentation' section to understand which fields are supported. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CECatCenter_Org-siteHealthSummaries-1.0.3-resolved.yaml @@ -24,23 +24,20 @@ description: |- It performs create operation on Sites. - Query an aggregated summary of all site health This data source action provides the latest health data from a given -'endTime' If data is not ready for the provided endTime, the request will fail, and the error message will indicate the +*endTime* If data is not ready for the provided endTime, the request will fail, and the error message will indicate the recommended endTime to use to retrieve a complete data set. This behavior may occur if the provided endTime=currentTime, -since we are not a real time system. When 'endTime' is not provided, the API returns the latest data. This data source -action also provides issue data. The 'startTime' query param can be used to specify the beginning point of time range to -retrieve the active issue counts in. When this param is not provided, the default 'startTime' will be 24 hours before +since we are not a real time system. When *endTime* is not provided, the API returns the latest data. This data source +action also provides issue data. The *startTime* query param can be used to specify the beginning point of time range to +retrieve the active issue counts in. When this param is not provided, the default *startTime* will be 24 hours before endTime. Aggregated response data will NOT have unique identifier data populated. - List of unique identifier data: ['id', 'siteHierarchy', -'siteHierarchyId', 'siteType', 'latitude', 'longitude'] Please refer to the 'API Support Documentation' section to + List of unique identifier data: [*id*, *siteHierarchy*, +*siteHierarchyId*, *siteType*, *latitude*, *longitude*] Please refer to the 'API Support Documentation' section to understand which fields are supported. For detailed information about the usage of the API, please refer to the Open API specification document https://github.com/cisco-en-programmability/catalyst-center-api- specs/blob/main/Assurance/CE_Cat_Center_Org-siteHealthSummaries-1.0.3-resolved.yaml - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -49,7 +46,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_site_health_summaries_summary_analytics_create" "example" { - provider = catalystcenter + provider = meraki id = "string" site_hierarchy = "string" site_hierarchy_id = "string" @@ -89,21 +86,21 @@ Optional: - `attributes` (List of String) Attributes - `end_time` (Number) End Time - `id` (String) id query parameter. The list of entity Uuids. (Ex."6bef213c-19ca-4170-8375-b694e251101c") Examples: id=6bef213c-19ca-4170-8375-b694e251101c (single entity uuid requested) id=6bef213c-19ca-4170-8375-b694e251101c&id=32219612-819e-4b5e-a96b-cf22aca13dd9&id=2541e9a7-b80d-4955-8aa2-79b233318ba0 (multiple entity uuid with '&' separator) -- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. 'Global/AreaName/BuildingName/FloorName') -This field supports wildcard asterisk ('*') character search support. E.g. '*/San*, */San, /San*' +- `site_hierarchy` (String) siteHierarchy query parameter. The full hierarchical breakdown of the site tree starting from Global site name and ending with the specific site name. The Root site is named "Global" (Ex. *Global/AreaName/BuildingName/FloorName*) +This field supports wildcard asterisk (***) character search support. E.g. **/San*, */San, /San** Examples: -'?siteHierarchy=Global/AreaName/BuildingName/FloorName' (single siteHierarchy requested) -'?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2' (multiple siteHierarchies requested) -- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. 'globalUuid/areaUuid/buildingUuid/floorUuid') -This field supports wildcard asterisk ('*') character search support. E.g. '*uuid*, *uuid, uuid*' +*?siteHierarchy=Global/AreaName/BuildingName/FloorName* (single siteHierarchy requested) +*?siteHierarchy=Global/AreaName/BuildingName/FloorName&siteHierarchy=Global/AreaName2/BuildingName2/FloorName2* (multiple siteHierarchies requested) +- `site_hierarchy_id` (String) siteHierarchyId query parameter. The full hierarchy breakdown of the site tree in id form starting from Global site UUID and ending with the specific site UUID. (Ex. *globalUuid/areaUuid/buildingUuid/floorUuid*) +This field supports wildcard asterisk (***) character search support. E.g. **uuid*, *uuid, uuid** Examples: -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid '(single siteHierarchyId requested) -'?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2' (multiple siteHierarchyIds requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid *(single siteHierarchyId requested) +*?siteHierarchyId=globalUuid/areaUuid/buildingUuid/floorUuid&siteHierarchyId=globalUuid/areaUuid2/buildingUuid2/floorUuid2* (multiple siteHierarchyIds requested) - `site_type` (String) siteType query parameter. The type of the site. A site can be an area, building, or floor. -Default when not provided will be '[floor,building,area]' +Default when not provided will be *[floor,building,area]* Examples: -'?siteType=area' (single siteType requested) -'?siteType=area&siteType=building&siteType=floor' (multiple siteTypes requested) +*?siteType=area* (single siteType requested) +*?siteType=area&siteType=building&siteType=floor* (multiple siteTypes requested) - `start_time` (Number) Start Time - `views` (List of String) Views diff --git a/docs/resources/sites_aaa_settings.md b/docs/resources/sites_aaa_settings.md index fa80cf5..bb1c7f3 100644 --- a/docs/resources/sites_aaa_settings.md +++ b/docs/resources/sites_aaa_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_aaa_settings Resource - terraform-provider-cat subcategory: "" description: |- It manages read and update operations on Network Settings. - Set AAA settings for a site; 'null' values indicate that the settings will be inherited from the parent site; empty - objects ('{}') indicate that the settings is unset. + Set AAA settings for a site; null values indicate that the settings will be inherited from the parent site; empty + objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_aaa_settings (Resource) It manages read and update operations on Network Settings. -- Set AAA settings for a site; 'null' values indicate that the settings will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set AAA settings for a site; *null* values indicate that the settings will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/sites_banner_settings.md b/docs/resources/sites_banner_settings.md index eb99b59..9ed72db 100644 --- a/docs/resources/sites_banner_settings.md +++ b/docs/resources/sites_banner_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_banner_settings Resource - terraform-provider- subcategory: "" description: |- It manages read and update operations on Network Settings. - Set banner settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty - objects ('{}') indicate that the settings is unset. + Set banner settings for a site; null values indicate that the setting will be inherited from the parent site; empty + objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_banner_settings (Resource) It manages read and update operations on Network Settings. -- Set banner settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set banner settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/sites_bulk.md b/docs/resources/sites_bulk.md index 110f4e5..4a9e66a 100644 --- a/docs/resources/sites_bulk.md +++ b/docs/resources/sites_bulk.md @@ -14,9 +14,6 @@ It performs create operation on Site Design. - Create area/building/floor together in bulk. If site already exist, then that will be ignored. Sites in the request payload need not to be ordered. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,23 +22,22 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sites_bulk" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - address = "string" - country = "string" - floor_number = 1 - height = 1.0 - latitude = 1.0 - length = 1.0 - longitude = 1.0 - name = "string" - parent_name_hierarchy = "string" - rf_model = "string" - type = "string" - units_of_measure = "string" - width = 1.0 - } + + address = "string" + country = "string" + floor_number = 1 + height = 1.0 + latitude = 1.0 + length = 1.0 + longitude = 1.0 + name = "string" + parent_name_hierarchy = "string" + rf_model = "string" + type = "string" + units_of_measure = "string" + width = 1.0 } } @@ -68,7 +64,7 @@ output "catalystcenter_sites_bulk_example" { Optional: -- `payload` (Block List) Array of RequestSiteDesignCreateSites (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSiteDesignCreateSitesV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/sites_device_credentials.md b/docs/resources/sites_device_credentials.md index 9dbbdd7..65d2aa1 100644 --- a/docs/resources/sites_device_credentials.md +++ b/docs/resources/sites_device_credentials.md @@ -4,8 +4,8 @@ page_title: "catalystcenter_sites_device_credentials Resource - terraform-provid subcategory: "" description: |- It manages read and update operations on Network Settings. - Updates device credential settings for a site; 'null' values indicate that the setting will be inherited from the - parent site; empty objects ('{}') indicate that the credential is unset, and that no credential of that type will be + Updates device credential settings for a site; null values indicate that the setting will be inherited from the + parent site; empty objects ({}) indicate that the credential is unset, and that no credential of that type will be used for the site. --- @@ -13,8 +13,8 @@ description: |- It manages read and update operations on Network Settings. -- Updates device credential settings for a site; 'null' values indicate that the setting will be inherited from the -parent site; empty objects ('{}') indicate that the credential is unset, and that no credential of that type will be +- Updates device credential settings for a site; *null* values indicate that the setting will be inherited from the +parent site; empty objects (*{}*) indicate that the credential is unset, and that no credential of that type will be used for the site. ## Example Usage @@ -22,6 +22,7 @@ used for the site. ```terraform resource "catalystcenter_sites_device_credentials" "example" { provider = catalystcenter + parameters { cli_credentials_id { @@ -75,7 +76,7 @@ output "catalystcenter_sites_device_credentials_example" { Required: -- `id` (String) id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' +- `id` (String) id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* Optional: @@ -91,7 +92,7 @@ Optional: Optional: -- `credentials_id` (String) The 'id' of the credentials. +- `credentials_id` (String) The *id* of the credentials. @@ -99,7 +100,7 @@ Optional: Optional: -- `credentials_id` (String) The 'id' of the credentials. +- `credentials_id` (String) The *id* of the credentials. @@ -107,7 +108,7 @@ Optional: Optional: -- `credentials_id` (String) The 'id' of the credentials. +- `credentials_id` (String) The *id* of the credentials. @@ -115,7 +116,7 @@ Optional: Optional: -- `credentials_id` (String) The 'id' of the credentials. +- `credentials_id` (String) The *id* of the credentials. @@ -123,7 +124,7 @@ Optional: Optional: -- `credentials_id` (String) The 'id' of the credentials. +- `credentials_id` (String) The *id* of the credentials. @@ -131,7 +132,7 @@ Optional: Optional: -- `credentials_id` (String) The 'id' of the credentials. +- `credentials_id` (String) The *id* of the credentials. diff --git a/docs/resources/sites_device_credentials_apply.md b/docs/resources/sites_device_credentials_apply.md index 8e7d6c3..a64c39e 100644 --- a/docs/resources/sites_device_credentials_apply.md +++ b/docs/resources/sites_device_credentials_apply.md @@ -20,9 +20,6 @@ sites (child sites which are inheriting the credential) get managed in inventory Credential gets configured on network devices before these get managed in inventory. Please make a note that cli credential wouldn't be configured on AAA authenticated devices but they just get managed with the associated site cli credential. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -31,7 +28,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sites_device_credentials_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_credential_id = "string" diff --git a/docs/resources/sites_dhcp_settings.md b/docs/resources/sites_dhcp_settings.md index d0211c0..67b17cc 100644 --- a/docs/resources/sites_dhcp_settings.md +++ b/docs/resources/sites_dhcp_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_dhcp_settings Resource - terraform-provider-ca subcategory: "" description: |- It manages read and update operations on Network Settings. - Set DHCP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty - objects ('{}') indicate that the settings is unset. + Set DHCP settings for a site; null values indicate that the setting will be inherited from the parent site; empty + objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_dhcp_settings (Resource) It manages read and update operations on Network Settings. -- Set DHCP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set DHCP settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/sites_dns_settings.md b/docs/resources/sites_dns_settings.md index 5fd2589..d1865da 100644 --- a/docs/resources/sites_dns_settings.md +++ b/docs/resources/sites_dns_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_dns_settings Resource - terraform-provider-cat subcategory: "" description: |- It manages read and update operations on Network Settings. - Set DNS settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty - objects ('{}') indicate that the settings is unset. + Set DNS settings for a site; null values indicate that the setting will be inherited from the parent site; empty + objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_dns_settings (Resource) It manages read and update operations on Network Settings. -- Set DNS settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set DNS settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/sites_image_distribution_settings.md b/docs/resources/sites_image_distribution_settings.md index 3016e26..cdfbd04 100644 --- a/docs/resources/sites_image_distribution_settings.md +++ b/docs/resources/sites_image_distribution_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_image_distribution_settings Resource - terrafo subcategory: "" description: |- It manages read and update operations on Network Settings. - Set image distribution settings for a site; 'null' values indicate that the setting will be inherited from the parent - site; empty objects ('{}') indicate that the settings is unset. + Set image distribution settings for a site; null values indicate that the setting will be inherited from the parent + site; empty objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_image_distribution_settings (Resource) It manages read and update operations on Network Settings. -- Set image distribution settings for a site; 'null' values indicate that the setting will be inherited from the parent -site; empty objects ('{}') indicate that the settings is unset. +- Set image distribution settings for a site; *null* values indicate that the setting will be inherited from the parent +site; empty objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/sites_ntp_settings.md b/docs/resources/sites_ntp_settings.md index ca95527..4a3975f 100644 --- a/docs/resources/sites_ntp_settings.md +++ b/docs/resources/sites_ntp_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_ntp_settings Resource - terraform-provider-cat subcategory: "" description: |- It manages read and update operations on Network Settings. - Set NTP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty - objects ('{}') indicate that the settings is unset. + Set NTP settings for a site; null values indicate that the setting will be inherited from the parent site; empty + objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_ntp_settings (Resource) It manages read and update operations on Network Settings. -- Set NTP settings for a site; 'null' values indicate that the setting will be inherited from the parent site; empty -objects ('{}') indicate that the settings is unset. +- Set NTP settings for a site; *null* values indicate that the setting will be inherited from the parent site; empty +objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/sites_telemetry_settings.md b/docs/resources/sites_telemetry_settings.md index 92309f7..47def0b 100644 --- a/docs/resources/sites_telemetry_settings.md +++ b/docs/resources/sites_telemetry_settings.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_sites_telemetry_settings Resource - terraform-provid subcategory: "" description: |- It manages read and update operations on Network Settings. - Sets telemetry settings for the given site; 'null' values indicate that the setting will be inherited from the parent + Sets telemetry settings for the given site; null values indicate that the setting will be inherited from the parent site. --- @@ -12,7 +12,7 @@ description: |- It manages read and update operations on Network Settings. -- Sets telemetry settings for the given site; 'null' values indicate that the setting will be inherited from the parent +- Sets telemetry settings for the given site; *null* values indicate that the setting will be inherited from the parent site. ## Example Usage @@ -78,7 +78,7 @@ output "catalystcenter_sites_telemetry_settings_example" { Required: -- `id` (String) id path parameter. Site Id, retrievable from the 'id' attribute in '/dna/intent/api/v1/sites' +- `id` (String) id path parameter. Site Id, retrievable from the *id* attribute in */dna/intent/api/v1/sites* Optional: diff --git a/docs/resources/sites_time_zone_settings.md b/docs/resources/sites_time_zone_settings.md index 3211753..110e6e7 100644 --- a/docs/resources/sites_time_zone_settings.md +++ b/docs/resources/sites_time_zone_settings.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_sites_time_zone_settings Resource - terraform-provid subcategory: "" description: |- It manages read and update operations on Network Settings. - Set time zone settings for a site; 'null' values indicate that the setting will be inherited from the parent site; - empty objects ('{}') indicate that the settings is unset. + Set time zone settings for a site; null values indicate that the setting will be inherited from the parent site; + empty objects ({}) indicate that the settings is unset. --- # catalystcenter_sites_time_zone_settings (Resource) It manages read and update operations on Network Settings. -- Set time zone settings for a site; 'null' values indicate that the setting will be inherited from the parent site; -empty objects ('{}') indicate that the settings is unset. +- Set time zone settings for a site; *null* values indicate that the setting will be inherited from the parent site; +empty objects (*{}*) indicate that the settings is unset. ## Example Usage diff --git a/docs/resources/snmp_properties.md b/docs/resources/snmp_properties.md index 4d49ba8..d17fda1 100644 --- a/docs/resources/snmp_properties.md +++ b/docs/resources/snmp_properties.md @@ -20,13 +20,12 @@ resource "catalystcenter_snmp_properties" "example" { provider = catalystcenter parameters { - payload { - id = "string" - instance_tenant_id = "string" - instance_uuid = "string" - int_value = 1 - system_property_name = "string" - } + + id = "string" + instance_tenant_id = "string" + instance_uuid = "string" + int_value = 1 + system_property_name = "string" } } @@ -40,7 +39,7 @@ output "catalystcenter_snmp_properties_example" { ### Optional -- `parameters` (Block List) Array of RequestDiscoveryCreateUpdateSNMPProperties (see [below for nested schema](#nestedblock--parameters)) +- `parameters` (Block List) Array of RequestDiscoveryCreateUpdateSNMPPropertiesV1 (see [below for nested schema](#nestedblock--parameters)) ### Read-Only diff --git a/docs/resources/sp_profile_delete_v2.md b/docs/resources/sp_profile_delete_v2.md index 294eb7d..17f034f 100644 --- a/docs/resources/sp_profile_delete_v2.md +++ b/docs/resources/sp_profile_delete_v2.md @@ -12,9 +12,6 @@ description: |- It performs delete operation on Network Settings. - API to delete Service Provider Profile (QoS). - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_sp_profile_delete_v2" "example" { - provider = catalystcenter + provider = meraki sp_profile_name = "string" parameters { diff --git a/docs/resources/swim_image_file.md b/docs/resources/swim_image_file.md index c1b6c73..e2bcdfd 100644 --- a/docs/resources/swim_image_file.md +++ b/docs/resources/swim_image_file.md @@ -3,22 +3,17 @@ page_title: "catalystcenter_swim_image_file Resource - terraform-provider-catalystcenter" subcategory: "" description: |- - It manages create and read operations on Software Image Management (SWIM). - Fetches a software image from local file system and uploads to Catalyst Center. Supported software image files extensions - are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2. - Upload the file to the file form data field + It performs create operation on Software Image Management (SWIM). + Fetches a software image from local file system and uploads to DNA Center. Supported software image files extensions + are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 --- # catalystcenter_swim_image_file (Resource) -It manages create and read operations on Software Image Management (SWIM). - -- Fetches a software image from local file system and uploads to Catalyst Center. Supported software image files extensions -are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2. -Upload the file to the **file** form data field - - +It performs create operation on Software Image Management (SWIM). +- Fetches a software image from local file system and uploads to DNA Center. Supported software image files extensions +are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,9 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_swim_image_file" "example" { - provider = catalystcenter - file_name = "string" - file_path = "string" + provider = meraki is_third_party = "false" third_party_application_type = "string" third_party_image_family = "string" @@ -75,37 +68,5 @@ Optional: Read-Only: -- `created_time` (String) -- `extended_attributes` (String) -- `family` (String) -- `feature` (String) -- `file_service_id` (String) -- `file_size` (String) -- `image_integrity_status` (String) -- `image_name` (String) -- `image_series` (List of String) -- `image_source` (String) -- `image_type` (String) -- `image_uuid` (String) -- `import_source_type` (String) -- `is_tagged_golden` (String) -- `md5_checksum` (String) -- `name` (String) -- `profile_info` (List of Object) (see [below for nested schema](#nestedobjatt--item--profile_info)) -- `sha_check_sum` (String) - `task_id` (String) -- `vendor` (String) -- `version` (String) - - -### Nested Schema for `item.profile_info` - -Read-Only: - -- `description` (String) -- `extended_attributes` (String) -- `memory` (Number) -- `product_type` (String) -- `profile_name` (String) -- `shares` (Number) -- `v_cpu` (Number) +- `url` (String) diff --git a/docs/resources/swim_image_url.md b/docs/resources/swim_image_url.md index 0813ee0..f4df11f 100644 --- a/docs/resources/swim_image_url.md +++ b/docs/resources/swim_image_url.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_swim_image_url Resource - terraform-provider-catalys subcategory: "" description: |- It performs create operation on Software Image Management (SWIM). - Fetches a software image from remote file system (using URL for HTTP/FTP) and uploads to Catalyst Center. Supported image + Fetches a software image from remote file system (using URL for HTTP/FTP) and uploads to DNA Center. Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 --- @@ -12,11 +12,8 @@ description: |- It performs create operation on Software Image Management (SWIM). -- Fetches a software image from remote file system (using URL for HTTP/FTP) and uploads to Catalyst Center. Supported image +- Fetches a software image from remote file system (using URL for HTTP/FTP) and uploads to DNA Center. Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2 - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_swim_image_url" "example" { - provider = catalystcenter + provider = meraki schedule_at = "string" schedule_desc = "string" schedule_origin = "string" @@ -62,7 +59,7 @@ output "catalystcenter_swim_image_url_example" { Optional: -- `payload` (Block List) Array of RequestSoftwareImageManagementSwimImportSoftwareImageViaURL (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestSoftwareImageManagementSwimImportSoftwareImageViaURLV1 (see [below for nested schema](#nestedblock--parameters--payload)) - `schedule_at` (String) scheduleAt query parameter. Epoch Time (The number of milli-seconds since January 1 1970 UTC) at which the distribution should be scheduled (Optional) - `schedule_desc` (String) scheduleDesc query parameter. Custom Description (Optional) - `schedule_origin` (String) scheduleOrigin query parameter. Originator of this call (Optional) diff --git a/docs/resources/tags_interfaces_members_associations_query.md b/docs/resources/tags_interfaces_members_associations_query.md new file mode 100644 index 0000000..20acbed --- /dev/null +++ b/docs/resources/tags_interfaces_members_associations_query.md @@ -0,0 +1,76 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_tags_interfaces_members_associations_query Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Tag. + Fetches the tags associated with the given interface ids. Interfaces that don't have any tags associated will not be + included in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is + tagged, it is called a member of the tag. ids can be fetched via /dna/intent/api/v1/interface API. +--- + +# catalystcenter_tags_interfaces_members_associations_query (Resource) + +It performs create operation on Tag. + +- Fetches the tags associated with the given interface *ids*. Interfaces that don't have any tags associated will not be +included in the response. A tag is a user-defined or system-defined construct to group resources. When an interface is +tagged, it is called a member of the tag. *ids* can be fetched via */dna/intent/api/v1/interface* API. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_tags_interfaces_members_associations_query" "example" { + provider = meraki + parameters { + + ids = ["string"] + } +} + +output "catalystcenter_tags_interfaces_members_associations_query_example" { + value = catalystcenter_tags_interfaces_members_associations_query.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `ids` (List of String) List of member ids (network device or interface), maximum 500 ids can be passed. + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedatt--parameters--items)) + + +### Nested Schema for `parameters.items` + +Read-Only: + +- `id` (String) +- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--parameters--items--tags)) + + +### Nested Schema for `parameters.items.tags` + +Read-Only: + +- `id` (String) +- `name` (String) diff --git a/docs/resources/tags_network_devices_members_associations_query.md b/docs/resources/tags_network_devices_members_associations_query.md new file mode 100644 index 0000000..13cb12f --- /dev/null +++ b/docs/resources/tags_network_devices_members_associations_query.md @@ -0,0 +1,76 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "catalystcenter_tags_network_devices_members_associations_query Resource - terraform-provider-catalystcenter" +subcategory: "" +description: |- + It performs create operation on Tag. + Fetches the tags associated with the given network device ids. Devices that don't have any tags associated will not + be included in the response. A tag is a user-defined or system-defined construct to group resources. When a device is + tagged, it is called a member of the tag. ids can be fetched via /dna/intent/api/v1/network-device API. +--- + +# catalystcenter_tags_network_devices_members_associations_query (Resource) + +It performs create operation on Tag. + +- Fetches the tags associated with the given network device *ids*. Devices that don't have any tags associated will not +be included in the response. A tag is a user-defined or system-defined construct to group resources. When a device is +tagged, it is called a member of the tag. *ids* can be fetched via */dna/intent/api/v1/network-device* API. +~>**Warning:** +This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. +Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. + +## Example Usage + +```terraform +resource "catalystcenter_tags_network_devices_members_associations_query" "example" { + provider = meraki + parameters { + + ids = ["string"] + } +} + +output "catalystcenter_tags_network_devices_members_associations_query_example" { + value = catalystcenter_tags_network_devices_members_associations_query.example +} +``` + + +## Schema + +### Required + +- `parameters` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--parameters)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_updated` (String) + + +### Nested Schema for `parameters` + +Optional: + +- `ids` (List of String) List of member ids (network device or interface), maximum 500 ids can be passed. + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedatt--parameters--items)) + + +### Nested Schema for `parameters.items` + +Read-Only: + +- `id` (String) +- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--parameters--items--tags)) + + +### Nested Schema for `parameters.items.tags` + +Read-Only: + +- `id` (String) +- `name` (String) diff --git a/docs/resources/telemetry_settings_apply.md b/docs/resources/telemetry_settings_apply.md index ab6feb8..cecca6c 100644 --- a/docs/resources/telemetry_settings_apply.md +++ b/docs/resources/telemetry_settings_apply.md @@ -14,9 +14,6 @@ It performs create operation on Network Settings. - Update a device(s) telemetry settings to conform to the telemetry settings for its site. One Task is created to track the update, for more granular status tracking, split your devices into multiple requests. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_telemetry_settings_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_ids = ["string"] diff --git a/docs/resources/template_preview.md b/docs/resources/template_preview.md index c673066..bd6de4a 100644 --- a/docs/resources/template_preview.md +++ b/docs/resources/template_preview.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Configuration Templates. - API to preview a template. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,12 +20,12 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_template_preview" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = "string" - params = "string" - resource_params = "string" + params = "------" + resource_params = "------" template_id = "string" } } diff --git a/docs/resources/trusted_certificates_import.md b/docs/resources/trusted_certificates_import.md index 2f150ba..f6756eb 100644 --- a/docs/resources/trusted_certificates_import.md +++ b/docs/resources/trusted_certificates_import.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Cisco Trusted Certificates. - Imports trusted certificate into a truststore. Accepts .pem or .der file as input. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_trusted_certificates_import" "example" { - provider = catalystcenter + provider = meraki } output "catalystcenter_trusted_certificates_import_example" { diff --git a/docs/resources/user.md b/docs/resources/user.md index 4f803b8..92a0259 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -4,16 +4,16 @@ page_title: "catalystcenter_user Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It manages create, read and update operations on User and Roles. - Add a new user for Cisco Catalyst Center System.Update a user for Cisco Catalyst Center System. + Add a new user for Cisco DNA Center System.Update a user for Cisco DNA Center System. --- # catalystcenter_user (Resource) It manages create, read and update operations on User and Roles. -- Add a new user for Cisco Catalyst Center System. +- Add a new user for Cisco DNA Center System. -- Update a user for Cisco Catalyst Center System. +- Update a user for Cisco DNA Center System. ## Example Usage diff --git a/docs/resources/users_external_authentication_create.md b/docs/resources/users_external_authentication_create.md index 559f9b7..711c702 100644 --- a/docs/resources/users_external_authentication_create.md +++ b/docs/resources/users_external_authentication_create.md @@ -4,7 +4,7 @@ page_title: "catalystcenter_users_external_authentication_create Resource - terr subcategory: "" description: |- It performs create operation on User and Roles. - Enable or disable external authentication on Cisco Catalyst Center System. + Enable or disable external authentication on Cisco DNA Center System. Please find the Administrator Guide for your particular release from the list linked below and follow the steps required to enable external authentication before trying to do so from this API. https://www.cisco.com/c/en/us/support/cloud-systems-management/dna-center/products-maintenance-guides-list.html @@ -14,13 +14,10 @@ description: |- It performs create operation on User and Roles. -- Enable or disable external authentication on Cisco Catalyst Center System. +- Enable or disable external authentication on Cisco DNA Center System. Please find the Administrator Guide for your particular release from the list linked below and follow the steps required to enable external authentication before trying to do so from this API. https://www.cisco.com/c/en/us/support/cloud-systems-management/dna-center/products-maintenance-guides-list.html - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -29,7 +26,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_users_external_authentication_create" "example" { - provider = catalystcenter + provider = meraki parameters { enable = "false" diff --git a/docs/resources/users_external_servers_aaa_attribute.md b/docs/resources/users_external_servers_aaa_attribute.md index 62c93b3..7cec6b7 100644 --- a/docs/resources/users_external_servers_aaa_attribute.md +++ b/docs/resources/users_external_servers_aaa_attribute.md @@ -29,6 +29,11 @@ and for RADIUS servers it will be "Cisco-AVPair". resource "catalystcenter_users_external_servers_aaa_attribute" "example" { provider = catalystcenter + + parameters { + + attribute_name = "string" + } } output "catalystcenter_users_external_servers_aaa_attribute_example" { diff --git a/docs/resources/wireless_accespoint_configuration.md b/docs/resources/wireless_accespoint_configuration.md index 92444d4..f72e8b8 100644 --- a/docs/resources/wireless_accespoint_configuration.md +++ b/docs/resources/wireless_accespoint_configuration.md @@ -14,9 +14,6 @@ It performs create operation on Wireless. - User can configure multiple access points with required options using this intent API. This data source action does not support configuration of CleanAir or SI for IOS-XE devices with version greater than or equal to 17.9 - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_accespoint_configuration" "example" { - provider = catalystcenter + provider = meraki parameters { admin_status = "false" diff --git a/docs/resources/wireless_accesspoint_configuration_create.md b/docs/resources/wireless_accespoint_configuration_v2.md similarity index 96% rename from docs/resources/wireless_accesspoint_configuration_create.md rename to docs/resources/wireless_accespoint_configuration_v2.md index 67be4aa..83069db 100644 --- a/docs/resources/wireless_accesspoint_configuration_create.md +++ b/docs/resources/wireless_accespoint_configuration_v2.md @@ -1,20 +1,17 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "catalystcenter_wireless_accesspoint_configuration_create Resource - terraform-provider-catalystcenter" +page_title: "catalystcenter_wireless_accespoint_configuration_v2 Resource - terraform-provider-catalystcenter" subcategory: "" description: |- It performs create operation on Wireless. User can configure multiple access points with required options using this intent API --- -# catalystcenter_wireless_accesspoint_configuration_create (Resource) +# catalystcenter_wireless_accespoint_configuration_v2 (Resource) It performs create operation on Wireless. - User can configure multiple access points with required options using this intent API - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -22,8 +19,8 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ## Example Usage ```terraform -resource "catalystcenter_wireless_accesspoint_configuration_create" "example" { - provider = catalystcenter +resource "catalystcenter_wireless_accespoint_configuration_v2" "example" { + provider = meraki parameters { admin_status = "false" @@ -93,8 +90,8 @@ resource "catalystcenter_wireless_accesspoint_configuration_create" "example" { } } -output "catalystcenter_wireless_accesspoint_configuration_create_example" { - value = catalystcenter_wireless_accesspoint_configuration_create.example +output "catalystcenter_wireless_accespoint_configuration_v2_example" { + value = catalystcenter_wireless_accespoint_configuration_v2.example } ``` diff --git a/docs/resources/wireless_access_points_factory_reset_request_provision.md b/docs/resources/wireless_access_points_factory_reset_request_provision.md index 07f6830..96cfbb0 100644 --- a/docs/resources/wireless_access_points_factory_reset_request_provision.md +++ b/docs/resources/wireless_access_points_factory_reset_request_provision.md @@ -16,9 +16,6 @@ It performs create operation on Wireless. - This data source action is used to factory reset Access Points. It is supported for maximum 100 Access Points per request. Factory reset clears all configurations from the Access Points. After factory reset the Access Point may become unreachable from the currently associated Wireless Controller and may or may not join back the same controller. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_access_points_factory_reset_request_provision" "example" { - provider = catalystcenter + provider = meraki parameters { ap_mac_addresses = ["string"] diff --git a/docs/resources/wireless_access_points_provision.md b/docs/resources/wireless_access_points_provision.md index 57d1d13..1b1a4ad 100644 --- a/docs/resources/wireless_access_points_provision.md +++ b/docs/resources/wireless_access_points_provision.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Wireless. - This data source action is used to provision access points - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_access_points_provision" "example" { - provider = catalystcenter + provider = meraki parameters { ap_zone_name = "string" diff --git a/docs/resources/wireless_controllers_assign_managed_ap_locations.md b/docs/resources/wireless_controllers_assign_managed_ap_locations.md index 9f6636e..3be5118 100644 --- a/docs/resources/wireless_controllers_assign_managed_ap_locations.md +++ b/docs/resources/wireless_controllers_assign_managed_ap_locations.md @@ -16,9 +16,6 @@ It performs create operation on Wireless. - This data source action allows user to assign Managed AP Locations for WLC by device ID. The payload should always be a complete list. The Managed AP Locations included in the payload will be fully processed for both addition and deletion. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -27,7 +24,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_controllers_assign_managed_ap_locations" "example" { - provider = catalystcenter + provider = meraki device_id = "string" parameters { diff --git a/docs/resources/wireless_controllers_provision.md b/docs/resources/wireless_controllers_provision.md index cf55964..cb61b71 100644 --- a/docs/resources/wireless_controllers_provision.md +++ b/docs/resources/wireless_controllers_provision.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Wireless. - This data source action is used to provision wireless controller - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_controllers_provision" "example" { - provider = catalystcenter + provider = meraki device_id = "string" parameters { diff --git a/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_provision.md b/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_provision.md index 73fd766..b163b6f 100644 --- a/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_provision.md +++ b/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_provision.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Wireless. - This data source action is used to provision/deploy wireless mobility into Cisco wireless controllers. - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision" "example" { - provider = catalystcenter + provider = meraki parameters { data_link_encryption = "false" diff --git a/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_reset.md b/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_reset.md index 67499ea..4f29724 100644 --- a/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_reset.md +++ b/docs/resources/wireless_controllers_wireless_mobility_groups_mobility_reset.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Wireless. - This data source action is used to reset wireless mobility which in turn sets mobility group name as 'default' - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset" "example" { - provider = catalystcenter + provider = meraki parameters { network_device_id = "string" diff --git a/docs/resources/wireless_profile.md b/docs/resources/wireless_profile.md index 93c2160..90ed618 100644 --- a/docs/resources/wireless_profile.md +++ b/docs/resources/wireless_profile.md @@ -5,7 +5,7 @@ subcategory: "" description: |- It manages create, read, update and delete operations on Wireless. Delete the Wireless Profile whose name is provided.Updates the wireless Network Profile with updated details provided. All sites to be present in the network profile - should be provided.Creates Wireless Network Profile on Cisco Catalyst Center and associates sites and SSIDs to it. + should be provided.Creates Wireless Network Profile on Cisco DNA Center and associates sites and SSIDs to it. --- # catalystcenter_wireless_profile (Resource) @@ -17,7 +17,7 @@ It manages create, read, update and delete operations on Wireless. - Updates the wireless Network Profile with updated details provided. All sites to be present in the network profile should be provided. -- Creates Wireless Network Profile on Cisco Catalyst Center and associates sites and SSIDs to it. +- Creates Wireless Network Profile on Cisco DNA Center and associates sites and SSIDs to it. ## Example Usage diff --git a/docs/resources/wireless_provision_access_point.md b/docs/resources/wireless_provision_access_point.md index 29ccb4b..dfa2aaa 100644 --- a/docs/resources/wireless_provision_access_point.md +++ b/docs/resources/wireless_provision_access_point.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Wireless. - Access Point Provision and ReProvision - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,16 +20,15 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_provision_access_point" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - custom_ap_group_name = "string" - custom_flex_group_name = ["string"] - device_name = "string" - rf_profile = "string" - site_name_hierarchy = "string" - type = "string" - } + + custom_ap_group_name = "string" + custom_flex_group_name = ["string"] + device_name = "string" + rf_profile = "string" + site_name_hierarchy = "string" + type = "string" } } @@ -59,7 +55,7 @@ output "catalystcenter_wireless_provision_access_point_example" { Optional: -- `payload` (Block List) Array of RequestWirelessAPProvision2 (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestWirelessAPProvisionConnectivityV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/wireless_provision_device_create.md b/docs/resources/wireless_provision_device_create.md index 98a05a8..a3680f6 100644 --- a/docs/resources/wireless_provision_device_create.md +++ b/docs/resources/wireless_provision_device_create.md @@ -12,9 +12,6 @@ description: |- It performs create operation on Wireless. - Provision wireless device - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,22 +20,21 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_provision_device_create" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - device_name = "string" - dynamic_interfaces { - - interface_gateway = "string" - interface_ipaddress = "string" - interface_name = "string" - interface_netmask_in_cid_r = 1 - lag_or_port_number = 1 - vlan_id = 1 - } - managed_aplocations = ["string"] - site = "string" + + device_name = "string" + dynamic_interfaces { + + interface_gateway = "string" + interface_ipaddress = "string" + interface_name = "string" + interface_netmask_in_cid_r = 1 + lag_or_port_number = 1 + vlan_id = 1 } + managed_aplocations = ["string"] + site = "string" } } @@ -65,7 +61,7 @@ output "catalystcenter_wireless_provision_device_create_example" { Optional: -- `payload` (Block List) Array of RequestWirelessProvision (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestWirelessProvisionV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/wireless_provision_device_update.md b/docs/resources/wireless_provision_device_update.md index db97408..b76ece3 100644 --- a/docs/resources/wireless_provision_device_update.md +++ b/docs/resources/wireless_provision_device_update.md @@ -12,9 +12,6 @@ description: |- It performs update operation on Wireless. - Updates wireless provisioning - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,21 +20,20 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_provision_device_update" "example" { - provider = catalystcenter + provider = meraki parameters { - payload { - device_name = "string" - dynamic_interfaces { - - interface_gateway = "string" - interface_ipaddress = "string" - interface_name = "string" - interface_netmask_in_cid_r = 1 - lag_or_port_number = 1 - vlan_id = 1 - } - managed_aplocations = ["string"] + + device_name = "string" + dynamic_interfaces { + + interface_gateway = "string" + interface_ipaddress = "string" + interface_name = "string" + interface_netmask_in_cid_r = 1 + lag_or_port_number = 1 + vlan_id = 1 } + managed_aplocations = ["string"] } } @@ -64,7 +60,7 @@ output "catalystcenter_wireless_provision_device_update_example" { Optional: -- `payload` (Block List) Array of RequestWirelessProvisionUpdate (see [below for nested schema](#nestedblock--parameters--payload)) +- `payload` (Block List) Array of RequestWirelessProvisionUpdateV1 (see [below for nested schema](#nestedblock--parameters--payload)) ### Nested Schema for `parameters.payload` diff --git a/docs/resources/wireless_provision_ssid_create_provision.md b/docs/resources/wireless_provision_ssid_create_provision.md index 67b379d..868cef0 100644 --- a/docs/resources/wireless_provision_ssid_create_provision.md +++ b/docs/resources/wireless_provision_ssid_create_provision.md @@ -14,9 +14,6 @@ It performs create operation on Wireless. - Creates SSID, updates the SSID to the corresponding site profiles and provision it to the devices matching the given sites - - - ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -25,7 +22,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_provision_ssid_create_provision" "example" { - provider = catalystcenter + provider = meraki parameters { enable_fabric = "false" diff --git a/docs/resources/wireless_provision_ssid_delete_reprovision.md b/docs/resources/wireless_provision_ssid_delete_reprovision.md index 0f914ca..dbf5819 100644 --- a/docs/resources/wireless_provision_ssid_delete_reprovision.md +++ b/docs/resources/wireless_provision_ssid_delete_reprovision.md @@ -4,17 +4,14 @@ page_title: "catalystcenter_wireless_provision_ssid_delete_reprovision Resource subcategory: "" description: |- It performs delete operation on Wireless. - Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from Catalyst Center + Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from DNA Center --- # catalystcenter_wireless_provision_ssid_delete_reprovision (Resource) It performs delete operation on Wireless. -- Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from Catalyst Center - - - +- Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from DNA Center ~>**Warning:** This resource does not represent a real-world entity in Cisco Catalyst Center, therefore changing or deleting this resource on its own has no immediate effect. Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed in DNACenter without any additional verification. It does not check if it was executed before or if a similar configuration or action already existed previously. @@ -23,7 +20,7 @@ Instead, it is a task part of a Cisco Catalyst Center workflow. It is executed i ```terraform resource "catalystcenter_wireless_provision_ssid_delete_reprovision" "example" { - provider = catalystcenter + provider = meraki managed_aplocations = "string" ssid_name = "string" parameters { diff --git a/examples/data-sources/catalystcenter_analytics_anc_policies/data-source.tf b/examples/data-sources/catalystcenter_analytics_anc_policies/data-source.tf new file mode 100644 index 0000000..7c72e7b --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_anc_policies/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_analytics_anc_policies" "example" { + provider = catalystcenter +} + +output "catalystcenter_analytics_anc_policies_example" { + value = data.catalystcenter_analytics_anc_policies.example.items +} diff --git a/examples/data-sources/catalystcenter_analytics_dictionaries/data-source.tf b/examples/data-sources/catalystcenter_analytics_dictionaries/data-source.tf new file mode 100644 index 0000000..ec4b311 --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_dictionaries/data-source.tf @@ -0,0 +1,9 @@ + +data "catalystcenter_analytics_dictionaries" "example" { + provider = catalystcenter + include_attributes = "false" +} + +output "catalystcenter_analytics_dictionaries_example" { + value = data.catalystcenter_analytics_dictionaries.example.items +} diff --git a/examples/data-sources/catalystcenter_analytics_endpoints/data-source.tf b/examples/data-sources/catalystcenter_analytics_endpoints/data-source.tf new file mode 100644 index 0000000..2f6e48d --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_endpoints/data-source.tf @@ -0,0 +1,10 @@ + +data "catalystcenter_analytics_endpoints" "example" { + provider = catalystcenter + ep_id = "string" + include = "string" +} + +output "catalystcenter_analytics_endpoints_example" { + value = data.catalystcenter_analytics_endpoints.example.item +} diff --git a/examples/data-sources/catalystcenter_analytics_endpoints_count/data-source.tf b/examples/data-sources/catalystcenter_analytics_endpoints_count/data-source.tf new file mode 100644 index 0000000..25d2936 --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_endpoints_count/data-source.tf @@ -0,0 +1,29 @@ + +data "catalystcenter_analytics_endpoints_count" "example" { + provider = catalystcenter + ai_spoofing_trust_level = "string" + anc_policy = "string" + auth_method = "string" + changed_profile_trust_level = "string" + concurrent_mac_trust_level = "string" + device_type = "string" + hardware_manufacturer = "string" + hardware_model = "string" + ip = "string" + ip_blocklist_detected = "false" + mac_address = "string" + mac_addresses = ["string"] + nat_trust_level = "string" + operating_system = "string" + posture_status = "string" + profiling_status = "string" + random_mac = "false" + registered = "false" + trust_score = "string" + unauth_port_detected = "false" + weak_cred_detected = "false" +} + +output "catalystcenter_analytics_endpoints_count_example" { + value = data.catalystcenter_analytics_endpoints_count.example.item +} diff --git a/examples/data-sources/catalystcenter_analytics_profiling_rules/data-source.tf b/examples/data-sources/catalystcenter_analytics_profiling_rules/data-source.tf new file mode 100644 index 0000000..7a551dc --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_profiling_rules/data-source.tf @@ -0,0 +1,23 @@ + +data "catalystcenter_analytics_profiling_rules" "example" { + provider = catalystcenter + include_deleted = "false" + limit = 1 + offset = 1 + order = "string" + rule_type = "string" + sort_by = "string" +} + +output "catalystcenter_analytics_profiling_rules_example" { + value = data.catalystcenter_analytics_profiling_rules.example.items +} + +data "catalystcenter_analytics_profiling_rules" "example" { + provider = catalystcenter + rule_id = "string" +} + +output "catalystcenter_analytics_profiling_rules_example" { + value = data.catalystcenter_analytics_profiling_rules.example.item +} diff --git a/examples/data-sources/catalystcenter_analytics_profiling_rules_count/data-source.tf b/examples/data-sources/catalystcenter_analytics_profiling_rules_count/data-source.tf new file mode 100644 index 0000000..efb580f --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_profiling_rules_count/data-source.tf @@ -0,0 +1,10 @@ + +data "catalystcenter_analytics_profiling_rules_count" "example" { + provider = catalystcenter + include_deleted = "false" + rule_type = "string" +} + +output "catalystcenter_analytics_profiling_rules_count_example" { + value = data.catalystcenter_analytics_profiling_rules_count.example.item +} diff --git a/examples/data-sources/catalystcenter_analytics_tasks/data-source.tf b/examples/data-sources/catalystcenter_analytics_tasks/data-source.tf new file mode 100644 index 0000000..19a2986 --- /dev/null +++ b/examples/data-sources/catalystcenter_analytics_tasks/data-source.tf @@ -0,0 +1,9 @@ + +data "catalystcenter_analytics_tasks" "example" { + provider = catalystcenter + task_id = "string" +} + +output "catalystcenter_analytics_tasks_example" { + value = data.catalystcenter_analytics_tasks.example.item +} diff --git a/examples/data-sources/catalystcenter_application_set_v2/data-source.tf b/examples/data-sources/catalystcenter_application_set_v2/data-source.tf new file mode 100644 index 0000000..a1d1b2d --- /dev/null +++ b/examples/data-sources/catalystcenter_application_set_v2/data-source.tf @@ -0,0 +1,12 @@ + +data "catalystcenter_application_set_v2" "example" { + provider = catalystcenter + attributes = "string" + limit = 1 + name = "string" + offset = 1 +} + +output "catalystcenter_application_set_v2_example" { + value = data.catalystcenter_application_set_v2.example.items +} diff --git a/examples/data-sources/catalystcenter_application_sets_count_v2/data-source.tf b/examples/data-sources/catalystcenter_application_sets_count_v2/data-source.tf new file mode 100644 index 0000000..71efe13 --- /dev/null +++ b/examples/data-sources/catalystcenter_application_sets_count_v2/data-source.tf @@ -0,0 +1,9 @@ + +data "catalystcenter_application_sets_count_v2" "example" { + provider = catalystcenter + scalable_group_type = "string" +} + +output "catalystcenter_application_sets_count_v2_example" { + value = data.catalystcenter_application_sets_count_v2.example.item +} diff --git a/examples/data-sources/catalystcenter_disasterrecovery_system_operationstatus/data-source.tf b/examples/data-sources/catalystcenter_disasterrecovery_system_operationstatus/data-source.tf new file mode 100644 index 0000000..1ad9ce1 --- /dev/null +++ b/examples/data-sources/catalystcenter_disasterrecovery_system_operationstatus/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_disasterrecovery_system_operationstatus" "example" { + provider = catalystcenter +} + +output "catalystcenter_disasterrecovery_system_operationstatus_example" { + value = data.catalystcenter_disasterrecovery_system_operationstatus.example.item +} diff --git a/examples/data-sources/catalystcenter_disasterrecovery_system_status/data-source.tf b/examples/data-sources/catalystcenter_disasterrecovery_system_status/data-source.tf new file mode 100644 index 0000000..baa3d47 --- /dev/null +++ b/examples/data-sources/catalystcenter_disasterrecovery_system_status/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_disasterrecovery_system_status" "example" { + provider = catalystcenter +} + +output "catalystcenter_disasterrecovery_system_status_example" { + value = data.catalystcenter_disasterrecovery_system_status.example.item +} diff --git a/examples/data-sources/catalystcenter_endpoint_analytics_profiling_rules/data-source.tf b/examples/data-sources/catalystcenter_endpoint_analytics_profiling_rules/data-source.tf new file mode 100644 index 0000000..a5e587b --- /dev/null +++ b/examples/data-sources/catalystcenter_endpoint_analytics_profiling_rules/data-source.tf @@ -0,0 +1,23 @@ + +data "catalystcenter_endpoint_analytics_profiling_rules" "example" { + provider = catalystcenter + include_deleted = "false" + limit = 1 + offset = 1 + order = "string" + rule_type = "string" + sort_by = "string" +} + +output "catalystcenter_endpoint_analytics_profiling_rules_example" { + value = data.catalystcenter_endpoint_analytics_profiling_rules.example.items +} + +data "catalystcenter_endpoint_analytics_profiling_rules" "example" { + provider = catalystcenter + rule_id = "string" +} + +output "catalystcenter_endpoint_analytics_profiling_rules_example" { + value = data.catalystcenter_endpoint_analytics_profiling_rules.example.item +} diff --git a/examples/data-sources/catalystcenter_file/data-source.tf b/examples/data-sources/catalystcenter_file/data-source.tf index 89ead7e..6764b85 100644 --- a/examples/data-sources/catalystcenter_file/data-source.tf +++ b/examples/data-sources/catalystcenter_file/data-source.tf @@ -1,7 +1,6 @@ data "catalystcenter_file" "example" { provider = catalystcenter - dirpath = "string" file_id = "string" } diff --git a/examples/data-sources/catalystcenter_floors_settings_v2/data-source.tf b/examples/data-sources/catalystcenter_floors_settings_v2/data-source.tf new file mode 100644 index 0000000..20605bc --- /dev/null +++ b/examples/data-sources/catalystcenter_floors_settings_v2/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_floors_settings_v2" "example" { + provider = catalystcenter +} + +output "catalystcenter_floors_settings_v2_example" { + value = data.catalystcenter_floors_settings_v2.example.item +} diff --git a/examples/data-sources/catalystcenter_interfaces_members_associations/data-source.tf b/examples/data-sources/catalystcenter_interfaces_members_associations/data-source.tf deleted file mode 100644 index 8c875d0..0000000 --- a/examples/data-sources/catalystcenter_interfaces_members_associations/data-source.tf +++ /dev/null @@ -1,10 +0,0 @@ - -data "catalystcenter_interfaces_members_associations" "example" { - provider = catalystcenter - limit = 1 - offset = 1 -} - -output "catalystcenter_interfaces_members_associations_example" { - value = data.catalystcenter_interfaces_members_associations.example.items -} diff --git a/examples/data-sources/catalystcenter_interfaces_members_associations_count/data-source.tf b/examples/data-sources/catalystcenter_interfaces_members_associations_count/data-source.tf deleted file mode 100644 index 0991ea0..0000000 --- a/examples/data-sources/catalystcenter_interfaces_members_associations_count/data-source.tf +++ /dev/null @@ -1,8 +0,0 @@ - -data "catalystcenter_interfaces_members_associations_count" "example" { - provider = catalystcenter -} - -output "catalystcenter_interfaces_members_associations_count_example" { - value = data.catalystcenter_interfaces_members_associations_count.example.item -} diff --git a/examples/data-sources/catalystcenter_ipam_server_setting/data-source.tf b/examples/data-sources/catalystcenter_ipam_server_setting/data-source.tf deleted file mode 100644 index 49c8f78..0000000 --- a/examples/data-sources/catalystcenter_ipam_server_setting/data-source.tf +++ /dev/null @@ -1,8 +0,0 @@ - -data "catalystcenter_ipam_server_setting" "example" { - provider = catalystcenter -} - -output "catalystcenter_ipam_server_setting_example" { - value = data.catalystcenter_ipam_server_setting.example.item -} diff --git a/examples/data-sources/catalystcenter_network_devices_members_associations/data-source.tf b/examples/data-sources/catalystcenter_network_devices_members_associations/data-source.tf deleted file mode 100644 index 95c7338..0000000 --- a/examples/data-sources/catalystcenter_network_devices_members_associations/data-source.tf +++ /dev/null @@ -1,10 +0,0 @@ - -data "catalystcenter_network_devices_members_associations" "example" { - provider = catalystcenter - limit = 1 - offset = 1 -} - -output "catalystcenter_network_devices_members_associations_example" { - value = data.catalystcenter_network_devices_members_associations.example.items -} diff --git a/examples/data-sources/catalystcenter_network_devices_members_associations_count/data-source.tf b/examples/data-sources/catalystcenter_network_devices_members_associations_count/data-source.tf deleted file mode 100644 index 2d680a9..0000000 --- a/examples/data-sources/catalystcenter_network_devices_members_associations_count/data-source.tf +++ /dev/null @@ -1,8 +0,0 @@ - -data "catalystcenter_network_devices_members_associations_count" "example" { - provider = catalystcenter -} - -output "catalystcenter_network_devices_members_associations_count_example" { - value = data.catalystcenter_network_devices_members_associations_count.example.item -} diff --git a/examples/data-sources/catalystcenter_profiling_rules_count/data-source.tf b/examples/data-sources/catalystcenter_profiling_rules_count/data-source.tf new file mode 100644 index 0000000..cc11b47 --- /dev/null +++ b/examples/data-sources/catalystcenter_profiling_rules_count/data-source.tf @@ -0,0 +1,10 @@ + +data "catalystcenter_profiling_rules_count" "example" { + provider = catalystcenter + include_deleted = "false" + rule_type = "string" +} + +output "catalystcenter_profiling_rules_count_example" { + value = data.catalystcenter_profiling_rules_count.example.item +} diff --git a/examples/data-sources/catalystcenter_projects_details_v2/data-source.tf b/examples/data-sources/catalystcenter_projects_details_v2/data-source.tf new file mode 100644 index 0000000..7269a2b --- /dev/null +++ b/examples/data-sources/catalystcenter_projects_details_v2/data-source.tf @@ -0,0 +1,13 @@ + +data "catalystcenter_projects_details_v2" "example" { + provider = catalystcenter + id = "string" + limit = 1 + name = "string" + offset = 1 + sort_order = "string" +} + +output "catalystcenter_projects_details_v2_example" { + value = data.catalystcenter_projects_details_v2.example.item +} diff --git a/examples/data-sources/catalystcenter_reports_executions_download/data-source.tf b/examples/data-sources/catalystcenter_reports_executions_download/data-source.tf index 3c117f0..4f43ced 100644 --- a/examples/data-sources/catalystcenter_reports_executions_download/data-source.tf +++ b/examples/data-sources/catalystcenter_reports_executions_download/data-source.tf @@ -1,7 +1,10 @@ data "catalystcenter_reports_executions_download" "example" { provider = catalystcenter - dirpath = "string" execution_id = "string" report_id = "string" -} \ No newline at end of file +} + +output "catalystcenter_reports_executions_download_example" { + value = data.catalystcenter_reports_executions_download.example.item +} diff --git a/examples/data-sources/catalystcenter_security_rogue_wireless_containment_status/data-source.tf b/examples/data-sources/catalystcenter_security_rogue_wireless_containment_status/data-source.tf new file mode 100644 index 0000000..6e1da51 --- /dev/null +++ b/examples/data-sources/catalystcenter_security_rogue_wireless_containment_status/data-source.tf @@ -0,0 +1,9 @@ + +data "catalystcenter_security_rogue_wireless_containment_status" "example" { + provider = catalystcenter + mac_address = "string" +} + +output "catalystcenter_security_rogue_wireless_containment_status_example" { + value = data.catalystcenter_security_rogue_wireless_containment_status.example.items +} diff --git a/examples/data-sources/catalystcenter_security_threats_level/data-source.tf b/examples/data-sources/catalystcenter_security_threats_level/data-source.tf new file mode 100644 index 0000000..8d5aa02 --- /dev/null +++ b/examples/data-sources/catalystcenter_security_threats_level/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_security_threats_level" "example" { + provider = catalystcenter +} + +output "catalystcenter_security_threats_level_example" { + value = data.catalystcenter_security_threats_level.example.items +} diff --git a/examples/data-sources/catalystcenter_security_threats_rogue_allowed_list/data-source.tf b/examples/data-sources/catalystcenter_security_threats_rogue_allowed_list/data-source.tf new file mode 100644 index 0000000..cb6019c --- /dev/null +++ b/examples/data-sources/catalystcenter_security_threats_rogue_allowed_list/data-source.tf @@ -0,0 +1,10 @@ + +data "catalystcenter_security_threats_rogue_allowed_list" "example" { + provider = catalystcenter + limit = 1 + offset = 1 +} + +output "catalystcenter_security_threats_rogue_allowed_list_example" { + value = data.catalystcenter_security_threats_rogue_allowed_list.example.items +} diff --git a/examples/data-sources/catalystcenter_security_threats_rogue_allowed_list_count/data-source.tf b/examples/data-sources/catalystcenter_security_threats_rogue_allowed_list_count/data-source.tf new file mode 100644 index 0000000..5853a58 --- /dev/null +++ b/examples/data-sources/catalystcenter_security_threats_rogue_allowed_list_count/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_security_threats_rogue_allowed_list_count" "example" { + provider = catalystcenter +} + +output "catalystcenter_security_threats_rogue_allowed_list_count_example" { + value = data.catalystcenter_security_threats_rogue_allowed_list_count.example.item +} diff --git a/examples/data-sources/catalystcenter_security_threats_type/data-source.tf b/examples/data-sources/catalystcenter_security_threats_type/data-source.tf new file mode 100644 index 0000000..6adbd54 --- /dev/null +++ b/examples/data-sources/catalystcenter_security_threats_type/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_security_threats_type" "example" { + provider = catalystcenter +} + +output "catalystcenter_security_threats_type_example" { + value = data.catalystcenter_security_threats_type.example.items +} diff --git a/examples/data-sources/catalystcenter_tags_interfaces_members_associations/data-source.tf b/examples/data-sources/catalystcenter_tags_interfaces_members_associations/data-source.tf new file mode 100644 index 0000000..101eaf9 --- /dev/null +++ b/examples/data-sources/catalystcenter_tags_interfaces_members_associations/data-source.tf @@ -0,0 +1,10 @@ + +data "catalystcenter_tags_interfaces_members_associations" "example" { + provider = catalystcenter + limit = 1 + offset = 1 +} + +output "catalystcenter_tags_interfaces_members_associations_example" { + value = data.catalystcenter_tags_interfaces_members_associations.example.items +} diff --git a/examples/data-sources/catalystcenter_tags_interfaces_members_associations_count/data-source.tf b/examples/data-sources/catalystcenter_tags_interfaces_members_associations_count/data-source.tf new file mode 100644 index 0000000..9acdaa2 --- /dev/null +++ b/examples/data-sources/catalystcenter_tags_interfaces_members_associations_count/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_tags_interfaces_members_associations_count" "example" { + provider = catalystcenter +} + +output "catalystcenter_tags_interfaces_members_associations_count_example" { + value = data.catalystcenter_tags_interfaces_members_associations_count.example.item +} diff --git a/examples/data-sources/catalystcenter_tags_network_devices_members_associations/data-source.tf b/examples/data-sources/catalystcenter_tags_network_devices_members_associations/data-source.tf new file mode 100644 index 0000000..e9ae95a --- /dev/null +++ b/examples/data-sources/catalystcenter_tags_network_devices_members_associations/data-source.tf @@ -0,0 +1,10 @@ + +data "catalystcenter_tags_network_devices_members_associations" "example" { + provider = catalystcenter + limit = 1 + offset = 1 +} + +output "catalystcenter_tags_network_devices_members_associations_example" { + value = data.catalystcenter_tags_network_devices_members_associations.example.items +} diff --git a/examples/data-sources/catalystcenter_tags_network_devices_members_associations_count/data-source.tf b/examples/data-sources/catalystcenter_tags_network_devices_members_associations_count/data-source.tf new file mode 100644 index 0000000..14f01cf --- /dev/null +++ b/examples/data-sources/catalystcenter_tags_network_devices_members_associations_count/data-source.tf @@ -0,0 +1,8 @@ + +data "catalystcenter_tags_network_devices_members_associations_count" "example" { + provider = catalystcenter +} + +output "catalystcenter_tags_network_devices_members_associations_count_example" { + value = data.catalystcenter_tags_network_devices_members_associations_count.example.item +} diff --git a/examples/data-sources/catalystcenter_templates_details_v2/data-source.tf b/examples/data-sources/catalystcenter_templates_details_v2/data-source.tf new file mode 100644 index 0000000..a1bee45 --- /dev/null +++ b/examples/data-sources/catalystcenter_templates_details_v2/data-source.tf @@ -0,0 +1,25 @@ + +data "catalystcenter_templates_details_v2" "example" { + provider = catalystcenter + all_template_attributes = "false" + filter_conflicting_templates = "false" + id = "string" + include_version_details = "false" + limit = 1 + name = "string" + offset = 1 + product_family = "string" + product_series = "string" + product_type = "string" + project_id = "string" + project_name = "string" + software_type = "string" + software_version = "string" + sort_order = "string" + tags = ["string"] + un_committed = "false" +} + +output "catalystcenter_templates_details_v2_example" { + value = data.catalystcenter_templates_details_v2.example.item +} diff --git a/examples/data-sources/catalystcenter_threat_detail/data-source.tf b/examples/data-sources/catalystcenter_threat_detail/data-source.tf new file mode 100644 index 0000000..1e26058 --- /dev/null +++ b/examples/data-sources/catalystcenter_threat_detail/data-source.tf @@ -0,0 +1,13 @@ + +data "catalystcenter_threat_detail" "example" { + provider = catalystcenter + end_time = 1 + is_new_threat = "false" + + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] +} \ No newline at end of file diff --git a/examples/data-sources/catalystcenter_threat_detail_count/data-source.tf b/examples/data-sources/catalystcenter_threat_detail_count/data-source.tf new file mode 100644 index 0000000..d8d6e36 --- /dev/null +++ b/examples/data-sources/catalystcenter_threat_detail_count/data-source.tf @@ -0,0 +1,13 @@ + +data "catalystcenter_threat_detail_count" "example" { + provider = catalystcenter + end_time = 1 + is_new_threat = "false" + + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] +} \ No newline at end of file diff --git a/examples/data-sources/catalystcenter_threat_summary/data-source.tf b/examples/data-sources/catalystcenter_threat_summary/data-source.tf new file mode 100644 index 0000000..b2e1c03 --- /dev/null +++ b/examples/data-sources/catalystcenter_threat_summary/data-source.tf @@ -0,0 +1,19 @@ + +data "catalystcenter_threat_summary" "example" { + provider = catalystcenter + end_time = 1 + items { + + threat_data { + + + + + } + + } + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_cmdb_endpoints/resource.tf b/examples/resources/catalystcenter_analytics_cmdb_endpoints/resource.tf new file mode 100644 index 0000000..3ac3147 --- /dev/null +++ b/examples/resources/catalystcenter_analytics_cmdb_endpoints/resource.tf @@ -0,0 +1,21 @@ + +resource "catalystcenter_analytics_cmdb_endpoints" "example" { + provider = meraki + parameters { + + asset_tag = "string" + department = "string" + display_name = "string" + last_update_timestamp = 1 + location = "string" + mac_address = "string" + managed_by = "string" + model = "string" + model_category = "string" + serial_number = "string" + } +} + +output "catalystcenter_analytics_cmdb_endpoints_example" { + value = catalystcenter_analytics_cmdb_endpoints.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_endpoints/import.sh b/examples/resources/catalystcenter_analytics_endpoints/import.sh new file mode 100644 index 0000000..d7d8be1 --- /dev/null +++ b/examples/resources/catalystcenter_analytics_endpoints/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_analytics_endpoints.example "ep_id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_endpoints/resource.tf b/examples/resources/catalystcenter_analytics_endpoints/resource.tf new file mode 100644 index 0000000..8d0a154 --- /dev/null +++ b/examples/resources/catalystcenter_analytics_endpoints/resource.tf @@ -0,0 +1,17 @@ + +resource "catalystcenter_analytics_endpoints" "example" { + provider = catalystcenter + + parameters { + + device_type = "string" + ep_id = "string" + hardware_manufacturer = "string" + hardware_model = "string" + mac_address = "string" + } +} + +output "catalystcenter_analytics_endpoints_example" { + value = catalystcenter_analytics_endpoints.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_endpoints_anc_policy_delete/resource.tf b/examples/resources/catalystcenter_analytics_endpoints_anc_policy_delete/resource.tf new file mode 100644 index 0000000..70288b0 --- /dev/null +++ b/examples/resources/catalystcenter_analytics_endpoints_anc_policy_delete/resource.tf @@ -0,0 +1,12 @@ + +resource "catalystcenter_analytics_endpoints_anc_policy_delete" "example" { + provider = meraki + ep_id = "string" + parameters { + + } +} + +output "catalystcenter_analytics_endpoints_anc_policy_delete_example" { + value = catalystcenter_analytics_endpoints_anc_policy_delete.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_endpoints_anc_policy_update/resource.tf b/examples/resources/catalystcenter_analytics_endpoints_anc_policy_update/resource.tf new file mode 100644 index 0000000..1e1eb2f --- /dev/null +++ b/examples/resources/catalystcenter_analytics_endpoints_anc_policy_update/resource.tf @@ -0,0 +1,18 @@ + +resource "catalystcenter_analytics_endpoints_anc_policy_update" "example" { + provider = meraki + ep_id = "string" + parameters { + + anc_policy = "string" + granular_anc_policy { + + name = "string" + nas_ip_address = "string" + } + } +} + +output "catalystcenter_analytics_endpoints_anc_policy_update_example" { + value = catalystcenter_analytics_endpoints_anc_policy_update.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_profiling_rules/import.sh b/examples/resources/catalystcenter_analytics_profiling_rules/import.sh new file mode 100644 index 0000000..3b8fb6e --- /dev/null +++ b/examples/resources/catalystcenter_analytics_profiling_rules/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_analytics_profiling_rules.example "rule_id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_profiling_rules/resource.tf b/examples/resources/catalystcenter_analytics_profiling_rules/resource.tf new file mode 100644 index 0000000..10a874e --- /dev/null +++ b/examples/resources/catalystcenter_analytics_profiling_rules/resource.tf @@ -0,0 +1,45 @@ + +resource "catalystcenter_analytics_profiling_rules" "example" { + provider = catalystcenter + + parameters { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } +} + +output "catalystcenter_analytics_profiling_rules_example" { + value = catalystcenter_analytics_profiling_rules.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_analytics_profiling_rules_bulk/resource.tf b/examples/resources/catalystcenter_analytics_profiling_rules_bulk/resource.tf new file mode 100644 index 0000000..f3f3a16 --- /dev/null +++ b/examples/resources/catalystcenter_analytics_profiling_rules_bulk/resource.tf @@ -0,0 +1,47 @@ + +resource "catalystcenter_analytics_profiling_rules_bulk" "example" { + provider = meraki + parameters { + + profiling_rules { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } + } +} + +output "catalystcenter_analytics_profiling_rules_bulk_example" { + value = catalystcenter_analytics_profiling_rules_bulk.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_app_policy_intent_create/resource.tf b/examples/resources/catalystcenter_app_policy_intent_create/resource.tf index 2d8f463..9987df8 100644 --- a/examples/resources/catalystcenter_app_policy_intent_create/resource.tf +++ b/examples/resources/catalystcenter_app_policy_intent_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_app_policy_intent_create" "example" { - provider = catalystcenter + provider = meraki parameters { create_list { diff --git a/examples/resources/catalystcenter_app_policy_queuing_profile/resource.tf b/examples/resources/catalystcenter_app_policy_queuing_profile/resource.tf index f312b69..57861bc 100644 --- a/examples/resources/catalystcenter_app_policy_queuing_profile/resource.tf +++ b/examples/resources/catalystcenter_app_policy_queuing_profile/resource.tf @@ -1,6 +1,7 @@ resource "catalystcenter_app_policy_queuing_profile" "example" { provider = catalystcenter + parameters { clause { diff --git a/examples/resources/catalystcenter_application_policy_application_set/resource.tf b/examples/resources/catalystcenter_application_policy_application_set/resource.tf index 58b2b06..814d2f9 100644 --- a/examples/resources/catalystcenter_application_policy_application_set/resource.tf +++ b/examples/resources/catalystcenter_application_policy_application_set/resource.tf @@ -1,6 +1,7 @@ resource "catalystcenter_application_policy_application_set" "example" { provider = catalystcenter + parameters { default_business_relevance = "string" diff --git a/examples/resources/catalystcenter_application_set_v2/import.sh b/examples/resources/catalystcenter_application_set_v2/import.sh new file mode 100644 index 0000000..34c3f63 --- /dev/null +++ b/examples/resources/catalystcenter_application_set_v2/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_application_set_v2.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_application_set_v2/resource.tf b/examples/resources/catalystcenter_application_set_v2/resource.tf new file mode 100644 index 0000000..ace13d3 --- /dev/null +++ b/examples/resources/catalystcenter_application_set_v2/resource.tf @@ -0,0 +1,20 @@ + +resource "catalystcenter_application_set_v2" "example" { + provider = catalystcenter + + parameters { + + default_business_relevance = "string" + id = "string" + name = "string" + namespace = "string" + qualifier = "string" + scalable_group_external_handle = "string" + scalable_group_type = "string" + type = "string" + } +} + +output "catalystcenter_application_set_v2_example" { + value = catalystcenter_application_set_v2.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_applications/resource.tf b/examples/resources/catalystcenter_applications/resource.tf index 5e831f3..e8a54d5 100644 --- a/examples/resources/catalystcenter_applications/resource.tf +++ b/examples/resources/catalystcenter_applications/resource.tf @@ -2,6 +2,7 @@ resource "catalystcenter_applications" "example" { provider = catalystcenter + parameters { application_set { diff --git a/examples/resources/catalystcenter_area/import.sh b/examples/resources/catalystcenter_area/import.sh deleted file mode 100644 index 1fce4af..0000000 --- a/examples/resources/catalystcenter_area/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_site.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_area/resource.tf b/examples/resources/catalystcenter_area/resource.tf deleted file mode 100644 index cc38fc5..0000000 --- a/examples/resources/catalystcenter_area/resource.tf +++ /dev/null @@ -1,22 +0,0 @@ - -resource "catalystcenter_area" "example" { - provider = catalystcenter - parameters { - - site { - - area { - - name = "string" - parent_name = "string" - } - - } - site_id = "string" - type = "string" - } -} - -output "catalystcenter_area_example" { - value = catalystcenter_area.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_areas/import.sh b/examples/resources/catalystcenter_areas/import.sh new file mode 100644 index 0000000..2c801f8 --- /dev/null +++ b/examples/resources/catalystcenter_areas/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_areas.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_areas/resource.tf b/examples/resources/catalystcenter_areas/resource.tf new file mode 100644 index 0000000..4867eaf --- /dev/null +++ b/examples/resources/catalystcenter_areas/resource.tf @@ -0,0 +1,15 @@ + +resource "catalystcenter_areas" "example" { + provider = catalystcenter + + parameters { + + id = "string" + name = "string" + parent_id = "string" + } +} + +output "catalystcenter_areas_example" { + value = catalystcenter_areas.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_assign_device_to_site/resource.tf b/examples/resources/catalystcenter_assign_device_to_site/resource.tf index 975aefc..e8f1b36 100644 --- a/examples/resources/catalystcenter_assign_device_to_site/resource.tf +++ b/examples/resources/catalystcenter_assign_device_to_site/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assign_device_to_site" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_assign_to_site_apply/resource.tf b/examples/resources/catalystcenter_assign_to_site_apply/resource.tf index 7bb6df3..88c20fc 100644 --- a/examples/resources/catalystcenter_assign_to_site_apply/resource.tf +++ b/examples/resources/catalystcenter_assign_to_site_apply/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assign_to_site_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_ids = ["string"] diff --git a/examples/resources/catalystcenter_associate_site_to_network_profile/resource.tf b/examples/resources/catalystcenter_associate_site_to_network_profile/resource.tf index df6271a..ac1ec80 100644 --- a/examples/resources/catalystcenter_associate_site_to_network_profile/resource.tf +++ b/examples/resources/catalystcenter_associate_site_to_network_profile/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_associate_site_to_network_profile" "example" { - provider = catalystcenter + provider = meraki network_profile_id = "string" site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_events_query/resource.tf b/examples/resources/catalystcenter_assurance_events_query/resource.tf index c5bfb49..de14810 100644 --- a/examples/resources/catalystcenter_assurance_events_query/resource.tf +++ b/examples/resources/catalystcenter_assurance_events_query/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_events_query" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_events_query_count/resource.tf b/examples/resources/catalystcenter_assurance_events_query_count/resource.tf index 033482e..73d906b 100644 --- a/examples/resources/catalystcenter_assurance_events_query_count/resource.tf +++ b/examples/resources/catalystcenter_assurance_events_query_count/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_events_query_count" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_ignore/resource.tf b/examples/resources/catalystcenter_assurance_issues_ignore/resource.tf index e5fab53..20376a8 100644 --- a/examples/resources/catalystcenter_assurance_issues_ignore/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_ignore/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_ignore" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_query/resource.tf b/examples/resources/catalystcenter_assurance_issues_query/resource.tf index 50b2fba..4121fa0 100644 --- a/examples/resources/catalystcenter_assurance_issues_query/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_query/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_query" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_query_count/resource.tf b/examples/resources/catalystcenter_assurance_issues_query_count/resource.tf index 8d72a12..182a3ca 100644 --- a/examples/resources/catalystcenter_assurance_issues_query_count/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_query_count/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_query_count" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_resolve/resource.tf b/examples/resources/catalystcenter_assurance_issues_resolve/resource.tf index 98da99d..a107085 100644 --- a/examples/resources/catalystcenter_assurance_issues_resolve/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_resolve/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_resolve" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_summary_analytics/resource.tf b/examples/resources/catalystcenter_assurance_issues_summary_analytics/resource.tf index b05185c..16aa3e9 100644 --- a/examples/resources/catalystcenter_assurance_issues_summary_analytics/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_summary_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_summary_analytics" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_top_n_analytics/resource.tf b/examples/resources/catalystcenter_assurance_issues_top_n_analytics/resource.tf index d3d48d4..7766517 100644 --- a/examples/resources/catalystcenter_assurance_issues_top_n_analytics/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_top_n_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_top_n_analytics" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_trend_analytics/resource.tf b/examples/resources/catalystcenter_assurance_issues_trend_analytics/resource.tf index 2e2a56f..83fe1a0 100644 --- a/examples/resources/catalystcenter_assurance_issues_trend_analytics/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_trend_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_trend_analytics" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_assurance_issues_update/resource.tf b/examples/resources/catalystcenter_assurance_issues_update/resource.tf index 4ad739e..f3b5fce 100644 --- a/examples/resources/catalystcenter_assurance_issues_update/resource.tf +++ b/examples/resources/catalystcenter_assurance_issues_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_assurance_issues_update" "example" { - provider = catalystcenter + provider = meraki accept_language = "string" id = "string" xca_lle_rid = "string" diff --git a/examples/resources/catalystcenter_auth_token_create/resource.tf b/examples/resources/catalystcenter_auth_token_create/resource.tf index 00cc46c..804c2b9 100644 --- a/examples/resources/catalystcenter_auth_token_create/resource.tf +++ b/examples/resources/catalystcenter_auth_token_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_auth_token_create" "example" { - provider = catalystcenter + provider = meraki authorization = "string" } diff --git a/examples/resources/catalystcenter_building/resource.tf b/examples/resources/catalystcenter_building/resource.tf deleted file mode 100644 index 16b2ca8..0000000 --- a/examples/resources/catalystcenter_building/resource.tf +++ /dev/null @@ -1,25 +0,0 @@ - -resource "catalystcenter_building" "example" { - provider = catalystcenter - parameters { - - site { - - building { - - address = "string" - country = "string" - latitude = 1.0 - longitude = 1.0 - name = "string" - parent_name = "string" - } - } - site_id = "string" - type = "string" - } -} - -output "catalystcenter_building_example" { - value = catalystcenter_building.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_buildings/import.sh b/examples/resources/catalystcenter_buildings/import.sh new file mode 100644 index 0000000..c5881c5 --- /dev/null +++ b/examples/resources/catalystcenter_buildings/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_buildings.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_buildings/resource.tf b/examples/resources/catalystcenter_buildings/resource.tf new file mode 100644 index 0000000..409278d --- /dev/null +++ b/examples/resources/catalystcenter_buildings/resource.tf @@ -0,0 +1,19 @@ + +resource "catalystcenter_buildings" "example" { + provider = catalystcenter + + parameters { + + address = "string" + country = "string" + id = "string" + latitude = 1.0 + longitude = 1.0 + name = "string" + parent_id = "string" + } +} + +output "catalystcenter_buildings_example" { + value = catalystcenter_buildings.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_business_sda_wireless_controller_create/resource.tf b/examples/resources/catalystcenter_business_sda_wireless_controller_create/resource.tf index 15827ae..0a67d0a 100644 --- a/examples/resources/catalystcenter_business_sda_wireless_controller_create/resource.tf +++ b/examples/resources/catalystcenter_business_sda_wireless_controller_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_business_sda_wireless_controller_create" "example" { - provider = catalystcenter + provider = meraki parameters { device_name = "string" diff --git a/examples/resources/catalystcenter_business_sda_wireless_controller_delete/resource.tf b/examples/resources/catalystcenter_business_sda_wireless_controller_delete/resource.tf index 6bc9b11..960547e 100644 --- a/examples/resources/catalystcenter_business_sda_wireless_controller_delete/resource.tf +++ b/examples/resources/catalystcenter_business_sda_wireless_controller_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_business_sda_wireless_controller_delete" "example" { - provider = catalystcenter + provider = meraki device_ipaddress = "string" } diff --git a/examples/resources/catalystcenter_clients_query/resource.tf b/examples/resources/catalystcenter_clients_query/resource.tf index be1e4bc..ed39dbe 100644 --- a/examples/resources/catalystcenter_clients_query/resource.tf +++ b/examples/resources/catalystcenter_clients_query/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_clients_query" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_clients_query_count/resource.tf b/examples/resources/catalystcenter_clients_query_count/resource.tf index 977c08d..eb97573 100644 --- a/examples/resources/catalystcenter_clients_query_count/resource.tf +++ b/examples/resources/catalystcenter_clients_query_count/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_clients_query_count" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_clients_summary_analytics/resource.tf b/examples/resources/catalystcenter_clients_summary_analytics/resource.tf index 45f6764..303d777 100644 --- a/examples/resources/catalystcenter_clients_summary_analytics/resource.tf +++ b/examples/resources/catalystcenter_clients_summary_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_clients_summary_analytics" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_clients_top_n_analytics/resource.tf b/examples/resources/catalystcenter_clients_top_n_analytics/resource.tf index 6f84e38..7fd0a46 100644 --- a/examples/resources/catalystcenter_clients_top_n_analytics/resource.tf +++ b/examples/resources/catalystcenter_clients_top_n_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_clients_top_n_analytics" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_clients_trend_analytics/resource.tf b/examples/resources/catalystcenter_clients_trend_analytics/resource.tf index b12f982..eaae919 100644 --- a/examples/resources/catalystcenter_clients_trend_analytics/resource.tf +++ b/examples/resources/catalystcenter_clients_trend_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_clients_trend_analytics" "example" { - provider = catalystcenter + provider = meraki xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_clients_trend_analytics_id/resource.tf b/examples/resources/catalystcenter_clients_trend_analytics_id/resource.tf index 3bf1500..96b579f 100644 --- a/examples/resources/catalystcenter_clients_trend_analytics_id/resource.tf +++ b/examples/resources/catalystcenter_clients_trend_analytics_id/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_clients_trend_analytics_id" "example" { - provider = catalystcenter + provider = meraki id = "string" xca_lle_rid = "string" parameters { diff --git a/examples/resources/catalystcenter_command_runner_run_command/resource.tf b/examples/resources/catalystcenter_command_runner_run_command/resource.tf index 3711312..2dd6d06 100644 --- a/examples/resources/catalystcenter_command_runner_run_command/resource.tf +++ b/examples/resources/catalystcenter_command_runner_run_command/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_command_runner_run_command" "example" { - provider = catalystcenter + provider = meraki parameters { commands = ["string"] diff --git a/examples/resources/catalystcenter_compliance/resource.tf b/examples/resources/catalystcenter_compliance/resource.tf index 30e6457..764bbda 100644 --- a/examples/resources/catalystcenter_compliance/resource.tf +++ b/examples/resources/catalystcenter_compliance/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_compliance" "example" { - provider = catalystcenter + provider = meraki parameters { categories = ["string"] diff --git a/examples/resources/catalystcenter_configuration_template/resource.tf b/examples/resources/catalystcenter_configuration_template/resource.tf index 941ad63..2034efe 100644 --- a/examples/resources/catalystcenter_configuration_template/resource.tf +++ b/examples/resources/catalystcenter_configuration_template/resource.tf @@ -1,7 +1,197 @@ resource "catalystcenter_configuration_template" "example" { provider = catalystcenter + item { + + + containing_templates { + + + + device_types { + + + + + } + + + + + rollback_template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + tags { + + + + } + + template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + + } + + + + device_types { + + + + + } + + + + + + + + + + + rollback_template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + + + + tags { + + + + } + + template_params { + + + + + + + + + + + + + + + + + range { + + + + + } + + selection { + + + + + + } + } + validation_errors { + + + + + + } + + } parameters { author = "string" @@ -49,7 +239,7 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } tags { @@ -87,7 +277,7 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } version = "string" @@ -140,7 +330,7 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } software_type = "string" @@ -182,13 +372,13 @@ resource "catalystcenter_configuration_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } validation_errors { - rollback_template_errors = "string" - template_errors = "string" + rollback_template_errors = "------" + template_errors = "------" template_id = "string" template_version = "string" } diff --git a/examples/resources/catalystcenter_configuration_template_clone/resource.tf b/examples/resources/catalystcenter_configuration_template_clone/resource.tf index 97656a1..b159068 100644 --- a/examples/resources/catalystcenter_configuration_template_clone/resource.tf +++ b/examples/resources/catalystcenter_configuration_template_clone/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_configuration_template_clone" "example" { - provider = catalystcenter + provider = meraki name = "string" project_id = "string" template_id = "string" diff --git a/examples/resources/catalystcenter_configuration_template_export_project/resource.tf b/examples/resources/catalystcenter_configuration_template_export_project/resource.tf index f5d388e..463794e 100644 --- a/examples/resources/catalystcenter_configuration_template_export_project/resource.tf +++ b/examples/resources/catalystcenter_configuration_template_export_project/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_configuration_template_export_project" "example" { - provider = catalystcenter + provider = meraki parameters = ["string"] } diff --git a/examples/resources/catalystcenter_configuration_template_export_template/resource.tf b/examples/resources/catalystcenter_configuration_template_export_template/resource.tf index 19a6092..3cdcf45 100644 --- a/examples/resources/catalystcenter_configuration_template_export_template/resource.tf +++ b/examples/resources/catalystcenter_configuration_template_export_template/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_configuration_template_export_template" "example" { - provider = catalystcenter + provider = meraki parameters = ["string"] } diff --git a/examples/resources/catalystcenter_configuration_template_import_project/resource.tf b/examples/resources/catalystcenter_configuration_template_import_project/resource.tf index 641c12b..895252a 100644 --- a/examples/resources/catalystcenter_configuration_template_import_project/resource.tf +++ b/examples/resources/catalystcenter_configuration_template_import_project/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_configuration_template_import_project" "example" { - provider = catalystcenter + provider = meraki do_version = "false" } diff --git a/examples/resources/catalystcenter_configuration_template_import_template/resource.tf b/examples/resources/catalystcenter_configuration_template_import_template/resource.tf index 6707064..43e0e97 100644 --- a/examples/resources/catalystcenter_configuration_template_import_template/resource.tf +++ b/examples/resources/catalystcenter_configuration_template_import_template/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_configuration_template_import_template" "example" { - provider = catalystcenter + provider = meraki do_version = "false" project_name = "string" parameters { @@ -50,7 +50,7 @@ resource "catalystcenter_configuration_template_import_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } tags { @@ -88,7 +88,7 @@ resource "catalystcenter_configuration_template_import_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } version = "string" @@ -141,7 +141,7 @@ resource "catalystcenter_configuration_template_import_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } software_type = "string" @@ -182,13 +182,13 @@ resource "catalystcenter_configuration_template_import_template" "example" { default_selected_values = ["string"] id = "string" selection_type = "string" - selection_values = "string" + selection_values = "------" } } validation_errors { - rollback_template_errors = "string" - template_errors = "string" + rollback_template_errors = "------" + template_errors = "------" template_id = "string" template_version = "string" } diff --git a/examples/resources/catalystcenter_configuration_template_version/import.sh b/examples/resources/catalystcenter_configuration_template_version/import.sh deleted file mode 100644 index 97ab0ed..0000000 --- a/examples/resources/catalystcenter_configuration_template_version/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_configuration_template_version.example "template_id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_configuration_template_version/resource.tf b/examples/resources/catalystcenter_configuration_template_version/resource.tf deleted file mode 100644 index 8b5a9bc..0000000 --- a/examples/resources/catalystcenter_configuration_template_version/resource.tf +++ /dev/null @@ -1,12 +0,0 @@ - -resource "catalystcenter_configuration_template_version" "example" { - provider = catalystcenter - parameters { - # comments = "string" - template_id = "string" - } -} - -output "catalystcenter_configuration_template_version_example" { - value = catalystcenter_configuration_template_version.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_credential_to_site_by_siteid_create_v2/resource.tf b/examples/resources/catalystcenter_credential_to_site_by_siteid_create_v2/resource.tf index 982adc5..79b754e 100644 --- a/examples/resources/catalystcenter_credential_to_site_by_siteid_create_v2/resource.tf +++ b/examples/resources/catalystcenter_credential_to_site_by_siteid_create_v2/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_credential_to_site_by_siteid_create_v2" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_deploy_template/resource.tf b/examples/resources/catalystcenter_deploy_template/resource.tf index 7d6d3bf..cf4e122 100644 --- a/examples/resources/catalystcenter_deploy_template/resource.tf +++ b/examples/resources/catalystcenter_deploy_template/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_deploy_template" "example" { - provider = catalystcenter + provider = meraki parameters { force_push_template = "false" @@ -11,7 +11,7 @@ resource "catalystcenter_deploy_template" "example" { host_name = "string" id = "string" - params = "string" + params = "------" resource_params = ["string"] type = "string" versioned_template_id = "string" diff --git a/examples/resources/catalystcenter_deploy_template_v2/resource.tf b/examples/resources/catalystcenter_deploy_template_v2/resource.tf new file mode 100644 index 0000000..2a9deba --- /dev/null +++ b/examples/resources/catalystcenter_deploy_template_v2/resource.tf @@ -0,0 +1,25 @@ + +resource "catalystcenter_deploy_template_v2" "example" { + provider = meraki + parameters { + + force_push_template = "false" + is_composite = "false" + main_template_id = "string" + member_template_deployment_info = ["string"] + target_info { + + host_name = "string" + id = "string" + params = "------" + resource_params = ["string"] + type = "string" + versioned_template_id = "string" + } + template_id = "string" + } +} + +output "catalystcenter_deploy_template_v2_example" { + value = catalystcenter_deploy_template_v2.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_device_configurations_export/resource.tf b/examples/resources/catalystcenter_device_configurations_export/resource.tf index 4ac160e..16d23bf 100644 --- a/examples/resources/catalystcenter_device_configurations_export/resource.tf +++ b/examples/resources/catalystcenter_device_configurations_export/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_device_configurations_export" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = "string" diff --git a/examples/resources/catalystcenter_device_replacement_deploy/resource.tf b/examples/resources/catalystcenter_device_replacement_deploy/resource.tf index 250b3af..1e17a44 100644 --- a/examples/resources/catalystcenter_device_replacement_deploy/resource.tf +++ b/examples/resources/catalystcenter_device_replacement_deploy/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_device_replacement_deploy" "example" { - provider = catalystcenter + provider = meraki parameters { faulty_device_serial_number = "string" diff --git a/examples/resources/catalystcenter_disassociate_site_to_network_profile/resource.tf b/examples/resources/catalystcenter_disassociate_site_to_network_profile/resource.tf index fbabc4c..8ee3762 100644 --- a/examples/resources/catalystcenter_disassociate_site_to_network_profile/resource.tf +++ b/examples/resources/catalystcenter_disassociate_site_to_network_profile/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_disassociate_site_to_network_profile" "example" { - provider = catalystcenter + provider = meraki network_profile_id = "string" site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_discovery/resource.tf b/examples/resources/catalystcenter_discovery/resource.tf index 6dbaa68..e7dc5f8 100644 --- a/examples/resources/catalystcenter_discovery/resource.tf +++ b/examples/resources/catalystcenter_discovery/resource.tf @@ -1,10 +1,72 @@ resource "catalystcenter_discovery" "example" { provider = catalystcenter + item { + + + + + + + + + http_read_credential { + + + + + + + + + + + + } + http_write_credential { + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + } parameters { - attribute_info = "string" + attribute_info = "------" cdp_level = 1 device_ids = "string" discovery_condition = "string" diff --git a/examples/resources/catalystcenter_discovery_range_delete/resource.tf b/examples/resources/catalystcenter_discovery_range_delete/resource.tf index 50afc26..79fea77 100644 --- a/examples/resources/catalystcenter_discovery_range_delete/resource.tf +++ b/examples/resources/catalystcenter_discovery_range_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_discovery_range_delete" "example" { - provider = catalystcenter + provider = meraki records_to_delete = 1 start_index = 1 parameters { diff --git a/examples/resources/catalystcenter_endpoint_analytics_profiling_rules/import.sh b/examples/resources/catalystcenter_endpoint_analytics_profiling_rules/import.sh new file mode 100644 index 0000000..9067a93 --- /dev/null +++ b/examples/resources/catalystcenter_endpoint_analytics_profiling_rules/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_endpoint_analytics_profiling_rules.example "rule_id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_endpoint_analytics_profiling_rules/resource.tf b/examples/resources/catalystcenter_endpoint_analytics_profiling_rules/resource.tf new file mode 100644 index 0000000..b496656 --- /dev/null +++ b/examples/resources/catalystcenter_endpoint_analytics_profiling_rules/resource.tf @@ -0,0 +1,45 @@ + +resource "catalystcenter_endpoint_analytics_profiling_rules" "example" { + provider = catalystcenter + + parameters { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } +} + +output "catalystcenter_endpoint_analytics_profiling_rules_example" { + value = catalystcenter_endpoint_analytics_profiling_rules.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_event_email_config_create/resource.tf b/examples/resources/catalystcenter_event_email_config_create/resource.tf index a9992ce..55eef17 100644 --- a/examples/resources/catalystcenter_event_email_config_create/resource.tf +++ b/examples/resources/catalystcenter_event_email_config_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_event_email_config_create" "example" { - provider = catalystcenter + provider = meraki parameters { email_config_id = "string" diff --git a/examples/resources/catalystcenter_event_email_config_update/resource.tf b/examples/resources/catalystcenter_event_email_config_update/resource.tf index 3a12d52..dc7d382 100644 --- a/examples/resources/catalystcenter_event_email_config_update/resource.tf +++ b/examples/resources/catalystcenter_event_email_config_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_event_email_config_update" "example" { - provider = catalystcenter + provider = meraki parameters { email_config_id = "string" diff --git a/examples/resources/catalystcenter_event_snmp_config_create/resource.tf b/examples/resources/catalystcenter_event_snmp_config_create/resource.tf index cc0bcf9..725a582 100644 --- a/examples/resources/catalystcenter_event_snmp_config_create/resource.tf +++ b/examples/resources/catalystcenter_event_snmp_config_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_event_snmp_config_create" "example" { - provider = catalystcenter + provider = meraki parameters { auth_password = "string" diff --git a/examples/resources/catalystcenter_event_snmp_config_update/resource.tf b/examples/resources/catalystcenter_event_snmp_config_update/resource.tf index fcc2648..8bc76a1 100644 --- a/examples/resources/catalystcenter_event_snmp_config_update/resource.tf +++ b/examples/resources/catalystcenter_event_snmp_config_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_event_snmp_config_update" "example" { - provider = catalystcenter + provider = meraki parameters { auth_password = "string" diff --git a/examples/resources/catalystcenter_event_webhook_create/resource.tf b/examples/resources/catalystcenter_event_webhook_create/resource.tf index 18031d8..028eb42 100644 --- a/examples/resources/catalystcenter_event_webhook_create/resource.tf +++ b/examples/resources/catalystcenter_event_webhook_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_event_webhook_create" "example" { - provider = catalystcenter + provider = meraki parameters { description = "string" diff --git a/examples/resources/catalystcenter_event_webhook_update/resource.tf b/examples/resources/catalystcenter_event_webhook_update/resource.tf index 31b9815..3d85243 100644 --- a/examples/resources/catalystcenter_event_webhook_update/resource.tf +++ b/examples/resources/catalystcenter_event_webhook_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_event_webhook_update" "example" { - provider = catalystcenter + provider = meraki parameters { description = "string" diff --git a/examples/resources/catalystcenter_execute_suggested_actions_commands/resource.tf b/examples/resources/catalystcenter_execute_suggested_actions_commands/resource.tf index bec0619..867decc 100644 --- a/examples/resources/catalystcenter_execute_suggested_actions_commands/resource.tf +++ b/examples/resources/catalystcenter_execute_suggested_actions_commands/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_execute_suggested_actions_commands" "example" { - provider = catalystcenter + provider = meraki parameters { entity_type = "string" diff --git a/examples/resources/catalystcenter_file_import/resource.tf b/examples/resources/catalystcenter_file_import/resource.tf index 4011fa7..e8b2176 100644 --- a/examples/resources/catalystcenter_file_import/resource.tf +++ b/examples/resources/catalystcenter_file_import/resource.tf @@ -1,8 +1,6 @@ resource "catalystcenter_file_import" "example" { - provider = catalystcenter - file_name = "string" - file_path = "string" + provider = meraki name_space = "string" parameters { diff --git a/examples/resources/catalystcenter_flexible_report_execute/resource.tf b/examples/resources/catalystcenter_flexible_report_execute/resource.tf index 0aff051..7d968fa 100644 --- a/examples/resources/catalystcenter_flexible_report_execute/resource.tf +++ b/examples/resources/catalystcenter_flexible_report_execute/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_flexible_report_execute" "example" { - provider = catalystcenter + provider = meraki report_id = "string" parameters { diff --git a/examples/resources/catalystcenter_flexible_report_schedule/resource.tf b/examples/resources/catalystcenter_flexible_report_schedule/resource.tf index 1ee85cb..9aa5a20 100644 --- a/examples/resources/catalystcenter_flexible_report_schedule/resource.tf +++ b/examples/resources/catalystcenter_flexible_report_schedule/resource.tf @@ -4,7 +4,7 @@ resource "catalystcenter_flexible_report_schedule" "example" { parameters { report_id = "string" - schedule = "string" + schedule = "------" } } diff --git a/examples/resources/catalystcenter_floor/resource.tf b/examples/resources/catalystcenter_floor/resource.tf deleted file mode 100644 index d429851..0000000 --- a/examples/resources/catalystcenter_floor/resource.tf +++ /dev/null @@ -1,26 +0,0 @@ - -resource "catalystcenter_floor" "example" { - provider = catalystcenter - parameters { - - site { - - floor { - - floor_number = 1.0 - height = 1.0 - length = 1.0 - name = "string" - parent_name = "string" - rf_model = "string" - width = 1.0 - } - } - site_id = "string" - type = "string" - } -} - -output "catalystcenter_floor_example" { - value = catalystcenter_floor.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_floors/import.sh b/examples/resources/catalystcenter_floors/import.sh new file mode 100644 index 0000000..146b092 --- /dev/null +++ b/examples/resources/catalystcenter_floors/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_floors.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_floors/resource.tf b/examples/resources/catalystcenter_floors/resource.tf new file mode 100644 index 0000000..719de87 --- /dev/null +++ b/examples/resources/catalystcenter_floors/resource.tf @@ -0,0 +1,21 @@ + +resource "catalystcenter_floors" "example" { + provider = catalystcenter + + parameters { + + floor_number = 1 + height = 1.0 + id = "string" + length = 1.0 + name = "string" + parent_id = "string" + rf_model = "string" + units_of_measure = "string" + width = 1.0 + } +} + +output "catalystcenter_floors_example" { + value = catalystcenter_floors.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_floors_settings_v2/import.sh b/examples/resources/catalystcenter_floors_settings_v2/import.sh new file mode 100644 index 0000000..17b1093 --- /dev/null +++ b/examples/resources/catalystcenter_floors_settings_v2/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_floors_settings_v2.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_floors_settings_v2/resource.tf b/examples/resources/catalystcenter_floors_settings_v2/resource.tf new file mode 100644 index 0000000..150a79e --- /dev/null +++ b/examples/resources/catalystcenter_floors_settings_v2/resource.tf @@ -0,0 +1,13 @@ + +resource "catalystcenter_floors_settings_v2" "example" { + provider = catalystcenter + + parameters { + + units_of_measure = "string" + } +} + +output "catalystcenter_floors_settings_v2_example" { + value = catalystcenter_floors_settings_v2.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_floors_upload_image/resource.tf b/examples/resources/catalystcenter_floors_upload_image/resource.tf index c6b132f..8f3ae88 100644 --- a/examples/resources/catalystcenter_floors_upload_image/resource.tf +++ b/examples/resources/catalystcenter_floors_upload_image/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_floors_upload_image" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_floors_upload_image_v2/resource.tf b/examples/resources/catalystcenter_floors_upload_image_v2/resource.tf new file mode 100644 index 0000000..0290c20 --- /dev/null +++ b/examples/resources/catalystcenter_floors_upload_image_v2/resource.tf @@ -0,0 +1,12 @@ + +resource "catalystcenter_floors_upload_image_v2" "example" { + provider = meraki + id = "string" + parameters { + + } +} + +output "catalystcenter_floors_upload_image_v2_example" { + value = catalystcenter_floors_upload_image_v2.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_cli/import.sh b/examples/resources/catalystcenter_global_credential_cli/import.sh deleted file mode 100644 index b31730f..0000000 --- a/examples/resources/catalystcenter_global_credential_cli/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credential.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_cli/resource.tf b/examples/resources/catalystcenter_global_credential_cli/resource.tf deleted file mode 100644 index e1adddf..0000000 --- a/examples/resources/catalystcenter_global_credential_cli/resource.tf +++ /dev/null @@ -1,23 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_cli" "example" { - provider = catalystcenter - parameters { - comments = "string" - credential_type = "string" - description = "string" - enable_password = "string" - id = "string" - instance_tenant_id = "string" - instance_uuid = "string" - password = "string" - username = "string" - } -} - -output "catalystcenter_global_credential_cli_example" { - value = catalystcenter_global_credential_cli.example - sensitive = true -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_delete/resource.tf b/examples/resources/catalystcenter_global_credential_delete/resource.tf index 4113920..033eb59 100644 --- a/examples/resources/catalystcenter_global_credential_delete/resource.tf +++ b/examples/resources/catalystcenter_global_credential_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_global_credential_delete" "example" { - provider = catalystcenter + provider = meraki global_credential_id = "string" parameters { diff --git a/examples/resources/catalystcenter_global_credential_http_read/import.sh b/examples/resources/catalystcenter_global_credential_http_read/import.sh deleted file mode 100644 index db96c52..0000000 --- a/examples/resources/catalystcenter_global_credential_http_read/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credential_http_read.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_http_read/resource.tf b/examples/resources/catalystcenter_global_credential_http_read/resource.tf deleted file mode 100644 index 41238bb..0000000 --- a/examples/resources/catalystcenter_global_credential_http_read/resource.tf +++ /dev/null @@ -1,24 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_http_read" "example" { - provider = catalystcenter - parameters { - secure = "false" - username = "string" - password = "string" - port = 1 - description = "string" - comments = "string" - credential_type = "string" - instance_tenant_id = "string" - instance_uuid = "string" - id = "string" - } -} - -output "catalystcenter_global_credential_http_read_example" { - value = catalystcenter_global_credential_http_read.example - sensitive = true -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_http_write/import.sh b/examples/resources/catalystcenter_global_credential_http_write/import.sh deleted file mode 100644 index 9375bc7..0000000 --- a/examples/resources/catalystcenter_global_credential_http_write/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credentail_http_write.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_http_write/resource.tf b/examples/resources/catalystcenter_global_credential_http_write/resource.tf deleted file mode 100644 index 48f2bb8..0000000 --- a/examples/resources/catalystcenter_global_credential_http_write/resource.tf +++ /dev/null @@ -1,24 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_http_write" "example" { - provider = catalystcenter - parameters { - secure = "false" - username = "string" - password = "string" - port = 1 - description = "string" - comments = "string" - credential_type = "string" - instance_tenant_id = "string" - instance_uuid = "string" - id = "string" - } -} - -output "catalystcenter_global_credential_http_write_example" { - value = catalystcenter_global_credential_http_write.example - sensitive = true -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_netconf/import.sh b/examples/resources/catalystcenter_global_credential_netconf/import.sh deleted file mode 100644 index b31730f..0000000 --- a/examples/resources/catalystcenter_global_credential_netconf/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credential.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_netconf/resource.tf b/examples/resources/catalystcenter_global_credential_netconf/resource.tf deleted file mode 100644 index 4ae2ccc..0000000 --- a/examples/resources/catalystcenter_global_credential_netconf/resource.tf +++ /dev/null @@ -1,20 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_netconf" "example" { - provider = catalystcenter - parameters { - description = "string" - comments = "string" - credential_type = "string" - netconf_port = "string" - instance_tenant_id = "string" - instance_uuid = "string" - id = "string" - } -} - -output "catalystcenter_global_credential_netconf_example" { - value = catalystcenter_global_credential_netconf.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_snmpv2_read_community/import.sh b/examples/resources/catalystcenter_global_credential_snmpv2_read_community/import.sh deleted file mode 100644 index 70f6177..0000000 --- a/examples/resources/catalystcenter_global_credential_snmpv2_read_community/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credential_snmpv2_read_community.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_snmpv2_read_community/resource.tf b/examples/resources/catalystcenter_global_credential_snmpv2_read_community/resource.tf deleted file mode 100644 index 6ac930c..0000000 --- a/examples/resources/catalystcenter_global_credential_snmpv2_read_community/resource.tf +++ /dev/null @@ -1,17 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_snmpv2_read_community" "example" { - provider = catalystcenter - parameters { - description = "string" - comments = "string" - credential_type = "string" - read_community = "string" - } -} - -output "catalystcenter_global_credential_snmpv2_read_community_example" { - value = catalystcenter_global_credential_snmpv2_read_community.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_snmpv2_write_community/import.sh b/examples/resources/catalystcenter_global_credential_snmpv2_write_community/import.sh deleted file mode 100644 index 04a2507..0000000 --- a/examples/resources/catalystcenter_global_credential_snmpv2_write_community/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credential_snmpv2_write_community.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_snmpv2_write_community/resource.tf b/examples/resources/catalystcenter_global_credential_snmpv2_write_community/resource.tf deleted file mode 100644 index 53533e3..0000000 --- a/examples/resources/catalystcenter_global_credential_snmpv2_write_community/resource.tf +++ /dev/null @@ -1,17 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_snmpv2_write_community" "example" { - provider = catalystcenter - parameters { - description = "string" - comments = "string" - credential_type = "string" - write_community = "string" - } -} - -output "catalystcenter_global_credential_snmpv2_write_community_example" { - value = catalystcenter_global_credential_snmpv2_read_community.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_snmpv3/import.sh b/examples/resources/catalystcenter_global_credential_snmpv3/import.sh deleted file mode 100644 index c31bf67..0000000 --- a/examples/resources/catalystcenter_global_credential_snmpv3/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_global_credential_snmpv3.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_snmpv3/resource.tf b/examples/resources/catalystcenter_global_credential_snmpv3/resource.tf deleted file mode 100644 index 8a28c7c..0000000 --- a/examples/resources/catalystcenter_global_credential_snmpv3/resource.tf +++ /dev/null @@ -1,25 +0,0 @@ -provider "catalystcenter" { - debug = "true" -} - -resource "catalystcenter_global_credential_snmpv3" "example" { - provider = catalystcenter - parameters { - auth_password = "string" - auth_type = "string" - comments = "string" - credential_type = "string" - description = "string" - id = "string" - instanceTenantId = "string" - instanceUuid = "string" - privacy_password = "string" - privacy_type = "string" - snmp_mode = "string" - username = "string" - } -} - -output "catalystcenter_global_credential_snmpv3_example" { - value = catalystcenter_global_credential_snmpv3.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_global_credential_update/resource.tf b/examples/resources/catalystcenter_global_credential_update/resource.tf index daefbaa..2274e5e 100644 --- a/examples/resources/catalystcenter_global_credential_update/resource.tf +++ b/examples/resources/catalystcenter_global_credential_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_global_credential_update" "example" { - provider = catalystcenter + provider = meraki global_credential_id = "string" parameters { diff --git a/examples/resources/catalystcenter_image_device_activation/resource.tf b/examples/resources/catalystcenter_image_device_activation/resource.tf index ab4d0e8..6066066 100644 --- a/examples/resources/catalystcenter_image_device_activation/resource.tf +++ b/examples/resources/catalystcenter_image_device_activation/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_image_device_activation" "example" { - provider = catalystcenter + provider = meraki client_type = "string" client_url = "string" schedule_validate = "false" diff --git a/examples/resources/catalystcenter_image_distribution/resource.tf b/examples/resources/catalystcenter_image_distribution/resource.tf index 568b0a7..8043c50 100644 --- a/examples/resources/catalystcenter_image_distribution/resource.tf +++ b/examples/resources/catalystcenter_image_distribution/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_image_distribution" "example" { - provider = catalystcenter + provider = meraki parameters { device_uuid = "string" diff --git a/examples/resources/catalystcenter_images_download/resource.tf b/examples/resources/catalystcenter_images_download/resource.tf index a3076f1..d995644 100644 --- a/examples/resources/catalystcenter_images_download/resource.tf +++ b/examples/resources/catalystcenter_images_download/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_images_download" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_integrate_ise/resource.tf b/examples/resources/catalystcenter_integrate_ise/resource.tf index 66a9f38..595e5e2 100644 --- a/examples/resources/catalystcenter_integrate_ise/resource.tf +++ b/examples/resources/catalystcenter_integrate_ise/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_integrate_ise" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_interface_operation_create/resource.tf b/examples/resources/catalystcenter_interface_operation_create/resource.tf index bd56b0c..c50f0cf 100644 --- a/examples/resources/catalystcenter_interface_operation_create/resource.tf +++ b/examples/resources/catalystcenter_interface_operation_create/resource.tf @@ -1,12 +1,12 @@ resource "catalystcenter_interface_operation_create" "example" { - provider = catalystcenter + provider = meraki deployment_mode = "string" interface_uuid = "string" parameters { operation = "string" - payload = "string" + payload = "------" } } diff --git a/examples/resources/catalystcenter_interface_update/resource.tf b/examples/resources/catalystcenter_interface_update/resource.tf index cac5f94..4cefdbb 100644 --- a/examples/resources/catalystcenter_interface_update/resource.tf +++ b/examples/resources/catalystcenter_interface_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_interface_update" "example" { - provider = catalystcenter + provider = meraki deployment_mode = "string" interface_uuid = "string" parameters { diff --git a/examples/resources/catalystcenter_interfaces_members_associations_query/resource.tf b/examples/resources/catalystcenter_interfaces_members_associations_query/resource.tf deleted file mode 100644 index f68a963..0000000 --- a/examples/resources/catalystcenter_interfaces_members_associations_query/resource.tf +++ /dev/null @@ -1,12 +0,0 @@ - -resource "catalystcenter_interfaces_members_associations_query" "example" { - provider = catalystcenter - parameters { - - ids = ["string"] - } -} - -output "catalystcenter_interfaces_members_associations_query_example" { - value = catalystcenter_interfaces_members_associations_query.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_interfaces_query/resource.tf b/examples/resources/catalystcenter_interfaces_query/resource.tf index d76a97b..487c118 100644 --- a/examples/resources/catalystcenter_interfaces_query/resource.tf +++ b/examples/resources/catalystcenter_interfaces_query/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_interfaces_query" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { @@ -18,12 +18,12 @@ resource "catalystcenter_interfaces_query" "example" { key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } page { diff --git a/examples/resources/catalystcenter_interfaces_query_count/resource.tf b/examples/resources/catalystcenter_interfaces_query_count/resource.tf index f1b992c..96dc14a 100644 --- a/examples/resources/catalystcenter_interfaces_query_count/resource.tf +++ b/examples/resources/catalystcenter_interfaces_query_count/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_interfaces_query_count" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { @@ -16,7 +16,7 @@ resource "catalystcenter_interfaces_query_count" "example" { key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } page { diff --git a/examples/resources/catalystcenter_ipam_server_setting/import.sh b/examples/resources/catalystcenter_ipam_server_setting/import.sh deleted file mode 100644 index aaf221e..0000000 --- a/examples/resources/catalystcenter_ipam_server_setting/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_ipam_server_setting.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_ipam_server_setting/resource.tf b/examples/resources/catalystcenter_ipam_server_setting/resource.tf deleted file mode 100644 index aae1bb8..0000000 --- a/examples/resources/catalystcenter_ipam_server_setting/resource.tf +++ /dev/null @@ -1,19 +0,0 @@ - -resource "catalystcenter_ipam_server_setting" "example" { - provider = catalystcenter - - parameters { - - password = "******" - provider = "string" - server_name = "string" - server_url = "string" - sync_view = "false" - user_name = "string" - view = "string" - } -} - -output "catalystcenter_ipam_server_setting_example" { - value = catalystcenter_ipam_server_setting.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_itsm_integration_events_retry/resource.tf b/examples/resources/catalystcenter_itsm_integration_events_retry/resource.tf index 30b7b07..449fdf9 100644 --- a/examples/resources/catalystcenter_itsm_integration_events_retry/resource.tf +++ b/examples/resources/catalystcenter_itsm_integration_events_retry/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_itsm_integration_events_retry" "example" { - provider = catalystcenter + provider = meraki parameters = ["string"] } diff --git a/examples/resources/catalystcenter_lan_automation_create/resource.tf b/examples/resources/catalystcenter_lan_automation_create/resource.tf index 0856d7a..bd88504 100644 --- a/examples/resources/catalystcenter_lan_automation_create/resource.tf +++ b/examples/resources/catalystcenter_lan_automation_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_lan_automation_create" "example" { - provider = catalystcenter + provider = meraki parameters { discovered_device_site_name_hierarchy = "string" diff --git a/examples/resources/catalystcenter_lan_automation_delete/resource.tf b/examples/resources/catalystcenter_lan_automation_delete/resource.tf index f1f134e..077e169 100644 --- a/examples/resources/catalystcenter_lan_automation_delete/resource.tf +++ b/examples/resources/catalystcenter_lan_automation_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_lan_automation_delete" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_lan_automation_update_device/resource.tf b/examples/resources/catalystcenter_lan_automation_update_device/resource.tf index 6c96f13..36991d7 100644 --- a/examples/resources/catalystcenter_lan_automation_update_device/resource.tf +++ b/examples/resources/catalystcenter_lan_automation_update_device/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_lan_automation_update_device" "example" { - provider = catalystcenter + provider = meraki feature = "string" parameters { diff --git a/examples/resources/catalystcenter_lan_automation_update_v2/resource.tf b/examples/resources/catalystcenter_lan_automation_update_v2/resource.tf index d2d7357..1521249 100644 --- a/examples/resources/catalystcenter_lan_automation_update_v2/resource.tf +++ b/examples/resources/catalystcenter_lan_automation_update_v2/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_lan_automation_update_v2" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_lan_automation_v2/resource.tf b/examples/resources/catalystcenter_lan_automation_v2/resource.tf index 51e4ce2..9f74cd7 100644 --- a/examples/resources/catalystcenter_lan_automation_v2/resource.tf +++ b/examples/resources/catalystcenter_lan_automation_v2/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_lan_automation_v2" "example" { - provider = catalystcenter + provider = meraki parameters { discovered_device_site_name_hierarchy = "string" diff --git a/examples/resources/catalystcenter_maps_export/resource.tf b/examples/resources/catalystcenter_maps_export/resource.tf index edafbc3..27daf46 100644 --- a/examples/resources/catalystcenter_maps_export/resource.tf +++ b/examples/resources/catalystcenter_maps_export/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_maps_export" "example" { - provider = catalystcenter + provider = meraki site_hierarchy_uuid = "string" parameters { diff --git a/examples/resources/catalystcenter_maps_import/resource.tf b/examples/resources/catalystcenter_maps_import/resource.tf index a148a51..fa65fb4 100644 --- a/examples/resources/catalystcenter_maps_import/resource.tf +++ b/examples/resources/catalystcenter_maps_import/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_maps_import" "example" { - provider = catalystcenter + provider = meraki import_context_uuid = "string" parameters { diff --git a/examples/resources/catalystcenter_maps_import_perform/resource.tf b/examples/resources/catalystcenter_maps_import_perform/resource.tf index 76869ec..7bc98be 100644 --- a/examples/resources/catalystcenter_maps_import_perform/resource.tf +++ b/examples/resources/catalystcenter_maps_import_perform/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_maps_import_perform" "example" { - provider = catalystcenter + provider = meraki import_context_uuid = "string" parameters { diff --git a/examples/resources/catalystcenter_maps_import_start/resource.tf b/examples/resources/catalystcenter_maps_import_start/resource.tf index 379b4cd..4057700 100644 --- a/examples/resources/catalystcenter_maps_import_start/resource.tf +++ b/examples/resources/catalystcenter_maps_import_start/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_maps_import_start" "example" { - provider = catalystcenter + provider = meraki } output "catalystcenter_maps_import_start_example" { diff --git a/examples/resources/catalystcenter_network_create/resource.tf b/examples/resources/catalystcenter_network_create/resource.tf index ce53a26..5fc135b 100644 --- a/examples/resources/catalystcenter_network_create/resource.tf +++ b/examples/resources/catalystcenter_network_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_create" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_network_device_config_write_memory/resource.tf b/examples/resources/catalystcenter_network_device_config_write_memory/resource.tf index 0982533..d1ecfb9 100644 --- a/examples/resources/catalystcenter_network_device_config_write_memory/resource.tf +++ b/examples/resources/catalystcenter_network_device_config_write_memory/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_config_write_memory" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = ["string"] diff --git a/examples/resources/catalystcenter_network_device_export/resource.tf b/examples/resources/catalystcenter_network_device_export/resource.tf index fdff0f2..ef7000f 100644 --- a/examples/resources/catalystcenter_network_device_export/resource.tf +++ b/examples/resources/catalystcenter_network_device_export/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_export" "example" { - provider = catalystcenter + provider = meraki parameters { device_uuids = ["string"] diff --git a/examples/resources/catalystcenter_network_device_management_address_update/resource.tf b/examples/resources/catalystcenter_network_device_management_address_update/resource.tf index 9e8879e..3e2b432 100644 --- a/examples/resources/catalystcenter_network_device_management_address_update/resource.tf +++ b/examples/resources/catalystcenter_network_device_management_address_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_management_address_update" "example" { - provider = catalystcenter + provider = meraki deviceid = "string" parameters { diff --git a/examples/resources/catalystcenter_network_device_sync/resource.tf b/examples/resources/catalystcenter_network_device_sync/resource.tf index 5c87a63..741dee8 100644 --- a/examples/resources/catalystcenter_network_device_sync/resource.tf +++ b/examples/resources/catalystcenter_network_device_sync/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_sync" "example" { - provider = catalystcenter + provider = meraki force_sync = "false" parameters = ["string"] } diff --git a/examples/resources/catalystcenter_network_device_update_role/resource.tf b/examples/resources/catalystcenter_network_device_update_role/resource.tf index e63a252..5a0dd00 100644 --- a/examples/resources/catalystcenter_network_device_update_role/resource.tf +++ b/examples/resources/catalystcenter_network_device_update_role/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_update_role" "example" { - provider = catalystcenter + provider = meraki parameters { id = "string" diff --git a/examples/resources/catalystcenter_network_device_user_defined_field_delete/resource.tf b/examples/resources/catalystcenter_network_device_user_defined_field_delete/resource.tf index c714d66..aed0db0 100644 --- a/examples/resources/catalystcenter_network_device_user_defined_field_delete/resource.tf +++ b/examples/resources/catalystcenter_network_device_user_defined_field_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_user_defined_field_delete" "example" { - provider = catalystcenter + provider = meraki device_id = "string" name = "string" parameters { diff --git a/examples/resources/catalystcenter_network_device_user_defined_field_update/resource.tf b/examples/resources/catalystcenter_network_device_user_defined_field_update/resource.tf index ee78dc3..7a07a08 100644 --- a/examples/resources/catalystcenter_network_device_user_defined_field_update/resource.tf +++ b/examples/resources/catalystcenter_network_device_user_defined_field_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_device_user_defined_field_update" "example" { - provider = catalystcenter + provider = meraki device_id = "string" parameters { diff --git a/examples/resources/catalystcenter_network_devices_interfaces_query/resource.tf b/examples/resources/catalystcenter_network_devices_interfaces_query/resource.tf index 8966c7a..94b0d0f 100644 --- a/examples/resources/catalystcenter_network_devices_interfaces_query/resource.tf +++ b/examples/resources/catalystcenter_network_devices_interfaces_query/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_interfaces_query" "example" { - provider = catalystcenter + provider = meraki device_id = "string" parameters { diff --git a/examples/resources/catalystcenter_network_devices_interfaces_query_v2/resource.tf b/examples/resources/catalystcenter_network_devices_interfaces_query_v2/resource.tf new file mode 100644 index 0000000..37665f9 --- /dev/null +++ b/examples/resources/catalystcenter_network_devices_interfaces_query_v2/resource.tf @@ -0,0 +1,34 @@ + +resource "catalystcenter_network_devices_interfaces_query_v2" "example" { + provider = meraki + device_id = "string" + parameters { + + end_time = 1 + query { + + fields = ["string"] + filters { + + key = "string" + operator = "string" + value = "string" + } + page { + + limit = 1 + offset = 1 + order_by { + + name = "string" + order = "string" + } + } + } + start_time = 1 + } +} + +output "catalystcenter_network_devices_interfaces_query_v2_example" { + value = catalystcenter_network_devices_interfaces_query_v2.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_network_devices_issues_remediation_provision/resource.tf b/examples/resources/catalystcenter_network_devices_issues_remediation_provision/resource.tf index 232f473..d0ac05f 100644 --- a/examples/resources/catalystcenter_network_devices_issues_remediation_provision/resource.tf +++ b/examples/resources/catalystcenter_network_devices_issues_remediation_provision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_issues_remediation_provision" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_network_devices_members_associations_query/resource.tf b/examples/resources/catalystcenter_network_devices_members_associations_query/resource.tf deleted file mode 100644 index ae8dbef..0000000 --- a/examples/resources/catalystcenter_network_devices_members_associations_query/resource.tf +++ /dev/null @@ -1,12 +0,0 @@ - -resource "catalystcenter_network_devices_members_associations_query" "example" { - provider = catalystcenter - parameters { - - ids = ["string"] - } -} - -output "catalystcenter_network_devices_members_associations_query_example" { - value = catalystcenter_network_devices_members_associations_query.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_network_devices_query/resource.tf b/examples/resources/catalystcenter_network_devices_query/resource.tf index 605f056..69c1d32 100644 --- a/examples/resources/catalystcenter_network_devices_query/resource.tf +++ b/examples/resources/catalystcenter_network_devices_query/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_query" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { diff --git a/examples/resources/catalystcenter_network_devices_query_count/resource.tf b/examples/resources/catalystcenter_network_devices_query_count/resource.tf index d9adf26..d9e4178 100644 --- a/examples/resources/catalystcenter_network_devices_query_count/resource.tf +++ b/examples/resources/catalystcenter_network_devices_query_count/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_query_count" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { diff --git a/examples/resources/catalystcenter_network_devices_resync_interval_settings/resource.tf b/examples/resources/catalystcenter_network_devices_resync_interval_settings/resource.tf index 3587484..ce8de24 100644 --- a/examples/resources/catalystcenter_network_devices_resync_interval_settings/resource.tf +++ b/examples/resources/catalystcenter_network_devices_resync_interval_settings/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_resync_interval_settings" "example" { - provider = catalystcenter + provider = meraki parameters { interval = 1 diff --git a/examples/resources/catalystcenter_network_devices_resync_interval_settings_override/resource.tf b/examples/resources/catalystcenter_network_devices_resync_interval_settings_override/resource.tf index 521a1cb..cd33aa1 100644 --- a/examples/resources/catalystcenter_network_devices_resync_interval_settings_override/resource.tf +++ b/examples/resources/catalystcenter_network_devices_resync_interval_settings_override/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_resync_interval_settings_override" "example" { - provider = catalystcenter + provider = meraki } output "catalystcenter_network_devices_resync_interval_settings_override_example" { diff --git a/examples/resources/catalystcenter_network_devices_summary_analytics/resource.tf b/examples/resources/catalystcenter_network_devices_summary_analytics/resource.tf index aed0d8b..546117c 100644 --- a/examples/resources/catalystcenter_network_devices_summary_analytics/resource.tf +++ b/examples/resources/catalystcenter_network_devices_summary_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_summary_analytics" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes { diff --git a/examples/resources/catalystcenter_network_devices_trend_analytics/resource.tf b/examples/resources/catalystcenter_network_devices_trend_analytics/resource.tf index 325e2d7..2103ab8 100644 --- a/examples/resources/catalystcenter_network_devices_trend_analytics/resource.tf +++ b/examples/resources/catalystcenter_network_devices_trend_analytics/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_trend_analytics" "example" { - provider = catalystcenter + provider = meraki parameters { aggregate_attributes = ["string"] diff --git a/examples/resources/catalystcenter_network_devices_trend_analytics_id/resource.tf b/examples/resources/catalystcenter_network_devices_trend_analytics_id/resource.tf index 4150123..4d77bf9 100644 --- a/examples/resources/catalystcenter_network_devices_trend_analytics_id/resource.tf +++ b/examples/resources/catalystcenter_network_devices_trend_analytics_id/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_trend_analytics_id" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { @@ -17,7 +17,7 @@ resource "catalystcenter_network_devices_trend_analytics_id" "example" { key = "string" logical_operator = "string" operator = "string" - value = "string" + value = "------" } group_by = ["string"] page { diff --git a/examples/resources/catalystcenter_network_devices_unassign_from_site_apply/resource.tf b/examples/resources/catalystcenter_network_devices_unassign_from_site_apply/resource.tf index d6352c1..a7a7b85 100644 --- a/examples/resources/catalystcenter_network_devices_unassign_from_site_apply/resource.tf +++ b/examples/resources/catalystcenter_network_devices_unassign_from_site_apply/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_devices_unassign_from_site_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_ids = ["string"] diff --git a/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_create/resource.tf b/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_create/resource.tf index fbfe7aa..2b40458 100644 --- a/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_create/resource.tf +++ b/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_create/resource.tf @@ -1,10 +1,10 @@ resource "catalystcenter_network_profiles_for_sites_site_assignments_bulk_create" "example" { - provider = catalystcenter + provider = meraki profile_id = "string" parameters { - items = [] + type = "------" } } diff --git a/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete/resource.tf b/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete/resource.tf index 8249ae5..551548b 100644 --- a/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete/resource.tf +++ b/examples/resources/catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_profiles_for_sites_site_assignments_bulk_delete" "example" { - provider = catalystcenter + provider = meraki profile_id = "string" site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_network_update/resource.tf b/examples/resources/catalystcenter_network_update/resource.tf index e3450dc..9d04fe6 100644 --- a/examples/resources/catalystcenter_network_update/resource.tf +++ b/examples/resources/catalystcenter_network_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_network_update" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_path_trace/resource.tf b/examples/resources/catalystcenter_path_trace/resource.tf index 729aff7..f0d5fe3 100644 --- a/examples/resources/catalystcenter_path_trace/resource.tf +++ b/examples/resources/catalystcenter_path_trace/resource.tf @@ -1,7 +1,855 @@ resource "catalystcenter_path_trace" "example" { provider = catalystcenter + item { + detailed_status { + + + + } + + network_elements { + + accuracy_list { + + + + } + detailed_status { + + + + } + device_statistics { + + cpu_statistics { + + + + + + } + memory_statistics { + + + + + } + } + + + egress_physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + egress_virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + flex_connect { + + + + egress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + ingress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + + } + + ingress_physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + ingress_virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + + + + + + perf_mon_statistics { + + + + + + + + + + + + + + + + + + + + } + + + + + + } + network_elements_info { + + accuracy_list { + + + + } + detailed_status { + + + + } + device_statistics { + + cpu_statistics { + + + + + + } + memory_statistics { + + + + + } + } + + + egress_interface { + + physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + } + flex_connect { + + + + egress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + ingress_acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + + } + + ingress_interface { + + physical_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + virtual_interface { + + acl_analysis { + + + matching_aces { + + + matching_ports { + + ports { + + + + } + + } + + } + + } + + interface_statistics { + + + + + + + + + + + + + + + + } + + + + path_overlay_info { + + + + + + + + + vxlan_info { + + + + } + } + qos_statistics { + + + + + + + + + + + + } + + + + + } + } + + + + + + perf_monitor_statistics { + + + + + + + + + + + + + + + + + + + + } + + + + + + } + + request { + + + + + + + + + + + + + + + + } + } parameters { control_path = "false" diff --git a/examples/resources/catalystcenter_pnp_device/resource.tf b/examples/resources/catalystcenter_pnp_device/resource.tf index e479c40..249353a 100644 --- a/examples/resources/catalystcenter_pnp_device/resource.tf +++ b/examples/resources/catalystcenter_pnp_device/resource.tf @@ -1,8 +1,325 @@ resource "catalystcenter_pnp_device" "example" { provider = catalystcenter + item { + day_zero_config { + + + } + + device_info { + + aaa_credentials { + + + + } + + + + + + + + + + + + + file_system_list { + + + + + + + + } + + + http_headers { + + + + } + + + ip_interfaces { + + + + + + + } + + + + location { + + + + + + + } + + + + neighbor_links { + + + + + + + + + + + } + + + pnp_profile_list { + + + + primary_endpoint { + + + + + + + + } + + secondary_endpoint { + + + + + + + + } + } + + pre_workflow_cli_ouputs { + + + + } + + + + + + + + + + stack_info { + + + stack_member_list { + + + + + + + + + + + + + + } + + + + + } + + + + + + + + + } + run_summary_list { + + + + history_task_info { + + addn_details { + + + + } + + + + work_item_list { + + + + + + + + } + } + + } + system_reset_workflow { + + + + + + + + + + + + + + + + tasks { + + + + + + + + + + work_item_list { + + + + + + + + } + } + + + + + } + system_workflow { + + + + + + + + + + + + + + + + tasks { + + + + + + + + + + work_item_list { + + + + + + + + } + } + + + + + } + + + workflow { + + + + + + + + + + + + + + + + tasks { + + + + + + + + + + work_item_list { + + + + + + + + } + } + + + + + } + workflow_parameters { + + config_list { + + + config_parameters { + + + + } + } + + + + } + } parameters { device_info { diff --git a/examples/resources/catalystcenter_pnp_device_authorize/resource.tf b/examples/resources/catalystcenter_pnp_device_authorize/resource.tf index 221ae70..503dac2 100644 --- a/examples/resources/catalystcenter_pnp_device_authorize/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_authorize/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_authorize" "example" { - provider = catalystcenter + provider = meraki parameters { device_id_list = ["string"] diff --git a/examples/resources/catalystcenter_pnp_device_claim/resource.tf b/examples/resources/catalystcenter_pnp_device_claim/resource.tf index 8bf6ba3..c268ea5 100644 --- a/examples/resources/catalystcenter_pnp_device_claim/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_claim/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_claim" "example" { - provider = catalystcenter + provider = meraki parameters { authorization_needed = "false" diff --git a/examples/resources/catalystcenter_pnp_device_config_preview/resource.tf b/examples/resources/catalystcenter_pnp_device_config_preview/resource.tf index e1c1a96..bbf2aa2 100644 --- a/examples/resources/catalystcenter_pnp_device_config_preview/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_config_preview/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_config_preview" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = "string" diff --git a/examples/resources/catalystcenter_pnp_device_import/resource.tf b/examples/resources/catalystcenter_pnp_device_import/resource.tf index e2e2b39..193554b 100644 --- a/examples/resources/catalystcenter_pnp_device_import/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_import/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_import" "example" { - provider = catalystcenter + provider = meraki parameters { id = "string" diff --git a/examples/resources/catalystcenter_pnp_device_reset/resource.tf b/examples/resources/catalystcenter_pnp_device_reset/resource.tf index c49fe20..dabb640 100644 --- a/examples/resources/catalystcenter_pnp_device_reset/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_reset/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_reset" "example" { - provider = catalystcenter + provider = meraki parameters { device_reset_list { diff --git a/examples/resources/catalystcenter_pnp_device_site_claim/resource.tf b/examples/resources/catalystcenter_pnp_device_site_claim/resource.tf index cc075b8..4e05d76 100644 --- a/examples/resources/catalystcenter_pnp_device_site_claim/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_site_claim/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_site_claim" "example" { - provider = catalystcenter + provider = meraki parameters { config_info { diff --git a/examples/resources/catalystcenter_pnp_device_unclaim/resource.tf b/examples/resources/catalystcenter_pnp_device_unclaim/resource.tf index b7229dc..faf284f 100644 --- a/examples/resources/catalystcenter_pnp_device_unclaim/resource.tf +++ b/examples/resources/catalystcenter_pnp_device_unclaim/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_device_unclaim" "example" { - provider = catalystcenter + provider = meraki parameters { device_id_list = ["string"] diff --git a/examples/resources/catalystcenter_pnp_server_profile_update/resource.tf b/examples/resources/catalystcenter_pnp_server_profile_update/resource.tf index 37fe060..0e28d72 100644 --- a/examples/resources/catalystcenter_pnp_server_profile_update/resource.tf +++ b/examples/resources/catalystcenter_pnp_server_profile_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_server_profile_update" "example" { - provider = catalystcenter + provider = meraki parameters { cco_user = "string" diff --git a/examples/resources/catalystcenter_pnp_virtual_account_add/resource.tf b/examples/resources/catalystcenter_pnp_virtual_account_add/resource.tf index 85085c3..2c1db2c 100644 --- a/examples/resources/catalystcenter_pnp_virtual_account_add/resource.tf +++ b/examples/resources/catalystcenter_pnp_virtual_account_add/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_virtual_account_add" "example" { - provider = catalystcenter + provider = meraki parameters { auto_sync_period = 1 diff --git a/examples/resources/catalystcenter_pnp_virtual_account_deregister/resource.tf b/examples/resources/catalystcenter_pnp_virtual_account_deregister/resource.tf index 098e688..1d60b68 100644 --- a/examples/resources/catalystcenter_pnp_virtual_account_deregister/resource.tf +++ b/examples/resources/catalystcenter_pnp_virtual_account_deregister/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_virtual_account_deregister" "example" { - provider = catalystcenter + provider = meraki domain = "string" name = "string" } diff --git a/examples/resources/catalystcenter_pnp_virtual_account_devices_sync/resource.tf b/examples/resources/catalystcenter_pnp_virtual_account_devices_sync/resource.tf index a8ab06b..cf7ceaf 100644 --- a/examples/resources/catalystcenter_pnp_virtual_account_devices_sync/resource.tf +++ b/examples/resources/catalystcenter_pnp_virtual_account_devices_sync/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_pnp_virtual_account_devices_sync" "example" { - provider = catalystcenter + provider = meraki parameters { auto_sync_period = 1 diff --git a/examples/resources/catalystcenter_profiling_rules_in_bulk_create/resource.tf b/examples/resources/catalystcenter_profiling_rules_in_bulk_create/resource.tf new file mode 100644 index 0000000..958bf70 --- /dev/null +++ b/examples/resources/catalystcenter_profiling_rules_in_bulk_create/resource.tf @@ -0,0 +1,47 @@ + +resource "catalystcenter_profiling_rules_in_bulk_create" "example" { + provider = meraki + parameters { + + profiling_rules { + + cluster_id = "string" + condition_groups { + + condition { + + attribute = "string" + attribute_dictionary = "string" + operator = "string" + value = "string" + } + condition_group = ["string"] + operator = "string" + type = "string" + } + is_deleted = "false" + last_modified_by = "string" + last_modified_on = 1 + plugin_id = "string" + rejected = "false" + result { + + device_type = ["string"] + hardware_manufacturer = ["string"] + hardware_model = ["string"] + operating_system = ["string"] + } + rule_id = "string" + rule_name = "string" + rule_priority = 1 + rule_type = "string" + rule_version = 1 + source_priority = 1 + used_attributes = ["string"] + } + } +} + +output "catalystcenter_profiling_rules_in_bulk_create_example" { + value = catalystcenter_profiling_rules_in_bulk_create.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_reports/resource.tf b/examples/resources/catalystcenter_reports/resource.tf index 2b5c412..3f20681 100644 --- a/examples/resources/catalystcenter_reports/resource.tf +++ b/examples/resources/catalystcenter_reports/resource.tf @@ -1,14 +1,66 @@ resource "catalystcenter_reports" "example" { provider = catalystcenter + item { + + + + executions { + + + + + + + + + } + + + + + + view { + + + field_groups { + + + + fields { + + + + } + } + filters { + + + + + + } + format { + + + + + } + + + + } + + + } parameters { data_category = "string" deliveries = ["string"] name = "string" report_id = "string" - schedule = "string" + schedule = "------" tags = ["string"] view { @@ -27,7 +79,7 @@ resource "catalystcenter_reports" "example" { display_name = "string" name = "string" type = "string" - value = "string" + value = "------" } format { diff --git a/examples/resources/catalystcenter_reserve_ip_subpool/resource.tf b/examples/resources/catalystcenter_reserve_ip_subpool/resource.tf index dec7baf..43c2885 100644 --- a/examples/resources/catalystcenter_reserve_ip_subpool/resource.tf +++ b/examples/resources/catalystcenter_reserve_ip_subpool/resource.tf @@ -2,31 +2,6 @@ resource "catalystcenter_reserve_ip_subpool" "example" { provider = catalystcenter - parameters { - - id = "string" - ipv4_dhcp_servers = ["string"] - ipv4_dns_servers = ["string"] - ipv4_gate_way = "string" - ipv4_global_pool = "string" - ipv4_prefix = "false" - ipv4_prefix_length = 1 - ipv4_subnet = "string" - ipv4_total_host = 1 - ipv6_address_space = "false" - ipv6_dhcp_servers = ["string"] - ipv6_dns_servers = ["string"] - ipv6_gate_way = "string" - ipv6_global_pool = "string" - ipv6_prefix = "false" - ipv6_prefix_length = 1 - ipv6_subnet = "string" - ipv6_total_host = 1 - name = "string" - site_id = "string" - slaac_support = "false" - type = "string" - } } output "catalystcenter_reserve_ip_subpool_example" { diff --git a/examples/resources/catalystcenter_sda_anycast_gateways/import.sh b/examples/resources/catalystcenter_sda_anycast_gateways/import.sh deleted file mode 100644 index 20ba257..0000000 --- a/examples/resources/catalystcenter_sda_anycast_gateways/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_sda_anycast_gateways.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_anycast_gateways/resource.tf b/examples/resources/catalystcenter_sda_anycast_gateways/resource.tf deleted file mode 100644 index 8c2484b..0000000 --- a/examples/resources/catalystcenter_sda_anycast_gateways/resource.tf +++ /dev/null @@ -1,31 +0,0 @@ - -resource "catalystcenter_sda_anycast_gateways" "example" { - provider = catalystcenter - - parameters { - - auto_generate_vlan_name = "false" - fabric_id = "string" - id = "string" - ip_pool_name = "string" - is_critical_pool = "false" - is_group_based_policy_enforcement_enabled = "false" - is_intra_subnet_routing_enabled = "false" - is_ip_directed_broadcast = "false" - is_layer2_flooding_enabled = "false" - is_multiple_ip_to_mac_addresses = "false" - is_supplicant_based_extended_node_onboarding = "false" - is_wireless_pool = "false" - pool_type = "string" - security_group_name = "string" - tcp_mss_adjustment = 1 - traffic_type = "string" - virtual_network_name = "string" - vlan_id = 1 - vlan_name = "string" - } -} - -output "catalystcenter_sda_anycast_gateways_example" { - value = catalystcenter_sda_anycast_gateways.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_anycast_gateways_create/resource.tf b/examples/resources/catalystcenter_sda_anycast_gateways_create/resource.tf index 1bc3b26..db79487 100644 --- a/examples/resources/catalystcenter_sda_anycast_gateways_create/resource.tf +++ b/examples/resources/catalystcenter_sda_anycast_gateways_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_anycast_gateways_create" "example" { - provider = catalystcenter + provider = meraki parameters { auto_generate_vlan_name = "false" diff --git a/examples/resources/catalystcenter_sda_anycast_gateways_delete/resource.tf b/examples/resources/catalystcenter_sda_anycast_gateways_delete/resource.tf index 4a581b9..1826e9f 100644 --- a/examples/resources/catalystcenter_sda_anycast_gateways_delete/resource.tf +++ b/examples/resources/catalystcenter_sda_anycast_gateways_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_anycast_gateways_delete" "example" { - provider = catalystcenter + provider = meraki id = "string" parameters { diff --git a/examples/resources/catalystcenter_sda_anycast_gateways_update/resource.tf b/examples/resources/catalystcenter_sda_anycast_gateways_update/resource.tf index 590b7e1..ad288ea 100644 --- a/examples/resources/catalystcenter_sda_anycast_gateways_update/resource.tf +++ b/examples/resources/catalystcenter_sda_anycast_gateways_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_anycast_gateways_update" "example" { - provider = catalystcenter + provider = meraki parameters { fabric_id = "string" diff --git a/examples/resources/catalystcenter_sda_fabric_border_device/resource.tf b/examples/resources/catalystcenter_sda_fabric_border_device/resource.tf index de1b61d..cd205bd 100644 --- a/examples/resources/catalystcenter_sda_fabric_border_device/resource.tf +++ b/examples/resources/catalystcenter_sda_fabric_border_device/resource.tf @@ -1,7 +1,138 @@ resource "catalystcenter_sda_fabric_border_device" "example" { provider = catalystcenter + item { + + payload { + + + + + + + + + + + + device_settings { + + + + + + + ext_connectivity_settings { + + + + + + + + + + + l3_handoff { + + + + + + + + + + virtual_network { + + + } + + } + + + } + + + + + + + + + + + } + + + + + + + + + + + + + network_widesettings { + + + + + dhcp { + + + ip_address { + + + + + + } + } + + dns { + + + + ip { + + + + + + } + } + + + + + + + + + + + } + + + + + + + + transit_networks { + + + } + + + + } + + } parameters { border_priority = "string" diff --git a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits/import.sh b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits/import.sh deleted file mode 100644 index d137637..0000000 --- a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits/resource.tf b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits/resource.tf deleted file mode 100644 index ab5ae9d..0000000 --- a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits/resource.tf +++ /dev/null @@ -1,19 +0,0 @@ - -resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits" "example" { - provider = catalystcenter - - parameters { - - affinity_id_decider = 1 - affinity_id_prime = 1 - connected_to_internet = "false" - fabric_id = "string" - is_multicast_over_transit_enabled = "false" - network_device_id = "string" - transit_network_id = "string" - } -} - -output "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_example" { - value = catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create/resource.tf b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create/resource.tf index 6cf6225..d067477 100644 --- a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create/resource.tf +++ b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_create" "example" { - provider = catalystcenter + provider = meraki parameters { affinity_id_decider = 1 diff --git a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete/resource.tf b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete/resource.tf index 8cd1b1c..f25695b 100644 --- a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete/resource.tf +++ b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_delete" "example" { - provider = catalystcenter + provider = meraki fabric_id = "string" network_device_id = "string" } diff --git a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update/resource.tf b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update/resource.tf index 8c04229..b7e8380 100644 --- a/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update/resource.tf +++ b/examples/resources/catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_fabric_devices_layer2_handoffs_sda_transits_update" "example" { - provider = catalystcenter + provider = meraki parameters { affinity_id_decider = 1 diff --git a/examples/resources/catalystcenter_sda_multicast/resource.tf b/examples/resources/catalystcenter_sda_multicast/resource.tf index 920fbd6..c8b0e55 100644 --- a/examples/resources/catalystcenter_sda_multicast/resource.tf +++ b/examples/resources/catalystcenter_sda_multicast/resource.tf @@ -1,6 +1,7 @@ resource "catalystcenter_sda_multicast" "example" { provider = catalystcenter + parameters { multicast_method = "string" diff --git a/examples/resources/catalystcenter_sda_multicast_create/resource.tf b/examples/resources/catalystcenter_sda_multicast_create/resource.tf deleted file mode 100644 index 7139fac..0000000 --- a/examples/resources/catalystcenter_sda_multicast_create/resource.tf +++ /dev/null @@ -1,26 +0,0 @@ - -resource "catalystcenter_sda_multicast_create" "example" { - provider = catalystcenter - parameters { - - multicast_method = "string" - multicast_type = "string" - multicast_vn_info { - - external_rp_ip_address = "string" - internal_rp_ip_address = ["string"] - ip_pool_name = "string" - ssm_info { - - ssm_group_range = "string" - ssm_wildcard_mask = "string" - } - virtual_network_name = "string" - } - site_name_hierarchy = "string" - } -} - -output "catalystcenter_sda_multicast_create_example" { - value = catalystcenter_sda_multicast_create.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_multicast_update/resource.tf b/examples/resources/catalystcenter_sda_multicast_update/resource.tf deleted file mode 100644 index ee0b37f..0000000 --- a/examples/resources/catalystcenter_sda_multicast_update/resource.tf +++ /dev/null @@ -1,9 +0,0 @@ - -resource "catalystcenter_sda_multicast_update" "example" { - provider = catalystcenter - site_name_hierarchy = "string" -} - -output "catalystcenter_sda_multicast_update_example" { - value = catalystcenter_sda_multicast_update.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_multicast_v1/import.sh b/examples/resources/catalystcenter_sda_multicast_v1/import.sh deleted file mode 100644 index 211af7e..0000000 --- a/examples/resources/catalystcenter_sda_multicast_v1/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_sda_multicast_v1.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_multicast_v1/resource.tf b/examples/resources/catalystcenter_sda_multicast_v1/resource.tf deleted file mode 100644 index 1501fd5..0000000 --- a/examples/resources/catalystcenter_sda_multicast_v1/resource.tf +++ /dev/null @@ -1,14 +0,0 @@ - -resource "catalystcenter_sda_multicast_v1" "example" { - provider = catalystcenter - - parameters { - - fabric_id = "string" - replication_mode = "string" - } -} - -output "catalystcenter_sda_multicast_v1_example" { - value = catalystcenter_sda_multicast_v1.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_sda_multicast_v1_update/resource.tf b/examples/resources/catalystcenter_sda_multicast_v1_update/resource.tf index e8412d3..a74ae4a 100644 --- a/examples/resources/catalystcenter_sda_multicast_v1_update/resource.tf +++ b/examples/resources/catalystcenter_sda_multicast_v1_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sda_multicast_v1_update" "example" { - provider = catalystcenter + provider = meraki parameters { fabric_id = "string" diff --git a/examples/resources/catalystcenter_security_rogue_additional_details/resource.tf b/examples/resources/catalystcenter_security_rogue_additional_details/resource.tf new file mode 100644 index 0000000..c1d8237 --- /dev/null +++ b/examples/resources/catalystcenter_security_rogue_additional_details/resource.tf @@ -0,0 +1,18 @@ + +resource "catalystcenter_security_rogue_additional_details" "example" { + provider = meraki + parameters { + + end_time = 1609459200 + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1609459200 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_rogue_additional_details_example" { + value = catalystcenter_security_rogue_additional_details.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_rogue_additional_details_count/resource.tf b/examples/resources/catalystcenter_security_rogue_additional_details_count/resource.tf new file mode 100644 index 0000000..340313d --- /dev/null +++ b/examples/resources/catalystcenter_security_rogue_additional_details_count/resource.tf @@ -0,0 +1,16 @@ + +resource "catalystcenter_security_rogue_additional_details_count" "example" { + provider = meraki + parameters { + + end_time = 1609459200 + site_id = ["string"] + start_time = 1609459200 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_rogue_additional_details_count_example" { + value = catalystcenter_security_rogue_additional_details_count.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_rogue_wireless_containment_start/resource.tf b/examples/resources/catalystcenter_security_rogue_wireless_containment_start/resource.tf new file mode 100644 index 0000000..f2340ab --- /dev/null +++ b/examples/resources/catalystcenter_security_rogue_wireless_containment_start/resource.tf @@ -0,0 +1,13 @@ + +resource "catalystcenter_security_rogue_wireless_containment_start" "example" { + provider = meraki + parameters { + + mac_address = "string" + type = 1 + } +} + +output "catalystcenter_security_rogue_wireless_containment_start_example" { + value = catalystcenter_security_rogue_wireless_containment_start.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_rogue_wireless_containment_stop/resource.tf b/examples/resources/catalystcenter_security_rogue_wireless_containment_stop/resource.tf new file mode 100644 index 0000000..9eca060 --- /dev/null +++ b/examples/resources/catalystcenter_security_rogue_wireless_containment_stop/resource.tf @@ -0,0 +1,14 @@ + +resource "catalystcenter_security_rogue_wireless_containment_stop" "example" { + provider = meraki + parameters { + + mac_address = "string" + type = 1 + wlc_ip = "string" + } +} + +output "catalystcenter_security_rogue_wireless_containment_stop_example" { + value = catalystcenter_security_rogue_wireless_containment_stop.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_threats_details/resource.tf b/examples/resources/catalystcenter_security_threats_details/resource.tf new file mode 100644 index 0000000..132899e --- /dev/null +++ b/examples/resources/catalystcenter_security_threats_details/resource.tf @@ -0,0 +1,19 @@ + +resource "catalystcenter_security_threats_details" "example" { + provider = meraki + parameters { + + end_time = 1 + is_new_threat = "false" + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_threats_details_example" { + value = catalystcenter_security_threats_details.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_threats_details_count/resource.tf b/examples/resources/catalystcenter_security_threats_details_count/resource.tf new file mode 100644 index 0000000..72bbe17 --- /dev/null +++ b/examples/resources/catalystcenter_security_threats_details_count/resource.tf @@ -0,0 +1,19 @@ + +resource "catalystcenter_security_threats_details_count" "example" { + provider = meraki + parameters { + + end_time = 1 + is_new_threat = "false" + limit = 1 + offset = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_threats_details_count_example" { + value = catalystcenter_security_threats_details_count.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_threats_rogue_allowed_list/import.sh b/examples/resources/catalystcenter_security_threats_rogue_allowed_list/import.sh new file mode 100644 index 0000000..8a12b3e --- /dev/null +++ b/examples/resources/catalystcenter_security_threats_rogue_allowed_list/import.sh @@ -0,0 +1 @@ +terraform import catalystcenter_security_threats_rogue_allowed_list.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_threats_rogue_allowed_list/resource.tf b/examples/resources/catalystcenter_security_threats_rogue_allowed_list/resource.tf new file mode 100644 index 0000000..a7c953c --- /dev/null +++ b/examples/resources/catalystcenter_security_threats_rogue_allowed_list/resource.tf @@ -0,0 +1,14 @@ + +resource "catalystcenter_security_threats_rogue_allowed_list" "example" { + provider = catalystcenter + + parameters { + + category = 1 + mac_address = "string" + } +} + +output "catalystcenter_security_threats_rogue_allowed_list_example" { + value = catalystcenter_security_threats_rogue_allowed_list.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_security_threats_summary/resource.tf b/examples/resources/catalystcenter_security_threats_summary/resource.tf new file mode 100644 index 0000000..7439c76 --- /dev/null +++ b/examples/resources/catalystcenter_security_threats_summary/resource.tf @@ -0,0 +1,16 @@ + +resource "catalystcenter_security_threats_summary" "example" { + provider = meraki + parameters { + + end_time = 1 + site_id = ["string"] + start_time = 1 + threat_level = ["string"] + threat_type = ["string"] + } +} + +output "catalystcenter_security_threats_summary_example" { + value = catalystcenter_security_threats_summary.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_sensor/resource.tf b/examples/resources/catalystcenter_sensor/resource.tf index dc1610d..0225124 100644 --- a/examples/resources/catalystcenter_sensor/resource.tf +++ b/examples/resources/catalystcenter_sensor/resource.tf @@ -1,7 +1,28 @@ resource "catalystcenter_sensor" "example" { provider = catalystcenter + item { + + + + + + + + + + ssh { + + + + + + } + + + + } parameters { ap_coverage { @@ -119,7 +140,7 @@ resource "catalystcenter_sensor" "example" { switch_serial_number = "string" switch_uuid = "string" target_a_ps = ["string"] - test_mac_addresses = "string" + test_mac_addresses = "------" wired_application_message = "string" wired_application_status = "string" xor_sensor = "false" diff --git a/examples/resources/catalystcenter_sensor_test_create/resource.tf b/examples/resources/catalystcenter_sensor_test_create/resource.tf index f3fe6ff..7b3aa19 100644 --- a/examples/resources/catalystcenter_sensor_test_create/resource.tf +++ b/examples/resources/catalystcenter_sensor_test_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sensor_test_create" "example" { - provider = catalystcenter + provider = meraki parameters { ap_coverage { @@ -118,7 +118,7 @@ resource "catalystcenter_sensor_test_create" "example" { switch_serial_number = "string" switch_uuid = "string" target_a_ps = ["string"] - test_mac_addresses = "string" + test_mac_addresses = "------" wired_application_message = "string" wired_application_status = "string" xor_sensor = "false" diff --git a/examples/resources/catalystcenter_sensor_test_run/resource.tf b/examples/resources/catalystcenter_sensor_test_run/resource.tf index c249889..e2aa52e 100644 --- a/examples/resources/catalystcenter_sensor_test_run/resource.tf +++ b/examples/resources/catalystcenter_sensor_test_run/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sensor_test_run" "example" { - provider = catalystcenter + provider = meraki parameters { template_name = "string" diff --git a/examples/resources/catalystcenter_sensor_test_template_duplicate/resource.tf b/examples/resources/catalystcenter_sensor_test_template_duplicate/resource.tf index 605699f..b79a173 100644 --- a/examples/resources/catalystcenter_sensor_test_template_duplicate/resource.tf +++ b/examples/resources/catalystcenter_sensor_test_template_duplicate/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sensor_test_template_duplicate" "example" { - provider = catalystcenter + provider = meraki parameters { new_template_name = "string" diff --git a/examples/resources/catalystcenter_sensor_test_template_edit/resource.tf b/examples/resources/catalystcenter_sensor_test_template_edit/resource.tf index 5430b45..97111dd 100644 --- a/examples/resources/catalystcenter_sensor_test_template_edit/resource.tf +++ b/examples/resources/catalystcenter_sensor_test_template_edit/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sensor_test_template_edit" "example" { - provider = catalystcenter + provider = meraki parameters { id = "string" @@ -132,7 +132,7 @@ resource "catalystcenter_sensor_test_template_edit" "example" { switch_serial_number = "string" switch_uuid = "string" target_a_ps = ["string"] - test_mac_addresses = "string" + test_mac_addresses = "------" wired_application_message = "string" wired_application_status = "string" xor_sensor = "false" diff --git a/examples/resources/catalystcenter_site_assign_credential/resource.tf b/examples/resources/catalystcenter_site_assign_credential/resource.tf index b18e84e..4e63c25 100644 --- a/examples/resources/catalystcenter_site_assign_credential/resource.tf +++ b/examples/resources/catalystcenter_site_assign_credential/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_site_assign_credential" "example" { - provider = catalystcenter + provider = meraki site_id = "string" parameters { diff --git a/examples/resources/catalystcenter_site_health_summaries_summary_analytics/import.sh b/examples/resources/catalystcenter_site_health_summaries_summary_analytics/import.sh deleted file mode 100644 index f75393e..0000000 --- a/examples/resources/catalystcenter_site_health_summaries_summary_analytics/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_site_health_summaries_summary_analytics.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_site_health_summaries_summary_analytics/resource.tf b/examples/resources/catalystcenter_site_health_summaries_summary_analytics/resource.tf deleted file mode 100644 index 4d4f60f..0000000 --- a/examples/resources/catalystcenter_site_health_summaries_summary_analytics/resource.tf +++ /dev/null @@ -1,15 +0,0 @@ - -resource "catalystcenter_site_health_summaries_summary_analytics" "example" { - provider = catalystcenter - parameters { - - attributes = ["string"] - end_time = 1 - start_time = 1 - views = ["string"] - } -} - -output "catalystcenter_site_health_summaries_summary_analytics_example" { - value = catalystcenter_site_health_summaries_summary_analytics.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_site_health_summaries_summary_analytics_create/resource.tf b/examples/resources/catalystcenter_site_health_summaries_summary_analytics_create/resource.tf index fb2a52b..5b793b0 100644 --- a/examples/resources/catalystcenter_site_health_summaries_summary_analytics_create/resource.tf +++ b/examples/resources/catalystcenter_site_health_summaries_summary_analytics_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_site_health_summaries_summary_analytics_create" "example" { - provider = catalystcenter + provider = meraki id = "string" site_hierarchy = "string" site_hierarchy_id = "string" diff --git a/examples/resources/catalystcenter_sites_bulk/resource.tf b/examples/resources/catalystcenter_sites_bulk/resource.tf index c402b20..35b61d3 100644 --- a/examples/resources/catalystcenter_sites_bulk/resource.tf +++ b/examples/resources/catalystcenter_sites_bulk/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sites_bulk" "example" { - provider = catalystcenter + provider = meraki parameters { address = "string" diff --git a/examples/resources/catalystcenter_sites_device_credentials/resource.tf b/examples/resources/catalystcenter_sites_device_credentials/resource.tf index 569bee4..4438bea 100644 --- a/examples/resources/catalystcenter_sites_device_credentials/resource.tf +++ b/examples/resources/catalystcenter_sites_device_credentials/resource.tf @@ -1,6 +1,7 @@ resource "catalystcenter_sites_device_credentials" "example" { provider = catalystcenter + parameters { cli_credentials_id { diff --git a/examples/resources/catalystcenter_sites_device_credentials_apply/resource.tf b/examples/resources/catalystcenter_sites_device_credentials_apply/resource.tf index 5473ec8..868b4ca 100644 --- a/examples/resources/catalystcenter_sites_device_credentials_apply/resource.tf +++ b/examples/resources/catalystcenter_sites_device_credentials_apply/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sites_device_credentials_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_credential_id = "string" diff --git a/examples/resources/catalystcenter_sp_profile_delete_v2/resource.tf b/examples/resources/catalystcenter_sp_profile_delete_v2/resource.tf index 75c2021..5b1dfa8 100644 --- a/examples/resources/catalystcenter_sp_profile_delete_v2/resource.tf +++ b/examples/resources/catalystcenter_sp_profile_delete_v2/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_sp_profile_delete_v2" "example" { - provider = catalystcenter + provider = meraki sp_profile_name = "string" parameters { diff --git a/examples/resources/catalystcenter_swim_image_file/resource.tf b/examples/resources/catalystcenter_swim_image_file/resource.tf index c6f1297..b427de2 100644 --- a/examples/resources/catalystcenter_swim_image_file/resource.tf +++ b/examples/resources/catalystcenter_swim_image_file/resource.tf @@ -1,8 +1,6 @@ resource "catalystcenter_swim_image_file" "example" { - provider = catalystcenter - file_name = "string" - file_path = "string" + provider = meraki is_third_party = "false" third_party_application_type = "string" third_party_image_family = "string" diff --git a/examples/resources/catalystcenter_swim_image_url/resource.tf b/examples/resources/catalystcenter_swim_image_url/resource.tf index eb2855c..78e808c 100644 --- a/examples/resources/catalystcenter_swim_image_url/resource.tf +++ b/examples/resources/catalystcenter_swim_image_url/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_swim_image_url" "example" { - provider = catalystcenter + provider = meraki schedule_at = "string" schedule_desc = "string" schedule_origin = "string" diff --git a/examples/resources/catalystcenter_tags_interfaces_members_associations_query/resource.tf b/examples/resources/catalystcenter_tags_interfaces_members_associations_query/resource.tf new file mode 100644 index 0000000..3dff315 --- /dev/null +++ b/examples/resources/catalystcenter_tags_interfaces_members_associations_query/resource.tf @@ -0,0 +1,12 @@ + +resource "catalystcenter_tags_interfaces_members_associations_query" "example" { + provider = meraki + parameters { + + ids = ["string"] + } +} + +output "catalystcenter_tags_interfaces_members_associations_query_example" { + value = catalystcenter_tags_interfaces_members_associations_query.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_tags_network_devices_members_associations_query/resource.tf b/examples/resources/catalystcenter_tags_network_devices_members_associations_query/resource.tf new file mode 100644 index 0000000..975e6d0 --- /dev/null +++ b/examples/resources/catalystcenter_tags_network_devices_members_associations_query/resource.tf @@ -0,0 +1,12 @@ + +resource "catalystcenter_tags_network_devices_members_associations_query" "example" { + provider = meraki + parameters { + + ids = ["string"] + } +} + +output "catalystcenter_tags_network_devices_members_associations_query_example" { + value = catalystcenter_tags_network_devices_members_associations_query.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_telemetry_settings_apply/resource.tf b/examples/resources/catalystcenter_telemetry_settings_apply/resource.tf index ec5af70..58e022f 100644 --- a/examples/resources/catalystcenter_telemetry_settings_apply/resource.tf +++ b/examples/resources/catalystcenter_telemetry_settings_apply/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_telemetry_settings_apply" "example" { - provider = catalystcenter + provider = meraki parameters { device_ids = ["string"] diff --git a/examples/resources/catalystcenter_template_preview/resource.tf b/examples/resources/catalystcenter_template_preview/resource.tf index 86df752..0eed8f0 100644 --- a/examples/resources/catalystcenter_template_preview/resource.tf +++ b/examples/resources/catalystcenter_template_preview/resource.tf @@ -1,11 +1,11 @@ resource "catalystcenter_template_preview" "example" { - provider = catalystcenter + provider = meraki parameters { device_id = "string" - params = "string" - resource_params = "string" + params = "------" + resource_params = "------" template_id = "string" } } diff --git a/examples/resources/catalystcenter_trusted_certificates_import/resource.tf b/examples/resources/catalystcenter_trusted_certificates_import/resource.tf index a5a3e18..65f1cce 100644 --- a/examples/resources/catalystcenter_trusted_certificates_import/resource.tf +++ b/examples/resources/catalystcenter_trusted_certificates_import/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_trusted_certificates_import" "example" { - provider = catalystcenter + provider = meraki } output "catalystcenter_trusted_certificates_import_example" { diff --git a/examples/resources/catalystcenter_users_external_authentication/import.sh b/examples/resources/catalystcenter_users_external_authentication/import.sh deleted file mode 100644 index b962d5b..0000000 --- a/examples/resources/catalystcenter_users_external_authentication/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import catalystcenter_users_external_authentication.example "id:=string" \ No newline at end of file diff --git a/examples/resources/catalystcenter_users_external_authentication/resource.tf b/examples/resources/catalystcenter_users_external_authentication/resource.tf deleted file mode 100644 index a81c1fe..0000000 --- a/examples/resources/catalystcenter_users_external_authentication/resource.tf +++ /dev/null @@ -1,9 +0,0 @@ - -resource "catalystcenter_users_external_authentication" "example" { - provider = catalystcenter - -} - -output "catalystcenter_users_external_authentication_example" { - value = catalystcenter_users_external_authentication.example -} \ No newline at end of file diff --git a/examples/resources/catalystcenter_users_external_authentication_create/resource.tf b/examples/resources/catalystcenter_users_external_authentication_create/resource.tf index f1805f6..e578e30 100644 --- a/examples/resources/catalystcenter_users_external_authentication_create/resource.tf +++ b/examples/resources/catalystcenter_users_external_authentication_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_users_external_authentication_create" "example" { - provider = catalystcenter + provider = meraki parameters { enable = "false" diff --git a/examples/resources/catalystcenter_users_external_servers_aaa_attribute/resource.tf b/examples/resources/catalystcenter_users_external_servers_aaa_attribute/resource.tf index 9ba2396..6b24f68 100644 --- a/examples/resources/catalystcenter_users_external_servers_aaa_attribute/resource.tf +++ b/examples/resources/catalystcenter_users_external_servers_aaa_attribute/resource.tf @@ -2,6 +2,11 @@ resource "catalystcenter_users_external_servers_aaa_attribute" "example" { provider = catalystcenter + + parameters { + + attribute_name = "string" + } } output "catalystcenter_users_external_servers_aaa_attribute_example" { diff --git a/examples/resources/catalystcenter_wireless_accespoint_configuration/resource.tf b/examples/resources/catalystcenter_wireless_accespoint_configuration/resource.tf index 62f4a74..4f0c88d 100644 --- a/examples/resources/catalystcenter_wireless_accespoint_configuration/resource.tf +++ b/examples/resources/catalystcenter_wireless_accespoint_configuration/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_accespoint_configuration" "example" { - provider = catalystcenter + provider = meraki parameters { admin_status = "false" diff --git a/examples/resources/catalystcenter_wireless_accespoint_configuration_v2/resource.tf b/examples/resources/catalystcenter_wireless_accespoint_configuration_v2/resource.tf new file mode 100644 index 0000000..ea9b865 --- /dev/null +++ b/examples/resources/catalystcenter_wireless_accespoint_configuration_v2/resource.tf @@ -0,0 +1,75 @@ + +resource "catalystcenter_wireless_accespoint_configuration_v2" "example" { + provider = meraki + parameters { + + admin_status = "false" + ap_list { + + ap_name = "string" + ap_name_new = "string" + mac_address = "string" + } + ap_mode = 1 + clean_air_s_i24 = "false" + clean_air_s_i5 = "false" + clean_air_s_i6 = "false" + configure_admin_status = "false" + configure_ap_mode = "false" + configure_clean_air_s_i24_ghz = "false" + configure_clean_air_s_i5_ghz = "false" + configure_clean_air_s_i6_ghz = "false" + configure_failover_priority = "false" + configure_hacontroller = "false" + configure_led_brightness_level = "false" + configure_led_status = "false" + configure_location = "false" + failover_priority = 1 + is_assigned_site_as_location = "false" + led_brightness_level = 1 + led_status = "false" + location = "string" + primary_controller_name = "string" + primary_ip_address { + + address = "string" + } + radio_configurations { + + admin_status = "false" + antenna_cable_name = "string" + antenna_gain = 1 + antenna_pattern_name = "string" + cable_loss = 1.0 + channel_assignment_mode = 1 + channel_number = 1 + channel_width = 1 + configure_admin_status = "false" + configure_antenna_cable = "false" + configure_antenna_pattern_name = "false" + configure_channel = "false" + configure_channel_width = "false" + configure_power = "false" + configure_radio_role_assignment = "false" + power_assignment_mode = 1 + powerlevel = 1 + radio_band = "string" + radio_role_assignment = "string" + radio_type = 1 + } + secondary_controller_name = "string" + secondary_ip_address { + + address = "string" + } + tertiary_controller_name = "string" + tertiary_ip_address { + + address = "string" + } + } +} + +output "catalystcenter_wireless_accespoint_configuration_v2_example" { + value = catalystcenter_wireless_accespoint_configuration_v2.example +} \ No newline at end of file diff --git a/examples/resources/catalystcenter_wireless_access_points_factory_reset_request_provision/resource.tf b/examples/resources/catalystcenter_wireless_access_points_factory_reset_request_provision/resource.tf index 9f378bd..48113bb 100644 --- a/examples/resources/catalystcenter_wireless_access_points_factory_reset_request_provision/resource.tf +++ b/examples/resources/catalystcenter_wireless_access_points_factory_reset_request_provision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_access_points_factory_reset_request_provision" "example" { - provider = catalystcenter + provider = meraki parameters { ap_mac_addresses = ["string"] diff --git a/examples/resources/catalystcenter_wireless_access_points_provision/resource.tf b/examples/resources/catalystcenter_wireless_access_points_provision/resource.tf index 9e1df13..fae8777 100644 --- a/examples/resources/catalystcenter_wireless_access_points_provision/resource.tf +++ b/examples/resources/catalystcenter_wireless_access_points_provision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_access_points_provision" "example" { - provider = catalystcenter + provider = meraki parameters { ap_zone_name = "string" diff --git a/examples/resources/catalystcenter_wireless_accesspoint_configuration_create/resource.tf b/examples/resources/catalystcenter_wireless_accesspoint_configuration_create/resource.tf index 6e65d94..c301b80 100644 --- a/examples/resources/catalystcenter_wireless_accesspoint_configuration_create/resource.tf +++ b/examples/resources/catalystcenter_wireless_accesspoint_configuration_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_accesspoint_configuration_create" "example" { - provider = catalystcenter + provider = meraki parameters { admin_status = "false" diff --git a/examples/resources/catalystcenter_wireless_controllers_assign_managed_ap_locations/resource.tf b/examples/resources/catalystcenter_wireless_controllers_assign_managed_ap_locations/resource.tf index 9b28683..28f9a18 100644 --- a/examples/resources/catalystcenter_wireless_controllers_assign_managed_ap_locations/resource.tf +++ b/examples/resources/catalystcenter_wireless_controllers_assign_managed_ap_locations/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_controllers_assign_managed_ap_locations" "example" { - provider = catalystcenter + provider = meraki device_id = "string" parameters { diff --git a/examples/resources/catalystcenter_wireless_controllers_provision/resource.tf b/examples/resources/catalystcenter_wireless_controllers_provision/resource.tf index 6236375..cf9671e 100644 --- a/examples/resources/catalystcenter_wireless_controllers_provision/resource.tf +++ b/examples/resources/catalystcenter_wireless_controllers_provision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_controllers_provision" "example" { - provider = catalystcenter + provider = meraki device_id = "string" parameters { diff --git a/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision/resource.tf b/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision/resource.tf index 315b72f..b6a8c54 100644 --- a/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision/resource.tf +++ b/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_provision" "example" { - provider = catalystcenter + provider = meraki parameters { data_link_encryption = "false" diff --git a/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset/resource.tf b/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset/resource.tf index 4689d45..336f718 100644 --- a/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset/resource.tf +++ b/examples/resources/catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_controllers_wireless_mobility_groups_mobility_reset" "example" { - provider = catalystcenter + provider = meraki parameters { network_device_id = "string" diff --git a/examples/resources/catalystcenter_wireless_provision_access_point/resource.tf b/examples/resources/catalystcenter_wireless_provision_access_point/resource.tf index 77010ab..ab40908 100644 --- a/examples/resources/catalystcenter_wireless_provision_access_point/resource.tf +++ b/examples/resources/catalystcenter_wireless_provision_access_point/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_provision_access_point" "example" { - provider = catalystcenter + provider = meraki parameters { custom_ap_group_name = "string" diff --git a/examples/resources/catalystcenter_wireless_provision_device_create/resource.tf b/examples/resources/catalystcenter_wireless_provision_device_create/resource.tf index 1de7745..5563002 100644 --- a/examples/resources/catalystcenter_wireless_provision_device_create/resource.tf +++ b/examples/resources/catalystcenter_wireless_provision_device_create/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_provision_device_create" "example" { - provider = catalystcenter + provider = meraki parameters { device_name = "string" diff --git a/examples/resources/catalystcenter_wireless_provision_device_update/resource.tf b/examples/resources/catalystcenter_wireless_provision_device_update/resource.tf index b8b94a9..6c2d08e 100644 --- a/examples/resources/catalystcenter_wireless_provision_device_update/resource.tf +++ b/examples/resources/catalystcenter_wireless_provision_device_update/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_provision_device_update" "example" { - provider = catalystcenter + provider = meraki parameters { device_name = "string" diff --git a/examples/resources/catalystcenter_wireless_provision_ssid_create_provision/resource.tf b/examples/resources/catalystcenter_wireless_provision_ssid_create_provision/resource.tf index d10e6d8..2f7f741 100644 --- a/examples/resources/catalystcenter_wireless_provision_ssid_create_provision/resource.tf +++ b/examples/resources/catalystcenter_wireless_provision_ssid_create_provision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_provision_ssid_create_provision" "example" { - provider = catalystcenter + provider = meraki parameters { enable_fabric = "false" diff --git a/examples/resources/catalystcenter_wireless_provision_ssid_delete_reprovision/resource.tf b/examples/resources/catalystcenter_wireless_provision_ssid_delete_reprovision/resource.tf index beff353..5e186bc 100644 --- a/examples/resources/catalystcenter_wireless_provision_ssid_delete_reprovision/resource.tf +++ b/examples/resources/catalystcenter_wireless_provision_ssid_delete_reprovision/resource.tf @@ -1,6 +1,6 @@ resource "catalystcenter_wireless_provision_ssid_delete_reprovision" "example" { - provider = catalystcenter + provider = meraki managed_aplocations = "string" ssid_name = "string" parameters { diff --git a/examples/samples/resources/catalystcenter_applications/main.tf b/examples/samples/resources/catalystcenter_applications/main.tf index ce28d93..ec7d041 100644 --- a/examples/samples/resources/catalystcenter_applications/main.tf +++ b/examples/samples/resources/catalystcenter_applications/main.tf @@ -13,7 +13,7 @@ provider "catalystcenter" { debug = "true" } -resource "catalystcenter_applications" "example" { +resource "catalystcenter_applications_v2" "example" { provider = catalystcenter parameters { payload { @@ -32,7 +32,7 @@ resource "catalystcenter_applications" "example" { engine_id = "3" help_string = "qmqp" id = "96b555f2-bf7b-41aa-a569-c26d3d3f68d9" - ignore_conflict = "string" + ignore_conflict = "true" long_description = "Quick Mail Queuing Protocol (QMQP) is a network protocol designed to share e-mail queues between several hosts. It is designed and implemented in qmail." name = "qmqp" popularity = 777 @@ -113,6 +113,6 @@ resource "catalystcenter_applications" "example" { } } -output "catalystcenter_applications_example" { - value = catalystcenter_applications.example -} +# output "catalystcenter_applications_example" { +# value = catalystcenter_applications.example +# } diff --git a/examples/samples/resources/catalystcenter_sda_fabric_sites/resource.tf b/examples/samples/resources/catalystcenter_sda_fabric_sites/resource.tf index 4d05565..9df6e98 100644 --- a/examples/samples/resources/catalystcenter_sda_fabric_sites/resource.tf +++ b/examples/samples/resources/catalystcenter_sda_fabric_sites/resource.tf @@ -12,10 +12,10 @@ resource "catalystcenter_sda_fabric_sites" "example" { parameters { payload { - authentication_profile_name = "string" + authentication_profile_name = "string" id = "string" is_pub_sub_enabled = "false" - site_id = "string" + site_id = "string" } } } diff --git a/go.mod b/go.mod index 840bc17..9874cef 100644 --- a/go.mod +++ b/go.mod @@ -76,6 +76,6 @@ require ( ) require ( - github.com/cisco-en-programmability/catalystcenter-go-sdk v1.0.0 + github.com/cisco-en-programmability/catalystcenter-go-sdk v1.0.2 github.com/mattn/go-isatty v0.0.19 // indirect ) diff --git a/go.sum b/go.sum index 33faaa4..9d6f12b 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cisco-en-programmability/catalystcenter-go-sdk v1.0.0 h1:3FT/675bBANmFvGsg8fPw0KtZAk4ovhTuSwwIliTuvw= -github.com/cisco-en-programmability/catalystcenter-go-sdk v1.0.0/go.mod h1:Xrq1NUEpypDkyqZBT67zgtfbKP9TEGP/UFor4rKBgqE= +github.com/cisco-en-programmability/catalystcenter-go-sdk v1.0.2 h1:49DGY6Ti43C7AIQ9GxWv3yLU0B3XpDdsBiBFG/BNgRc= +github.com/cisco-en-programmability/catalystcenter-go-sdk v1.0.2/go.mod h1:Xrq1NUEpypDkyqZBT67zgtfbKP9TEGP/UFor4rKBgqE= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE= github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=