openapi

package module
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 31 Imported by: 200

Documentation

Index

Constants

View Source
const (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = ContextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = ContextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = ContextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = ContextKey("apikey")
)
View Source
const (
	TimeoutPeriod         = 10 * time.Second
	ReadIdleTimeoutPeriod = 1 * time.Second
	PingTimeoutPeriod     = 1 * time.Second
)
View Source
const (
	ServiceBaseURI_NNRF_NFM_v1  string = "/" + string(models.ServiceName_NNRF_NFM) + "/v1"
	ServiceBaseURI_NNRF_DISC_v1 string = "/" + string(models.ServiceName_NNRF_DISC) + "/v1"
	ServiceBaseURI_NNRF_OAUTH2  string = ""
	ServiceBaseURI_NNRF_OAM_v1  string = "/" + string(models.ServiceName_NNRF_OAM) + "/v1"
	ServiceBaseURI_NNRF_CMI_v1  string = "/" + string(models.ServiceName_NNRF_CMI) + "/v1"
	ServiceBaseURI_NUDM_SDM_v2  string = "/" + string(models.ServiceName_NUDM_SDM) + "/v2"
	ServiceBaseURI_NUDM_UECM_v1 string = "/" + string(models.ServiceName_NUDM_UECM) + "/v1"
	ServiceBaseURI_NUDM_UEAU_v1 string = "/" + string(models.ServiceName_NUDM_UEAU) + "/v1"
	ServiceBaseURI_NUDM_EE_v1   string = "/" + string(models.ServiceName_NUDM_EE) + "/v1"
	ServiceBaseURI_NUDM_PP_v1   string = "/" + string(models.ServiceName_NUDM_PP) + "/v1"
	// ServiceBaseURI_NUDM_NIDDAU string = "/" + string(models.ServiceName_NUDM_NIDDAU)
	// ServiceBaseURI_NUDM_MT     string = "/" + string(models.ServiceName_NUDM_MT)
	ServiceBaseURI_NUDM_OAM_v1            string = "/" + string(models.ServiceName_NUDM_OAM) + "/v1"
	ServiceBaseURI_NUDM_CMI_v1            string = "/" + string(models.ServiceName_NUDM_CMI) + "/v1"
	ServiceBaseURI_NAMF_COMM_v1           string = "/" + string(models.ServiceName_NAMF_COMM) + "/v1"
	ServiceBaseURI_NAMF_EVTS_v1           string = "/" + string(models.ServiceName_NAMF_EVTS) + "/v1"
	ServiceBaseURI_NAMF_MT_v1             string = "/" + string(models.ServiceName_NAMF_MT) + "/v1"
	ServiceBaseURI_NAMF_LOC_v1            string = "/" + string(models.ServiceName_NAMF_LOC) + "/v1"
	ServiceBaseURI_NAMF_OAM_v1            string = "/" + string(models.ServiceName_NAMF_OAM) + "/v1"
	ServiceBaseURI_NAMF_CMI_v1            string = "/" + string(models.ServiceName_NAMF_CMI) + "/v1"
	ServiceBaseURI_NSMF_PDUSESSION_v1     string = "/" + string(models.ServiceName_NSMF_PDUSESSION) + "/v1"
	ServiceBaseURI_NSMF_EVENT_EXPOSURE_v1 string = "/" + string(models.ServiceName_NSMF_EVENT_EXPOSURE) + "/v1"
	// ServiceBaseURI_NSMF_NIDD string = "/" + string(models.ServiceName_NSMF_NIDD)
	ServiceBaseURI_NSMF_OAM_v1                 string = "/" + string(models.ServiceName_NSMF_OAM) + "/v1"
	ServiceBaseURI_NSMF_CMI_v1                 string = "/" + string(models.ServiceName_NSMF_CMI) + "/v1"
	ServiceBaseURI_NAUSF_AUTH_v1               string = "/" + string(models.ServiceName_NAUSF_AUTH) + "/v1"
	ServiceBaseURI_NAUSF_SORPROTECTION_v1      string = "/" + string(models.ServiceName_NAUSF_SORPROTECTION) + "/v1"
	ServiceBaseURI_NAUSF_UPUPROTECTION_v1      string = "/" + string(models.ServiceName_NAUSF_UPUPROTECTION) + "/v1"
	ServiceBaseURI_NAUSF_OAM_v1                string = "/" + string(models.ServiceName_NAUSF_OAM) + "/v1"
	ServiceBaseURI_NAUSF_CMI_v1                string = "/" + string(models.ServiceName_NAUSF_CMI) + "/v1"
	ServiceBaseURI_NNEF_PFDMANAGEMENT_v1       string = "/" + string(models.ServiceName_NNEF_PFDMANAGEMENT) + "/v1"
	ServiceBaseURI_3GPP_AS_SESSION_WITH_QOS_v1 string = "/" + string(models.ServiceName_3GPP_AS_SESSION_WITH_QOS) + "/v1"
	ServiceBaseURI_3GPP_PFD_MANAGEMENT_v1      string = "/" + string(models.ServiceName_3GPP_PFD_MANAGEMENT) + "/v1"
	ServiceBaseURI_3GPP_TRAFFIC_INFLUENCE_v1   string = "/" + string(models.ServiceName_3GPP_TRAFFIC_INFLUENCE) + "/v1"
	// ServiceBaseURI_NNEF_SMCONTEXT     string = "/" + string(models.ServiceName_NNEF_SMCONTEXT)
	// ServiceBaseURI_NNEF_EVENTEXPOSURE string = "/" + string(models.ServiceName_NNEF_EVENTEXPOSURE)
	ServiceBaseURI_NNEF_OAM_v1                 string = "/" + string(models.ServiceName_NNEF_OAM) + "/v1"
	ServiceBaseURI_NNEF_CMI_v1                 string = "/" + string(models.ServiceName_NNEF_CMI) + "/v1"
	ServiceBaseURI_NPCF_AM_POLICY_CONTROL_v1   string = "/" + string(models.ServiceName_NPCF_AM_POLICY_CONTROL) + "/v1"
	ServiceBaseURI_NPCF_SMPOLICYCONTROL_v1     string = "/" + string(models.ServiceName_NPCF_SMPOLICYCONTROL) + "/v1"
	ServiceBaseURI_NPCF_POLICYAUTHORIZATION_v1 string = "/" + string(models.ServiceName_NPCF_POLICYAUTHORIZATION) + "/v1"
	ServiceBaseURI_NPCF_BDTPOLICYCONTROL_v1    string = "/" + string(models.ServiceName_NPCF_BDTPOLICYCONTROL) + "/v1"
	// ServiceBaseURI_NPCF_EVENTEXPOSURE string = "/" + string(models.ServiceName_NPCF_EVENTEXPOSURE)
	ServiceBaseURI_NPCF_UE_POLICY_CONTROL_v1 string = "/" + string(models.ServiceName_NPCF_UE_POLICY_CONTROL) + "/v1"
	ServiceBaseURI_NPCF_OAM_v1               string = "/" + string(models.ServiceName_NPCF_OAM) + "/v1"
	ServiceBaseURI_NPCF_CMI_v1               string = "/" + string(models.ServiceName_NPCF_CMI) + "/v1"
	// ServiceBaseURI_NSMSF_SMS string = "/" + string(models.ServiceName_NSMSF_SMS)
	ServiceBaseURI_NNSSF_NSSELECTION_v2       string = "/" + string(models.ServiceName_NNSSF_NSSELECTION) + "/v2"
	ServiceBaseURI_NNSSF_NSSAIAVAILABILITY_v1 string = "/" + string(models.ServiceName_NNSSF_NSSAIAVAILABILITY) + "/v1"
	ServiceBaseURI_NNSSF_OAM_v1               string = "/" + string(models.ServiceName_NNSSF_OAM) + "/v1"
	ServiceBaseURI_NNSSF_CMI_v1               string = "/" + string(models.ServiceName_NNSSF_CMI) + "/v1"
	ServiceBaseURI_NUDR_DR_v2                 string = "/" + string(models.ServiceName_NUDR_DR) + "/v2"
	ServiceBaseURI_NUDR_GROUP_ID_MAP_v1       string = "/" + string(models.ServiceName_NUDR_GROUP_ID_MAP) + "/v1"
	ServiceBaseURI_NUDR_OAM_v1                string = "/" + string(models.ServiceName_NUDR_OAM) + "/v1"
	ServiceBaseURI_NUDR_CMI_v1                string = "/" + string(models.ServiceName_NUDR_CMI) + "/v1"
	// ServiceBaseURI_NLMF_LOC                     string = "/" + string(models.ServiceName_NLMF_LOC)
	// ServiceBaseURI_N5G_EIR_EIC                  string = "/" + string(models.ServiceName_N5G_EIR_EIC)
	// ServiceBaseURI_NBSF_MANAGEMENT              string = "/" + string(models.ServiceName_NBSF_MANAGEMENT)
	// ServiceBaseURI_NCHF_SPENDINGLIMITCONTROL    string = "/" + string(models.ServiceName_NCHF_SPENDINGLIMITCONTROL)
	// ServiceBaseURI_NCHF_CONVERGEDCHARGING       string = "/" + string(models.ServiceName_NCHF_CONVERGEDCHARGING)
	// ServiceBaseURI_NCHF_OFFLINEONLYCHARGING     string = "/" + string(models.ServiceName_NCHF_OFFLINEONLYCHARGING)
	// ServiceBaseURI_NNWDAF_EVENTSSUBSCRIPTION    string = "/" + string(models.ServiceName_NNWDAF_EVENTSSUBSCRIPTION)
	// ServiceBaseURI_NNWDAF_ANALYTICSINFO         string = "/" + string(models.ServiceName_NNWDAF_ANALYTICSINFO)
	// ServiceBaseURI_NGMLC_LOC                    string = "/" + string(models.ServiceName_NGMLC_LOC)
	// ServiceBaseURI_NUCMF_PROVISIONING           string = "/" + string(models.ServiceName_NUCMF_PROVISIONING)
	// ServiceBaseURI_NUCMF_UECAPABILITYMANAGEMENT string = "/" + string(models.ServiceName_NUCMF_UECAPABILITYMANAGEMENT)
	// ServiceBaseURI_NHSS_SDM                     string = "/" + string(models.ServiceName_NHSS_SDM)
	// ServiceBaseURI_NHSS_UECM                    string = "/" + string(models.ServiceName_NHSS_UECM)
	// ServiceBaseURI_NHSS_UEAU                    string = "/" + string(models.ServiceName_NHSS_UEAU)
	// ServiceBaseURI_NHSS_EE                      string = "/" + string(models.ServiceName_NHSS_EE)
	ServiceBaseURI_NHSS_IMS_SDM_v1  string = "/" + string(models.ServiceName_NHSS_IMS_SDM) + "/v1"
	ServiceBaseURI_NHSS_IMS_UECM_v1 string = "/" + string(models.ServiceName_NHSS_IMS_UECM) + "/v1"
	ServiceBaseURI_NHSS_IMS_UEAU_v1 string = "/" + string(models.ServiceName_NHSS_IMS_UEAU) + "/v1"
	// ServiceBaseURI_NSEPP_TELESCOPIC             string = "/" + string(models.ServiceName_NSEPP_TELESCOPIC)
	// ServiceBaseURI_NSORAF_SOR                   string = "/" + string(models.ServiceName_NSORAF_SOR)
	// ServiceBaseURI_NSPAF_SECURED_PACKET         string = "/" + string(models.ServiceName_NSPAF_SECURED_PACKET)
	// ServiceBaseURI_NUDSF_DR                     string = "/" + string(models.ServiceName_NUDSF_DR)
	// ServiceBaseURI_NNSSAAF_NSSAA                string = "/" + string(models.ServiceName_NNSSAAF_NSSAA)
	ServiceBaseURI_NUPF_OAM_v1 string = "/" + string(models.ServiceName_NUPF_OAM) + "/v1"
	ServiceBaseURI_NUPF_CMI_v1 string = "/" + string(models.ServiceName_NUPF_CMI) + "/v1"
)

