models

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddResourceEntry

type AddResourceEntry struct {
	Attributes      interface{} `json:"attributes" validate:"required"`
	ID              string      `json:"id" validate:"required"`
	IntegrationID   string      `json:"integrationId" validate:"uuid4"`
	IntegrationType string      `json:"integrationType" validate:"oneof=aws"`
	Type            string      `json:"type" validate:"required"`
}

type AddResourcesInput

type AddResourcesInput struct {
	Resources []AddResourceEntry `json:"resources" validate:"min=1,dive"`
}

Backend adds or replaces resources

type DeleteEntry

type DeleteEntry struct {
	ID string `json:"id" validate:"required"`
}

type DeleteResourcesInput

type DeleteResourcesInput struct {
	Resources []DeleteEntry `json:"resources" validate:"min=1,dive"`
}

type GetResourceInput

type GetResourceInput struct {
	ID string `json:"resourceId" validate:"required"`
}

type GetResourceOutput

type GetResourceOutput = Resource

type LambdaInput

type LambdaInput struct {
	AddResources    *AddResourcesInput    `json:"addResources"`
	GetResource     *GetResourceInput     `json:"getResource"`
	DeleteResources *DeleteResourcesInput `json:"deleteResources"`
	ListResources   *ListResourcesInput   `json:"listResources"`
}

LambdaInput is the request structure for the resources-api Lambda function.

type ListResourcesInput

type ListResourcesInput struct {
	// ***** Filtering *****
	// Only include resources with a specific compliance status
	ComplianceStatus models.ComplianceStatus `json:"complianceStatus" validate:"omitempty,oneof=ERROR FAIL PASS"`

	// Only include resources which are or are not deleted
	Deleted *bool `json:"deleted"`

	// Only include resources whose ID contains this substring (case-insensitive)
	IDContains string `json:"idContains"`

	// Only include resources from this source integration
	IntegrationID string `json:"integrationId" validate:"omitempty,uuid4"`

	// Only include resoures from this integration type
	IntegrationType string `json:"integrationType" validate:"omitempty,oneof=aws"`

	// Only include resources which match one of these resource types
	Types []string `json:"types" validate:"omitempty,dive,required"`

	// ***** Projection *****
	// Resource fields to select (default: all except attributes)
	Fields []string `json:"fields" validate:"omitempty,dive,required"`

	// ***** Sorting *****
	SortBy  string `json:"sortBy" validate:"omitempty,oneof=complianceStatus id lastModified type"`
	SortDir string `json:"sortDir" validate:"omitempty,oneof=ascending descending"`

	// ***** Paging *****
	PageSize int `json:"pageSize" validate:"omitempty,min=1"`
	Page     int `json:"page" validate:"omitempty,min=1"`
}

type ListResourcesOutput

type ListResourcesOutput struct {
	Paging    Paging     `json:"paging"`
	Resources []Resource `json:"resources"`
}

type Paging

type Paging struct {
	ThisPage   int `json:"thisPage"`
	TotalPages int `json:"totalPages"`
	TotalItems int `json:"totalItems"`
}

type Resource

type Resource struct {
	Attributes       interface{}             `json:"attributes"`
	ComplianceStatus models.ComplianceStatus `json:"complianceStatus"`
	Deleted          bool                    `json:"deleted"`
	ID               string                  `json:"id"`
	IntegrationID    string                  `json:"integrationId"`
	IntegrationType  string                  `json:"integrationType"`
	LastModified     time.Time               `json:"lastModified"`
	Type             string                  `json:"type"`
}

Jump to

Keyboard shortcuts

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