models

package
v0.0.0-...-83a3fee Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MPL-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SourceDataTypeIsDataPlane

func SourceDataTypeIsDataPlane(sourceDataType SourceDataType) bool

func SourceDataTypeName

func SourceDataTypeName(sourceDataType SourceDataType) string

Types

type APIResource

type APIResource struct {
	// Constants specifies a map of Constant Name (key) to SDKConstant (value)
	// which contains information about the Constants used within this APIResource.
	// NOTE: the Constant Name is a valid Identifier.
	Constants map[string]SDKConstant

	// Models specifies a map of Model Name (key) to SDKModel (value)
	// which contains information about the Models used within this APIResource.
	// NOTE: the Model Name is a valid Identifier.
	Models map[string]SDKModel

	// Name specifies the name of this APIResource.
	Name string

	// Operations specifies a map of Operation Name (key) to SDKOperation (value)
	// which contains information about the Operations used within this APIResource.
	// NOTE: the Operation Name is a valid Identifier.
	Operations map[string]SDKOperation

	// ResourceIDs specifies a map of Resource ID Name (key) to SDKOperation (value)
	// which contains information about the ResourceIDs used within this APIResource.
	// NOTE: the Resource ID Name is a valid Identifier.
	ResourceIDs map[string]ResourceID
}

APIResource defines a grouping of related information within an APIVersion.

type APIVersion

type APIVersion struct {
	// APIVersion specifies the Version of this API.
	APIVersion string

	// Generate specifies whether this APIVersion should be generated or not.
	Generate bool

	// Preview specifies whether this APIVersion is a Preview API Version (meaning
	// `preview`, `publicpreview`, `privatepreview`, `beta` and `alpha`) as opposed
	// to a Stable API Version.
	Preview bool

	// Resources specifies a map of API Resource Names (key) to APIResource (value).
	// The API Resource Name is a valid Identifier.
	Resources map[string]APIResource

	// Source specifies the origin of the Source Data for this APIVersion.
	Source SourceDataOrigin
}

APIVersion defines a version of an API for a specific Service. An example of this would be `2021-01-01` (within the Service `Compute`) which contains APIResource's for `ManagedDisks` and `VirtualMachines`.

type CommonTypes

type CommonTypes struct {
	// Constants specifies a map of Constant Name (key) to SDKConstant (value) which
	// describes each common Constant supported by this API.
	// NOTE: the Constant Name is a valid Identifier.
	Constants map[string]SDKConstant

	// Models specifies a map of Model Name (key) to SDKModel (value) which
	// describes each common Model supported by this API.
	// NOTE: the Model Name is a valid Identifier.
	Models map[string]SDKModel

	// ResourceIDs specifies a map of Resource ID Name (key) to SDKOperation (value)
	// which contains information about the common ResourceIDs available in this API.
	// NOTE: the Resource ID Name is a valid Identifier.
	ResourceIDs map[string]ResourceID
}

CommonTypes defines the common set of SDKConstant's and SDKModel's used throughout this Source Data Type.

type ResourceID

type ResourceID struct {
	// CommonIDAlias specifies the Common ID Alias for this Resource ID.
	// Common IDs are defined within `github.com/hashicorp/go-azure-helpers` and allow referencing
	// a single instance of a Resource ID type - rather than redefining this in multiple places.
	// Examples a Common ID include a Resource Group ID and a Subscription ID.
	CommonIDAlias *string `json:"commonAlias,omitempty"` // TODO: update the json struct tag when everything is switched over

	// ConstantNames specifies a list of Constant Names used within Segments.
	ConstantNames []string `json:"constantNames"` // TODO: remove this once everything is switched over

	// Constants specifies a map of Constant Name (Key) to SDKConstant (value) describing the Constants
	// used within Segments.
	// Note: the Constant Name is a valid Identifier.
	Constants map[string]SDKConstant `json:"constants"`

	// ExampleValue specifies a full example value for this ResourceID.
	// This is intended to be used in both documentation and error messages, so should be both
	// clear, short yet descriptive.
	// Example: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}`
	ExampleValue string `json:"id"` // TODO: update the json struct tag when everything is switched over

	// Segments specifies the ResourceIDSegments which comprise this ResourceID.
	// At least one ResourceIDSegment must be specified - but typically a Resource ID contains
	// at least a StaticResourceIDSegmentType and a UserSpecifiedResourceIDSegmentType.
	Segments []ResourceIDSegment `json:"segments"`
}

ResourceID defines a Unique Resource Identifier. A ResourceID contains one or more ResourceIDSegment's which defines the shape of the expected ResourceID - and (SHOULD) typically contain an equal number of ResourceIDSegment's.

type ResourceIDSegment

type ResourceIDSegment struct {
	// ConstantReference specifies the name of the SDKConstant used within this ResourceIDSegment.
	// This is only specified when Type is set to ConstantResourceIDSegmentType - and when it is
	// the parsed value MUST be one of the associated Values for the SDK Constant.
	ConstantReference *string `json:"constantReference,omitempty"`

	// ExampleValue provides an example of a valid value for this ResourceIDSegment.
	// This is intended to be used in both documentation and error messages and as such
	// should be both a good example and as short/clear as reasonably possible.
	ExampleValue string `json:"exampleValue"`

	// FixedValue specifies the Fixed, Static (Exact) Value this ResourceIDSegment must contain
	// when Type is set to ResourceProviderResourceIDSegmentType or StaticResourceIDSegmentType.
	FixedValue *string `json:"fixedValue,omitempty"`

	// Type specifies the Type of ResourceIDSegment this is - in most cases these are either
	// a Static Value represented by StaticResourceIDSegmentType or a User-Specified value
	// represented by UserSpecifiedResourceIDSegmentType.
	Type ResourceIDSegmentType `json:"type"`

	// Name specifies a unique name for this ResourceIDSegment.
	// This is primarily used as a unique key for the dictionary returned when a Resource ID is
	// parsed - however it's also used in a few error messages and thus should aim to be
	// user-friendly (albeit these are auto-generated).
	Name string `json:"name"`
}

ResourceIDSegment defines a Segment within a ResourceID. Each ResourceIDSegment comprises a unique Name and a Type which describes the expected shape of the Resource ID Segment.

func NewConstantResourceIDSegment

func NewConstantResourceIDSegment(name, constantReferenceName, exampleValue string) ResourceIDSegment

NewConstantResourceIDSegment returns a configured ResourceIDSegment which represents the value from a Constant. The user-provided value for this Resource ID Segment MUST represent one of the values specified in the Constant.

func NewResourceGroupNameResourceIDSegment

func NewResourceGroupNameResourceIDSegment(name string) ResourceIDSegment

NewResourceGroupNameResourceIDSegment returns a configured ResourceIDSegment which represents the value of a Resource Group Name.

func NewResourceProviderResourceIDSegment

func NewResourceProviderResourceIDSegment(name, resourceProviderName string) ResourceIDSegment

NewResourceProviderResourceIDSegment returns a configured ResourceIDSegment which represents the value of an Azure Resource Provider.

func NewScopeResourceIDSegment

func NewScopeResourceIDSegment(name string) ResourceIDSegment

NewScopeResourceIDSegment returns a configured ResourceIDSegment which represents the value of an Azure Resource Scope.

func NewStaticValueResourceIDSegment

func NewStaticValueResourceIDSegment(name, fixedValue string) ResourceIDSegment

NewStaticValueResourceIDSegment returns a configured ResourceIDSegment which represents a fixed/static value.

func NewSubscriptionIDResourceIDSegment

func NewSubscriptionIDResourceIDSegment(name string) ResourceIDSegment

NewSubscriptionIDResourceIDSegment returns a configured ResourceIDSegment which represents the value of a Subscription ID.

func NewUserSpecifiedResourceIDSegment

func NewUserSpecifiedResourceIDSegment(name, exampleValue string) ResourceIDSegment

NewUserSpecifiedResourceIDSegment returns a configured ResourceIDSegment which represents a User Specified value.

type ResourceIDSegmentType

