Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
api_group_identifiers.go 5.42 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . 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"
)
// GroupIdentifiersAPIService GroupIdentifiersAPI service
type GroupIdentifiersAPIService service
type ApiGetGroupIdentifiersRequest struct {
ctx context.Context
ApiService *GroupIdentifiersAPIService
extGroupId *string
intGroupId *string
ueIdInd *bool
supportedFeatures *string
}
// External Group Identifier
func (r ApiGetGroupIdentifiersRequest) ExtGroupId(extGroupId string) ApiGetGroupIdentifiersRequest {
r.extGroupId = &extGroupId
return r
}
// Internal Group Identifier
func (r ApiGetGroupIdentifiersRequest) IntGroupId(intGroupId string) ApiGetGroupIdentifiersRequest {
r.intGroupId = &intGroupId
return r
}
// Indication whether UE identifiers are required or not
func (r ApiGetGroupIdentifiersRequest) UeIdInd(ueIdInd bool) ApiGetGroupIdentifiersRequest {
r.ueIdInd = &ueIdInd
return r
}
// Supported Features
func (r ApiGetGroupIdentifiersRequest) SupportedFeatures(supportedFeatures string) ApiGetGroupIdentifiersRequest {
r.supportedFeatures = &supportedFeatures
return r
}
func (r ApiGetGroupIdentifiersRequest) Execute() (*GroupIdentifiers, *http.Response, error) {
return r.ApiService.GetGroupIdentifiersExecute(r)
}
/*
GetGroupIdentifiers Mapping of Group Identifiers
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetGroupIdentifiersRequest
*/
func (a *GroupIdentifiersAPIService) GetGroupIdentifiers(ctx context.Context) ApiGetGroupIdentifiersRequest {
return ApiGetGroupIdentifiersRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GroupIdentifiers
func (a *GroupIdentifiersAPIService) GetGroupIdentifiersExecute(r ApiGetGroupIdentifiersRequest) (*GroupIdentifiers, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GroupIdentifiers
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupIdentifiersAPIService.GetGroupIdentifiers")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/subscription-data/group-data/group-identifiers"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.extGroupId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "ext-group-id", r.extGroupId, "")
}
if r.intGroupId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "int-group-id", r.intGroupId, "")
}
if r.ueIdInd != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "ue-id-ind", r.ueIdInd, "")
} else {
var defaultValue bool = false
r.ueIdInd = &defaultValue
}
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", "application/problem+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,
}
if localVarHTTPResponse.StatusCode == 403 {
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

搜索帮助