@@ -81,9 +81,7 @@ func main() {
8181 ctx := context.Background ()
8282
8383 s := apiclientgo.New (
84- apiclientgo.WithSecurity (components.Security {
85- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
86- }),
84+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
8785 )
8886
8987 res , err := s.Client .Chat .Create (ctx, components.ChatRequest {
@@ -124,9 +122,7 @@ func main() {
124122 ctx := context.Background ()
125123
126124 s := apiclientgo.New (
127- apiclientgo.WithSecurity (components.Security {
128- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
129- }),
125+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
130126 )
131127
132128 res , err := s.Client .Chat .CreateStream (ctx, components.ChatRequest {
@@ -156,14 +152,13 @@ func main() {
156152
157153### Per-Client Security Schemes
158154
159- This SDK supports the following security schemes globally:
155+ This SDK supports the following security scheme globally:
160156
161- | Name | Type | Scheme | Environment Variable |
162- | ------------ | ------ | ----------- | -------------------- |
163- | ` APIToken ` | http | HTTP Bearer | ` GLEAN_API_TOKEN ` |
164- | ` CookieAuth ` | apiKey | API key | ` GLEAN_COOKIE_AUTH ` |
157+ | Name | Type | Scheme | Environment Variable |
158+ | ---------- | ---- | ----------- | -------------------- |
159+ | ` APIToken ` | http | HTTP Bearer | ` GLEAN_API_TOKEN ` |
165160
166- You can set the security parameters through the ` WithSecurity ` option when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it . For example:
161+ You can configure it using the ` WithSecurity ` option when initializing the SDK client instance. For example:
167162``` go
168163package main
169164
@@ -180,9 +175,7 @@ func main() {
180175 ctx := context.Background ()
181176
182177 s := apiclientgo.New (
183- apiclientgo.WithSecurity (components.Security {
184- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
185- }),
178+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
186179 )
187180
188181 res , err := s.Client .Activity .Report (ctx, components.Activity {
@@ -484,9 +477,7 @@ func main() {
484477 ctx := context.Background ()
485478
486479 s := apiclientgo.New (
487- apiclientgo.WithSecurity (components.Security {
488- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
489- }),
480+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
490481 )
491482
492483 res , err := s.Client .Activity .Report (ctx, components.Activity {
@@ -564,9 +555,7 @@ func main() {
564555 },
565556 RetryConnectionErrors: false ,
566557 }),
567- apiclientgo.WithSecurity (components.Security {
568- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
569- }),
558+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
570559 )
571560
572561 res , err := s.Client .Activity .Report (ctx, components.Activity {
@@ -640,9 +629,7 @@ func main() {
640629 ctx := context.Background ()
641630
642631 s := apiclientgo.New (
643- apiclientgo.WithSecurity (components.Security {
644- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
645- }),
632+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
646633 )
647634
648635 res , err := s.Client .Collections .Create (ctx, components.CreateCollectionRequest {
@@ -1358,9 +1345,7 @@ func main() {
13581345
13591346 s := apiclientgo.New (
13601347 apiclientgo.WithInstance (" <value>" ),
1361- apiclientgo.WithSecurity (components.Security {
1362- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
1363- }),
1348+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
13641349 )
13651350
13661351 res , err := s.Client .Activity .Report (ctx, components.Activity {
@@ -1419,9 +1404,7 @@ func main() {
14191404
14201405 s := apiclientgo.New (
14211406 apiclientgo.WithServerURL (" https://instance-name-be.glean.com" ),
1422- apiclientgo.WithSecurity (components.Security {
1423- APIToken: apiclientgo.String (os.Getenv (" GLEAN_API_TOKEN" )),
1424- }),
1407+ apiclientgo.WithSecurity (os.Getenv (" GLEAN_API_TOKEN" )),
14251408 )
14261409
14271410 res , err := s.Client .Activity .Report (ctx, components.Activity {
0 commit comments