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/policy"
16 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/query"
17 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/report"
20 // Default r i c subscription HTTP client.
21 var Default = NewHTTPClient(nil)
24 // DefaultHost is the default Host
25 // found in Meta (info) section of spec file
26 DefaultHost string = "hostname"
27 // DefaultBasePath is the default BasePath
28 // found in Meta (info) section of spec file
29 DefaultBasePath string = "/ric/v1"
32 // DefaultSchemes are the default schemes found in Meta (info) section of spec file
33 var DefaultSchemes = []string{"http"}
35 // NewHTTPClient creates a new r i c subscription HTTP client.
36 func NewHTTPClient(formats strfmt.Registry) *RICSubscription {
37 return NewHTTPClientWithConfig(formats, nil)
40 // NewHTTPClientWithConfig creates a new r i c subscription HTTP client,
41 // using a customizable transport config.
42 func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *RICSubscription {
43 // ensure nullable parameters have default
45 cfg = DefaultTransportConfig()
48 // create transport and client
49 transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
50 return New(transport, formats)
53 // New creates a new r i c subscription client
54 func New(transport runtime.ClientTransport, formats strfmt.Registry) *RICSubscription {
55 // ensure nullable parameters have default
57 formats = strfmt.Default
60 cli := new(RICSubscription)
61 cli.Transport = transport
63 cli.Common = common.New(transport, formats)
65 cli.Policy = policy.New(transport, formats)
67 cli.Query = query.New(transport, formats)
69 cli.Report = report.New(transport, formats)
74 // DefaultTransportConfig creates a TransportConfig with the
75 // default settings taken from the meta section of the spec file.
76 func DefaultTransportConfig() *TransportConfig {
77 return &TransportConfig{
79 BasePath: DefaultBasePath,
80 Schemes: DefaultSchemes,
84 // TransportConfig contains the transport related info,
85 // found in the meta section of the spec file.
86 type TransportConfig struct {
92 // WithHost overrides the default host,
93 // provided by the meta section of the spec file.
94 func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
99 // WithBasePath overrides the default basePath,
100 // provided by the meta section of the spec file.
101 func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
102 cfg.BasePath = basePath
106 // WithSchemes overrides the default schemes,
107 // provided by the meta section of the spec file.
108 func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
109 cfg.Schemes = schemes
113 // RICSubscription is a client for r i c subscription
114 type RICSubscription struct {
115 Common *common.Client
117 Policy *policy.Client
121 Report *report.Client
123 Transport runtime.ClientTransport
126 // SetTransport changes the transport on the client and all its subresources
127 func (c *RICSubscription) SetTransport(transport runtime.ClientTransport) {
128 c.Transport = transport
130 c.Common.SetTransport(transport)
132 c.Policy.SetTransport(transport)
134 c.Query.SetTransport(transport)
136 c.Report.SetTransport(transport)