Add optional subscription ID
[ric-plt/xapp-frame.git] / pkg / clientapi / r_i_c_subscription_client.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package clientapi
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         "github.com/go-openapi/runtime"
10         httptransport "github.com/go-openapi/runtime/client"
11         "github.com/go-openapi/strfmt"
12
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"
15 )
16
17 // Default r i c subscription HTTP client.
18 var Default = NewHTTPClient(nil)
19
20 const (
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"
27 )
28
29 // DefaultSchemes are the default schemes found in Meta (info) section of spec file
30 var DefaultSchemes = []string{"http"}
31
32 // NewHTTPClient creates a new r i c subscription HTTP client.
33 func NewHTTPClient(formats strfmt.Registry) *RICSubscription {
34         return NewHTTPClientWithConfig(formats, nil)
35 }
36
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
41         if cfg == nil {
42                 cfg = DefaultTransportConfig()
43         }
44
45         // create transport and client
46         transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
47         return New(transport, formats)
48 }
49
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
53         if formats == nil {
54                 formats = strfmt.Default
55         }
56
57         cli := new(RICSubscription)
58         cli.Transport = transport
59         cli.Common = common.New(transport, formats)
60         cli.Xapp = xapp.New(transport, formats)
61         return cli
62 }
63
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{
68                 Host:     DefaultHost,
69                 BasePath: DefaultBasePath,
70                 Schemes:  DefaultSchemes,
71         }
72 }
73
74 // TransportConfig contains the transport related info,
75 // found in the meta section of the spec file.
76 type TransportConfig struct {
77         Host     string
78         BasePath string
79         Schemes  []string
80 }
81
82 // WithHost overrides the default host,
83 // provided by the meta section of the spec file.
84 func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
85         cfg.Host = host
86         return cfg
87 }
88
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
93         return cfg
94 }
95
96 // WithSchemes overrides the default schemes,
97 // provided by the meta section of the spec file.
98 func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
99         cfg.Schemes = schemes
100         return cfg
101 }
102
103 // RICSubscription is a client for r i c subscription
104 type RICSubscription struct {
105         Common common.ClientService
106
107         Xapp xapp.ClientService
108
109         Transport runtime.ClientTransport
110 }
111
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)
117 }