Skip to content

Commit

Permalink
Refactor configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Feb 4, 2024
1 parent 8a80e68 commit 0b7bdf8
Show file tree
Hide file tree
Showing 178 changed files with 1,826 additions and 2,094 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Build
run: |
export VERSION=`echo $GITHUB_REF | sed -e "s/refs\/heads\///g" -e "s/release\///g"`
sed -i "s/0.0.0/${VERSION}/g" src/version.go
sed -i "s/0.0.0/${VERSION}/g" version.go
make install
make test
Expand Down
113 changes: 59 additions & 54 deletions src/api/api_access_records.go → apis/api_access_records.go

Large diffs are not rendered by default.

47 changes: 26 additions & 21 deletions src/api/api_accounts.go → apis/api_accounts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package authress
package apis

import (
"bytes"
Expand All @@ -8,10 +8,15 @@ import (
"net/url"
"strings"
"time"

. "github.com/authress/authress-sdk.go/models"
. "github.com/authress/authress-sdk.go/utilities"
)

// AccountsApi Accounts service
type AccountsApi service
type AccountsApi struct {
Client *HttpClient
}

type ApiDelegateAuthenticationRequest struct {
ctx context.Context
Expand Down Expand Up @@ -48,10 +53,10 @@ func (a *AccountsApi) DelegateAuthenticationExecute(r ApiDelegateAuthenticationR
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
formFiles []FormFile
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.DelegateAuthentication")
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.DelegateAuthentication")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
Expand Down Expand Up @@ -84,12 +89,12 @@ func (a *AccountsApi) DelegateAuthenticationExecute(r ApiDelegateAuthenticationR
}
// body params
localVarPostBody = r.identityRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}

localVarHTTPResponse, err := a.client.callAPI(req)
localVarHTTPResponse, err := a.Client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
Expand Down Expand Up @@ -146,11 +151,11 @@ func (a *AccountsApi) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
formFiles []FormFile
localVarReturnValue *Account
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.GetAccount")
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.GetAccount")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
Expand Down Expand Up @@ -179,12 +184,12 @@ func (a *AccountsApi) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.client.callAPI(req)
localVarHTTPResponse, err := a.Client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
Expand All @@ -204,7 +209,7 @@ func (a *AccountsApi) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
Expand Down Expand Up @@ -247,11 +252,11 @@ func (a *AccountsApi) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesReque
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
formFiles []FormFile
localVarReturnValue *IdentityCollection
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.GetAccountIdentities")
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.GetAccountIdentities")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
Expand Down Expand Up @@ -279,12 +284,12 @@ func (a *AccountsApi) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesReque
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.client.callAPI(req)
localVarHTTPResponse, err := a.Client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
Expand All @@ -304,7 +309,7 @@ func (a *AccountsApi) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesReque
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
Expand Down Expand Up @@ -354,11 +359,11 @@ func (a *AccountsApi) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountColle
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
formFiles []FormFile
localVarReturnValue *AccountCollection
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsApi.GetAccounts")
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "AccountsApi.GetAccounts")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
Expand Down Expand Up @@ -389,12 +394,12 @@ func (a *AccountsApi) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountColle
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.client.callAPI(req)
localVarHTTPResponse, err := a.Client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
Expand All @@ -414,7 +419,7 @@ func (a *AccountsApi) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountColle
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
Expand Down
19 changes: 12 additions & 7 deletions src/api/api_applications.go → apis/api_applications.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package authress
package apis

import (
"bytes"
Expand All @@ -7,10 +7,15 @@ import (
"net/http"
"net/url"
"strings"

. "github.com/authress/authress-sdk.go/models"
. "github.com/authress/authress-sdk.go/utilities"
)

// ApplicationsApi Applications service
type ApplicationsApi service
type ApplicationsApi struct {
Client *HttpClient
}

type ApiDelegateUserLoginRequest struct {
ctx context.Context
Expand Down Expand Up @@ -49,11 +54,11 @@ func (a *ApplicationsApi) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
formFiles []FormFile
localVarReturnValue *ApplicationDelegation
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationsApi.DelegateUserLogin")
localBasePath, err := a.Client.ClientConfiguration.ServerURLWithContext(r.ctx, "ApplicationsApi.DelegateUserLogin")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
Expand Down Expand Up @@ -89,12 +94,12 @@ func (a *ApplicationsApi) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
req, err := a.Client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.client.callAPI(req)
localVarHTTPResponse, err := a.Client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
Expand All @@ -114,7 +119,7 @@ func (a *ApplicationsApi) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.Client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
Expand Down
Loading

0 comments on commit 0b7bdf8

Please sign in to comment.