Variables

Functions

func ApiVersion added in v1.1.0

func ApiVersion(name models.ServiceName) string

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

func CallAPI

func CallAPI(cfg Configuration, request *http.Request) (*http.Response, error)

callAPI do the request.

func Convert

func Convert(from interface{}, to interface{}) error

Convert - convert map[string]interface{} to openapi models

func Deserialize

func Deserialize(v interface{}, b []byte, contentType string) (err error)

func ExtSnssaiEqualFold added in v1.1.0

func ExtSnssaiEqualFold(s, t models.ExtSnssai) bool

func GetNFServiceUri added in v1.1.0

func GetNFServiceUri(
	nfProf *models.NrfNfDiscoveryNfProfile,
	srvName models.ServiceName,
) string

Returns NF Uri derived from NfProfile with corresponding service

func GetServiceNfProfileAndUri added in v1.1.0

func GetServiceNfProfileAndUri(
	nfInstances []models.NrfNfDiscoveryNfProfile,
	srvName models.ServiceName,
) (*models.NrfNfDiscoveryNfProfile, string, error)

func InterceptH2CClient

func InterceptH2CClient()

func MarshToJsonString

func MarshToJsonString(v interface{}) (result []string)

func MultipartDeserialize

func MultipartDeserialize(b []byte, v interface{}, boundary string) (err error)

