@@ -22,12 +22,10 @@ import (
22
22
23
23
// Client represents an HTTP client to interact with a specific API.
24
24
type Client struct {
25
- InstanceName string // Website Instance name without the root domain
26
- AuthMethod string // Specifies the authentication method: "bearer" or "oauth"
27
- Token string // Authentication Token
28
- OverrideBaseDomain string // Base domain override used when the default in the api handler isn't suitable
29
- Expiry time.Time // Expiry time set for the auth token
30
- httpClient * http.Client
25
+ AuthMethod string // Specifies the authentication method: "bearer" or "oauth"
26
+ Token string // Authentication Token
27
+ Expiry time.Time // Expiry time set for the auth token
28
+ httpClient * http.Client // Internal HTTP client
31
29
clientConfig ClientConfig
32
30
Logger logger.Logger
33
31
ConcurrencyHandler * concurrency.ConcurrencyHandler
@@ -52,9 +50,11 @@ type AuthConfig struct {
52
50
53
51
// EnvironmentConfig represents the structure to read authentication details from a JSON configuration file.
54
52
type EnvironmentConfig struct {
55
- InstanceName string `json:"InstanceName,omitempty"`
56
- OverrideBaseDomain string `json:"OverrideBaseDomain,omitempty"`
57
- APIType string `json:"APIType,omitempty"`
53
+ APIType string `json:"APIType,omitempty"` // APIType specifies the type of API integration to use
54
+ InstanceName string `json:"InstanceName,omitempty"` // Website Instance name without the root domain
55
+ OverrideBaseDomain string `json:"OverrideBaseDomain,omitempty"` // Base domain override used when the default in the api handler isn't suitable
56
+ TenantID string `json:"TenantID,omitempty"` // TenantID is the unique identifier for the tenant
57
+ TenantName string `json:"TenantName,omitempty"` // TenantName is the name of the tenant
58
58
}
59
59
60
60
// ClientOptions holds optional configuration options for the HTTP Client.
@@ -148,10 +148,10 @@ func BuildClient(config ClientConfig) (*Client, error) {
148
148
149
149
// Create a new HTTP client with the provided configuration.
150
150
client := & Client {
151
- APIHandler : apiHandler ,
152
- InstanceName : config .Environment .InstanceName ,
153
- AuthMethod : authMethod ,
154
- OverrideBaseDomain : config .Environment .OverrideBaseDomain ,
151
+ APIHandler : apiHandler ,
152
+ // InstanceName: config.Environment.InstanceName,
153
+ AuthMethod : authMethod ,
154
+ // OverrideBaseDomain: config.Environment.OverrideBaseDomain,
155
155
httpClient : httpClient ,
156
156
clientConfig : config ,
157
157
Logger : log ,
@@ -162,8 +162,10 @@ func BuildClient(config ClientConfig) (*Client, error) {
162
162
// Log the client's configuration.
163
163
log .Info ("New API client initialized" ,
164
164
zap .String ("API Type" , config .Environment .APIType ),
165
- zap .String ("Instance Name" , client .InstanceName ),
165
+ zap .String ("Instance Name" , config . Environment .InstanceName ),
166
166
zap .String ("Override Base Domain" , config .Environment .OverrideBaseDomain ),
167
+ zap .String ("Tenant ID" , config .Environment .TenantID ),
168
+ zap .String ("Tenant Name" , config .Environment .TenantName ),
167
169
zap .String ("Authentication Method" , authMethod ),
168
170
zap .String ("Logging Level" , config .ClientOptions .LogLevel ),
169
171
zap .String ("Log Encoding Format" , config .ClientOptions .LogOutputFormat ),
0 commit comments