// Package generated provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
package generated

import (
	"bytes"
	"compress/flate"
	"encoding/base64"
	"fmt"
	"net/url"
	"path"
	"strings"

	"github.com/getkin/kin-openapi/openapi3"
	openapi_types "github.com/oapi-codegen/runtime/types"
)

// Defines values for AlarmDefinitionAlarmChangeType.
const (
	ADDED    AlarmDefinitionAlarmChangeType = "ADDED"
	DELETED  AlarmDefinitionAlarmChangeType = "DELETED"
	MODIFIED AlarmDefinitionAlarmChangeType = "MODIFIED"
)

// Valid indicates whether the value is a known member of the AlarmDefinitionAlarmChangeType enum.
func (e AlarmDefinitionAlarmChangeType) Valid() bool {
	switch e {
	case ADDED:
		return true
	case DELETED:
		return true
	case MODIFIED:
		return true
	default:
		return false
	}
}

// Defines values for AlarmDefinitionClearingType.
const (
	AUTOMATIC AlarmDefinitionClearingType = "AUTOMATIC"
	MANUAL    AlarmDefinitionClearingType = "MANUAL"
)

// Valid indicates whether the value is a known member of the AlarmDefinitionClearingType enum.
func (e AlarmDefinitionClearingType) Valid() bool {
	switch e {
	case AUTOMATIC:
		return true
	case MANUAL:
		return true
	default:
		return false
	}
}

// Defines values for AlarmDefinitionManagementInterfaceId.
const (
	AlarmDefinitionManagementInterfaceIdO2IMS AlarmDefinitionManagementInterfaceId = "O2IMS"
)

// Valid indicates whether the value is a known member of the AlarmDefinitionManagementInterfaceId enum.
func (e AlarmDefinitionManagementInterfaceId) Valid() bool {
	switch e {
	case AlarmDefinitionManagementInterfaceIdO2IMS:
		return true
	default:
		return false
	}
}

// Defines values for AlarmDictionaryManagementInterfaceId.
const (
	AlarmDictionaryManagementInterfaceIdO2IMS AlarmDictionaryManagementInterfaceId = "O2IMS"
)

// Valid indicates whether the value is a known member of the AlarmDictionaryManagementInterfaceId enum.
func (e AlarmDictionaryManagementInterfaceId) Valid() bool {
	switch e {
	case AlarmDictionaryManagementInterfaceIdO2IMS:
		return true
	default:
		return false
	}
}

// APIVersion Information about a version of the API.
type APIVersion struct {
	// Version Example: 2.0.0
	Version *string `json:"version,omitempty"`
}

// APIVersions Information about a list of versions of the API.
type APIVersions struct {
	// ApiVersions Example: [{"version":"2.0.0"}]
	ApiVersions *[]APIVersion `json:"apiVersions,omitempty"`

	// UriPrefix Example: /o2ims-infrastructureInventory/v2
	UriPrefix *string `json:"uriPrefix,omitempty"`
}

// AlarmDefinition Information about an alarm definition.
type AlarmDefinition struct {
	// AlarmAdditionalFields List of metadata key-value pairs used to associate meaningful metadata to the related resource type.
	AlarmAdditionalFields *map[string]interface{} `json:"alarmAdditionalFields,omitempty"`

	// AlarmChangeType Indicates the type of change that occurred during the alarm last change; added, deleted, modified.
	AlarmChangeType AlarmDefinitionAlarmChangeType `json:"alarmChangeType"`

	// AlarmDefinitionId Provides a unique identifier of the alarm being raised. This is the Primary Key into the Alarm Dictionary
	AlarmDefinitionId openapi_types.UUID `json:"alarmDefinitionId"`

	// AlarmDescription Provides a longer descriptive meaning of the alarm condition and a description of the consequences of the
	// alarm condition. This is intended to be read by an operator to give an idea of what happened and a sense of
	// the effects, consequences, and other impacted areas of the system.
	AlarmDescription string `json:"alarmDescription"`

	// AlarmLastChange Indicates the Alarm Dictionary Version in which this alarm last changed.
	AlarmLastChange string `json:"alarmLastChange"`

	// AlarmName Provides short name for the alarm
	AlarmName string `json:"alarmName"`

	// ClearingType Identifies whether alarm is cleared automatically or manually.
	ClearingType AlarmDefinitionClearingType `json:"clearingType"`

	// ManagementInterfaceId List of management interface over which alarms are transmitted for this Entity Type.
	// RESTRICTION: For the O-Cloud IMS Services this value is limited to O2IMS.
	ManagementInterfaceId []AlarmDefinitionManagementInterfaceId `json:"managementInterfaceId"`

	// PkNotificationField Identifies which field or list of fields in the alarm notification contains the primary key (PK) into the
	// Alarm Dictionary for this interface; i.e. which field contains the Alarm Definition ID.
	PkNotificationField []string `json:"pkNotificationField"`

	// ProposedRepairActions Provides guidance for proposed repair actions.
	ProposedRepairActions string `json:"proposedRepairActions"`
}

