-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from andy89923/feat/bsf
- Loading branch information
Showing
29 changed files
with
3,909 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
/* | ||
* Nbsf_Management | ||
* | ||
* Binding Support Management Service API. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. | ||
* | ||
* Source file: 3GPP TS 29.521 V17.7.0; 5G System; Binding Support Management Service. | ||
* Url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.521/ | ||
* | ||
* API version: 1.3.1 | ||
* Generated by: OpenAPI Generator (https://openapi-generator.tech) | ||
*/ | ||
|
||
package Management | ||
|
||
import ( | ||
"github.com/free5gc/openapi" | ||
"github.com/free5gc/openapi/models" | ||
|
||
"context" | ||
"io/ioutil" | ||
"net/url" | ||
"strings" | ||
) | ||
|
||
// Linger please | ||
var ( | ||
_ context.Context | ||
) | ||
|
||
type IndividualPCFBindingDocumentApiService service | ||
|
||
/* | ||
IndividualPCFBindingDocumentApiService Delete an existing Individual PCF for a PDU Session Binding information | ||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). | ||
* @param BindingId - Represents the individual PCF for a PDU Session Binding. | ||
@return DeleteIndPCFBindingResponse | ||
*/ | ||
|
||
// DeleteIndPCFBindingRequest | ||
type DeleteIndPCFBindingRequest struct { | ||
BindingId *string | ||
} | ||
|
||
func (r *DeleteIndPCFBindingRequest) SetBindingId(BindingId string) { | ||
r.BindingId = &BindingId | ||
} | ||
|
||
type DeleteIndPCFBindingResponse struct { | ||
} | ||
|
||
type DeleteIndPCFBindingError struct { | ||
Location string | ||
Var3gppSbiTargetNfId string | ||
ProblemDetails models.ProblemDetails | ||
RedirectResponse models.RedirectResponse | ||
} | ||
|
||
func (a *IndividualPCFBindingDocumentApiService) DeleteIndPCFBinding(ctx context.Context, request *DeleteIndPCFBindingRequest) (*DeleteIndPCFBindingResponse, error) { | ||
var ( | ||
localVarHTTPMethod = strings.ToUpper("Delete") | ||
localVarPostBody interface{} | ||
localVarFormFileName string | ||
localVarFileName string | ||
localVarFileBytes []byte | ||
localVarReturnValue DeleteIndPCFBindingResponse | ||
) | ||
|
||
// create path and map variables | ||
localVarPath := a.client.cfg.BasePath() + "/pcfBindings/{bindingId}" | ||
localVarPath = strings.Replace(localVarPath, "{"+"bindingId"+"}", openapi.StringOfValue(*request.BindingId), -1) | ||
|
||
localVarHeaderParams := make(map[string]string) | ||
localVarQueryParams := url.Values{} | ||
localVarFormParams := url.Values{} | ||
|
||
localVarHTTPContentTypes := []string{"application/json"} | ||
|
||
localVarHeaderParams["Content-Type"] = localVarHTTPContentTypes[0] // use the first content type specified in 'consumes' | ||
|
||
// to determine the Accept header | ||
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"} | ||
|
||
// set Accept header | ||
localVarHTTPHeaderAccept := strings.Join(localVarHTTPHeaderAccepts, ", ") | ||
if localVarHTTPHeaderAccept != "" { | ||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept | ||
} | ||
|
||
r, err := openapi.PrepareRequest(ctx, a.client.cfg, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
localVarHTTPResponse, err := openapi.CallAPI(a.client.cfg, r) | ||
if err != nil || localVarHTTPResponse == nil { | ||
return nil, err | ||
} | ||
|
||
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
err = localVarHTTPResponse.Body.Close() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
apiError := openapi.GenericOpenAPIError{ | ||
RawBody: localVarBody, | ||
ErrorStatus: localVarHTTPResponse.StatusCode, | ||
} | ||
|
||
switch localVarHTTPResponse.StatusCode { | ||
case 204: | ||
return &localVarReturnValue, nil | ||
case 307: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.RedirectResponse, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
v.Location = localVarHTTPResponse.Header.Get("Location") | ||
v.Var3gppSbiTargetNfId = localVarHTTPResponse.Header.Get("3gpp-Sbi-Target-Nf-Id") | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 308: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.RedirectResponse, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
v.Location = localVarHTTPResponse.Header.Get("Location") | ||
v.Var3gppSbiTargetNfId = localVarHTTPResponse.Header.Get("3gpp-Sbi-Target-Nf-Id") | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 400: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 401: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 403: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 404: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 429: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 500: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
case 503: | ||
var v DeleteIndPCFBindingError | ||
err = openapi.Deserialize(&v.ProblemDetails, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
apiError.ErrorModel = v | ||
return nil, apiError | ||
default: | ||
return nil, apiError | ||
} | ||
} |
Oops, something went wrong.