-
Notifications
You must be signed in to change notification settings - Fork 64
/
configuration.go
75 lines (60 loc) · 1.45 KB
/
configuration.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
72
73
74
75
/*
* Npcf_SMPolicyControl
*
* Session Management Policy Control Service
*
* API version: 1.0.1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package Npcf_SMPolicyControl
import (
"net/http"
"strings"
)
type Configuration struct {
url string
basePath string
host string
defaultHeader map[string]string
userAgent string
httpClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
basePath: "https://example.com/npcf-smpolicycontrol/v1",
url: "{apiRoot}/npcf-smpolicycontrol/v1",
defaultHeader: make(map[string]string),
userAgent: "OpenAPI-Generator/1.0.0/go",
}
return cfg
}
func (c *Configuration) SetBasePath(apiRoot string) {
url := c.url
// Replace apiRoot
url = strings.Replace(url, "{"+"apiRoot"+"}", apiRoot, -1)
c.basePath = url
}
func (c *Configuration) BasePath() string {
return c.basePath
}
func (c *Configuration) Host() string {
return c.host
}
func (c *Configuration) SetHost(host string) {
c.host = host
}
func (c *Configuration) UserAgent() string {
return c.userAgent
}
func (c *Configuration) SetUserAgent(userAgent string) {
c.userAgent = userAgent
}
func (c *Configuration) DefaultHeader() map[string]string {
return c.defaultHeader
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.defaultHeader[key] = value
}
func (c *Configuration) HTTPClient() *http.Client {
return c.httpClient
}