api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPolicyRestrictions

func CheckPolicyRestrictions(ctx context.Context, requestUrl string, payloadJson string) (interface{}, error)

func Execute

func Execute[ResponseT interface{}](ctx context.Context, client *Client, method string, url string, apiVersion string, body interface{}) (*ResponseT, error)

func Preflight

func Preflight(ctx context.Context, model PreflightRequestModel) (interface{}, error)

func PreflightInBatch

func PreflightInBatch(ctx context.Context, requests []types.RequestModel, concurrency int) []error

Types

type CheckPolicyRestrictionsRequestModel

type CheckPolicyRestrictionsRequestModel struct {
	ResourceDetails    ResourceDetailsModel `json:"resourceDetails"`
	IncludeAuditEffect bool                 `json:"includeAuditEffect"`
}

type CheckPolicyRestrictionsResponseModel

type CheckPolicyRestrictionsResponseModel struct {
	FieldRestrictions       []FieldRestriction           `json:"fieldRestrictions"`
	ContentEvaluationResult ContentEvaluationResultModel `json:"contentEvaluationResult"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func DefaultSharedClient

func DefaultSharedClient() (*Client, error)

func NewClient

func NewClient() (*Client, error)

type ContentEvaluationResultModel

type ContentEvaluationResultModel struct {
	PolicyEvaluations []PolicyEvaluationModel `json:"policyEvaluations"`
}

type FieldRestriction

type FieldRestriction struct {
	Field        string                   `json:"field"`
	Restrictions []map[string]interface{} `json:"restrictions"`
}

type PolicyEvaluationModel

type PolicyEvaluationModel struct {
	PolicyInfo        map[string]interface{} `json:"policyInfo"`
	EvaluationResult  string                 `json:"evaluationResult"`
	EvaluationDetails map[string]interface{} `json:"evaluationDetails"`
	EffectDetails     map[string]interface{} `json:"effectDetails"`
}

type PreflightRequestModel

type PreflightRequestModel struct {
	Provider  string                   `json:"provider"`
	Type      string                   `json:"type"`
	Location  string                   `json:"location"`
	Scope     string                   `json:"scope"`
	Resources []map[string]interface{} `json:"resources"`
}

func BuildPreflightRequestBody

func BuildPreflightRequestBody(request types.RequestModel) (PreflightRequestModel, error)

type PreflightResponseModel

type PreflightResponseModel struct {
	Properties PropertiesModel `json:"properties"`
}

type PropertiesModel

type PropertiesModel struct {
	ValidatedResources []string `json:"validatedResources"`
}

type ResourceDetailsModel

type ResourceDetailsModel struct {
	ResourceContent map[string]interface{} `json:"resourceContent"`
	ApiVersion      string                 `json:"apiVersion"`
}

Jump to

Keyboard shortcuts

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