type ResourceIDSegmentType string

ResourceIDSegmentType defines a Type of ResourceIDSegment.

const (
	// ConstantResourceIDSegmentType specifies that the ResourceIDSegment is related to a Constant.
	ConstantResourceIDSegmentType ResourceIDSegmentType = "Constant"

	// ResourceGroupResourceIDSegmentType specifies that the ResourceIDSegment is the name of a Resource Group.
	ResourceGroupResourceIDSegmentType ResourceIDSegmentType = "ResourceGroup"

	// ResourceProviderResourceIDSegmentType specifies that the ResourceIDSegment is the name of a Resource Provider.
	ResourceProviderResourceIDSegmentType ResourceIDSegmentType = "ResourceProvider"

	// ScopeResourceIDSegmentType specifies that the ResourceIDSegment is a Scope (URI Path).
	ScopeResourceIDSegmentType ResourceIDSegmentType = "Scope"

	// StaticResourceIDSegmentType specifies that the ResourceIDSegment is a fixed/static value.
	StaticResourceIDSegmentType ResourceIDSegmentType = "Static"

	// SubscriptionIDResourceIDSegmentType specifies that the ResourceIDSegment is an Azure Subscription ID.
	SubscriptionIDResourceIDSegmentType ResourceIDSegmentType = "SubscriptionId"

	// UserSpecifiedResourceIDSegmentType specifies that the ResourceIDSegment is a User-Specified/Provided value.
	// Typically (but importantly not always) these represent the Name components for a given Resource.
	UserSpecifiedResourceIDSegmentType ResourceIDSegmentType = "UserSpecified"
)

type SDKConstant

type SDKConstant struct {
	// Type specifies the type of values provided by this Constant.
	// This can be either a Float value (output as `float64`), an Integer (output as
	// `int64`) or a String (output as `string`).
	Type SDKConstantType `json:"type"`

	// Values specifies a mapping of Constant Name (key) to the Stringified Value.
	// This value is stringified to ensure the same precision is output/used everywhere for
	// float values.
	// NOTE: the Constant Name is a valid Identifier.
	Values map[string]string `json:"values"`
}

SDKConstant defines a Constant used in the SDK. The Type field specified whether this Constant is an Integer, Float or a String. The Values field specifies a map of Keys (intended to be used as the Constant/Display Name) to the Values - which are all output as Strings.

type SDKConstantType

type SDKConstantType = string

SDKConstantType defines the backing Type for a Constant used within the SDK. In the majority of cases these are String values (StringSDKConstantType) however both Float and Integer constants can exist too.

const (
	// FloatSDKConstantType specifies that this represents a Float value.
	// This will be output in the Go SDK as a `float64`.
	FloatSDKConstantType SDKConstantType = "float"

	// IntegerSDKConstantType specifies that this represents an Integer value.
	// This will be output in the Go SDK as a `int64`.
	IntegerSDKConstantType SDKConstantType = "int"

	// StringSDKConstantType specifies that this represents a String value.
	// This will be output in the Go SDK as a `string`.
	StringSDKConstantType SDKConstantType = "string"
)

type SDKDateFormat

type SDKDateFormat = string

SDKDateFormat defines the required format for a DateTime value. whilst in the majority of cases this is going to be an RFC3339 value (specified by RFC3339SDKDateFormat) - multiple other types are possible however are unimplemented at this time. Related: https://github.com/hashicorp/pandora/issues/8

const (
	// RFC3339SDKDateFormat specifies that the DateTime is an RFC3339 value.
	RFC3339SDKDateFormat SDKDateFormat = "RFC3339"

	// RFC3339NanoSDKDateFormat specifies that the DateTime is an RFC3339Nano value.
	RFC3339NanoSDKDateFormat SDKDateFormat = "RFC3339Nano"
)

type SDKField

type SDKField struct {
	// ContainsDiscriminatedValue specifies whether this SDKField contains the Discriminated Value
	// used to uniquely identify a Discriminated Type.
	ContainsDiscriminatedValue bool `json:"isTypeHint"` // TODO: update the json struct tag once everything is switched overs

	// DateFormat specifies the SDKDateFormat which should be used when the ObjectDefinition is a
	// DateTimeSDKObjectDefinitionType.
	DateFormat *SDKDateFormat `json:"dateFormat,omitempty"`

	// Description specifies the description for this SDKField.
	Description string `json:"description"`

	// JsonName specifies the name of this field within the JSON - which is typically in camelCase.
	JsonName string `json:"jsonName"`

	// ObjectDefinition specifies the shape of the Type backing this SDKField.
	ObjectDefinition SDKObjectDefinition `json:"objectDefinition"`

	// Optional specifies that this SDKField is Optional and can be omitted from the Request/Response.
	// NOTE that a field must be either Optional or Required but not both.
	Optional bool `json:"optional"`

	// ReadOnly specifies that this SDKField is ReadOnly and so should be omitted from Requests but may
	// be present in the Response.
	// NOTE: This can either be used in conjunction with Optional and Computed or by itself (i.e. Computed).
	ReadOnly bool `json:"readOnly"`

	// Required specifies that this SDKField is Required and must be present in the Request/Response.
	// NOTE that a field must be either Optional or Required but not both.
	Required bool `json:"required"`

	// Sensitive specifies that this field contains a Sensitive value (such as a password or an API Key).
	Sensitive bool `json:"sensitive"`
}

SDKField defines a field present within a SDKModel. The shape of the field is described by the ObjectDefinition object.

type SDKModel

type SDKModel struct {
	// DiscriminatedValue optionally specifies the Discriminated Value for this Discriminated Implementation.
	DiscriminatedValue *string `json:"typeHintValue,omitempty"` // TODO: update the json struct tag once everything is switched over

	// FieldNameContainingDiscriminatedValue optionally specifies the Name of the Field which
	// contains the Discriminated Value used to uniquely identify the Discriminated Implementation.
	FieldNameContainingDiscriminatedValue *string `json:"typeHintIn"` // TODO: update the json struct tag once everything is switched over

	// Fields specifies a map of key (FieldName) to value (SDKField) which describes
	// the Fields present within this SDKModel.
	// NOTE: the Field Name is a valid Identifier.
	Fields map[string]SDKField `json:"fields"`

	// IsParent specifies whether this model is a known parent model, typically for discriminated child models.
	IsParent bool

	// ParentTypeName optionally specifies the name of the Parent Type for this Model.
	// If a ParentTypeName is present then this SDKModel will be a Discriminated Implementation
	// meaning that a TypeHintIn and TypeHintValue must also be specified in order to uniquely
	// identify this SDKModel from the Parent Type.
	ParentTypeName *string `json:"parentTypeName"`
}

SDKModel defines a Model used in an SDKOperation. A SDKModel should contain at least one field - unless it's a Discriminated Type when it may only contain fields from its parent.

func (SDKModel) IsDiscriminatedImplementation

func (m SDKModel) IsDiscriminatedImplementation() bool

IsDiscriminatedImplementation returns whether this SDKModel is a Discriminated Implementation. This means that this Model has both a Parent Type and a Discriminated Value.

func (SDKModel) IsDiscriminatedParentType

func (m SDKModel) IsDiscriminatedParentType() bool

IsDiscriminatedParentType returns whether this SDKModel is a Discriminated Parent Type. This means that this SDKModel will have associated Discriminated Implementations.

type SDKObjectDefinition

