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/xapp"
18 // Default r i c subscription HTTP client.
19 var Default = NewHTTPClient(nil)
22 // DefaultHost is the default Host
23 // found in Meta (info) section of spec file
24 DefaultHost string = "hostname"
25 // DefaultBasePath is the default BasePath
26 // found in Meta (info) section of spec file
27 DefaultBasePath string = "/ric/v1"
30 // DefaultSchemes are the default schemes found in Meta (info) section of spec file
31 var DefaultSchemes = []string{"http"}
33 // NewHTTPClient creates a new r i c subscription HTTP client.
34 func NewHTTPClient(formats strfmt.Registry) *RICSubscription {
35 return NewHTTPClientWithConfig(formats, nil)
38 // NewHTTPClientWithConfig creates a new r i c subscription HTTP client,
39 // using a customizable transport config.
40 func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *RICSubscription {
41 // ensure nullable parameters have default
43 cfg = DefaultTransportConfig()
46 // create transport and client
47 transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
48 return New(transport, formats)
51 // New creates a new r i c subscription client
52 func New(transport runtime.ClientTransport, formats strfmt.Registry) *RICSubscription {
53 // ensure nullable parameters have default
55 formats = strfmt.Default
58 cli := new(RICSubscription)
59 cli.Transport = transport
61 cli.Common = common.New(transport, formats)
63 cli.Xapp = xapp.New(transport, formats)
68 // DefaultTransportConfig creates a TransportConfig with the
69 // default settings taken from the meta section of the spec file.
70 func DefaultTransportConfig() *TransportConfig {
71 return &TransportConfig{
73 BasePath: DefaultBasePath,
74 Schemes: DefaultSchemes,
78 // TransportConfig contains the transport related info,
79 // found in the meta section of the spec file.
80 type TransportConfig struct {
86 // WithHost overrides the default host,
87 // provided by the meta section of the spec file.
88 func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
93 // WithBasePath overrides the default basePath,
94 // provided by the meta section of the spec file.
95 func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
96 cfg.BasePath = basePath
100 // WithSchemes overrides the default schemes,
101 // provided by the meta section of the spec file.
102 func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
103 cfg.Schemes = schemes
107 // RICSubscription is a client for r i c subscription
108 type RICSubscription struct {
109 Common *common.Client
113 Transport runtime.ClientTransport
116 // SetTransport changes the transport on the client and all its subresources
117 func (c *RICSubscription) SetTransport(transport runtime.ClientTransport) {
118 c.Transport = transport
120 c.Common.SetTransport(transport)
122 c.Xapp.SetTransport(transport)