1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
9 "github.com/go-openapi/runtime"
10 httptransport "github.com/go-openapi/runtime/client"
12 strfmt "github.com/go-openapi/strfmt"
14 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/common"
15 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/control"
16 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/policy"
17 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/query"
18 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/report"
21 // Default r i c subscription HTTP client.
22 var Default = NewHTTPClient(nil)
25 // DefaultHost is the default Host
26 // found in Meta (info) section of spec file
27 DefaultHost string = "hostname"
28 // DefaultBasePath is the default BasePath
29 // found in Meta (info) section of spec file
30 DefaultBasePath string = "/ric/v1"
33 // DefaultSchemes are the default schemes found in Meta (info) section of spec file
34 var DefaultSchemes = []string{"http"}
36 // NewHTTPClient creates a new r i c subscription HTTP client.
37 func NewHTTPClient(formats strfmt.Registry) *RICSubscription {
38 return NewHTTPClientWithConfig(formats, nil)
41 // NewHTTPClientWithConfig creates a new r i c subscription HTTP client,
42 // using a customizable transport config.
43 func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *RICSubscription {
44 // ensure nullable parameters have default
46 cfg = DefaultTransportConfig()
49 // create transport and client
50 transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
51 return New(transport, formats)
54 // New creates a new r i c subscription client
55 func New(transport runtime.ClientTransport, formats strfmt.Registry) *RICSubscription {
56 // ensure nullable parameters have default
58 formats = strfmt.Default
61 cli := new(RICSubscription)
62 cli.Transport = transport
64 cli.Common = common.New(transport, formats)
66 cli.Control = control.New(transport, formats)
68 cli.Policy = policy.New(transport, formats)
70 cli.Query = query.New(transport, formats)
72 cli.Report = report.New(transport, formats)
77 // DefaultTransportConfig creates a TransportConfig with the
78 // default settings taken from the meta section of the spec file.
79 func DefaultTransportConfig() *TransportConfig {
80 return &TransportConfig{
82 BasePath: DefaultBasePath,
83 Schemes: DefaultSchemes,
87 // TransportConfig contains the transport related info,
88 // found in the meta section of the spec file.
89 type TransportConfig struct {
95 // WithHost overrides the default host,
96 // provided by the meta section of the spec file.
97 func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
102 // WithBasePath overrides the default basePath,
103 // provided by the meta section of the spec file.
104 func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
105 cfg.BasePath = basePath
109 // WithSchemes overrides the default schemes,
110 // provided by the meta section of the spec file.
111 func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
112 cfg.Schemes = schemes
116 // RICSubscription is a client for r i c subscription
117 type RICSubscription struct {
118 Common *common.Client
120 Control *control.Client
122 Policy *policy.Client
126 Report *report.Client
128 Transport runtime.ClientTransport
131 // SetTransport changes the transport on the client and all its subresources
132 func (c *RICSubscription) SetTransport(transport runtime.ClientTransport) {
133 c.Transport = transport
135 c.Common.SetTransport(transport)
137 c.Control.SetTransport(transport)
139 c.Policy.SetTransport(transport)
141 c.Query.SetTransport(transport)
143 c.Report.SetTransport(transport)