type SDKObjectDefinition struct {
	// NestedItem specifies the shape of the object nested within this SDK Object Definition.
	// For example an SDKObjectDefinition with a Type of List may contain a NestedItem which
	// in turn has a Type of ReferenceSDKObjectDefinitionType and a ReferenceName set, to indicate
	// that a `[]TheReferenceName` should be assumed/output.
	NestedItem *SDKObjectDefinition `json:"nestedItem,omitempty"`

	// ReferenceName is the name of either the Constant or Model that should be output when Type
	// is set to `ReferenceSDKObjectDefinitionType`.
	ReferenceName *string `json:"referenceName,omitempty"`

	// ReferenceNameIsCommonType specifies whether the referenced Constant or Model is a common type
	ReferenceNameIsCommonType *bool `json:"referenceNameIsCommonType,omitempty"`

	// Type specifies the Type that represents this SDK Object Definition. This can be either a
	// Simple type (e.g. a String/Integer), a Reference to a Constant/Model or a more complex object
	// (e.g. a CommonSchema type [such as a SystemAssignedIdentity] - or a List/Dictionary).
	Type SDKObjectDefinitionType `json:"type"`

	// Nullable specifies that this type should be unset by sending `null` as the JSON value.
	Nullable bool `json:"nullable"`
}

