RIC:1060: Change in PTL
[ric-plt/xapp-frame.git] / pkg / clientapi / xapp / xapp_client.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package xapp
4
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
7
8 import (
9         "fmt"
10
11         "github.com/go-openapi/runtime"
12         "github.com/go-openapi/strfmt"
13 )
14
15 // New creates a new xapp API client.
16 func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
17         return &Client{transport: transport, formats: formats}
18 }
19
20 /*
21 Client for xapp API
22 */
23 type Client struct {
24         transport runtime.ClientTransport
25         formats   strfmt.Registry
26 }
27
28 // ClientService is the interface for Client methods
29 type ClientService interface {
30         GetXappConfigList(params *GetXappConfigListParams) (*GetXappConfigListOK, error)
31
32         SetTransport(transport runtime.ClientTransport)
33 }
34
35 /*
36   GetXappConfigList returns the configuration of all xapps
37 */
38 func (a *Client) GetXappConfigList(params *GetXappConfigListParams) (*GetXappConfigListOK, error) {
39         // TODO: Validate the params before sending
40         if params == nil {
41                 params = NewGetXappConfigListParams()
42         }
43
44         result, err := a.transport.Submit(&runtime.ClientOperation{
45                 ID:                 "getXappConfigList",
46                 Method:             "GET",
47                 PathPattern:        "/config",
48                 ProducesMediaTypes: []string{"application/json", "application/xml"},
49                 ConsumesMediaTypes: []string{"application/json"},
50                 Schemes:            []string{"http"},
51                 Params:             params,
52                 Reader:             &GetXappConfigListReader{formats: a.formats},
53                 Context:            params.Context,
54                 Client:             params.HTTPClient,
55         })
56         if err != nil {
57                 return nil, err
58         }
59         success, ok := result.(*GetXappConfigListOK)
60         if ok {
61                 return success, nil
62         }
63         // unexpected success response
64         // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
65         msg := fmt.Sprintf("unexpected success response for getXappConfigList: API contract not enforced by server. Client expected to get an error, but got: %T", result)
66         panic(msg)
67 }
68
69 // SetTransport changes the transport on the client
70 func (a *Client) SetTransport(transport runtime.ClientTransport) {
71         a.transport = transport
72 }