Skip to content

Commit 0b7bdf8

Browse files
committed
Refactor configuration
1 parent 8a80e68 commit 0b7bdf8

File tree

178 files changed

+1826
-2094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+1826
-2094
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Build
2727
run: |
2828
export VERSION=`echo $GITHUB_REF | sed -e "s/refs\/heads\///g" -e "s/release\///g"`
29-
sed -i "s/0.0.0/${VERSION}/g" src/version.go
29+
sed -i "s/0.0.0/${VERSION}/g" version.go
3030
make install
3131
make test
3232

src/api/api_access_records.go apis/api_access_records.go

+59-54
Large diffs are not rendered by default.

src/api/api_accounts.go apis/api_accounts.go

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package authress
1+
package apis
22

33
import (
44
"bytes"
@@ -8,10 +8,15 @@ import (
88
"net/url"
99
"strings"
1010
"time"
11+
12+
. "github.com/authress/authress-sdk.go/models"
13+
. "github.com/authress/authress-sdk.go/utilities"
1114
)
1215

1316
// AccountsApi Accounts service
14-
type AccountsApi service
17+
type AccountsApi struct {
18+
Client *HttpClient
19+
}
1520

1621
type ApiDelegateAuthenticationRequest struct {
1722
ctx context.Context
@@ -48,10 +53,10 @@ func (a *AccountsApi) DelegateAuthenticationExecute(r ApiDelegateAuthenticationR
4853
var (
4954
localVarHTTPMethod = http.MethodPost
5055
localVarPostBody interface{}
51-
formFiles []formFile
56+
formFiles []FormFile
5257
)
5358

54-
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.DelegateAuthentication")
59+
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.DelegateAuthentication")
5560
if err != nil {
5661
return nil, &GenericOpenAPIError{error: err.Error()}
5762
}
@@ -84,12 +89,12 @@ func (a *AccountsApi) DelegateAuthenticationExecute(r ApiDelegateAuthenticationR
8489
}
8590
// body params
8691
localVarPostBody = r.identityRequest
87-
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
92+
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
8893
if err != nil {
8994
return nil, err
9095
}
9196

92-
localVarHTTPResponse, err := a.client.callAPI(req)
97+
localVarHTTPResponse, err := a.Client.callAPI(req)
9398
if err != nil || localVarHTTPResponse == nil {
9499
return localVarHTTPResponse, err
95100
}
@@ -146,11 +151,11 @@ func (a *AccountsApi) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http
146151
var (
147152
localVarHTTPMethod = http.MethodGet
148153
localVarPostBody interface{}
149-
formFiles []formFile
154+
formFiles []FormFile
150155
localVarReturnValue *Account
151156
)
152157

153-
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.GetAccount")
158+
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.GetAccount")
154159
if err != nil {
155160
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
156161
}
@@ -179,12 +184,12 @@ func (a *AccountsApi) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http
179184
if localVarHTTPHeaderAccept != "" {
180185
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
181186
}
182-
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
187+
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
183188
if err != nil {
184189
return localVarReturnValue, nil, err
185190
}
186191

187-
localVarHTTPResponse, err := a.client.callAPI(req)
192+
localVarHTTPResponse, err := a.Client.callAPI(req)
188193
if err != nil || localVarHTTPResponse == nil {
189194
return localVarReturnValue, localVarHTTPResponse, err
190195
}
@@ -204,7 +209,7 @@ func (a *AccountsApi) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http
204209
return localVarReturnValue, localVarHTTPResponse, newErr
205210
}
206211

207-
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
212+
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
208213
if err != nil {
209214
newErr := &GenericOpenAPIError{
210215
body: localVarBody,
@@ -247,11 +252,11 @@ func (a *AccountsApi) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesReque
247252
var (
248253
localVarHTTPMethod = http.MethodGet
249254
localVarPostBody interface{}
250-
formFiles []formFile
255+
formFiles []FormFile
251256
localVarReturnValue *IdentityCollection
252257
)
253258

254-
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.GetAccountIdentities")
259+
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.GetAccountIdentities")
255260
if err != nil {
256261
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
257262
}
@@ -279,12 +284,12 @@ func (a *AccountsApi) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesReque
279284
if localVarHTTPHeaderAccept != "" {
280285
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
281286
}
282-
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
287+
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
283288
if err != nil {
284289
return localVarReturnValue, nil, err
285290
}
286291

287-
localVarHTTPResponse, err := a.client.callAPI(req)
292+
localVarHTTPResponse, err := a.Client.callAPI(req)
288293
if err != nil || localVarHTTPResponse == nil {
289294
return localVarReturnValue, localVarHTTPResponse, err
290295
}
@@ -304,7 +309,7 @@ func (a *AccountsApi) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesReque
304309
return localVarReturnValue, localVarHTTPResponse, newErr
305310
}
306311

307-
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
312+
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
308313
if err != nil {
309314
newErr := &GenericOpenAPIError{
310315
body: localVarBody,
@@ -354,11 +359,11 @@ func (a *AccountsApi) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountColle
354359
var (
355360
localVarHTTPMethod = http.MethodGet
356361
localVarPostBody interface{}
357-
formFiles []formFile
362+
formFiles []FormFile
358363
localVarReturnValue *AccountCollection
359364
)
360365

361-
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.GetAccounts")
366+
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.GetAccounts")
362367
if err != nil {
363368
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
364369
}
@@ -389,12 +394,12 @@ func (a *AccountsApi) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountColle
389394
if localVarHTTPHeaderAccept != "" {
390395
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
391396
}
392-
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
397+
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
393398
if err != nil {
394399
return localVarReturnValue, nil, err
395400
}
396401

397-
localVarHTTPResponse, err := a.client.callAPI(req)
402+
localVarHTTPResponse, err := a.Client.callAPI(req)
398403
if err != nil || localVarHTTPResponse == nil {
399404
return localVarReturnValue, localVarHTTPResponse, err
400405
}
@@ -414,7 +419,7 @@ func (a *AccountsApi) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountColle
414419
return localVarReturnValue, localVarHTTPResponse, newErr
415420
}
416421

417-
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
422+
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
418423
if err != nil {
419424
newErr := &GenericOpenAPIError{
420425
body: localVarBody,

src/api/api_applications.go apis/api_applications.go

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package authress
1+
package apis
22

33
import (
44
"bytes"
@@ -7,10 +7,15 @@ import (
77
"net/http"
88
"net/url"
99
"strings"
10+
11+
. "github.com/authress/authress-sdk.go/models"
12+
. "github.com/authress/authress-sdk.go/utilities"
1013
)
1114

1215
// ApplicationsApi Applications service
13-
type ApplicationsApi service
16+
type ApplicationsApi struct {
17+
Client *HttpClient
18+
}
1419

1520
type ApiDelegateUserLoginRequest struct {
1621
ctx context.Context
@@ -49,11 +54,11 @@ func (a *ApplicationsApi) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest
4954
var (
5055
localVarHTTPMethod = http.MethodPost
5156
localVarPostBody interface{}
52-
formFiles []formFile
57+
formFiles []FormFile
5358
localVarReturnValue *ApplicationDelegation
5459
)
5560

56-
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationsApi.DelegateUserLogin")
61+
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "ApplicationsApi.DelegateUserLogin")
5762
if err != nil {
5863
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
5964
}
@@ -89,12 +94,12 @@ func (a *ApplicationsApi) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest
8994
if localVarHTTPHeaderAccept != "" {
9095
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
9196
}
92-
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
97+
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
9398
if err != nil {
9499
return localVarReturnValue, nil, err
95100
}
96101

97-
localVarHTTPResponse, err := a.client.callAPI(req)
102+
localVarHTTPResponse, err := a.Client.callAPI(req)
98103
if err != nil || localVarHTTPResponse == nil {
99104
return localVarReturnValue, localVarHTTPResponse, err
100105
}
@@ -114,7 +119,7 @@ func (a *ApplicationsApi) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest
114119
return localVarReturnValue, localVarHTTPResponse, newErr
115120
}
116121

117-
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
122+
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
118123
if err != nil {
119124
newErr := &GenericOpenAPIError{
120125
body: localVarBody,

0 commit comments

Comments
 (0)