From 8855e37ad2b25b07c11729d71d7e11183da61190 Mon Sep 17 00:00:00 2001 From: benbuchanan <49174271+benbuchanan@users.noreply.github.com> Date: Thu, 21 Mar 2024 02:37:24 -0400 Subject: [PATCH] fix(CatalogManagement): Bump Go SDK to v0.61.2, remove catalog syndication (#5219) * fix(CatalogManagement): bump go sdk version to 0.61.2, fix catalog errors * fix(CatalogManagement): remove catalog syndication from docs --- examples/ibm-catalog-management/README.md | 2 - go.mod | 2 +- go.sum | 4 +- .../data_source_ibm_cm_catalog.go | 253 ------------ .../resource_ibm_cm_catalog.go | 364 ------------------ metadata/provider_metadata.json | 328 ---------------- website/docs/d/cm_catalog.html.markdown | 30 -- 7 files changed, 3 insertions(+), 980 deletions(-) diff --git a/examples/ibm-catalog-management/README.md b/examples/ibm-catalog-management/README.md index 3de6ee97e3..ca3ed6d95e 100644 --- a/examples/ibm-catalog-management/README.md +++ b/examples/ibm-catalog-management/README.md @@ -39,7 +39,6 @@ resource "ibm_cm_catalog" "cm_catalog_instance" { resource_group_id = var.cm_catalog_resource_group_id owning_account = var.cm_catalog_owning_account catalog_filters = var.cm_catalog_catalog_filters - syndication_settings = var.cm_catalog_syndication_settings kind = var.cm_catalog_kind metadata = var.cm_catalog_metadata } @@ -225,7 +224,6 @@ data "cm_offering_instance" "cm_offering_instance_instance" { | resource_group_id | Resource group id the catalog is owned by. | `string` | false | | owning_account | Account that owns catalog. | `string` | false | | catalog_filters | Filters for account and catalog filters. | `` | false | -| syndication_settings | Feature information. | `` | false | | kind | Kind of catalog. Supported kinds are offering and vpe. | `string` | false | | metadata | Catalog specific metadata. | `map()` | false | | catalog_id | Catalog identifier. | `string` | true | diff --git a/go.mod b/go.mod index d3aac097b0..0562e6351c 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta github.com/IBM/keyprotect-go-client v0.12.2 github.com/IBM/networking-go-sdk v0.45.0 - github.com/IBM/platform-services-go-sdk v0.60.0 + github.com/IBM/platform-services-go-sdk v0.61.2 github.com/IBM/project-go-sdk v0.2.1 github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 github.com/IBM/scc-go-sdk/v5 v5.1.5 diff --git a/go.sum b/go.sum index 373f2c44be..6c1f7a7906 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,8 @@ github.com/IBM/mqcloud-go-sdk v0.0.4 h1:gqMpoU5a0qJ0GETG4PQrkgeEEoaQLvbxRJnEe6yt github.com/IBM/mqcloud-go-sdk v0.0.4/go.mod h1:gQptHC6D+rxfg0muRFFGvTDmvl4YfiDE0uXkaRRewRk= github.com/IBM/networking-go-sdk v0.45.0 h1:tYgDhVDpgKvELNY7tcodbZ4ny9fatpEWM6PwtQcDe20= github.com/IBM/networking-go-sdk v0.45.0/go.mod h1:NnJPA1e5GWr5opJe+5Hs6e1G6RcBIFz64TrkZsdnSp8= -github.com/IBM/platform-services-go-sdk v0.60.0 h1:DXCp5hAtFO6quUmb5qKeosQw0ln/fYE5nrKjgXbiSBU= -github.com/IBM/platform-services-go-sdk v0.60.0/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE= +github.com/IBM/platform-services-go-sdk v0.61.2 h1:yQ7sBmowpxlyKPRZChFBqlGn1nZO7ScPc6QqjUDdbYA= +github.com/IBM/platform-services-go-sdk v0.61.2/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE= github.com/IBM/project-go-sdk v0.2.1 h1:Xo7ITrfyfVm0eCsaC2SADlhcEjqjx9rtU37fwnzGMCI= github.com/IBM/project-go-sdk v0.2.1/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig= github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4= diff --git a/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go b/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go index 066bbcab4d..c534c98770 100644 --- a/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go +++ b/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go @@ -220,155 +220,6 @@ func DataSourceIBMCmCatalog() *schema.Resource { }, }, }, - "syndication_settings": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Feature information.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "remove_related_components": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Remove related components.", - }, - "clusters": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Syndication clusters.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster region.", - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster ID.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster name.", - }, - "resource_group_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Resource group ID.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Syndication type.", - }, - "namespaces": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Syndicated namespaces.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "all_namespaces": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Syndicated to all namespaces on cluster.", - }, - }, - }, - }, - "history": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Feature information.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "namespaces": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Array of syndicated namespaces.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "clusters": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Array of syndicated namespaces.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster region.", - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster ID.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster name.", - }, - "resource_group_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Resource group ID.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Syndication type.", - }, - "namespaces": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Syndicated namespaces.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "all_namespaces": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Syndicated to all namespaces on cluster.", - }, - }, - }, - }, - "last_run": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Date and time last syndicated.", - }, - }, - }, - }, - "authorization": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Feature information.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "token": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Array of syndicated namespaces.", - }, - "last_run": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Date and time last updated.", - }, - }, - }, - }, - }, - }, - }, "kind": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -563,18 +414,6 @@ func dataSourceIBMCmCatalogRead(context context.Context, d *schema.ResourceData, return diag.FromErr(fmt.Errorf("Error setting catalog_filters %s", err)) } - syndicationSettings := []map[string]interface{}{} - if catalog.SyndicationSettings != nil { - modelMap, err := dataSourceIBMCmCatalogSyndicationResourceToMap(catalog.SyndicationSettings) - if err != nil { - return diag.FromErr(err) - } - syndicationSettings = append(syndicationSettings, modelMap) - } - if err = d.Set("syndication_settings", syndicationSettings); err != nil { - return diag.FromErr(fmt.Errorf("Error setting syndication_settings %s", err)) - } - if err = d.Set("kind", catalog.Kind); err != nil { return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) } @@ -695,95 +534,3 @@ func dataSourceIBMCmCatalogIDFilterToMap(model *catalogmanagementv1.IDFilter) (m } return modelMap, nil } - -func dataSourceIBMCmCatalogSyndicationResourceToMap(model *catalogmanagementv1.SyndicationResource) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.RemoveRelatedComponents != nil { - modelMap["remove_related_components"] = *model.RemoveRelatedComponents - } - if model.Clusters != nil { - clusters := []map[string]interface{}{} - for _, clustersItem := range model.Clusters { - clustersItemMap, err := dataSourceIBMCmCatalogSyndicationClusterToMap(&clustersItem) - if err != nil { - return modelMap, err - } - clusters = append(clusters, clustersItemMap) - } - modelMap["clusters"] = clusters - } - if model.History != nil { - historyMap, err := dataSourceIBMCmCatalogSyndicationHistoryToMap(model.History) - if err != nil { - return modelMap, err - } - modelMap["history"] = []map[string]interface{}{historyMap} - } - if model.Authorization != nil { - authorizationMap, err := dataSourceIBMCmCatalogSyndicationAuthorizationToMap(model.Authorization) - if err != nil { - return modelMap, err - } - modelMap["authorization"] = []map[string]interface{}{authorizationMap} - } - return modelMap, nil -} - -func dataSourceIBMCmCatalogSyndicationClusterToMap(model *catalogmanagementv1.SyndicationCluster) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Region != nil { - modelMap["region"] = *model.Region - } - if model.ID != nil { - modelMap["id"] = *model.ID - } - if model.Name != nil { - modelMap["name"] = *model.Name - } - if model.ResourceGroupName != nil { - modelMap["resource_group_name"] = *model.ResourceGroupName - } - if model.Type != nil { - modelMap["type"] = *model.Type - } - if model.Namespaces != nil { - modelMap["namespaces"] = model.Namespaces - } - if model.AllNamespaces != nil { - modelMap["all_namespaces"] = *model.AllNamespaces - } - return modelMap, nil -} - -func dataSourceIBMCmCatalogSyndicationHistoryToMap(model *catalogmanagementv1.SyndicationHistory) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Namespaces != nil { - modelMap["namespaces"] = model.Namespaces - } - if model.Clusters != nil { - clusters := []map[string]interface{}{} - for _, clustersItem := range model.Clusters { - clustersItemMap, err := dataSourceIBMCmCatalogSyndicationClusterToMap(&clustersItem) - if err != nil { - return modelMap, err - } - clusters = append(clusters, clustersItemMap) - } - modelMap["clusters"] = clusters - } - if model.LastRun != nil { - modelMap["last_run"] = model.LastRun.String() - } - return modelMap, nil -} - -func dataSourceIBMCmCatalogSyndicationAuthorizationToMap(model *catalogmanagementv1.SyndicationAuthorization) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Token != nil { - modelMap["token"] = *model.Token - } - if model.LastRun != nil { - modelMap["last_run"] = model.LastRun.String() - } - return modelMap, nil -} diff --git a/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go b/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go index 00f52d04e9..188df0b1bf 100644 --- a/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go +++ b/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go @@ -174,151 +174,6 @@ func ResourceIBMCmCatalog() *schema.Resource { }, }, }, - "syndication_settings": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Feature information.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "remove_related_components": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Description: "Remove related components.", - }, - "clusters": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "Syndication clusters.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Cluster region.", - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Cluster ID.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Cluster name.", - }, - "resource_group_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Resource group ID.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Syndication type.", - }, - "namespaces": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "Syndicated namespaces.", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "all_namespaces": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Description: "Syndicated to all namespaces on cluster.", - }, - }, - }, - }, - "history": &schema.Schema{ - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Description: "Feature information.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "namespaces": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "Array of syndicated namespaces.", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "clusters": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "Array of syndicated namespaces.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Cluster region.", - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Cluster ID.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Cluster name.", - }, - "resource_group_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Resource group ID.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Syndication type.", - }, - "namespaces": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "Syndicated namespaces.", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "all_namespaces": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Description: "Syndicated to all namespaces on cluster.", - }, - }, - }, - }, - "last_run": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Date and time last syndicated.", - }, - }, - }, - }, - "authorization": &schema.Schema{ - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Description: "Feature information.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "token": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Array of syndicated namespaces.", - }, - "last_run": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Date and time last updated.", - }, - }, - }, - }, - }, - }, - }, "kind": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -476,13 +331,6 @@ func resourceIBMCmCatalogCreate(context context.Context, d *schema.ResourceData, } createCatalogOptions.SetCatalogFilters(catalogFiltersModel) } - if _, ok := d.GetOk("syndication_settings"); ok { - syndicationSettingsModel, err := resourceIBMCmCatalogMapToSyndicationResource(d.Get("syndication_settings.0").(map[string]interface{})) - if err != nil { - return diag.FromErr(err) - } - createCatalogOptions.SetSyndicationSettings(syndicationSettingsModel) - } if _, ok := d.GetOk("kind"); ok { createCatalogOptions.SetKind(d.Get("kind").(string)) } @@ -580,15 +428,6 @@ func resourceIBMCmCatalogRead(context context.Context, d *schema.ResourceData, m return diag.FromErr(fmt.Errorf("Error setting catalog_filters: %s", err)) } } - if catalog.SyndicationSettings != nil { - syndicationSettingsMap, err := resourceIBMCmCatalogSyndicationResourceToMap(catalog.SyndicationSettings) - if err != nil { - return diag.FromErr(err) - } - if err = d.Set("syndication_settings", []map[string]interface{}{syndicationSettingsMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting syndication_settings: %s", err)) - } - } if err = d.Set("kind", catalog.Kind); err != nil { return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) } @@ -694,13 +533,6 @@ func resourceIBMCmCatalogUpdate(context context.Context, d *schema.ResourceData, } replaceCatalogOptions.SetCatalogFilters(catalogFilters) } - if _, ok := d.GetOk("syndication_settings"); ok { - syndicationSettings, err := resourceIBMCmCatalogMapToSyndicationResource(d.Get("syndication_settings.0").(map[string]interface{})) - if err != nil { - return diag.FromErr(err) - } - replaceCatalogOptions.SetSyndicationSettings(syndicationSettings) - } if _, ok := d.GetOk("kind"); ok { replaceCatalogOptions.SetKind(d.Get("kind").(string)) } @@ -873,110 +705,6 @@ func resourceIBMCmCatalogMapToIDFilter(modelMap map[string]interface{}) (*catalo return model, nil } -func resourceIBMCmCatalogMapToSyndicationResource(modelMap map[string]interface{}) (*catalogmanagementv1.SyndicationResource, error) { - model := &catalogmanagementv1.SyndicationResource{} - if modelMap["remove_related_components"] != nil { - model.RemoveRelatedComponents = core.BoolPtr(modelMap["remove_related_components"].(bool)) - } - if modelMap["clusters"] != nil { - clusters := []catalogmanagementv1.SyndicationCluster{} - for _, clustersItem := range modelMap["clusters"].([]interface{}) { - clustersItemModel, err := resourceIBMCmCatalogMapToSyndicationCluster(clustersItem.(map[string]interface{})) - if err != nil { - return model, err - } - clusters = append(clusters, *clustersItemModel) - } - model.Clusters = clusters - } - if modelMap["history"] != nil && len(modelMap["history"].([]interface{})) > 0 { - var HistoryModel *catalogmanagementv1.SyndicationHistory - var err error - if modelMap["history"].([]interface{})[0] != nil { - HistoryModel, err = resourceIBMCmCatalogMapToSyndicationHistory(modelMap["history"].([]interface{})[0].(map[string]interface{})) - if err != nil { - return model, err - } - } - model.History = HistoryModel - } - if modelMap["authorization"] != nil && len(modelMap["authorization"].([]interface{})) > 0 { - AuthorizationModel, err := resourceIBMCmCatalogMapToSyndicationAuthorization(modelMap["authorization"].([]interface{})[0].(map[string]interface{})) - if err != nil { - return model, err - } - model.Authorization = AuthorizationModel - } - return model, nil -} - -func resourceIBMCmCatalogMapToSyndicationCluster(modelMap map[string]interface{}) (*catalogmanagementv1.SyndicationCluster, error) { - model := &catalogmanagementv1.SyndicationCluster{} - if modelMap["region"] != nil && modelMap["region"].(string) != "" { - model.Region = core.StringPtr(modelMap["region"].(string)) - } - if modelMap["id"] != nil && modelMap["id"].(string) != "" { - model.ID = core.StringPtr(modelMap["id"].(string)) - } - if modelMap["name"] != nil && modelMap["name"].(string) != "" { - model.Name = core.StringPtr(modelMap["name"].(string)) - } - if modelMap["resource_group_name"] != nil && modelMap["resource_group_name"].(string) != "" { - model.ResourceGroupName = core.StringPtr(modelMap["resource_group_name"].(string)) - } - if modelMap["type"] != nil && modelMap["type"].(string) != "" { - model.Type = core.StringPtr(modelMap["type"].(string)) - } - if modelMap["namespaces"] != nil { - namespaces := []string{} - for _, namespacesItem := range modelMap["namespaces"].([]interface{}) { - namespaces = append(namespaces, namespacesItem.(string)) - } - model.Namespaces = namespaces - } - if modelMap["all_namespaces"] != nil { - model.AllNamespaces = core.BoolPtr(modelMap["all_namespaces"].(bool)) - } - return model, nil -} - -func resourceIBMCmCatalogMapToSyndicationHistory(modelMap map[string]interface{}) (*catalogmanagementv1.SyndicationHistory, error) { - model := &catalogmanagementv1.SyndicationHistory{} - if modelMap["namespaces"] != nil { - namespaces := []string{} - for _, namespacesItem := range modelMap["namespaces"].([]interface{}) { - namespaces = append(namespaces, namespacesItem.(string)) - } - model.Namespaces = namespaces - } - if modelMap["clusters"] != nil { - clusters := []catalogmanagementv1.SyndicationCluster{} - for _, clustersItem := range modelMap["clusters"].([]interface{}) { - clustersItemModel, err := resourceIBMCmCatalogMapToSyndicationCluster(clustersItem.(map[string]interface{})) - if err != nil { - return model, err - } - clusters = append(clusters, *clustersItemModel) - } - model.Clusters = clusters - } - if modelMap["last_run"] != nil { - - } - return model, nil -} - -func resourceIBMCmCatalogMapToSyndicationAuthorization(modelMap map[string]interface{}) (*catalogmanagementv1.SyndicationAuthorization, error) { - model := &catalogmanagementv1.SyndicationAuthorization{} - if modelMap["token"] != nil && modelMap["token"].(string) != "" { - model.Token = core.StringPtr(modelMap["token"].(string)) - } - if modelMap["last_run"] != nil { - - } - return model, nil -} - func resourceIBMCmCatalogFeatureToMap(model *catalogmanagementv1.Feature) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) if model.Title != nil { @@ -1085,95 +813,3 @@ func resourceIBMCmCatalogIDFilterToMap(model *catalogmanagementv1.IDFilter) (map } return modelMap, nil } - -func resourceIBMCmCatalogSyndicationResourceToMap(model *catalogmanagementv1.SyndicationResource) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.RemoveRelatedComponents != nil { - modelMap["remove_related_components"] = model.RemoveRelatedComponents - } - if model.Clusters != nil { - clusters := []map[string]interface{}{} - for _, clustersItem := range model.Clusters { - clustersItemMap, err := resourceIBMCmCatalogSyndicationClusterToMap(&clustersItem) - if err != nil { - return modelMap, err - } - clusters = append(clusters, clustersItemMap) - } - modelMap["clusters"] = clusters - } - if model.History != nil { - historyMap, err := resourceIBMCmCatalogSyndicationHistoryToMap(model.History) - if err != nil { - return modelMap, err - } - modelMap["history"] = []map[string]interface{}{historyMap} - } - if model.Authorization != nil { - authorizationMap, err := resourceIBMCmCatalogSyndicationAuthorizationToMap(model.Authorization) - if err != nil { - return modelMap, err - } - modelMap["authorization"] = []map[string]interface{}{authorizationMap} - } - return modelMap, nil -} - -func resourceIBMCmCatalogSyndicationClusterToMap(model *catalogmanagementv1.SyndicationCluster) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Region != nil { - modelMap["region"] = model.Region - } - if model.ID != nil { - modelMap["id"] = model.ID - } - if model.Name != nil { - modelMap["name"] = model.Name - } - if model.ResourceGroupName != nil { - modelMap["resource_group_name"] = model.ResourceGroupName - } - if model.Type != nil { - modelMap["type"] = model.Type - } - if model.Namespaces != nil { - modelMap["namespaces"] = model.Namespaces - } - if model.AllNamespaces != nil { - modelMap["all_namespaces"] = model.AllNamespaces - } - return modelMap, nil -} - -func resourceIBMCmCatalogSyndicationHistoryToMap(model *catalogmanagementv1.SyndicationHistory) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Namespaces != nil { - modelMap["namespaces"] = model.Namespaces - } - if model.Clusters != nil { - clusters := []map[string]interface{}{} - for _, clustersItem := range model.Clusters { - clustersItemMap, err := resourceIBMCmCatalogSyndicationClusterToMap(&clustersItem) - if err != nil { - return modelMap, err - } - clusters = append(clusters, clustersItemMap) - } - modelMap["clusters"] = clusters - } - if model.LastRun != nil { - modelMap["last_run"] = model.LastRun.String() - } - return modelMap, nil -} - -func resourceIBMCmCatalogSyndicationAuthorizationToMap(model *catalogmanagementv1.SyndicationAuthorization) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Token != nil { - modelMap["token"] = model.Token - } - if model.LastRun != nil { - modelMap["last_run"] = model.LastRun.String() - } - return modelMap, nil -} diff --git a/metadata/provider_metadata.json b/metadata/provider_metadata.json index ce535fcbe0..41d4aec350 100644 --- a/metadata/provider_metadata.json +++ b/metadata/provider_metadata.json @@ -11386,169 +11386,6 @@ "cloud_data_type": "resource_group", "computed": true }, - { - "name": "syndication_settings", - "type": "TypeList", - "description": "Feature information.", - "computed": true, - "elem": { - "authorization": { - "name": "authorization", - "type": "TypeList", - "description": "Feature information.", - "computed": true, - "elem": { - "last_run": { - "name": "last_run", - "type": "TypeString", - "description": "Date and time last updated.", - "computed": true - }, - "token": { - "name": "token", - "type": "TypeString", - "description": "Array of syndicated namespaces.", - "computed": true - } - } - }, - "clusters": { - "name": "clusters", - "type": "TypeList", - "description": "Syndication clusters.", - "computed": true, - "elem": { - "all_namespaces": { - "name": "all_namespaces", - "type": "TypeBool", - "description": "Syndicated to all namespaces on cluster.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Cluster ID.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Cluster name.", - "computed": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Syndicated namespaces.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Cluster region.", - "computed": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "Resource group ID.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Syndication type.", - "computed": true - } - } - }, - "history": { - "name": "history", - "type": "TypeList", - "description": "Feature information.", - "computed": true, - "elem": { - "clusters": { - "name": "clusters", - "type": "TypeList", - "description": "Array of syndicated namespaces.", - "computed": true, - "elem": { - "all_namespaces": { - "name": "all_namespaces", - "type": "TypeBool", - "description": "Syndicated to all namespaces on cluster.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Cluster ID.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Cluster name.", - "computed": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Syndicated namespaces.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Cluster region.", - "computed": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "Resource group ID.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Syndication type.", - "computed": true - } - } - }, - "last_run": { - "name": "last_run", - "type": "TypeString", - "description": "Date and time last syndicated.", - "computed": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Array of syndicated namespaces.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - "remove_related_components": { - "name": "remove_related_components", - "type": "TypeBool", - "description": "Remove related components.", - "computed": true - } - } - }, { "name": "label_i18n", "type": "TypeMap", @@ -96830,171 +96667,6 @@ "description": "Account that owns catalog.", "computed": true }, - { - "name": "syndication_settings", - "type": "TypeList", - "description": "Feature information.", - "computed": true, - "elem": { - "authorization": { - "name": "authorization", - "type": "TypeList", - "description": "Feature information.", - "optional": true, - "elem": { - "last_run": { - "name": "last_run", - "type": "TypeString", - "description": "Date and time last updated.", - "optional": true - }, - "token": { - "name": "token", - "type": "TypeString", - "description": "Array of syndicated namespaces.", - "optional": true - } - }, - "max_items": 1 - }, - "clusters": { - "name": "clusters", - "type": "TypeList", - "description": "Syndication clusters.", - "optional": true, - "elem": { - "all_namespaces": { - "name": "all_namespaces", - "type": "TypeBool", - "description": "Syndicated to all namespaces on cluster.", - "optional": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Cluster ID.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Cluster name.", - "optional": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Syndicated namespaces.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Cluster region.", - "optional": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "Resource group ID.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Syndication type.", - "optional": true - } - } - }, - "history": { - "name": "history", - "type": "TypeList", - "description": "Feature information.", - "optional": true, - "elem": { - "clusters": { - "name": "clusters", - "type": "TypeList", - "description": "Array of syndicated namespaces.", - "optional": true, - "elem": { - "all_namespaces": { - "name": "all_namespaces", - "type": "TypeBool", - "description": "Syndicated to all namespaces on cluster.", - "optional": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Cluster ID.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Cluster name.", - "optional": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Syndicated namespaces.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Cluster region.", - "optional": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "Resource group ID.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Syndication type.", - "optional": true - } - } - }, - "last_run": { - "name": "last_run", - "type": "TypeString", - "description": "Date and time last syndicated.", - "optional": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Array of syndicated namespaces.", - "optional": true, - "elem": { - "type": "TypeString" - } - } - }, - "max_items": 1 - }, - "remove_related_components": { - "name": "remove_related_components", - "type": "TypeBool", - "description": "Remove related components.", - "optional": true - } - } - }, { "name": "target_account_contexts", "type": "TypeList", diff --git a/website/docs/d/cm_catalog.html.markdown b/website/docs/d/cm_catalog.html.markdown index f0e7592d17..6fb9a9add1 100644 --- a/website/docs/d/cm_catalog.html.markdown +++ b/website/docs/d/cm_catalog.html.markdown @@ -77,36 +77,6 @@ Nested scheme for **features**: * `short_description` - (String) Description in the requested language. -* `syndication_settings` - (List) Feature information. -Nested scheme for **syndication_settings**: - * `authorization` - (List) Feature information. - Nested scheme for **authorization**: - * `last_run` - (String) Date and time last updated. - * `token` - (String) Array of syndicated namespaces. - * `clusters` - (List) Syndication clusters. - Nested scheme for **clusters**: - * `all_namespaces` - (Boolean) Syndicated to all namespaces on cluster. - * `id` - (String) Cluster ID. - * `name` - (String) Cluster name. - * `namespaces` - (List) Syndicated namespaces. - * `region` - (String) Cluster region. - * `resource_group_name` - (String) Resource group ID. - * `type` - (String) Syndication type. - * `history` - (List) Feature information. - Nested scheme for **history**: - * `clusters` - (List) Array of syndicated namespaces. - Nested scheme for **clusters**: - * `all_namespaces` - (Boolean) Syndicated to all namespaces on cluster. - * `id` - (String) Cluster ID. - * `name` - (String) Cluster name. - * `namespaces` - (List) Syndicated namespaces. - * `region` - (String) Cluster region. - * `resource_group_name` - (String) Resource group ID. - * `type` - (String) Syndication type. - * `last_run` - (String) Date and time last syndicated. - * `namespaces` - (List) Array of syndicated namespaces. - * `remove_related_components` - (Boolean) Remove related components. - * `tags` - (List) List of tags associated with this catalog. * `target_account_contexts` - (List) List of target account contexts for this catalog.