22 lines
800 B
Go
22 lines
800 B
Go
package utilities
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/hashicorp/terraform-plugin-log/tflog"
|
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
|
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/client"
|
|
)
|
|
|
|
func AccountAvailableTemplatesListDataSourceCheckPresence(ctx context.Context, accountId uint64, c *client.Client) ([]uint64, error) {
|
|
tflog.Info(ctx, fmt.Sprintf("AccountAvailableTemplatesListDataSourceCheckPresence: Get info about templates with account ID - %v", accountId))
|
|
|
|
templatesList, err := c.CloudBroker().Account().ListAvailableTemplates(ctx, account.ListAvailableTemplatesRequest{AccountID: accountId})
|
|
if err != nil {
|
|
return nil, fmt.Errorf("cannot get info about templated with error: %w", err)
|
|
}
|
|
|
|
return templatesList, err
|
|
}
|