territory2model

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const NAME = "Territory2Model"

Variables

This section is empty.

Functions

func ComponentName added in v0.63.0

func ComponentName(path string) metadata.MetadataObjectName

ComponentName returns the package.xml member name of a territory or rule file, <Model>.<Name>.

func ModelComponentFiles added in v0.63.0

func ModelComponentFiles(m metadata.RegisterableMetadata, model, dir, name string, metadataType metadata.MetadataType, format metadata.Format) (map[string][]byte, error)

ModelComponentFiles returns the file for a component of the model named model, territory2Models/<model>/<dir>/<name>.<suffix>, with -meta.xml appended in source format. An empty dir places the file directly in the model's directory.

func ModelName added in v0.63.0

func ModelName(path string) string

ModelName returns the DeveloperName of the model that owns a territory or rule file, the directory above its territories or rules directory: territory2Models/<Model>/territories/<Name>.territory2.

Types

type FieldValue added in v0.63.0

type FieldValue struct {
	Name struct {
		Text string `xml:",chardata"`
	} `xml:"name"`
	Value TypedValue `xml:"value"`
}

FieldValue is the value of a custom field on a territory or territory model.

type Territory2Model

type Territory2Model struct {
	metadata.MetadataInfo
	XMLName      xml.Name     `xml:"Territory2Model"`
	Xmlns        string       `xml:"xmlns,attr"`
	Xsi          string       `xml:"xmlns:xsi,attr,omitempty"`
	Xsd          string       `xml:"xmlns:xsd,attr,omitempty"`
	CustomFields []FieldValue `xml:"customFields"`
	Description  *struct {
		Text string `xml:",chardata"`
	} `xml:"description"`
	Name struct {
		Text string `xml:",chardata"`
	} `xml:"name"`
	RecordVisibility *struct {
		Text string `xml:",chardata"`
	} `xml:"recordVisibility"`
	UserRecordAccess *struct {
		Text string `xml:",chardata"`
	} `xml:"userRecordAccess"`
}

func Open

func Open(path string) (*Territory2Model, error)

func (*Territory2Model) Files added in v0.63.0

func (c *Territory2Model) Files(format metadata.Format) (map[string][]byte, error)

Files writes the model into its own directory, which also holds its territories and rules: territory2Models/<Model>/<Model>.territory2Model.

func (*Territory2Model) SetMetadata

func (c *Territory2Model) SetMetadata(m metadata.MetadataInfo)

func (*Territory2Model) Type

type TypedValue added in v0.63.0

type TypedValue struct {
	Text string `xml:",innerxml"`
	Type string `xml:"xsi:type,attr,omitempty"`
	Nil  string `xml:"xsi:nil,attr,omitempty"`
}

TypedValue is a custom field value written with its XML schema type, <value xsi:type="xsd:string">, or as <value xsi:nil="true"/> when the field has no value.

Jump to

Keyboard shortcuts

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