models

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionModel

type ActionModel struct {
	ActionType      types.String `tfsdk:"action_type"`
	TakeAction      types.Bool   `tfsdk:"take_action"`
	Category        types.String `tfsdk:"category"`
	Name            types.String `tfsdk:"name"`
	GracePeriodDays types.Int64  `tfsdk:"grace_period_days"`
}

ActionModel represents a policy action.

type FilterModel

type FilterModel struct {
	Field types.String `tfsdk:"field"`
	Type  types.String `tfsdk:"type"`
	Value types.String `tfsdk:"value"`
}

FilterModel represents a filter for the list data source.

type PoliciesDataSourceModel

type PoliciesDataSourceModel struct {
	ID          types.String  `tfsdk:"id"`
	Filter      *FilterModel  `tfsdk:"filter"`
	From        types.Int64   `tfsdk:"from"`
	To          types.Int64   `tfsdk:"to"`
	Policies    []PolicyModel `tfsdk:"policies"`
	TotalCount  types.Int64   `tfsdk:"total_count"`
	FilterCount types.Int64   `tfsdk:"filter_count"`
}

PoliciesDataSourceModel is the model for the policies list data source.

func (*PoliciesDataSourceModel) RefreshFromRemote

func (m *PoliciesDataSourceModel) RefreshFromRemote(ctx context.Context, diags *diag.Diagnostics, remote []vulnerabilityTypes.VulnerabilityManagementPolicy, totalCount, filterCount int)

RefreshFromRemote updates the data source model from the SDK response.

func (*PoliciesDataSourceModel) ToListRequest

ToListRequest converts the data source model to an SDK list request.

type PolicyModel

type PolicyModel struct {
	ID                  types.String `tfsdk:"id"`
	Name                types.String `tfsdk:"name"`
	Description         types.String `tfsdk:"description"`
	Priority            types.Int64  `tfsdk:"priority"`
	Status              types.String `tfsdk:"status"`
	MatchCriteria       types.String `tfsdk:"match_criteria"`
	ExclusionCriteria   types.String `tfsdk:"exclusion_criteria"`
	Action              types.List   `tfsdk:"action"`
	ActionCategory      types.String `tfsdk:"action_category"`
	Severity            types.String `tfsdk:"severity"`
	AssetGroupScope     types.List   `tfsdk:"asset_group_scope"`
	PolicyType          types.String `tfsdk:"policy_type"`
	OpenIssues          types.Int64  `tfsdk:"open_issues"`
	EstimatedMatchCount types.Int64  `tfsdk:"estimated_match_count"`
	ModifiedBy          types.String `tfsdk:"modified_by"`
	ModifiedTimestamp   types.String `tfsdk:"modified_timestamp"`
}

PolicyModel is the Terraform model for a vulnerability management policy.

func (*PolicyModel) RefreshFromRemote

func (m *PolicyModel) RefreshFromRemote(ctx context.Context, diags *diag.Diagnostics, remote *vulnerabilityTypes.VulnerabilityManagementPolicy)

RefreshFromRemote updates the Terraform model from the SDK response.

func (*PolicyModel) ToCreateRequest

ToCreateRequest converts the Terraform model to an SDK create request.

func (*PolicyModel) ToUpdateRequest

ToUpdateRequest converts the Terraform model to an SDK update request. Note: Vulnerability policy updates are FULL REPLACEMENT, not merge.

Jump to

Keyboard shortcuts

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