// AlarmDefinitionAlarmChangeType Indicates the type of change that occurred during the alarm last change; added, deleted, modified.
type AlarmDefinitionAlarmChangeType string

// AlarmDefinitionClearingType Identifies whether alarm is cleared automatically or manually.
type AlarmDefinitionClearingType string

// AlarmDefinitionManagementInterfaceId defines model for AlarmDefinition.ManagementInterfaceId.
type AlarmDefinitionManagementInterfaceId string

// AlarmDictionary Information about an alarm dictionary.
type AlarmDictionary struct {
	AlarmDefinition []AlarmDefinition `json:"alarmDefinition"`

	// AlarmDictionaryId The Identifier of the Alarm Dictionary. The Identifier is unique within an O-Cloud.
	AlarmDictionaryId openapi_types.UUID `json:"alarmDictionaryId"`

	// AlarmDictionarySchemaVersion Version of the Alarm Dictionary Schema to which this alarm dictionary conforms.
	AlarmDictionarySchemaVersion string `json:"alarmDictionarySchemaVersion"`

	// AlarmDictionaryVersion Version of the Alarm Dictionary. Version is vendor defined such that the version of the dictionary can be
	// associated with a specific version of the software delivery of this product.
	AlarmDictionaryVersion string `json:"alarmDictionaryVersion"`

	// EntityType O-RAN entity type emitting the alarm: This shall be unique per vendor ResourceType.model and
	// ResourceType.version
	EntityType string `json:"entityType"`

	// ManagementInterfaceId List of management interface over which alarms are transmitted for this Entity Type.
	// RESTRICTION: For the O-Cloud IMS Services this value is limited to O2IMS.
	ManagementInterfaceId []AlarmDictionaryManagementInterfaceId `json:"managementInterfaceId"`

	// PkNotificationField Identifies which field or list of fields in the alarm notification contains the primary key (PK) into the
	// Alarm Dictionary for this interface; i.e. which field contains the Alarm Definition ID.
	PkNotificationField []string `json:"pkNotificationField"`

	// Vendor Vendor of the Entity Type to whom this Alarm Dictionary applies. This should be the same value as in the
	// ResourceType.vendor attribute
	Vendor string `json:"vendor"`
}

// AlarmDictionaryManagementInterfaceId defines model for AlarmDictionary.ManagementInterfaceId.
type AlarmDictionaryManagementInterfaceId string

// ProblemDetails defines model for ProblemDetails.
type ProblemDetails struct {
	// AdditionalAttributes Any number of additional attributes, as defined in a specification or by an implementation.
	AdditionalAttributes *map[string]string `json:"additionalAttributes,omitempty"`

	// Detail A human-readable explanation specific to this occurrence of the problem.
	//
	// Example: Connection to database timed out
	Detail string `json:"detail"`

	// Instance A URI reference that identifies the specific occurrence of the problem.
	// It may yield further information if dereferenced.
	Instance *string `json:"instance,omitempty"`

	// Status The HTTP status code for this occurrence of the problem.
	Status int `json:"status"`

	// Title A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem,
	// except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided.
	Title *string `json:"title,omitempty"`

	// Type A URI reference according to IETF RFC 3986 [3] that identifies the problem type. It is encouraged that the URI provides
	// human-readable documentation for the problem (e.g. usingHTML) when dereferenced. When this member is not present,
	// its value is assumed to be "about:blank".
	//
	//
	// Example: https://problem.description.com
	Type *string `json:"type,omitempty"`
}

// AlarmDictionaryId defines model for alarmDictionaryId.
type AlarmDictionaryId = openapi_types.UUID

// AllFields defines model for allFields.
type AllFields = string

// ExcludeFields defines model for excludeFields.
type ExcludeFields = string

// Fields defines model for fields.
type Fields = string

// Filter defines model for filter.
type Filter = string

// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec.
// Stored as a slice of fixed-width chunks rather than one concatenated
// const string: with thousands of chunks the chained `+` fold is several
// times slower for the Go compiler than parsing a slice literal.
var swaggerSpec = []string{
	"7Fpbc9tGsv4rXTinKnGKohw5x8erVB5UklxhxbK0EpV9MF3LIdAgZj2YgeYimRvrv2/1zOBCABTlZGt3",
	"H1ZPIjHT83X315dp8LckVWWlJEprkuPfkoppVqJF7T8xwXR5xlPLlWR6M8voywxNqnlF3yXHya3kdw6B",
	"ZygtzzlqUDkwCX4rZM3e6UImkwQ/s7ISmBwnr95k6er1q9XB6vv85cEP2VF68ObNKj/4v9c//PD69f+/",
	"xPzl98kk4XRGxWyRTBLJSto5BDVJNN45rjFLjq12OElMWmDJCG2udMlscpw4x2ml3VQkxFjN5Tp5fJwk",
	"TIi3HEVmhsrNC27g9no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LbFh2GMDCzdRbwr37CGMX/cKMDyqrd",
	"ECf+dxJY2dBBO039qr8oC5Uywf8eeAizPFRZbvw1XXbu2P7t1SLxfeXxSjD5aZFMYptTB0AswkwYPwCo",
	"Qv++6w5sR0t+nzwsTZXOfMVXMDufv4Xrt6fw6k9vXsOHVx9HuTUwHjeAMlVOszVVw7r7oYMiRrOQPYdk",
	"KnVNhDYX8Fr0tzhdT8NPOX6eX7x7QbdquU1FaOfRJfq0EV+SVRoNSjtZSG47xZoZ48pmeNKzdH84XVhb",
	"mePDw5qCHRtOU1XuDYJe+o8R0WSdYbp99BGfq5EejboHOFVlqSRcUHdlPG2umh+keeyCpyiNd3icmp9U",
	"LC0Qjvx42mnRUevh4WHK/OOp0uvDuNccvpudnr+/OT84mr6cFrYUnUB7Bg5fjuo58/dhzjxJVIWSVTw5",
	"Tl7FUXnFbEHp4fHxHwEAAP//",
}

// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes,
// after base64-decoding and flate-decompressing the embedded blob.
func decodeSpec() ([]byte, error) {
	encoded := strings.Join(swaggerSpec, "")
	compressed, err := base64.StdEncoding.DecodeString(encoded)
	if err != nil {
		return nil, fmt.Errorf("error base64 decoding spec: %w", err)
	}
	zr := flate.NewReader(bytes.NewReader(compressed))
	var buf bytes.Buffer
	if _, err := buf.ReadFrom(zr); err != nil {
		return nil, fmt.Errorf("read flate: %w", err)
	}
	if err := zr.Close(); err != nil {
		return nil, fmt.Errorf("close flate reader: %w", err)
	}

	return buf.Bytes(), nil
}

var rawSpec = decodeSpecCached()

// a naive cache of the decoded OpenAPI spec
func decodeSpecCached() func() ([]byte, error) {
	data, err := decodeSpec()
	return func() ([]byte, error) {
		return data, err
	}
}

// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
	res := make(map[string]func() ([]byte, error))
	if len(pathToFile) > 0 {
		res[pathToFile] = rawSpec
	}

	return res
}

// GetSpec returns the OpenAPI specification corresponding to the generated
// code in this file. External references in the spec are resolved through
// PathToRawSpec; externally-referenced files must be embedded in their
// corresponding Go packages (via the import-mapping feature). URL-based
// external refs are not supported.
func GetSpec() (swagger *openapi3.T, err error) {
	resolvePath := PathToRawSpec("")

	loader := openapi3.NewLoader()
	loader.IsExternalRefsAllowed = true
	loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
		pathToFile := url.String()
		pathToFile = path.Clean(pathToFile)
		getSpec, ok := resolvePath[pathToFile]
		if !ok {
			err1 := fmt.Errorf("path not found: %s", pathToFile)
			return nil, err1
		}
		return getSpec()
	}
	var specData []byte
	specData, err = rawSpec()
	if err != nil {
		return
	}
	swagger, err = loader.LoadFromData(specData)
	if err != nil {
		return
	}
	return
}

// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI
// specification: decompressed but not unmarshaled. External references
// are not resolved here; the bytes are the spec exactly as embedded by
// codegen. The result is cached at package init time, so repeated calls
// are cheap.
func GetSpecJSON() ([]byte, error) {
	return rawSpec()
}

// GetSwagger returns the OpenAPI specification corresponding to the
// generated code in this file.
//
// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger
// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for
// backwards compatibility.
func GetSwagger() (*openapi3.T, error) {
	return GetSpec()
}
