@@ -22,12 +22,10 @@ import (
2222
2323// Client represents an HTTP client to interact with a specific API.
2424type 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
3129 clientConfig ClientConfig
3230 Logger logger.Logger
3331 ConcurrencyHandler * concurrency.ConcurrencyHandler
@@ -52,9 +50,11 @@ type AuthConfig struct {
5250
5351// EnvironmentConfig represents the structure to read authentication details from a JSON configuration file.
5452type 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
5858}
5959
6060// ClientOptions holds optional configuration options for the HTTP Client.
@@ -148,10 +148,10 @@ func BuildClient(config ClientConfig) (*Client, error) {
148148
149149 // Create a new HTTP client with the provided configuration.
150150 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,
155155 httpClient : httpClient ,
156156 clientConfig : config ,
157157 Logger : log ,
@@ -162,8 +162,10 @@ func BuildClient(config ClientConfig) (*Client, error) {
162162 // Log the client's configuration.
163163 log .Info ("New API client initialized" ,
164164 zap .String ("API Type" , config .Environment .APIType ),
165- zap .String ("Instance Name" , client .InstanceName ),
165+ zap .String ("Instance Name" , config . Environment .InstanceName ),
166166 zap .String ("Override Base Domain" , config .Environment .OverrideBaseDomain ),
167+ zap .String ("Tenant ID" , config .Environment .TenantID ),
168+ zap .String ("Tenant Name" , config .Environment .TenantName ),
167169 zap .String ("Authentication Method" , authMethod ),
168170 zap .String ("Logging Level" , config .ClientOptions .LogLevel ),
169171 zap .String ("Log Encoding Format" , config .ClientOptions .LogOutputFormat ),
0 commit comments