// Package common29122 provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version v1.10.1 DO NOT EDIT. package common29122 import ( "bytes" "compress/gzip" "encoding/base64" "fmt" "net/url" "path" "strings" "time" "github.com/getkin/kin-openapi/openapi3" externalRef0 "oransc.org/nonrtric/servicemanager/internal/common" externalRef1 "oransc.org/nonrtric/servicemanager/internal/common29571" ) // Defines values for Event. const ( EventFAILEDRESOURCESALLOCATION Event = "FAILED_RESOURCES_ALLOCATION" EventLOSSOFBEARER Event = "LOSS_OF_BEARER" EventRECOVERYOFBEARER Event = "RECOVERY_OF_BEARER" EventRELEASEOFBEARER Event = "RELEASE_OF_BEARER" EventSESSIONTERMINATION Event = "SESSION_TERMINATION" EventSUCCESSFULRESOURCESALLOCATION Event = "SUCCESSFUL_RESOURCES_ALLOCATION" EventUSAGEREPORT Event = "USAGE_REPORT" ) // Defines values for ResultReason. const ( ResultReasonOTHERREASON ResultReason = "OTHER_REASON" ResultReasonROAMINGNOTALLOWED ResultReason = "ROAMING_NOT_ALLOWED" ) // Represents an accumulated usage. type AccumulatedUsage struct { // Unsigned integer identifying a volume in units of bytes. DownlinkVolume *Volume `json:"downlinkVolume,omitempty"` // Unsigned integer identifying a period of time in units of seconds. Duration *DurationSec `json:"duration,omitempty"` // Unsigned integer identifying a volume in units of bytes. TotalVolume *Volume `json:"totalVolume,omitempty"` // Unsigned integer identifying a volume in units of bytes. UplinkVolume *Volume `json:"uplinkVolume,omitempty"` } // Represents a successful acknowledgement of a notification. type Acknowledgement struct { // A human-readable explanation specific to this successful acknowledgement Details string `json:"details"` } // integer indicating a bandwidth in bits per second. type Bandwidth int // string identifying a BDT Reference ID as defined in clause 5.3.3 of 3GPP TS 29.154. type BdtReferenceId string // This data type is defined in the same way as the BdtReferenceId data type, but with the nullable property set to true. type BdtReferenceIdRm string // string with format "binary" as defined in OpenAPI Specification. type Binary string // String with format "byte" as defined in OpenAPI Specification, i.e, base64-encoded characters. type Bytes string // Represents one configuration processing result for a group's members. type ConfigResult interface{} // string with format "date-time" as defined in OpenAPI. type DateTime time.Time // string with format "date-time" as defined in OpenAPI with "nullable=true" property. type DateTimeRm time.Time // string with format "date-time" as defined in OpenAPI with "readOnly=true" property. type DateTimeRo time.Time // integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, and the subsequent weekdays shall be indicated with the next higher numbers. 7 shall indicate Sunday. type DayOfWeek int // Unsigned integer identifying a period of time in units of minutes. type DurationMin int32 // Unsigned integer identifying a period of time in units of seconds. type DurationSec int // Unsigned integer identifying a period of time in units of seconds with "nullable=true" property. type DurationSecRm int // Unsigned integer identifying a period of time in units of seconds with "readOnly=true" property. type DurationSecRo int // Represents Ethernet flow information. type EthFlowInfo struct { // Indicates the packet filters of the Ethernet flow. It shall contain UL and/or DL Ethernet flow description. EthFlowDescriptions *[]externalRef0.EthFlowDescription `json:"ethFlowDescriptions,omitempty"` // Indicates the Ethernet flow identifier. FlowId int `json:"flowId"` } // Possible values are - SESSION_TERMINATION: Indicates that Rx session is terminated. - LOSS_OF_BEARER : Indicates a loss of a bearer. - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. - RELEASE_OF_BEARER: Indicates a release of a bearer. - USAGE_REPORT: Indicates the usage report event. - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. - SUCCESSFUL_RESOURCES_ALLOCATION: Indicates the resource allocation is successful. type Event string // Represents an event report. type EventReport struct { // Represents an accumulated usage. AccumulatedUsage *AccumulatedUsage `json:"accumulatedUsage,omitempty"` // Possible values are - SESSION_TERMINATION: Indicates that Rx session is terminated. - LOSS_OF_BEARER : Indicates a loss of a bearer. - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. - RELEASE_OF_BEARER: Indicates a release of a bearer. - USAGE_REPORT: Indicates the usage report event. - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. - SUCCESSFUL_RESOURCES_ALLOCATION: Indicates the resource allocation is successful. Event Event `json:"event"` // Identifies the IP flows that were sent during event subscription FlowIds *[]int `json:"flowIds,omitempty"` } // string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clauses 4.6.2 and 4.6.3 of 3GPP TS 23.682 for more information. type ExternalGroupId string // string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clause 4.6.2 of 3GPP TS 23.682 for more information. type ExternalId string // Represents IP flow information. type FlowInfo struct { // Indicates the packet filters of the IP flow. Refer to clause 5.3.8 of 3GPP TS 29.214 for encoding. It shall contain UL and/or DL IP flow description. FlowDescriptions *[]string `json:"flowDescriptions,omitempty"` // Indicates the IP flow identifier. FlowId int `json:"flowId"` } // Represents the description of invalid parameters, for a request rejected due to invalid parameters. type InvalidParam struct { // Attribute's name encoded as a JSON Pointer, or header's name. Param string `json:"param"` // A human-readable reason, e.g. "must be a positive integer". Reason *string `json:"reason,omitempty"` } // string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. type Ipv4Addr string // string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166, with "readOnly=true" property. type Ipv4AddrRo string // string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. type Ipv6Addr string // string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952, with "readOnly=true" property. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. type Ipv6AddrRo string // string formatted according to IETF RFC 3986 identifying a referenced resource. type Link string // String formatted according to IETF RFC 3986 identifying a referenced resource, but with the nullable property set to true. type LinkRm string // Represents a user location area. type LocationArea struct { // Indicates a list of Cell Global Identities of the user which identifies the cell the UE is registered. CellIds *[]string `json:"cellIds,omitempty"` // Identifies a list of civic addresses of the user where the UE is located. CivicAddresses *[]externalRef0.CivicAddress `json:"civicAddresses,omitempty"` // Indicates a list of eNodeB identities in which the UE is currently located. EnodeBIds *[]string `json:"enodeBIds,omitempty"` // Identifies a list of geographic area of the user where the UE is located. GeographicAreas *[]externalRef0.GeographicArea `json:"geographicAreas,omitempty"` // Identifies a list of Routing Area Identities of the user where the UE is located. RoutingAreaIds *[]string `json:"routingAreaIds,omitempty"` // Identifies a list of Tracking Area Identities of the user where the UE is located. TrackingAreaIds *[]string `json:"trackingAreaIds,omitempty"` } // Represents a user location area when the UE is attached to 5G. type LocationArea5G struct { // Identifies a list of civic addresses of the user where the UE is located. CivicAddresses *[]externalRef0.CivicAddress `json:"civicAddresses,omitempty"` // Identifies a list of geographic area of the user where the UE is located. GeographicAreas *[]externalRef0.GeographicArea `json:"geographicAreas,omitempty"` // Describes a network area information in which the NF service consumer requests the number of UEs. NwAreaInfo *externalRef0.NetworkAreaInfo `json:"nwAreaInfo,omitempty"` } // String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. type Mcc string // String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. type Mnc string // string formatted according to clause 3.3 of 3GPP TS 23.003 that describes an MSISDN. type Msisdn string // Represents the information to be conveyed in a bearer level event(s) notification. type NotificationData struct { // Contains the reported event and applicable information EventReports []EventReport `json:"eventReports"` // string formatted according to IETF RFC 3986 identifying a referenced resource. Transaction Link `json:"transaction"` } // Represents the identifier of a PLMN. type PlmnId struct { // String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. Mcc Mcc `json:"mcc"` // String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. Mnc Mnc `json:"mnc"` } // Unsigned integer with valid values between 0 and 65535. type Port int // Unsigned integer with valid values between 0 and 65535, with "readOnly=true" property. type PortRo int // Represents additional information and details on an error response. type ProblemDetails struct { // A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. Cause *string `json:"cause,omitempty"` // A human-readable explanation specific to this occurrence of the problem. Detail *string `json:"detail,omitempty"` // string providing an URI formatted according to IETF RFC 3986. Instance *Uri `json:"instance,omitempty"` // Description of invalid parameters, for a request rejected due to invalid parameters. InvalidParams *[]InvalidParam `json:"invalidParams,omitempty"` // The HTTP status code for this occurrence of the problem. Status *int `json:"status,omitempty"` // A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. SupportedFeatures *externalRef1.SupportedFeatures `json:"supportedFeatures,omitempty"` // A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. Title *string `json:"title,omitempty"` // string providing an URI formatted according to IETF RFC 3986. Type *Uri `json:"type,omitempty"` } // string chosen by the SCEF to serve as identifier in a resource URI. type ResourceId string // Possible values are - ROAMING_NOT_ALLOWED: Identifies the configuration parameters are not allowed by roaming agreement. - OTHER_REASON: Identifies the configuration parameters are not configured due to other reason. type ResultReason string // string that identifies an SCS/AS. type ScsAsId string // Represents a sponsor information. type SponsorInformation struct { // It indicates Application Service Provider ID. AspId string `json:"aspId"` // It indicates Sponsor ID. SponsorId string `json:"sponsorId"` } // Represents a notification that can be sent to test whether a chosen notification mechanism works. type TestNotification struct { // string formatted according to IETF RFC 3986 identifying a referenced resource. Subscription Link `json:"subscription"` } // String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). type TimeOfDay string // Represents a time window identified by a start time and a stop time. type TimeWindow struct { // string with format "date-time" as defined in OpenAPI. StartTime DateTime `json:"startTime"` // string with format "date-time" as defined in OpenAPI. StopTime DateTime `json:"stopTime"` } // string providing an URI formatted according to IETF RFC 3986. type Uri string // Represents a usage threshold. type UsageThreshold struct { // Unsigned integer identifying a volume in units of bytes. DownlinkVolume *Volume `json:"downlinkVolume,omitempty"` // Unsigned integer identifying a period of time in units of seconds. Duration *DurationSec `json:"duration,omitempty"` // Unsigned integer identifying a volume in units of bytes. TotalVolume *Volume `json:"totalVolume,omitempty"` // Unsigned integer identifying a volume in units of bytes. UplinkVolume *Volume `json:"uplinkVolume,omitempty"` } // Represents the same as the UsageThreshold data type but with the nullable:true property. type UsageThresholdRm struct { // Unsigned integer identifying a volume in units of bytes with "nullable=true" property. DownlinkVolume *VolumeRm `json:"downlinkVolume"` // Unsigned integer identifying a period of time in units of seconds with "nullable=true" property. Duration *DurationSecRm `json:"duration"` // Unsigned integer identifying a volume in units of bytes with "nullable=true" property. TotalVolume *VolumeRm `json:"totalVolume"` // Unsigned integer identifying a volume in units of bytes with "nullable=true" property. UplinkVolume *VolumeRm `json:"uplinkVolume"` } // Unsigned integer identifying a volume in units of bytes. type Volume int64 // Unsigned integer identifying a volume in units of bytes with "nullable=true" property. type VolumeRm int64 // Represents the configuration information for the delivery of notifications over Websockets. type WebsockNotifConfig struct { // Set by the SCS/AS to indicate that the Websocket delivery is requested. RequestWebsocketUri *bool `json:"requestWebsocketUri,omitempty"` // string formatted according to IETF RFC 3986 identifying a referenced resource. WebsocketUri *Link `json:"websocketUri,omitempty"` } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ "H4sIAAAAAAAC/+Rb724iuZZ/laPale4dLU0IJOnuSCstDaQvqyQgisxoNRlFpupA+XaVXWu7oLmjPNC+", "xj7ZynYVVIGhoLvnZnfvl5km+Pj8zrHPXx9+9wKepJwhU9K7/d0TKFPOJJoPndZ7/b8QZSBoqihn3q03", "xSTlgog1TDCkAgPlNbwISYjCEN3zgNilu5RdBiRWKBhRdInwNBkCn4OKEARKnokAm17DE/ifGRUYerdK", "ZNjwZBBhQvRuap2id+tJJShbeK+vr68Nr9P6sM9ojCIhWqT/FRCvW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vDJahF8oC/mq5sgM0JVZuTUf4yeIDlBC2RX2pVkqnprPjlPRa4t52qO/GSnmbk2I5Ol5", "NLtHueFa2sx1pDoIHHIdNscyLpGZX96e0k53at2MhUwjgTLicVjbPyILBFWs/sf+9U5Vc5P652LzY438", "hxpV4tJvPJzvGabWqJQou88Y338Mk+QbD8ISnn0Uluz8w9B0ruPY7nHWAOrSkFUGT2drx+zwzVXt7O4G", "34/CcNaMvAtj/fTuLziTPPhiAqb9aUvtNa6mVuW6tfiNRYgxLUYZy4FSAl+igJwnKkekzCugzRKnE/RR", "bfNbnTDZGimfQzdBXH+32WQLyDyOGQ6Vh+MZ5zESM+q62uF8UqjeuYz6T8WPZ/o8cBRU5V+Htdvw8+X7", "5vtmC6Yfto+ckHLK7E+EHrlQ0YxnLITueCi9hpeJ2Lv1IqVSeXtxsVqtmp1Fmja5WFzMVXrhpxjICyKC", "iC7xov3xRaKgKC8suwtbsrqGlPqFH5Ll1pypH5YoSGz4NwGe2X//F7Rb7XbDdjBHYkEY/RvJmxljIhTT", "2fafu5PhpwZ0p0O/Ab2e323AYOoPGzD1++Z/067+T+8ns2c3jkHQRaT0KZmKJbSJeF7VeVuN2QIRDN6p", "xus1vCUKacW4bLabl1pKniIjKdUab7aaLX3diIr0gby+/k8AAAD//9JC9tDPQwAA", } // GetSwagger returns the content of the embedded swagger specification file // or error if failed to decode func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { return nil, fmt.Errorf("error base64 decoding spec: %s", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { return nil, fmt.Errorf("error decompressing spec: %s", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { return nil, fmt.Errorf("error decompressing spec: %s", err) } return buf.Bytes(), nil } var rawSpec = decodeSpecCached() // a naive cached of a decoded swagger 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) { var res = make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } pathPrefix := path.Dir(pathToFile) for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "CommonData.yaml")) { if _, ok := res[rawPath]; ok { // it is not possible to compare functions in golang, so always overwrite the old value } res[rawPath] = rawFunc } for rawPath, rawFunc := range externalRef1.PathToRawSpec(path.Join(pathPrefix, "TS29571_CommonData.yaml")) { if _, ok := res[rawPath]; ok { // it is not possible to compare functions in golang, so always overwrite the old value } res[rawPath] = rawFunc } return res } // GetSwagger returns the Swagger specification corresponding to the generated code // in this file. The external references of Swagger specification are resolved. // The logic of resolving external references is tightly connected to "import-mapping" feature. // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { var resolvePath = PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { var 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 }