Skip to content

Commit 1a49575

Browse files
authored
chore: go fix for path params (#635)
<!-- We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines, then fill out the blanks below. Please format the PR title appropriately based on the type of change: <type>[!]: <description> Where <type> is one of: docs, chore, feat, fix, test, misc. Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature). **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.** Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged! e.g. Fixes #1 Closes #2 --> # Fixes # go fix for path params twilio/twilio-go#263 ### Checklist - [x] I acknowledge that all my contributions will be made under the project's license - [ ] Run `make test-docker` - [ ] Verify affected language: - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our [OpenAPI specification](https://github.com/twilio/twilio-oai) using the [build_twilio_go.py](./examples/build_twilio_go.py) using `python examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-go` and inspect the diff - [ ] Run `make test` in `twilio-go` - [ ] Create a pull request in `twilio-go` - [ ] Provide a link below to the pull request - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please create a GitHub Issue in this repository.
1 parent 079f7bd commit 1a49575

18 files changed

+50
-21
lines changed

examples/go/go-client/helper/rest/api/v2010/accounts.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import (
1818
"encoding/json"
1919
"fmt"
2020
"net/url"
21-
"strings"
22-
"time"
2321

2422
"github.com/twilio/twilio-go/client"
2523
)

examples/go/go-client/helper/rest/api/v2010/accounts_calls.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import (
1818
"encoding/json"
1919
"fmt"
2020
"net/url"
21-
"strings"
21+
22+
"github.com/twilio/twilio-go/client"
2223
)
2324

2425
// Optional parameters for the method 'CreateCall'

examples/go/go-client/helper/rest/api/v2010/accounts_calls_feedback_summary.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import (
1818
"encoding/json"
1919
"fmt"
2020
"net/url"
21-
"strings"
21+
22+
"github.com/twilio/twilio-go/client"
2223
)
2324

2425
// Optional parameters for the method 'UpdateCallFeedbackSummary'

examples/go/go-client/helper/rest/api/v2010/model_list_account_response.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// ListAccountResponse struct for ListAccountResponse
1823
type ListAccountResponse struct {
1924
End int `json:"end,omitempty"`

examples/go/go-client/helper/rest/api/v2010/model_list_health_check.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// ListHealthCheck struct for ListHealthCheck
1823
type ListHealthCheck struct {
1924
Status []string `json:"status,omitempty"`

examples/go/go-client/helper/rest/api/v2010/model_test_response_object.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package openapi
1616

1717
import (
1818
"encoding/json"
19-
2019
"github.com/twilio/twilio-go/client"
2120
)
2221

examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_array_of_objects.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package openapi
1616

1717
import (
1818
"encoding/json"
19-
2019
"github.com/twilio/twilio-go/client"
2120
)
2221

examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_object.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// TestResponseObjectTestObject struct for TestResponseObjectTestObject
1823
type TestResponseObjectTestObject struct {
1924
Fax bool `json:"fax,omitempty"`

examples/go/go-client/helper/rest/flex/v1/credentials_aws.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import (
1818
"encoding/json"
1919
"fmt"
2020
"net/url"
21-
"strings"
22-
"time"
2321

2422
"github.com/twilio/twilio-go/client"
2523
)

examples/go/go-client/helper/rest/flex/v1/credentials_aws_history.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ package openapi
1616

1717
import (
1818
"encoding/json"
19+
"fmt"
1920
"net/url"
20-
"strings"
21+
22+
"github.com/twilio/twilio-go/client"
2123
)
2224

2325
// Optional parameters for the method 'FetchCredentialHistory'

examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// ListCredentialAwsResponse struct for ListCredentialAwsResponse
1823
type ListCredentialAwsResponse struct {
1924
Credentials []TestResponseObject `json:"credentials,omitempty"`

examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response_meta.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// ListCredentialAwsResponseMeta struct for ListCredentialAwsResponseMeta
1823
type ListCredentialAwsResponseMeta struct {
1924
FirstPageUrl string `json:"first_page_url,omitempty"`

examples/go/go-client/helper/rest/flex/v1/model_test_response_object.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// TestResponseObject struct for TestResponseObject
1823
type TestResponseObject struct {
1924
AccountSid *string `json:"account_sid,omitempty"`

examples/go/go-client/helper/rest/flex/v1/model_update_call_response.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
package openapi
1616

17+
import (
18+
"encoding/json"
19+
"github.com/twilio/twilio-go/client"
20+
)
21+
1722
// UpdateCallResponse struct for UpdateCallResponse
1823
type UpdateCallResponse struct {
1924
// Non-string path parameter in the response.

examples/go/go-client/helper/rest/flex/v1/voice.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ package openapi
1616

1717
import (
1818
"encoding/json"
19+
"fmt"
1920
"net/url"
20-
"strings"
21+
22+
"github.com/twilio/twilio-go/client"
2123
)
2224

2325
func (c *ApiService) UpdateCall(Sid string) (*UpdateCallResponse, error) {

examples/go/go-client/terraform/resources/api/v2010/api_default.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ package openapi
1616

1717
import (
1818
"context"
19-
"fmt"
20-
. "go-client/helper/rest/api/v2010"
21-
"go-client/terraform/client"
22-
"strings"
23-
2419
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
2520
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2621
. "github.com/twilio/terraform-provider-twilio/core"
22+
. "go-client/helper/rest/api/v2010"
23+
"go-client/terraform/client"
2724
)
2825

2926
func ResourceAccounts() *schema.Resource {

examples/go/go-client/terraform/resources/flex/v1/api_default.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ package openapi
1616

1717
import (
1818
"context"
19-
"fmt"
20-
. "go-client/helper/rest/flex/v1"
21-
"go-client/terraform/client"
22-
"strings"
23-
2419
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
2520
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2621
. "github.com/twilio/terraform-provider-twilio/core"
22+
. "go-client/helper/rest/flex/v1"
23+
"go-client/terraform/client"
2724
)
2825

2926
func ResourceCredentialsAWS() *schema.Resource {

src/main/resources/twilio-go/partial_serialization.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if params != nil && params.PathAccountSid != nil {
88
{{/vendorExtensions.x-is-account-sid}}
99
{{/queryParams}}
1010
{{#pathParams}}
11-
path = strings.Replace(path, "{"+"{{paramName}}"+"}", {{^isString}}fmt.Sprint({{/isString}}{{paramName}}{{^isString}}){{/isString}}, -1)
11+
path = strings.Replace(path, "{"+"{{baseName}}"+"}", {{^isString}}fmt.Sprint({{/isString}}{{paramName}}{{^isString}}){{/isString}}, -1)
1212
{{/pathParams}}
1313

1414
data := url.Values{}

0 commit comments

Comments
 (0)