Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Go][Experimental] Allow retrieving the underlying configuration for APIClient #4195

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ func (c *APIClient) ChangeBasePath(path string) {
c.cfg.BasePath = path
}

// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}

// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
Expand Down
6 changes: 6 additions & 0 deletions samples/client/petstore/go-experimental/go-petstore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ func (c *APIClient) ChangeBasePath(path string) {
c.cfg.BasePath = path
}

// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}

// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ func (c *APIClient) ChangeBasePath(path string) {
c.cfg.BasePath = path
}

// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}

// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**EnumStringRequired** | Pointer to **string** | |
**EnumInteger** | Pointer to **int32** | | [optional]
**EnumNumber** | Pointer to **float64** | | [optional]
**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional]
**OuterEnum** | Pointer to [**NullableOuterEnum**](OuterEnum.md) | | [optional]
**OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
Expand Down Expand Up @@ -117,13 +117,13 @@ SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNu

### GetOuterEnum

`func (o *EnumTest) GetOuterEnum() OuterEnum`
`func (o *EnumTest) GetOuterEnum() NullableOuterEnum`

GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise.

### GetOuterEnumOk

`func (o *EnumTest) GetOuterEnumOk() (OuterEnum, bool)`
`func (o *EnumTest) GetOuterEnumOk() (NullableOuterEnum, bool)`

GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
Expand All @@ -136,9 +136,9 @@ HasOuterEnum returns a boolean if a field has been set.

### SetOuterEnum

`func (o *EnumTest) SetOuterEnum(v OuterEnum)`
`func (o *EnumTest) SetOuterEnum(v NullableOuterEnum)`

SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field.
SetOuterEnum gets a reference to the given NullableOuterEnum and assigns it to the OuterEnum field.

### SetOuterEnumExplicitNull

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**NullableMessage** | Pointer to **string** | | [optional]
**NullableMessage** | Pointer to **NullableString** | | [optional]

## Methods

### GetNullableMessage

`func (o *HealthCheckResult) GetNullableMessage() string`
`func (o *HealthCheckResult) GetNullableMessage() NullableString`

GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise.

### GetNullableMessageOk

`func (o *HealthCheckResult) GetNullableMessageOk() (string, bool)`
`func (o *HealthCheckResult) GetNullableMessageOk() (NullableString, bool)`

GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
Expand All @@ -29,9 +29,9 @@ HasNullableMessage returns a boolean if a field has been set.

### SetNullableMessage

`func (o *HealthCheckResult) SetNullableMessage(v string)`
`func (o *HealthCheckResult) SetNullableMessage(v NullableString)`

SetNullableMessage gets a reference to the given string and assigns it to the NullableMessage field.
SetNullableMessage gets a reference to the given NullableString and assigns it to the NullableMessage field.

### SetNullableMessageExplicitNull

Expand Down
Loading