// GetEnabledCloudProviderNames returns a list of cloud provider names from the enabled cloud providers
GetEnabledCloudProviderNames returns a list of cloud provider names from the enabled cloud providers
// GetEnabledCloudProviderNames returns a list of cloud provider names from the enabled cloud providers
func GetEnabledCloudProviderNames(f *factory.Factory) ([]string, error) {
	validProviders := []string{}
	conn, err := f.Connection(connection.DefaultConfigSkipMasAuth)
	if err != nil {
		return validProviders, err
	}
	cloudProviderResponse, _, err := conn.API().KafkaMgmt().GetCloudProviders(f.Context).Execute()
	if err != nil {
		return validProviders, err
	}
	cloudProviders := cloudProviderResponse.GetItems()
	cloudProviderNames := []string{}
	for _, provider := range cloudProviders {
		if provider.GetEnabled() {
			cloudProviderNames = append(cloudProviderNames, provider.GetName())
		}
	}
	return cloudProviderNames, err
}
func GetEnabledCloudProviderNames ( f * factory . Factory ) ( [ ] string , error ) { validProviders := [ ] string { } conn , err := f . Connection ( connection . DefaultConfigSkipMasAuth ) if err != nil { return validProviders , err } cloudProviderResponse , _ , err := conn . API ( ) . KafkaMgmt ( ) . GetCloudProviders ( f . Context ) . Execute ( ) if err != nil { return validProviders , err } cloudProviders := cloudProviderResponse . GetItems ( ) cloudProviderNames := [ ] string { } for _ , provider := range cloudProviders { if provider . GetEnabled ( ) { cloudProviderNames = append ( cloudProviderNames , provider . GetName ( ) ) } } return cloudProviderNames , err }
GetEnabledCloudProviderNames returns a list of cloud provider names from the enabled cloud providers
GetEnabledCloudProviderNames returns a list of cloud provider names from the enabled cloud providers