func MultipartEncode

func MultipartEncode(v interface{}, body io.Writer) (string, error)

func MultipartSerialize

func MultipartSerialize(v interface{}) ([]byte, string, error)

func ParameterToString

func ParameterToString(obj interface{}, format string) string

ParameterToString convert interface{} parameters to string, using a delimiter if format is provided.

func PlmnIdJsonToModels added in v1.1.0

func PlmnIdJsonToModels(plmnIdJson []byte) (*models.PlmnId, error)

func PrepareRequest

func PrepareRequest(
	ctx context.Context,
	cfg Configuration,
	path string, method string,
	postBody interface{},
	headerParams map[string]string,
	queryParams url.Values,
	formParams url.Values,
	formFileName string,
	fileName string,
	fileBytes []byte,
) (localVarRequest *http.Request, err error)

prepareRequest build the request

func ProblemDetailsDataNotFound added in v1.0.2

func ProblemDetailsDataNotFound(detail string) *models.ProblemDetails

func ProblemDetailsForbidden added in v1.1.0

func ProblemDetailsForbidden(detail, cause string) *models.ProblemDetails

func ProblemDetailsMalformedReqSyntax added in v1.0.2

func ProblemDetailsMalformedReqSyntax(detail string) *models.ProblemDetails

func ProblemDetailsOperationNotSupported added in v1.1.0