SDKObjectDefinition is used to represent a Type used in the SDK. Some examples of this:

  1. A Simple type (e.g. an integer/float/string).
  2. A Complex type (e.g. the CommonSchema type `SystemAssignedIdentitySDKObjectDefinitionType`).
  3. A Reference to another Constant/Model.
  4. A List/Dictionary containing any of the above (e.g. a List<string>, a List<SomeConstant>, a List<SomeModel>, a List<SystemAssignedIdentitySDKObjectDefinitionType>. These can be nested repeatedly too, for example `Dictionary<string, Dictionary<string, Dictionary<string, int>>>>`.

type SDKObjectDefinitionType

type SDKObjectDefinitionType string

SDKObjectDefinitionType defines the Type of Object Definition used in an SDKField. Possible values include Simple types (e.g. boolean/integer/float/string), References (to a Constant or Model), a Common Schema type (e.g. SystemAssignedIdentity) and a List or Dictionary of the previous values. Note that Lists (and Dictionaries) can be repeatedly nested (e.g. `List<List<List<string>>>`).

const (
	// BooleanSDKObjectDefinitionType specifies that this represents a Boolean value.
	// This will be output in the Go SDK as a `bool`.
	BooleanSDKObjectDefinitionType SDKObjectDefinitionType = "Boolean"

	// DateTimeSDKObjectDefinitionType specifies that this represents a DateTime value.
	// This will be output in the Go SDK as a `string` with Get and Set functions for
	// converting to/from a `time.Time` value.
	DateTimeSDKObjectDefinitionType SDKObjectDefinitionType = "DateTime"

	// FloatSDKObjectDefinitionType specifies that this represents a Float value.
	// This will be output in the Go SDK as a `float64`.
	FloatSDKObjectDefinitionType SDKObjectDefinitionType = "Float"

	// IntegerSDKObjectDefinitionType specifies that this represents an Integer value.
	// This will be output in the Go SDK as an `int64`.
	IntegerSDKObjectDefinitionType SDKObjectDefinitionType = "Integer"

	// StringSDKObjectDefinitionType specifies that this represents a String value.
	// This will be output in the Go SDK as a `string`.
	StringSDKObjectDefinitionType SDKObjectDefinitionType = "String"
)

Simple Types

const (
	// CSVSDKObjectDefinitionType specifies that this represents a CSV value.
	// This will be output in the Go SDK as a `string`.
	CSVSDKObjectDefinitionType SDKObjectDefinitionType = "Csv"

	// DictionarySDKObjectDefinitionType specifies that this represents a Dictionary value.
	// This will be output in the Go SDK as a `map[string]{TypeOfTheNestedObjectDefinition}`
	// Note that at this time we only support string keys.
	DictionarySDKObjectDefinitionType SDKObjectDefinitionType = "Dictionary"

	// ListSDKObjectDefinitionType specifies that this represents a List of values.
	// This will be output in the Go SDK as a `[]{TypeOfTheNestedObjectDefinition}`.
	ListSDKObjectDefinitionType SDKObjectDefinitionType = "List"

	// RawFileSDKObjectDefinitionType specifies that this represents a file-based payload.
	// This is _intentionally_ not named bytes to enable a `bytes` type to be added if required
	// in the future (for Data Plane operations).
	// This will be output in the Go SDK as a `[]byte`.
	RawFileSDKObjectDefinitionType SDKObjectDefinitionType = "RawFile"

	// RawObjectSDKObjectDefinitionType specifies that this represents any payload.
	// This will be output in the Go SDK as a `interface{}`.
	RawObjectSDKObjectDefinitionType SDKObjectDefinitionType = "RawObject"

	// ReferenceSDKObjectDefinitionType specifies that this represents a Constant or Model.
	// This will be output in the Go SDK as `{ReferenceName}`.
	ReferenceSDKObjectDefinitionType SDKObjectDefinitionType = "Reference"
)

Complex Objects

const (
	// EdgeZoneSDKObjectDefinitionType specifies that this represents an Edge Zone.
	// This will be output in the Go SDK as `edgezones.Model`.
	EdgeZoneSDKObjectDefinitionType SDKObjectDefinitionType = "EdgeZone"

	// LegacySystemAndUserAssignedIdentityListSDKObjectDefinitionType specifies that this represents one of the
	// Legacy Identity Types, where `SystemAssigned,UserAssigned` is the required value rather than the more
	// modern `SystemAssigned, UserAssigned` value.
	// This will be output in the Go SDK as `identity.LegacySystemAndUserAssignedList`.
	LegacySystemAndUserAssignedIdentityListSDKObjectDefinitionType SDKObjectDefinitionType = "LegacySystemAndUserAssignedIdentityList"

	// LegacySystemAndUserAssignedIdentityMapSDKObjectDefinitionType specifies that this represents one of the
	// Legacy Identity Types, where `SystemAssigned,UserAssigned` is the required value rather than the more
	// modern `SystemAssigned, UserAssigned` value.
	// This will be output in the Go SDK as `identity.LegacySystemAndUserAssignedMap`.
	LegacySystemAndUserAssignedIdentityMapSDKObjectDefinitionType SDKObjectDefinitionType = "LegacySystemAndUserAssignedIdentityMap"

	// LocationSDKObjectDefinitionType specifies that this represents an Azure Location/Region.
	// This will be output in the Go SDK as a `string`. // TODO: we should add a typealias for this
	LocationSDKObjectDefinitionType SDKObjectDefinitionType = "Location"

	// SystemAssignedIdentitySDKObjectDefinitionType specifies that this represents an Identity type which
	// only supports SystemAssigned identities.
	// This will be output in the Go SDK as `identity.SystemAssigned`.
	SystemAssignedIdentitySDKObjectDefinitionType SDKObjectDefinitionType = "SystemAssignedIdentity"

	// SystemAndUserAssignedIdentityListSDKObjectDefinitionType specifies that this represents an Identity type which
	// supports both SystemAssigned, User Assigned and both System and User Assigned identities with a List used for
	// the UserAssignedIdentityIDs.
	// This will be output in the Go SDK as `identity.SystemAssignedUserAssignedList`.
	SystemAndUserAssignedIdentityListSDKObjectDefinitionType SDKObjectDefinitionType = "SystemAndUserAssignedIdentityList"

	// SystemAndUserAssignedIdentityMapSDKObjectDefinitionType specifies that this represents an Identity type which
	// supports both SystemAssigned, User Assigned and both System and User Assigned identities with UserAssignedIdentityIDs
	// using a map[UserAssignedIdentityIDs]objects.
	// This will be output in the Go SDK as `identity.SystemAssignedUserAssignedMap`.
	SystemAndUserAssignedIdentityMapSDKObjectDefinitionType SDKObjectDefinitionType = "SystemAndUserAssignedIdentityMap"

	// SystemDataSDKObjectDefinitionType specifies that this represents the SystemData type - containing readonly
	// metadata about the resource.
	// This will be output in the Go SDK as `systemdata.SystemData`.
	SystemDataSDKObjectDefinitionType SDKObjectDefinitionType = "SystemData"

	// SystemOrUserAssignedIdentityListSDKObjectDefinitionType specifies that this represents an Identity type which
	// supports both SystemAssigned and User Assigned - but not both concurrently. The User Assigned Identities are
	// defined using a List of UserAssignedIdentityIDs.
	// This will be output in the Go SDK as `identity.SystemOrUserAssignedList`.
	SystemOrUserAssignedIdentityListSDKObjectDefinitionType SDKObjectDefinitionType = "SystemOrUserAssignedIdentityList"

	// SystemOrUserAssignedIdentityMapSDKObjectDefinitionType specifies that this represents an Identity type which
	// supports both SystemAssigned and User Assigned - but not both concurrently. The User Assigned Identities are
	// defined using a map[UserAssignedIdentityIDs]objects.
	// This will be output in the Go SDK as `identity.SystemOrUserAssignedMap`.
	SystemOrUserAssignedIdentityMapSDKObjectDefinitionType SDKObjectDefinitionType = "SystemOrUserAssignedIdentityMap"

	// TagsSDKObjectDefinitionType specifies that this represents a Dictionary of Tags.
	// This will be output in the Go SDK as `map[string]string`. // TODO: we should add a typealias for this
	TagsSDKObjectDefinitionType SDKObjectDefinitionType = "Tags"

	// UserAssignedIdentityListSDKObjectDefinitionType specifies that this represents an Identity type which
	// only supports UserAssigned identities - with a List used for the UserAssignedIdentityIDs.
	// This will be output in the Go SDK as `identity.UserAssignedList`.
	UserAssignedIdentityListSDKObjectDefinitionType SDKObjectDefinitionType = "UserAssignedIdentityList"

	// UserAssignedIdentityMapSDKObjectDefinitionType specifies that this represents an Identity type which
	// only supports UserAssigned identities - with UserAssignedIdentityIDs using a map[UserAssignedIdentityIDs]objects.
	// This will be output in the Go SDK as `identity.UserAssignedMap`.
	UserAssignedIdentityMapSDKObjectDefinitionType SDKObjectDefinitionType = "UserAssignedIdentityMap"

	// ZoneSDKObjectDefinitionType specifies that this represents a single Azure Availability Zone.
	// This will be output in the Go SDK as a `string`. // TODO: we should add a typealias for this
	ZoneSDKObjectDefinitionType SDKObjectDefinitionType = "Zone"

	// ZonesSDKObjectDefinitionType specifies that this represents a single Azure Availability Zone.
	// This will be output in the Go SDK as `zones.Schema`.
	ZonesSDKObjectDefinitionType SDKObjectDefinitionType = "Zones"
)

Common Schema Types

type SDKOperation

type SDKOperation struct {
	// ContentType specifies the HTTP `Content-Type` header which should be used when
	// performing the Request for this Operation.
	ContentType string `json:"contentType"`

	// Description is used to write a comment for the operation method
	Description string `json:"description"`

	// ExpectedStatusCodes specifies the list of Status Codes which are expected to be
	// returned by this Operation.
	ExpectedStatusCodes []int `json:"expectedStatusCodes"`

	// FieldContainingPaginationDetails is an optional field specifying the name of the
	// Field within the ResponseObject that contains the pagination information (e.g.
	// the `nextLink` or `@odata.link` field).
	FieldContainingPaginationDetails *string `json:"fieldContainingPaginationDetails,omitempty"`

	// LongRunning specifies if this is a Long Running Operation, meaning that this
	// Operation does not complete immediately - and must be polled until completion.
	// The type of Polling used depends on the HTTP Response - but typically polls on
	// either the HTTP Header `Location` and/or the `provisioningState` value.
	LongRunning bool `json:"longRunning"`

	// Method specifies the HTTP Method used for this operation, e.g. GET, POST, PATCH.
	Method string `json:"method"`

	// Options specifies a map of Option Name (key) to SDKOperationOption (value) which
	// allows supporting optional QueryString or HTTP Header parameters. Example of these
	// are the QueryString parameter `forceDelete` and the HTTP Header `If-Match`.
	// NOTE: the Option Name is a valid Identifier.
	Options map[string]SDKOperationOption `json:"options"`

	// RequestObject optionally specifies the Object which must be provided in the Request.
	// This is represented by an SDKObjectDefinition, which defines the shape of the object.
	RequestObject *SDKObjectDefinition `json:"requestObject"`

	// ResourceIDName optionally specifies the name of the Resource ID related to this Operation.
	// When specified, this forms part of the Request URI - and MAY or MAY NOT be supplemented by
	// a URISuffix.
	// This means the Request URI can be either:
	//   1. {formattedResourceId}
	//   2. {formattedResourceId}{uriSuffix}
	//   3. {uriSuffix}
	ResourceIDName *string `json:"resourceIdName"`

	// ResourceIDNameIsCommonType specifies whether the referenced ResourceIdName is a common type
	ResourceIDNameIsCommonType *bool `json:"resourceIdNameIsCommonType,omitempty"`

	// ResponseObject optionally specifies the Object which is expected to be returned in the
	// HTTP Response. This is represented by an SDKObjectDefinition, which defines the shape
	// of the object.
	ResponseObject *SDKObjectDefinition `json:"responseObject"`

	// URISuffix optionally specifies a static value which will be suffixed onto the URI for
	// this Operation. This is typically used to perform Operations on Resources (e.g. `/shutdown`).
	// When specified, this forms part of the Request URI - and MAY or MAY NOT be supplemented by
	// a ResourceID.
	// This means the Request URI can be either:
	//   1. {formattedResourceId}
	//   2. {formattedResourceId}{uriSuffix}
	//   3. {uriSuffix}
	URISuffix *string `json:"uriSuffix"`
}

SDKOperation defines an API Operation (e.g. a GET operation against an endpoint within Azure Resource Manager or Microsoft Graph) that should be output in (and assumed to exist within) the Go SDK. This information includes the HTTP Method used, any Request/Response Payloads and the expected status codes, amongst other properties.

type SDKOperationOption

type SDKOperationOption struct {
	// HeaderName specifies the name of the HTTP Header associated with this Option.
	HeaderName *string `json:"headerName,omitempty"`

	// Type signals a special behavior for this Option.
	//   Data: this option specifies Request data, as described in ObjectDefinition, HeaderName, ODataFieldName and/or QueryStringName.
	//   ContentType: this option specifies a custom Content Type for the Request to be specified by the caller.
	//   RetryFunc: this option specifies a client.RequestRetryFunc that can be passed in.
	Type SDKOperationOptionType `json:"type"`

	// ODataFieldName specifies the name for the OData query string parameter associated with this Option.
	ODataFieldName *string `json:"odataFieldName,omitempty"`

	// QueryStringName specifies the name for the QueryString key associated with this Option.
	QueryStringName *string `json:"queryStringName,omitempty"`

	// ObjectDefinition specifies the shape of the payload this Option represents.
	ObjectDefinition SDKOperationOptionObjectDefinition `json:"objectDefinition"`

	// Required specifies whether this Option must be specified in the Request or not.
	Required bool `json:"required"`
}

SDKOperationOption defines a QueryString or HTTP Header that can be specified for an Operation.

type SDKOperationOptionObjectDefinition

type SDKOperationOptionObjectDefinition struct {
	// NestedItem specifies the shape of any Nested object for this Object Definition.
	NestedItem *SDKOperationOptionObjectDefinition `json:"nestedItem,omitempty"`

	// ReferenceName specifies the name of the Constant when Type is set to
	// ReferenceSDKOperationOptionObjectDefinitionType.
	ReferenceName *string `json:"referenceName,omitempty"`

	// Type specifies the Type of Object that represents this Object Definition.
	// This can either be a Simple type (e.g. bool/integer/float/string), a Reference
	// to a Constant or a List of one of the previous items (e.g. `List<string>`).
	Type SDKOperationOptionObjectDefinitionType `json:"type"`
}

SDKOperationOptionObjectDefinition defines the shape of an SDKOperationOption. This can either represent a Simple type (e.g. bool/integer/float/string), a Reference to a Constant or a List of one of the previous items (e.g. `List<string>`).

type SDKOperationOptionObjectDefinitionType

type SDKOperationOptionObjectDefinitionType string

SDKOperationOptionObjectDefinitionType defines the Type of Object Definition used in an SDKOperationOption. Possible values include Simple types (boolean/integer/float/string), References (to a Constant) and a List of the previous values.

const (
	// BooleanSDKOperationOptionObjectDefinitionType defines that the payload is a Boolean.
	// This will be output as the Go type `bool`.
	BooleanSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "Boolean"

	// CSVSDKOperationOptionObjectDefinitionType defines that the payload is a list of Comma Separated Values.
	// This will be output as the Go type `string`.
	CSVSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "Csv"

	// IntegerSDKOperationOptionObjectDefinitionType defines that the payload is an Integer.
	// This will be output as the Go type `int64`.
	IntegerSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "Integer"

	// FloatSDKOperationOptionObjectDefinitionType defines that the payload is a Float.
	// This will be output as the Go type `float64`.
	FloatSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "Float"

	// ListSDKOperationOptionObjectDefinitionType defines that the payload is a List.
	// A List must always contain a Nested Item (stating what it's a List of).
	// This will be output as a Go slice (e.g. `[]string` for a List<string>`).
	ListSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "List"

	// ReferenceSDKOperationOptionObjectDefinitionType defines that the payload is a reference to a Constant.
	// This will be output as the associated Reference name (e.g. `AvailableSkusConstant`).
	ReferenceSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "Reference"

	// StringSDKOperationOptionObjectDefinitionType defines that the payload is a String.
	// This will be output as the Go type `string`.
	StringSDKOperationOptionObjectDefinitionType SDKOperationOptionObjectDefinitionType = "String"
)

type SDKOperationOptionType

type SDKOperationOptionType = string
const (
	SDKOperationOptionTypeData        SDKOperationOptionType = "Data"
	SDKOperationOptionTypeContentType SDKOperationOptionType = "ContentType"
	SDKOperationOptionTypeRetryFunc   SDKOperationOptionType = "RetryFunc"
)

type Service

type Service struct {
	// APIVersions specifies a map of API Version (key) to APIVersion (value)
	// which defines the available API Versions for this Service.
	APIVersions map[string]APIVersion

	// Generate specifies whether this Service should be generated or not.
	Generate bool `json:"generate"`

	// Name specifies the name of this Service.
	Name string

	// ResourceProvider optionally specifies the Azure Resource Provider
	// that this Service is related to.
	// Note that this only exists when the SourceDataType is ResourceManagerSourceDataType.
	// Also note that Resource Providers do NOT have to start with `Microsoft.`.
	ResourceProvider *string

	// TerraformDefinition optionally specifies the Terraform Data Sources and
	// Terraform Resources which are included as a part of this Service.
	TerraformDefinition *TerraformDefinition
}

Service defines a collection of APIVersion's which are all grouped/related to the same area. An example of this would be `Compute` which contains the APIVersion `2021-01-01` which in turn contains APIResource's for `ManagedDisks` and `VirtualMachines`.

type SourceDataOrigin

type SourceDataOrigin = string

SourceDataOrigin defines where a given set of Source Data (associated with a SourceDataType) came from - both for informational purposes and for licence attribution as needed.

const (
	// AzureRestAPISpecsSourceDataOrigin specifies that the Source Data comes from the
	// Azure Rest API Specs repository at `github.com/Azure/azure-rest-api-specs`.
	AzureRestAPISpecsSourceDataOrigin SourceDataOrigin = "ResourceManagerRestApiSpecs"

	// MicrosoftGraphMetaDataSourceDataOrigin specifies that the Source Data comes from the
	// Microsoft Graph MetaData repository at `github.com/microsoftgraph/msgraph-metadata`.
	MicrosoftGraphMetaDataSourceDataOrigin SourceDataOrigin = "MicrosoftGraphMetadata"

	// HandWrittenSourceDataOrigin specifies that this data was written by hand.
	HandWrittenSourceDataOrigin SourceDataOrigin = "HandWritten"
)

type SourceDataType

type SourceDataType string

SourceDataType defines a type of Source Data.

const (
	// MicrosoftGraphSourceDataType defines that this Data is related to Microsoft Graph.
	MicrosoftGraphSourceDataType SourceDataType = "microsoft-graph"

	// ResourceManagerSourceDataType defines that this Data is related to Azure Resource Manager.
	ResourceManagerSourceDataType SourceDataType = "resource-manager"
)

type TerraformDefinition

type TerraformDefinition struct {
	// Resources defines a map of Resource Label (key) to TerraformResourceDetails
	// containing information about the Terraform Resources defined within this Service.
	Resources map[string]TerraformResourceDefinition `json:"resources"`

	// TerraformPackageName specifies the name of the Terraform Package associated with this Service.
	TerraformPackageName string `json:"terraformPackageName"`
}

TerraformDefinition defines the available Terraform Data Sources and Resources available within this Service.

type TerraformDirectAssignmentFieldMappingDefinition

type TerraformDirectAssignmentFieldMappingDefinition struct {
	// TODO: remove this unnecessary wrapper object once the updated SDK is rolled out everywhere
	DirectAssignment TerraformDirectAssignmentFieldMappingDefinitionImpl `json:"directAssignment"`
}

TerraformDirectAssignmentFieldMappingDefinition defines that a TerraformSchemaField within a TerraformSchemaModel should be mapped onto an SDKField within an SDKModel.

func (TerraformDirectAssignmentFieldMappingDefinition) MarshalJSON

type TerraformDirectAssignmentFieldMappingDefinitionImpl

type TerraformDirectAssignmentFieldMappingDefinitionImpl struct {
	// TerraformSchemaModelName specifies the name of the TerraformSchemaModel where the TerraformSchemaField named in
	// TerraformSchemaFieldName exists.
	TerraformSchemaModelName string `json:"schemaModelName"` // TODO: rename the struct tags once everything is refactored

	// TerraformSchemaFieldName specifies the name of the TerraformSchemaField (within the TerraformSchemaModel named in
	// TerraformSchemaModelName) where the value for SDKFieldName should be mapped to/from.
	TerraformSchemaFieldName string `json:"schemaFieldPath"` // TODO: rename the struct tags once everything is refactored

	// SDKModelName specifies the name of the SDKModel where the SDKField named in SDKFieldName exists.
	SDKModelName string `json:"sdkModelName"`

	// SDKFieldName specifies the name of the SDKField (within the SDKModel named in SDKModelName) that should be mapped
	// to/from the value for the TerraformSchemaField (named in TerraformSchemaFieldName).
	SDKFieldName string `json:"sdkFieldPath"` // TODO: rename the struct tags once everything is refactored
}

type TerraformDocumentationDefinition

type TerraformDocumentationDefinition struct {
	// Category specifies the Website Category for this Terraform Data Source/Resource.
	// This allows related Terraform Data Sources and Resources to be grouped together
	// in the Terraform Registry.
	Category string `json:"category"`

	// Description specifies a friendly, human-readable summary for this Terraform Data
	// Source/Resource. This will be output in the documentation and should be both concise
	// yet clear.
	Description string `json:"description"`

	// ExampleUsageHCL specifies the HCL used in the `Example Usage` component within the
	// documentation for this Terraform Data Source/Resource.
	// This should be a minimal Terraform Configuration, containing only Required properties
	// of how to use this Terraform Data Source/Resource.
	ExampleUsageHCL string `json:"exampleUsageHcl"`
}

TerraformDocumentationDefinition defines the core set of documentation related properties for a Terraform Data Source/Resource.

type TerraformFieldMappingDefinition

type TerraformFieldMappingDefinition interface {
	// contains filtered or unexported methods
}

TerraformFieldMappingDefinition defines how a given TerraformSchemaField within a TerraformSchemaModel should be mapped onto a SDKField within a SDKModel.

type TerraformFieldMappingDefinitionType

type TerraformFieldMappingDefinitionType = string

TerraformFieldMappingDefinitionType specifies a type of mapping for a TerraformSchemaField. The specifics of the type of mapping change based on the implementation - but map a TerraformSchemaField to/from a SDKField in some manner.

const (
	// DirectAssignmentTerraformFieldMappingDefinitionType specifies a DirectAssignment mapping.
	// This represents a literal direct assignment (e.g. `sdkmodel.SomeField = schemamodel.SomeField`).
	DirectAssignmentTerraformFieldMappingDefinitionType TerraformFieldMappingDefinitionType = "DirectAssignment"

	// ModelToModelTerraformFieldMappingDefinitionType specifies a ModelToModel mapping for a TerraformSchemaField.
	// This represents an SDKField needs to be mapped to/from a TerraformSchemaModel.
	ModelToModelTerraformFieldMappingDefinitionType TerraformFieldMappingDefinitionType = "ModelToModel"
)

type TerraformMappingDefinition

type TerraformMappingDefinition struct {
	// Fields specifies the mappings between a TerraformSchemaField (within a TerraformSchemaModel) and
	// a SDKField (within a SDKModel).
	Fields []TerraformFieldMappingDefinition `json:"fields"`

	// ModelToModels specifies the mappings between TerraformSchemaModel's and SDKModel's.
	// This information is aggregated from the other mapping types, and is present to make
	// ordering the output simpler.
	// TODO: determine if this is still needed.
	ModelToModels []TerraformModelToModelMappingDefinition `json:"modelToModel"`

	// ResourceID specifies the mappings between any Segments within the ResourceID and a TerraformSchemaModel.
	// This is used in both the Create function (to build up the ResourceID) and in the Read function
	// (to populate the TerraformSchemaField values stored within the ResourceID).
	ResourceID []TerraformResourceIDMappingDefinition `json:"resourceId"`
}

TerraformMappingDefinition defines how Fields within TerraformSchemaModel's should be mapped onto either SDKField/SDKModel's or ResourceID segments.

func (*TerraformMappingDefinition) UnmarshalJSON

func (d *TerraformMappingDefinition) UnmarshalJSON(bytes []byte) error

type TerraformMethodDefinition

type TerraformMethodDefinition struct {
	// Generate specifies whether the function should be generated for this Method for the
	// Terraform Data Source/Resource in question.
	Generate bool `json:"generate"`

	// SDKOperationName specifies the name of the SDKOperation which should be invoked as
	// a part of this Terraform Method, to (for example) Create the Terraform Resource.
	SDKOperationName string `json:"methodName"` // TODO: update the json struct tag once everything is refactored

	// TimeoutInMinutes specifies the Terraform Timeout for this Method for the Terraform
	// Data Source/Resource (in minutes).
	TimeoutInMinutes int `json:"timeoutInMinutes"`
}

TerraformMethodDefinition defines how the configuration for a particular Terraform Method such as Create, Read, Update or Delete within a Terraform Data Source/Resource.

type TerraformModelToModelFieldMappingDefinition

type TerraformModelToModelFieldMappingDefinition struct {
	// TODO: remove this unnecessary wrapper object once the updated SDK is rolled out everywhere
	ModelToModel TerraformModelToModelFieldMappingDefinitionImpl `json:"modelToModel"`
}

TerraformModelToModelFieldMappingDefinition defines that the SDKField named in SDKFieldName should be mapped to/from the TerraformSchemaModel named in TerraformSchemaModelName by calling the associated `map{TerraformSchemaModelName}To{SDKModel}` (and vica-versa) function.

This enables fields which contain nested models (e.g. a list of `[]Subnets`) to be mapped across.

func (TerraformModelToModelFieldMappingDefinition) MarshalJSON

type TerraformModelToModelFieldMappingDefinitionImpl

type TerraformModelToModelFieldMappingDefinitionImpl struct {
	// TerraformSchemaModelName specifies the name of the TerraformSchemaModel which should be mapped to/from the SDKModel
	// named in SDKModelName.
	TerraformSchemaModelName string `json:"schemaModelName"`

	// SDKModelName specifies the name of the SDKModel which should be mapped to/from the TerraformSchemaModel named in
	// TerraformSchemaModelName.
	SDKModelName string `json:"sdkModelName"`

	// SDKFieldName specifies the name of the SDKField within the SDKModel (defined in SDKModelName) which should be
	// mapped to/from the TerraformSchemaModel (defined in TerraformSchemaModelName).
	SDKFieldName string `json:"sdkFieldName"`
}

type TerraformModelToModelMappingDefinition

type TerraformModelToModelMappingDefinition struct {
	// SDKModelName specifies the name of the SDKModel which should be mapped to/from the
	// TerraformSchemaModel named in TerraformSchemaModelName.
	SDKModelName string `json:"sdkModelName"`

	// TerraformSchemaModelName specifies the name of the TerraformSchemaModel which should
	// be mapped to/from the SDKModel named in SDKModelName.
	TerraformSchemaModelName string `json:"schemaModelName"`
}

TerraformModelToModelMappingDefinition defines XXX. This is used to output both the `map{TerraformSchemaModelName}To{SDKModelName}` and `map{SDKModelName}To{TerraformSchemaModelName}` functions.

type TerraformResourceDefinition

type TerraformResourceDefinition struct {
	// APIResource specifies the name of the APIResource within this APIVersion/Service where the
	// SDK that this Terraform Resource will use.
	APIResource string `json:"resource"` // TODO: update the json struct tag once everything is updated

	// APIVersion specifies the API Version that should be used for this Terraform Resource.
	APIVersion string `json:"apiVersion"`

	// CreateMethod specifies the configuration for the Create method of the generated Terraform Resource.
	// This includes whether this should be generated, the SDKMethod to use and the default timeout.
	CreateMethod TerraformMethodDefinition `json:"createMethod"`

	// DeleteMethod specifies the configuration for the Delete method of the generated Terraform Resource.
	// This includes whether this should be generated, the SDKMethod to use and the default timeout.
	DeleteMethod TerraformMethodDefinition `json:"deleteMethod"`

	// Documentation specifies metadata that's used to generate the Documentation for this Terraform Resource.
	Documentation TerraformDocumentationDefinition `json:"documentation"`

	// DisplayName specifies the human-readable/marketing name for this Terraform Resource.
	// Note that any abbreviations (such as `VM`) should be spelled out - e.g. `Virtual Machine` rather than `VM`.
	DisplayName string `json:"displayName"`

	// Generate specifies whether this Terraform Resource should be generated or not.
	Generate bool `json:"generate"`

	// GenerateModel specifies whether the Terraform Schema Model(s) should be generated for this
	// Terraform Resource.
	// If this is set to `false` then this must be specified in the Provider by hand.
	GenerateModel bool `json:"generateModel"`

	// GenerateIDValidation specifies whether the Resource ID Validation function should be generated
	// for this Resource - which is used during Terraform Import.
	// If this is set to `false` then this must be specified in the Provider by hand.
	GenerateIDValidation bool `json:"generateIdValidation"`

	// GenerateSchema specifies whether the Terraform Schema should be generated for this Terraform Resource.
	// If this is set to `false` then this must be specified in the Provider by hand.
	GenerateSchema bool `json:"generateSchema"`

	// Mappings specifies the Terraform Mappings for this Terraform Resource.
	// These define how SDKField's within SDKModel's are mapped onto TerraformSchemaField's within the associated
	// TerraformSchemaModel's for this Terraform Resource.
	Mappings TerraformMappingDefinition `json:"mappings"`

	// ReadMethod specifies the configuration for the Read method of the generated Terraform Resource.
	// This includes whether this should be generated, the SDKMethod to use and the default timeout.
	ReadMethod TerraformMethodDefinition `json:"readMethod"`

	// ResourceIDName specifies the name of the Resource ID used for this Terraform Resource.
	ResourceIDName string `json:"resourceIdName"`

	// ResourceLabel specifies the label for this Resource, without any Provider Prefix.
	// Example: `resource_group` (to form `azurerm_resource_group`).
	ResourceLabel string `json:"resourceLabel"`

	// ResourceName specifies the name of this Resource.
	// The Resource Name is an Identifier.
	ResourceName string `json:"resourceName"`

	// SchemaModelName specifies the name of the Terraform Schema Model for this Terraform Resource
	SchemaModelName string `json:"schemaModelName"`

	// SchemaModels specifies a map of Schema Model Name (key) to TerraformSchemaModel (value) which
	// defines the Terraform Schema Models used in this Terraform Resource. This contains both the
	// top-level Schema Model (referenced in SchemaModelName) and any nested Schema Models.
	SchemaModels map[string]TerraformSchemaModel `json:"schemaModels"`

	// Tests specifies the Terraform Configurations used to test this Terraform Resource.
	Tests TerraformResourceTestsDefinition `json:"tests"`

	// UpdateMethod optionally specifies the configuration for the Update method of the generated Terraform
	// Resource.
	// This includes whether this should be generated, the SDKMethod to use and the default timeout.
	// Note that not all Terraform Resources support update - which is signified by this field being nil.
	UpdateMethod *TerraformMethodDefinition `json:"updateMethod,omitempty"`
}

TerraformResourceDefinition defines a Terraform Resource that is either fully or partially generated.

type TerraformResourceIDMappingDefinition

type TerraformResourceIDMappingDefinition struct {
	// ParsedFromParentID specifies whether the TerraformSchemaField named in TerraformSchemaFieldName
	// comes from the Parent Resources ResourceID rather than the ResourceID for the current Terraform Resource.
	ParsedFromParentID bool `json:"parsedFromParentId"`

	// SegmentName specifies the Name of the ResourceIDSegment within the ResourceID where the
	// TerraformSchemaField named in TerraformSchemaFieldName should be mapped to/from.
	SegmentName string `json:"segmentName"`

	// TerraformSchemaFieldName specifies the Name of the TerraformSchemaField within the top-level
	// TerraformSchemaModel where the ResourceIDSegment named in SegmentName should be mapped to/from.
	TerraformSchemaFieldName string `json:"schemaFieldName"` // TODO: update the json struct tag name once refactored?
}

TerraformResourceIDMappingDefinition defines how a TerraformSchemaField should be mapped to/from a ResourceIDSegment. This allows mapping fields which only exist within the ResourceID (such as a ResourceGroupName) to be retrieved from and stored within the top-level TerraformSchemaModel for a Terraform Resource.

type TerraformResourceTestsDefinition

type TerraformResourceTestsDefinition struct {
	// BasicConfiguration specifies the most basic/minimal Terraform Configuration required
	// to provision the associated Terraform Resource.
	BasicConfiguration TerraformTestDefinition `json:"basicConfiguration"`

	// RequiresImportConfiguration specifies the Terraform Configuration used to validate that
	// a Resource which already exists needs to be imported to be able to use it.
	// This should reuse and interpolate values for fields from BasicConfiguration, which is
	// used to provision a minimal resource we can rely on existing for this Test Configuration.
	RequiresImportConfiguration TerraformTestDefinition `json:"requiresImportConfiguration"`

	// CompleteConfiguration optionally specifies the Terraform Configuration used for the Complete
	// Test - which includes all possible fields that can be set for this Resource.
	// Note that this is optional because if a Terraform Resource contains only Required fields then
	// this test case would be superfluous (and covered by BasicConfiguration).
	CompleteConfiguration *TerraformTestDefinition `json:"completeConfiguration,omitempty"`

	// Generate specifies whether the Tests should be generated or not.
	// If this is set to `false` then these are assumed to exist (e.g. by hand) in the Terraform Provider.
	Generate bool `json:"generate"`

	// OtherTests optionally specifies a map of Test Name (key) to a slice of Test Configurations (value) which
	// are output as Acceptance Tests.
	OtherTests *map[string][]TerraformTestDefinition `json:"otherTests,omitempty"`

	// TemplateConfiguration optionally specifies a Terraform Configuration to use as a Template
	// for each of the other tests defined above, which includes any parent Terraform Data Sources
	// or Resources needed to provision the Terraform Resource being tested.
	TemplateConfiguration *TerraformTestDefinition `json:"templateConfiguration,omitempty"`
}

TerraformResourceTestsDefinition defines the Test Configurations for a Terraform Resource. Each Terraform Resource is backed by at a minimum a Basic and RequiresImport Test Configuration however may optionally have more tests including Complete and extra tests with multiple stages as defined in `OtherTests`.

type TerraformSchemaField

type TerraformSchemaField struct {

	// Computed specifies whether this field is Computed - meaning that there is a default value
	// for this field set by the API.
	// Note that it's preferable for a field to be Optional with a Default value, rather than Computed.
	Computed bool `json:"computed"`

	// Documentation specifies the Documentation available for this field
	Documentation TerraformSchemaFieldDocumentationDefinition `json:"documentation"`

	// ForceNew specifies whether this field is ForceNew - meaning that it can only be set during Creation
	// and that to update the value the Terraform Resource must be recreated.
	ForceNew bool `json:"forceNew"`

	// HCLName specifies the HCL Name for this field within the Terraform Schema.
	HCLName string `json:"hclName"`

	// ObjectDefinition specifies the Type of this field, mapping to Types in the Terraform Schema.
	// Examples include a String or a List of a Model.
	ObjectDefinition TerraformSchemaObjectDefinition `json:"objectDefinition"`

	// Optional specifies whether this field is Optional, e.g. whether it can be omitted.
	Optional bool `json:"optional"`

	// Requires specifies whether this field is Required, e.g. whether it must be specified.
	Required bool `json:"required"`

	// Validation specifies the validation criteria for this field, for example a set of fixed values.
	Validation TerraformSchemaFieldValidationDefinition `json:"validation"`
}

TerraformSchemaField defines a Field within a TerraformSchemaModel, which is output in both the generated Model and the Terraform Schema for this Terraform Resource.

func (*TerraformSchemaField) UnmarshalJSON

func (f *TerraformSchemaField) UnmarshalJSON(bytes []byte) error

type TerraformSchemaFieldDocumentationDefinition

type TerraformSchemaFieldDocumentationDefinition struct {

	// Markdown specifies the documentation for this field in the Markdown format.
	Markdown string `json:"markdown"`
}

TerraformSchemaFieldDocumentationDefinition defines the documentation for a TerraformSchemaField.

type TerraformSchemaFieldValidationDefinition

type TerraformSchemaFieldValidationDefinition interface {
	// contains filtered or unexported methods
}

TerraformSchemaFieldValidationDefinition defines the type of Validation available for a TerraformSchemaField.

type TerraformSchemaFieldValidationPossibleValuesDefinition

type TerraformSchemaFieldValidationPossibleValuesDefinition struct {
	// TODO: remove this inner object once the SDK Refactor is complete since we're now using Discriminators directly.
	PossibleValues *TerraformSchemaFieldValidationPossibleValuesDefinitionImpl `json:"possibleValues"`
}

TerraformSchemaFieldValidationPossibleValuesDefinition defines a list of Possible Values for a TerraformSchemaField.

func (TerraformSchemaFieldValidationPossibleValuesDefinition) MarshalJSON

type TerraformSchemaFieldValidationPossibleValuesDefinitionImpl

type TerraformSchemaFieldValidationPossibleValuesDefinitionImpl struct {
	// NOTE: this temporary struct exists until the SDK refactor is complete, at which point it can be inlined within the parent
	Type TerraformSchemaFieldValidationPossibleValuesType `json:"type"`

	// Values is the list of possible values allowed for this field, which can either be
	// a []int64, []float64 or []string depending on the value of `Type`.
	Values []any `json:"values"`
}

type TerraformSchemaFieldValidationPossibleValuesType

type TerraformSchemaFieldValidationPossibleValuesType string

TerraformSchemaFieldValidationPossibleValuesType defines the type of possible values for a TerraformSchemaField.

const (
	// FloatTerraformSchemaFieldValidationPossibleValuesType specifies that the list of possible values contains
	// Float values.
	FloatTerraformSchemaFieldValidationPossibleValuesType TerraformSchemaFieldValidationPossibleValuesType = "Float"

	// IntegerTerraformSchemaFieldValidationPossibleValuesType specifies that the list of possible values contains
	// Integer values.
	IntegerTerraformSchemaFieldValidationPossibleValuesType TerraformSchemaFieldValidationPossibleValuesType = "Int"

	// StringTerraformSchemaFieldValidationPossibleValuesType specifies that the list of possible values contains
	// String values.
	StringTerraformSchemaFieldValidationPossibleValuesType TerraformSchemaFieldValidationPossibleValuesType = "String"
)

type TerraformSchemaFieldValidationType

type TerraformSchemaFieldValidationType = string

TerraformSchemaFieldValidationType defines the type of Validation used for a TerraformSchemaField.

const (
	// PossibleValuesTerraformSchemaFieldValidationType specifies that one of a fixed set of possible values must
	// be specified for this field.
	// Example: [`Standard` and `Basic` SKUs] or [`1-5`]
	PossibleValuesTerraformSchemaFieldValidationType TerraformSchemaFieldValidationType = "PossibleValues"
)

type TerraformSchemaModel

type TerraformSchemaModel struct {
	// Fields specifies a map of Field Name (key) to TerraformSchemaField (value) representing
	// the Fields available within this Schema Model.
	// The Field Name is an Identifier.
	Fields map[string]TerraformSchemaField `json:"fields"`
}

TerraformSchemaModel defines a Model used within the Terraform Schema for a Terraform Data Source/Resource.

type TerraformSchemaObjectDefinition

type TerraformSchemaObjectDefinition struct {
	// NestedObject specifies any Nested Object housed within this TerraformSchemaObjectDefinition.
	// This is only specified when Type is set to DictionaryTerraformSchemaObjectDefinitionType,
	// ListTerraformSchemaObjectDefinitionType or SetTerraformSchemaObjectDefinitionType.
	NestedObject *TerraformSchemaObjectDefinition `json:"nestedObject"`

	// ReferenceName specifies the Constant or Model which is used as a Reference.
	// This is only specified when Type is set to ReferenceTerraformSchemaObjectDefinitionType.
	ReferenceName *string `json:"referenceName"`

	// Type specifies the Type of field that this is, for example a String or a Location.
	Type TerraformSchemaObjectDefinitionType `json:"type"`
}

TerraformSchemaObjectDefinition is used to represent a Type used in the Terraform Schema. Some examples of this:

  1. A Simple type (e.g. an integer/float/string).
  2. A Complex type (e.g. the CommonSchema type `SystemAssignedIdentityTerraformSchemaObjectDefinitionType`).
  3. A Reference to another Constant/Model (.
  4. A List/Dictionary containing any of the above (e.g. a List<string>, a List<SomeConstant>, a List<SomeModel>, a List<SystemAssignedIdentityTerraformSchemaObjectDefinitionType>.

type TerraformSchemaObjectDefinitionType

type TerraformSchemaObjectDefinitionType string

TerraformSchemaObjectDefinitionType defines the Type of Object Definition used in an TerraformSchemaObjectDefinition. Possible values include Simple types (boolean/integer/float/string), References (to a Constant or Model) and a List of the previous values.

const (
	// BooleanTerraformSchemaObjectDefinitionType specifies that this represents a Boolean value.
	// This is output as a `bool` in Models and as `pluginsdk.TypeBool` within the Terraform Schema.
	BooleanTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Boolean"

	// DateTimeTerraformSchemaObjectDefinitionType specifies that this represents a DateTime value.
	// This is output as a `string` in Models and as `pluginsdk.TypeString` within the Schema.
	DateTimeTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "DateTime"

	// FloatTerraformSchemaObjectDefinitionType specifies that this represents a Float value.
	// This is output as a `float64` in Models and as `pluginsdk.TypeFloat` within the Schema.
	FloatTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Float"

	// IntegerTerraformSchemaObjectDefinitionType specifies that this represents an Integer value.
	// This is output as an `int64` in Models and as `pluginsdk.TypeInt` within the Schema.
	IntegerTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Integer"

	// StringTerraformSchemaObjectDefinitionType specifies that this represents a String value.
	// This is output as a `string` in Models and as `pluginsdk.TypeString` within the Schema.
	StringTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "String"
)
const (
	// DictionaryTerraformSchemaObjectDefinitionType specifies that this represents a Dictionary value.
	// Note that a Dictionary must have an associated NestedItem which defines the Dictionary's Value type.
	// This is output as a `map[string]NestedObjectType` in Models and as `pluginsdk.TypeMap` within the Schema.
	DictionaryTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Dictionary"

	// ListTerraformSchemaObjectDefinitionType specifies that this represents a List value.
	// Note that a List must have an associated NestedItem which defines the List's Value type.
	// This is output as a `[]NestedObjectType` in Models and as `pluginsdk.TypeList` within the Schema.
	ListTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "List"

	// ReferenceTerraformSchemaObjectDefinitionType specifies that this represents a reference to another
	// Constant/Model.
	// This is output as a `NestedObjectType` in Models and as `pluginsdk.TypeList` (with MaxItems: 1) within
	// the Schema.
	ReferenceTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Reference"

	// SetTerraformSchemaObjectDefinitionType specifies that this represents a Set value.
	// Note that a Set must have an associated NestedItem which defines the Set's Value type.
	// This is output as a `[]NestedObjectType` in Models and as `pluginsdk.TypeSet` within the Schema.
	SetTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Set"
)
const (
	// EdgeZoneTerraformSchemaObjectDefinitionType specifies that this represents the Edge Zone Common Schema type.
	// This is output as a `[]NestedObjectType` in Models and as `commonschema.EdgeZoneXXX` within the Schema.
	EdgeZoneTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "EdgeZone"

	// LocationTerraformSchemaObjectDefinitionType specifies that this represents the Location Common Schema type.
	// This is output as a `string` in Models and as `commonschema.LocationXXX` within the Schema. // TODO: introduce a typealias for the model?
	LocationTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Location"

	// ResourceGroupTerraformSchemaObjectDefinitionType specifies that this represents the Resource Group Name Common
	// Schema type.
	// This is output as a `string` in Models and as `commonschema.ResourceGroupXXX` within the Schema. // TODO: introduce a typealias for the model?
	ResourceGroupTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "ResourceGroup"

	// TagsTerraformSchemaObjectDefinitionType specifies that this represents the Tags Common Schema type.
	// This is output as a `map[string]string` in Models and as `commonschema.TagsXXX` within the Schema. // TODO: introduce a typealias for the model?
	TagsTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Tags"

	// SystemAssignedIdentityTerraformSchemaObjectDefinitionType specifies that this represents the System Assigned Identity
	// Common Schema type.
	SystemAssignedIdentityTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "IdentitySystemAssigned"

	// SystemAndUserAssignedIdentityTerraformSchemaObjectDefinitionType specifies that this represents the System AND User
	// Assigned Identity Common Schema type.
	SystemAndUserAssignedIdentityTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "IdentitySystemAndUserAssigned"

	// SystemOrUserAssignedIdentityTerraformSchemaObjectDefinitionType specifies that this represents the System OR User
	// Assigned Identity Common Schema type.
	SystemOrUserAssignedIdentityTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "IdentitySystemOrUserAssigned"

	// UserAssignedIdentityTerraformSchemaObjectDefinitionType specifies that this represents the User Assigned Identity
	// Common Schema type.
	UserAssignedIdentityTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "IdentityUserAssigned"

	// ZoneTerraformSchemaObjectDefinitionType specifies that this represents the Singular Zone Common Schema type.
	ZoneTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Zone"

	// ZonesTerraformSchemaObjectDefinitionType specifies that this represents the Multiple Zones Common Schema type.
	ZonesTerraformSchemaObjectDefinitionType TerraformSchemaObjectDefinitionType = "Zones"
)

type TerraformTestDefinition

type TerraformTestDefinition = string

TerraformTestDefinition defines the Terraform Configuration used for testing purposes.

Jump to

Keyboard shortcuts

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