Skip to content

Commit

Permalink
chore: go fix for path params (#635)
Browse files Browse the repository at this point in the history
<!--
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.
  • Loading branch information
manisha1997 authored Feb 19, 2025
1 parent 079f7bd commit 1a49575
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 21 deletions.
2 changes: 0 additions & 2 deletions examples/go/go-client/helper/rest/api/v2010/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"encoding/json"
"fmt"
"net/url"
"strings"
"time"

"github.com/twilio/twilio-go/client"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
"encoding/json"
"fmt"
"net/url"
"strings"

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

// Optional parameters for the method 'CreateCall'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
"encoding/json"
"fmt"
"net/url"
"strings"

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

// Optional parameters for the method 'UpdateCallFeedbackSummary'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// ListAccountResponse struct for ListAccountResponse
type ListAccountResponse struct {
End int `json:"end,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// ListHealthCheck struct for ListHealthCheck
type ListHealthCheck struct {
Status []string `json:"status,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package openapi

import (
"encoding/json"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package openapi

import (
"encoding/json"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// TestResponseObjectTestObject struct for TestResponseObjectTestObject
type TestResponseObjectTestObject struct {
Fax bool `json:"fax,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions examples/go/go-client/helper/rest/flex/v1/credentials_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"encoding/json"
"fmt"
"net/url"
"strings"
"time"

"github.com/twilio/twilio-go/client"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ package openapi

import (
"encoding/json"
"fmt"
"net/url"
"strings"

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

// Optional parameters for the method 'FetchCredentialHistory'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// ListCredentialAwsResponse struct for ListCredentialAwsResponse
type ListCredentialAwsResponse struct {
Credentials []TestResponseObject `json:"credentials,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// ListCredentialAwsResponseMeta struct for ListCredentialAwsResponseMeta
type ListCredentialAwsResponseMeta struct {
FirstPageUrl string `json:"first_page_url,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// TestResponseObject struct for TestResponseObject
type TestResponseObject struct {
AccountSid *string `json:"account_sid,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

package openapi

import (
"encoding/json"
"github.com/twilio/twilio-go/client"
)

// UpdateCallResponse struct for UpdateCallResponse
type UpdateCallResponse struct {
// Non-string path parameter in the response.
Expand Down
4 changes: 3 additions & 1 deletion examples/go/go-client/helper/rest/flex/v1/voice.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ package openapi

import (
"encoding/json"
"fmt"
"net/url"
"strings"

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

func (c *ApiService) UpdateCall(Sid string) (*UpdateCallResponse, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ package openapi

import (
"context"
"fmt"
. "go-client/helper/rest/api/v2010"
"go-client/terraform/client"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
. "github.com/twilio/terraform-provider-twilio/core"
. "go-client/helper/rest/api/v2010"
"go-client/terraform/client"
)

func ResourceAccounts() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ package openapi

import (
"context"
"fmt"
. "go-client/helper/rest/flex/v1"
"go-client/terraform/client"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
. "github.com/twilio/terraform-provider-twilio/core"
. "go-client/helper/rest/flex/v1"
"go-client/terraform/client"
)

func ResourceCredentialsAWS() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if params != nil && params.PathAccountSid != nil {
{{/vendorExtensions.x-is-account-sid}}
{{/queryParams}}
{{#pathParams}}
path = strings.Replace(path, "{"+"{{paramName}}"+"}", {{^isString}}fmt.Sprint({{/isString}}{{paramName}}{{^isString}}){{/isString}}, -1)
path = strings.Replace(path, "{"+"{{baseName}}"+"}", {{^isString}}fmt.Sprint({{/isString}}{{paramName}}{{^isString}}){{/isString}}, -1)
{{/pathParams}}

data := url.Values{}
Expand Down

0 comments on commit 1a49575

Please sign in to comment.