func NewProvider(hostname svchost.Hostname, namespace, typeName string) Provider {
	if namespace == LegacyProviderNamespace {
		panic("attempt to create legacy provider address using NewProvider; use NewLegacyProvider instead")
	}
	return Provider{
		Type:      MustParseProviderPart(typeName),
		Namespace: MustParseProviderPart(namespace),
		Hostname:  hostname,
	}
}
NewProvider constructs a provider address from its parts, and normalizes
the namespace and type parts to lowercase using unicode case folding rules
so that resulting addrs.Provider values can be compared using standard
Go equality rules (==).

The hostname is given as a svchost.Hostname, which is required by the
contract of that type to have already been normalized for equality testing.

This function will panic if the given namespace or type name are not valid.
When accepting namespace or type values from outside the program, use
ParseProviderPart first to check that the given value is valid.
package addrs
import (
	"fmt"
	"strings"
	"golang.org/x/net/idna"
	"github.com/camptocamp/terraboard/internal/terraform/tfdiags"
	"github.com/hashicorp/hcl/v2"
	svchost "github.com/hashicorp/terraform-svchost"
)
type Provider struct {
	Type      string
	Namespace string
	Hostname  svchost.Hostname
}
const DefaultRegistryHost = svchost.Hostname("registry.terraform.io")
const BuiltInProviderHost = svchost.Hostname("terraform.io")
const BuiltInProviderNamespace = "builtin"
const LegacyProviderNamespace = "-"
func (pt Provider) String() string {
	if pt.IsZero() {
		panic("called String on zero-value addrs.Provider")
	}
	return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type
}
func (pt Provider) ForDisplay() string {
	if pt.IsZero() {
		panic("called ForDisplay on zero-value addrs.Provider")
	}
	if pt.Hostname == DefaultRegistryHost {
		return pt.Namespace + "/" + pt.Type
	}
	return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type
}