func ProblemDetailsOperationNotSupported() *models.ProblemDetails

func ProblemDetailsSystemFailure added in v1.0.2

func ProblemDetailsSystemFailure(detail string) *models.ProblemDetails

func ReportError

func ReportError(format string, a ...interface{}) error

Prevent trying to import "fmt"

func RestoreH2CClient

func RestoreH2CClient()

func SelectHeaderAccept

func SelectHeaderAccept(accepts []string) string

SelectHeaderAccept join all accept types and return

func Serialize

func Serialize(v interface{}, mediaType string) ([]byte, error)

Serialize - serialize data v to corresponding media type

func ServiceBaseUri added in v1.1.0

func ServiceBaseUri(srvName models.ServiceName) string

func ServiceUri added in v1.1.0

func ServiceUri(srvName models.ServiceName, apiPrefix string) string

func SnssaiEqualFold added in v1.0.7

func SnssaiEqualFold(s, t models.Snssai) bool

func SnssaiHexToModels added in v1.1.0

func SnssaiHexToModels(hexString string) (*models.Snssai, error)

func SnssaiModelsToHex added in v1.1.0

func SnssaiModelsToHex(snssai models.Snssai) string

func StringOfValue added in v1.1.0

func StringOfValue(v interface{}) string

func TypeCheckParameter

func TypeCheckParameter(obj interface{}, expected string, name string) error

Verify optional parameters are of the correct type.

Types

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration interface {
	BasePath() string
	Host() string
	UserAgent() string
	DefaultHeader() map[string]string
	HTTPClient() *http.Client
	Metrics() RequestMetricsHook
}

type ContextKey

type ContextKey string

func (ContextKey) String

func (c ContextKey) String() string

type GenericOpenAPIError

type GenericOpenAPIError struct {
	RawBody     []byte
	ErrorStatus int
	ErrorModel  interface{}
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type MediaKind

type MediaKind int

MediaKind - represents the sets of media type

const (
	MediaKindUnsupported MediaKind = iota
	MediaKindPlaintext   MediaKind = iota
	MediaKindJSON
	MediaKindXML
	MediaKindMultipartRelated
)

MediaKind enums

func KindOfMediaType

func KindOfMediaType(mediaType string) MediaKind

KindOfMediaType - returns Mediakind of the media type

type MultipartRelatedBinding

type MultipartRelatedBinding struct{}

func (MultipartRelatedBinding) Bind

func (MultipartRelatedBinding) Bind(req *http.Request, obj interface{}) error

func (MultipartRelatedBinding) BindBody

func (MultipartRelatedBinding) BindBody(body []byte, obj interface{}) error

func (MultipartRelatedBinding) Name

type MultipartRelatedRender

type MultipartRelatedRender struct {
	Data interface{}
	// contains filtered or unexported fields
}

func (MultipartRelatedRender) Render

func (r MultipartRelatedRender) Render(w http.ResponseWriter) (err error)

func (MultipartRelatedRender) WriteContentType

func (r MultipartRelatedRender) WriteContentType(w http.ResponseWriter)

type RequestMetricsHook added in v1.2.1

type RequestMetricsHook func(
	method string,
	path string,
	status int,
	duration float64,
)

RequestMetricsHook is called after each HTTP Submit.

method:       HTTP method (GET, POST, ...)
path:         URL path pattern (e.g. "/namf-comm/v1/...")
status:       HTTP status code (0 if no response)

type SupportedFeature

type SupportedFeature []byte

SupportedFeature - bytes used to indicate the features supported by a API that is used as defined in subclause 6.6 in 3GPP TS 29.500

func NewSupportedFeature

func NewSupportedFeature(suppFeat string) (SupportedFeature, error)

NewSupportedFeature - new NewSupportedFeature from string

func (SupportedFeature) GetFeature

func (suppoertedFeature SupportedFeature) GetFeature(n int) bool

GetFeature - get nth feature is supported

func (SupportedFeature) NegotiateWith

func (suppoertedFeature SupportedFeature) NegotiateWith(incomingSuppFeat SupportedFeature) SupportedFeature

NegotiateWith - Negotiate with other supported feature

func (SupportedFeature) String

func (suppoertedFeature SupportedFeature) String() string

String - convert SupportedFeature to hex format

Jump to

Keyboard shortcuts

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