/
copr_h_d_client.go
71 lines (48 loc) · 1.67 KB
/
copr_h_d_client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/victorock/gocoprhd/client/authentication"
"github.com/victorock/gocoprhd/client/block"
"github.com/victorock/gocoprhd/client/compute"
"github.com/victorock/gocoprhd/client/vdc"
)
// Default copr h d HTTP client.
var Default = NewHTTPClient(nil)
// NewHTTPClient creates a new copr h d HTTP client.
func NewHTTPClient(formats strfmt.Registry) *CoprHD {
if formats == nil {
formats = strfmt.Default
}
transport := httptransport.New("localhost", "/", []string{"https", "http"})
return New(transport, formats)
}
// New creates a new copr h d client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *CoprHD {
cli := new(CoprHD)
cli.Transport = transport
cli.Authentication = authentication.New(transport, formats)
cli.Block = block.New(transport, formats)
cli.Compute = compute.New(transport, formats)
cli.Vdc = vdc.New(transport, formats)
return cli
}
// CoprHD is a client for copr h d
type CoprHD struct {
Authentication *authentication.Client
Block *block.Client
Compute *compute.Client
Vdc *vdc.Client
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *CoprHD) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Authentication.SetTransport(transport)
c.Block.SetTransport(transport)
c.Compute.SetTransport(transport)
c.Vdc.SetTransport(transport)
}