Skip to content

Commit

Permalink
Merge pull request #8 from tarmo-randma/upstream
Browse files Browse the repository at this point in the history
Exposed the new client creaton logic in common package to the outside…
  • Loading branch information
Dysar authored May 12, 2020
2 parents be2ce42 + 483c28d commit 2d1b7b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package api

import (
"errors"
"net/http"

"github.com/erply/api-go-wrapper/internal/common"
"github.com/erply/api-go-wrapper/pkg/api/addresses"
"github.com/erply/api-go-wrapper/pkg/api/auth"
Expand All @@ -12,7 +14,6 @@ import (
"github.com/erply/api-go-wrapper/pkg/api/sales"
"github.com/erply/api-go-wrapper/pkg/api/servicediscovery"
"github.com/erply/api-go-wrapper/pkg/api/warehouse"
"net/http"
)

type Client struct {
Expand All @@ -38,6 +39,13 @@ type Client struct {
ServiceDiscoverer servicediscovery.ServiceDiscoverer
}

//NewUnvalidatedClient returns a new Client without validating any of the incoming parameters giving the
//developer more flexibility
func NewUnvalidatedClient(sk, cc, partnerKey string, httpCli *http.Client) *Client {
comCli := common.NewClient(sk, cc, partnerKey, httpCli)
return newErplyClient(comCli)
}

// NewClient Takes three params:
// sessionKey string obtained from credentials or jwt
// clientCode erply customer identification number
Expand Down

0 comments on commit 2d1b7b3

Please sign in to comment.