1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
api_authentication_upu_document.go 7.81 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 . update
/*
Nudr_DataRepository API OpenAPI file
Unified Data Repository Service. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 2.2.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Nudr_DR
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// AuthenticationUPUDocumentAPIService AuthenticationUPUDocumentAPI service
type AuthenticationUPUDocumentAPIService service
type ApiCreateAuthenticationUPURequest struct {
ctx context.Context
ApiService *AuthenticationUPUDocumentAPIService
ueId string
upuData *UpuData
supportedFeatures *string
}
func (r ApiCreateAuthenticationUPURequest) UpuData(upuData UpuData) ApiCreateAuthenticationUPURequest {
r.upuData = &upuData
return r
}
// Supported Features
func (r ApiCreateAuthenticationUPURequest) SupportedFeatures(supportedFeatures string) ApiCreateAuthenticationUPURequest {
r.supportedFeatures = &supportedFeatures
return r
}
func (r ApiCreateAuthenticationUPURequest) Execute() (*http.Response, error) {
return r.ApiService.CreateAuthenticationUPUExecute(r)
}
/*
CreateAuthenticationUPU To store the UPU acknowledgement information of a UE
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param ueId UE id
@return ApiCreateAuthenticationUPURequest
*/
func (a *AuthenticationUPUDocumentAPIService) CreateAuthenticationUPU(ctx context.Context, ueId string) ApiCreateAuthenticationUPURequest {
return ApiCreateAuthenticationUPURequest{
ApiService: a,
ctx: ctx,
ueId: ueId,
}
}
// Execute executes the request
func (a *AuthenticationUPUDocumentAPIService) CreateAuthenticationUPUExecute(r ApiCreateAuthenticationUPURequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationUPUDocumentAPIService.CreateAuthenticationUPU")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/subscription-data/{ueId}/ue-update-confirmation-data/upu-data"
localVarPath = strings.Replace(localVarPath, "{"+"ueId"+"}", url.PathEscape(parameterValueToString(r.ueId, "ueId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.upuData == nil {
return nil, reportError("upuData is required and must be specified")
}
if r.supportedFeatures != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "supported-features", r.supportedFeatures, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.upuData
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type ApiQueryAuthUPURequest struct {
ctx context.Context
ApiService *AuthenticationUPUDocumentAPIService
ueId string
supportedFeatures *string
}
// Supported Features
func (r ApiQueryAuthUPURequest) SupportedFeatures(supportedFeatures string) ApiQueryAuthUPURequest {
r.supportedFeatures = &supportedFeatures
return r
}
func (r ApiQueryAuthUPURequest) Execute() (*UpuData, *http.Response, error) {
return r.ApiService.QueryAuthUPUExecute(r)
}
/*
QueryAuthUPU Retrieves the UPU acknowledgement information of a UE
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param ueId UE id
@return ApiQueryAuthUPURequest
*/
func (a *AuthenticationUPUDocumentAPIService) QueryAuthUPU(ctx context.Context, ueId string) ApiQueryAuthUPURequest {
return ApiQueryAuthUPURequest{
ApiService: a,
ctx: ctx,
ueId: ueId,
}
}
// Execute executes the request
//
// @return UpuData
func (a *AuthenticationUPUDocumentAPIService) QueryAuthUPUExecute(r ApiQueryAuthUPURequest) (*UpuData, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *UpuData
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationUPUDocumentAPIService.QueryAuthUPU")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/subscription-data/{ueId}/ue-update-confirmation-data/upu-data"
localVarPath = strings.Replace(localVarPath, "{"+"ueId"+"}", url.PathEscape(parameterValueToString(r.ueId, "ueId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.supportedFeatures != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "supported-features", r.supportedFeatures, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

搜索帮助