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"
11 "github.com/go-openapi/strfmt"
13 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/common"
14 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/xapp"
17 // Default r i c subscription HTTP client.
18 var Default = NewHTTPClient(nil)
21 // DefaultHost is the default Host
22 // found in Meta (info) section of spec file
23 DefaultHost string = "hostname"
24 // DefaultBasePath is the default BasePath
25 // found in Meta (info) section of spec file
26 DefaultBasePath string = "/ric/v1"
29 // DefaultSchemes are the default schemes found in Meta (info) section of spec file
30 var DefaultSchemes = []string{"http"}
32 // NewHTTPClient creates a new r i c subscription HTTP client.
33 func NewHTTPClient(formats strfmt.Registry) *RICSubscription {
34 return NewHTTPClientWithConfig(formats, nil)
37 // NewHTTPClientWithConfig creates a new r i c subscription HTTP client,
38 // using a customizable transport config.
39 func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *RICSubscription {
40 // ensure nullable parameters have default
42 cfg = DefaultTransportConfig()
45 // create transport and client
46 transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
47 return New(transport, formats)
50 // New creates a new r i c subscription client
51 func New(transport runtime.ClientTransport, formats strfmt.Registry) *RICSubscription {
52 // ensure nullable parameters have default
54 formats = strfmt.Default
57 cli := new(RICSubscription)
58 cli.Transport = transport
59 cli.Common = common.New(transport, formats)
60 cli.Xapp = xapp.New(transport, formats)
64 // DefaultTransportConfig creates a TransportConfig with the
65 // default settings taken from the meta section of the spec file.
66 func DefaultTransportConfig() *TransportConfig {
67 return &TransportConfig{
69 BasePath: DefaultBasePath,
70 Schemes: DefaultSchemes,
74 // TransportConfig contains the transport related info,
75 // found in the meta section of the spec file.
76 type TransportConfig struct {
82 // WithHost overrides the default host,
83 // provided by the meta section of the spec file.
84 func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
89 // WithBasePath overrides the default basePath,
90 // provided by the meta section of the spec file.
91 func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
92 cfg.BasePath = basePath
96 // WithSchemes overrides the default schemes,
97 // provided by the meta section of the spec file.
98 func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
103 // RICSubscription is a client for r i c subscription
104 type RICSubscription struct {
105 Common common.ClientService
107 Xapp xapp.ClientService
109 Transport runtime.ClientTransport
112 // SetTransport changes the transport on the client and all its subresources
113 func (c *RICSubscription) SetTransport(transport runtime.ClientTransport) {
114 c.Transport = transport
115 c.Common.SetTransport(transport)
116 c.Xapp.SetTransport(transport)