github.com/free5gc/openapi@v1.0.8/Nnssf_NSSAIAvailability/configuration.go (about) 1 /* 2 * NSSF NSSAI Availability 3 * 4 * NSSF NSSAI Availability Service 5 * 6 * API version: 1.0.0 7 * Generated by: OpenAPI Generator (https://openapi-generator.tech) 8 */ 9 10 package Nnssf_NSSAIAvailability 11 12 import ( 13 "net/http" 14 "strings" 15 ) 16 17 type Configuration struct { 18 url string 19 basePath string 20 host string 21 defaultHeader map[string]string 22 userAgent string 23 httpClient *http.Client 24 } 25 26 func NewConfiguration() *Configuration { 27 cfg := &Configuration{ 28 basePath: "https://example.com/nnssf-nssaiavailability/v1", 29 url: "{apiRoot}/nnssf-nssaiavailability/v1", 30 defaultHeader: make(map[string]string), 31 userAgent: "OpenAPI-Generator/1.0.0/go", 32 } 33 return cfg 34 } 35 36 func (c *Configuration) SetBasePath(apiRoot string) { 37 url := c.url 38 39 // Replace apiRoot 40 url = strings.Replace(url, "{"+"apiRoot"+"}", apiRoot, -1) 41 42 c.basePath = url 43 } 44 45 func (c *Configuration) SetBasePathNoGroup(basePath string) { 46 c.basePath = basePath 47 } 48 49 func (c *Configuration) BasePath() string { 50 return c.basePath 51 } 52 53 func (c *Configuration) Host() string { 54 return c.host 55 } 56 57 func (c *Configuration) SetHost(host string) { 58 c.host = host 59 } 60 61 func (c *Configuration) UserAgent() string { 62 return c.userAgent 63 } 64 65 func (c *Configuration) SetUserAgent(userAgent string) { 66 c.userAgent = userAgent 67 } 68 69 func (c *Configuration) DefaultHeader() map[string]string { 70 return c.defaultHeader 71 } 72 73 func (c *Configuration) AddDefaultHeader(key string, value string) { 74 c.defaultHeader[key] = value 75 } 76 77 func (c *Configuration) HTTPClient() *http.Client { 78 return c.httpClient 79 }