util

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DomainFqdnRegex string = `^(([a-zA-Z0-9-_]){1,63}\.)+[a-zA-Z]{2,63}$`
View Source
const GuidRegex string = `^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$`
View Source
const UpnRegex string = `^[^@]+@\b(([a-zA-Z0-9-_]){1,63}\.)+[a-zA-Z]{2,63}$`

Variables

This section is empty.

Functions

func AppendNameValueStringPair

func AppendNameValueStringPair(stringPairs *[]citrixorchestration.NameValueStringPairModel, name string, appendValue string)

func Contains

func Contains[T comparable](s []T, e T) bool

func ConvertBaseStringArrayToPrimitiveStringArray

func ConvertBaseStringArrayToPrimitiveStringArray(v []types.String) []string

func ConvertPrimitiveStringArrayToBaseStringArray

func ConvertPrimitiveStringArrayToBaseStringArray(v []string) []types.String

func ConvertToString added in v0.3.4

func ConvertToString(model any) (string, error)

func GetAllResourcePathList

func GetAllResourcePathList(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorId, folderPath, resourceType string) []string

func GetFilteredResourcePathList

func GetFilteredResourcePathList(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorId, folderPath, resourceType string, filter []string, connectionType citrixorchestration.HypervisorConnectionType) ([]string, error)

func GetHypervisor added in v0.3.6

Gets the hypervisor and logs any errors

func GetHypervisorResourcePool added in v0.3.6

func GetHypervisorResourcePool(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, hypervisorId, hypervisorResourcePoolId string) (*citrixorchestration.HypervisorResourcePoolDetailResponseModel, error)

func GetMachineCatalog added in v0.3.6

func GetMachineCatalog(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, machineCatalogId string, addErrorToDiagnostics bool) (*citrixorchestration.MachineCatalogDetailResponseModel, error)

func GetMachineCatalogMachines added in v0.3.6

func GetMachineCatalogMachines(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, machineCatalogId string) (*citrixorchestration.MachineResponseModelCollection, error)

func GetSingleHypervisorResource added in v0.3.6

func GetSingleHypervisorResource(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorId, folderPath, resourceName, resourceType, resourceGroupName string, connectionType citrixorchestration.HypervisorConnectionType) (*citrixorchestration.HypervisorResourceResponseModel, error)

func GetSingleResourcePathFromHypervisor

func GetSingleResourcePathFromHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorName, hypervisorPoolName, folderPath, resourceName, resourceType, resourceGroupName string) (string, error)

func GetValidatorFromEnum

func GetValidatorFromEnum[V ~string, T []V](enum T) validator.String

func IsValidUUID

func IsValidUUID(u string) bool

func IsValidUUIDorNull

func IsValidUUIDorNull(u basetypes.StringValue) bool

func PanicHandler added in v0.3.6

func PanicHandler(diagnostics *diag.Diagnostics)

func ParseNameValueStringPairToClientModel

func ParseNameValueStringPairToClientModel(stringPairs []NameValueStringPairModel) *[]citrixorchestration.NameValueStringPairModel

func ParseNameValueStringPairToPluginModel

func ParseNameValueStringPairToPluginModel(stringPairs []citrixorchestration.NameValueStringPairModel) *[]NameValueStringPairModel

func ProcessAsyncJobResponse added in v0.3.6

func ProcessAsyncJobResponse(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, jobResp *http.Response, errContext string, diagnostics *diag.Diagnostics, maxTimeout int) (err error)

func ReadClientError

func ReadClientError(err error) string

func ReadResource added in v0.3.3

func ReadResource[ResponseType any](request any, ctx context.Context, client *citrixdaasclient.CitrixDaasClient, resp *resource.ReadResponse, resourceType, resourceIdOrName string) (ResponseType, *http.Response, error)

func StringToTypeBool

func StringToTypeBool(from string) types.Bool

func TypeBoolToString

func TypeBoolToString(from types.Bool) string

Types

type NameValueStringPairModel

type NameValueStringPairModel struct {
	Name  types.String `tfsdk:"name"`
	Value types.String `tfsdk:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL