diff --git a/okta/okta.go b/okta/okta.go index 3d7862ff8..1d260ac44 100644 --- a/okta/okta.go +++ b/okta/okta.go @@ -150,6 +150,19 @@ func (c *Client) GetConfig() *config { return c.config } +func (c *Client) SetConfig(conf ...ConfigSetter) (err error) { + config := c.config + for _, confSetter := range conf { + confSetter(config) + } + _, err = validateConfig(config) + if err != nil { + return + } + c.config = config + return +} + // GetRequestExecutor returns underlying request executor // Deprecated: please use CloneRequestExecutor() to avoid race conditions func (c *Client) GetRequestExecutor() *RequestExecutor { diff --git a/openapi/generator/templates/okta.go.hbs b/openapi/generator/templates/okta.go.hbs index 4382491b5..dc4c2a7f4 100644 --- a/openapi/generator/templates/okta.go.hbs +++ b/openapi/generator/templates/okta.go.hbs @@ -84,6 +84,19 @@ func (c *Client) GetConfig() *config { return c.config } +func (c *Client) SetConfig(conf ...ConfigSetter) (err error) { + config := c.config + for _, confSetter := range conf { + confSetter(config) + } + _, err = validateConfig(config) + if err != nil { + return + } + c.config = config + return +} + // GetRequestExecutor returns underlying request executor // Deprecated: please use CloneRequestExecutor() to avoid race conditions func (c *Client) GetRequestExecutor() *RequestExecutor {