/*
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
Authors:
Petr Krutov, <petr.krutov@digitalenergy.online>
Stanislav Solovev, <spsolovev@digitalenergy.online>
Kasim Baybikov, <kmbaybikov@basistech.ru>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package provider

import (
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/account"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/bservice"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/disks"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/flipgroup"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/image"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/k8s"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/kvmvm"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/lb"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/pfw"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/rg"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/secgroup"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/snapshot"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudapi/vins"
	accessgroup "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/sdn/access_group"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/sdn/hypervisors"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/sdn/logicalports"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/sdn/netobjgroups"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/sdn/segments"

	cb_account "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/account"
	cb_disks "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/disks"
	cb_dpdknet "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/dpdknet"
	cb_extnet "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/extnet"
	cb_flipgroup "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/flipgroup"
	cb_image "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/image"
	cb_k8ci "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/k8ci"
	cb_k8s "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/k8s"
	cb_kvmvm "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/kvmvm"
	cb_lb "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/lb"
	cb_pcidevice "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/pcidevice"
	cb_rg "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/rg"
	cb_secgroup "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/secgroup"
	cb_sep "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/sep"
	cb_stpolicy "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/stpolicy"
	cb_trunk "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/trunk"
	cb_user "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/user"
	cb_vfpool "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/vfpool"
	cb_vins "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/vins"
	cb_zone "repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/zone"
)

func newResourcesMap() map[string]*schema.Resource {
	return map[string]*schema.Resource{
		"decort_resgroup":      rg.ResourceResgroup(),
		"decort_kvmvm":         kvmvm.ResourceCompute(),
		"decort_disk":          disks.ResourceDisk(),
		"decort_disk_snapshot": disks.ResourceDiskSnapshot(),
		//"decort_disk_replication":         disks.ResourceDiskReplication(),
		"decort_vins":                     vins.ResourceVins(),
		"decort_pfw":                      pfw.ResourcePfw(),
		"decort_k8s":                      k8s.ResourceK8s(),
		"decort_k8s_wg":                   k8s.ResourceK8sWg(),
		"decort_k8s_cp":                   k8s.ResourceK8sCP(),
		"decort_snapshot":                 snapshot.ResourceSnapshot(),
		"decort_account":                  account.ResourceAccount(),
		"decort_bservice":                 bservice.ResourceBasicService(),
		"decort_bservice_group":           bservice.ResourceBasicServiceGroup(),
		"decort_image":                    image.ResourceImage(),
		"decort_image_from_blank_compute": image.ResourceImageFromBlankCompute(),
		"decort_image_from_platform_disk": image.ResourceImageFromPlatformDisk(),
		"decort_image_virtual":            image.ResourceImageVirtual(),
		"decort_lb":                       lb.ResourceLB(),
		"decort_lb_backend":               lb.ResourceLBBackend(),
		"decort_lb_backend_server":        lb.ResourceLBBackendServer(),
		"decort_lb_frontend":              lb.ResourceLBFrontend(),
		"decort_lb_frontend_bind":         lb.ResourceLBFrontendBind(),
		"decort_flipgroup":                flipgroup.ResourceFlipgroup(),
		"decort_vins_static_route":        vins.ResourceStaticRoute(),
		"decort_security_group":           secgroup.ResourceSecurityGroup(),

		"decort_cb_account":             cb_account.ResourceAccount(),
		"decort_cb_dpdknet":             cb_dpdknet.ResourceDPDKNet(),
		"decort_cb_extnet":              cb_extnet.ResourceExtnetCB(),
		"decort_cb_extnet_static_route": cb_extnet.ResourceStaticRoute(),
		"decort_cb_disk":                cb_disks.ResourceDisk(),
		"decort_cb_disk_snapshot":       cb_disks.ResourceDiskSnapshot(),
		//"decort_cb_disk_replication":         cb_disks.ResourceDiskReplication(),
		"decort_cb_image":                    cb_image.ResourceImage(),
		"decort_cb_image_from_blank_compute": cb_image.ResourceImageFromBlankCompute(),
		"decort_cb_image_from_platform_disk": cb_image.ResourceImageFromPlatformDisk(),
		"decort_cb_virtual_image":            cb_image.ResourceVirtualImage(),
		"decort_cb_cdrom_image":              cb_image.ResourceCDROMImage(),
		"decort_cb_multi_image":              cb_image.ResourceMultiImage(),
		"decort_cb_pcidevice":                cb_pcidevice.ResourcePcidevice(),
		"decort_cb_sep":                      cb_sep.ResourceSep(),
		"decort_cb_sep_config":               cb_sep.ResourceSepConfig(),
		"decort_cb_kvmvm":                    cb_kvmvm.ResourceCompute(),
		"decort_cb_vins":                     cb_vins.ResourceVins(),
		"decort_cb_k8ci":                     cb_k8ci.ResourceK8CI(),
		"decort_cb_k8s_cp":                   cb_k8s.ResourceK8sCP(),
		"decort_cb_k8s_wg":                   cb_k8s.ResourceK8sWg(),
		"decort_cb_vins_static_route":        cb_vins.ResourceStaticRoute(),
		"decort_cb_flipgroup":                cb_flipgroup.ResourceFlipgroup(),
		"decort_cb_lb":                       cb_lb.ResourceLB(),
		"decort_cb_lb_backend":               cb_lb.ResourceLBBackend(),
		"decort_cb_lb_backend_server":        cb_lb.ResourceLBBackendServer(),
		"decort_cb_lb_frontend":              cb_lb.ResourceLBFrontend(),
		"decort_cb_lb_frontend_bind":         cb_lb.ResourceLBFrontendBind(),
		"decort_cb_rg":                       cb_rg.ResourceResgroup(),
		"decort_cb_storage_policy":           cb_stpolicy.ResourceStoragePolicy(),
		"decort_cb_security_group":           cb_secgroup.ResourceSecurityGroup(),
		"decort_cb_trunk":                    cb_trunk.ResourceTrunk(),
		"decort_cb_user":                     cb_user.ResourceUser(),
		"decort_cb_vfpool":                   cb_vfpool.ResourceVFPool(),
		"decort_cb_zone":                     cb_zone.ResourceZone(),

		"decort_sdn_segment":              segments.ResourceSegment(),
		"decort_sdn_access_group":         accessgroup.ResourceAccessGroup(),
		"decort_sdn_hypervisor":           hypervisors.ResourceHypervisor(),
		"decort_sdn_logical_port":         logicalports.ResourceLogicalPort(),
		"decort_sdn_network_object_group": netobjgroups.ResourceNetworkObjectGroup(),
	}
}
