diff --git a/examples/go/go-client/helper/rest/api/v2010/accounts.go b/examples/go/go-client/helper/rest/api/v2010/accounts.go index 5e0eac389..092f7c552 100644 --- a/examples/go/go-client/helper/rest/api/v2010/accounts.go +++ b/examples/go/go-client/helper/rest/api/v2010/accounts.go @@ -18,8 +18,6 @@ import ( "encoding/json" "fmt" "net/url" - "strings" - "time" "github.com/twilio/twilio-go/client" ) diff --git a/examples/go/go-client/helper/rest/api/v2010/accounts_calls.go b/examples/go/go-client/helper/rest/api/v2010/accounts_calls.go index c1adae789..c585f4043 100644 --- a/examples/go/go-client/helper/rest/api/v2010/accounts_calls.go +++ b/examples/go/go-client/helper/rest/api/v2010/accounts_calls.go @@ -18,7 +18,8 @@ import ( "encoding/json" "fmt" "net/url" - "strings" + + "github.com/twilio/twilio-go/client" ) // Optional parameters for the method 'CreateCall' diff --git a/examples/go/go-client/helper/rest/api/v2010/accounts_calls_feedback_summary.go b/examples/go/go-client/helper/rest/api/v2010/accounts_calls_feedback_summary.go index 89398a47f..0f6a8cb1c 100644 --- a/examples/go/go-client/helper/rest/api/v2010/accounts_calls_feedback_summary.go +++ b/examples/go/go-client/helper/rest/api/v2010/accounts_calls_feedback_summary.go @@ -18,7 +18,8 @@ import ( "encoding/json" "fmt" "net/url" - "strings" + + "github.com/twilio/twilio-go/client" ) // Optional parameters for the method 'UpdateCallFeedbackSummary' diff --git a/examples/go/go-client/helper/rest/api/v2010/model_list_account_response.go b/examples/go/go-client/helper/rest/api/v2010/model_list_account_response.go index 40053642d..14404a123 100644 --- a/examples/go/go-client/helper/rest/api/v2010/model_list_account_response.go +++ b/examples/go/go-client/helper/rest/api/v2010/model_list_account_response.go @@ -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"` diff --git a/examples/go/go-client/helper/rest/api/v2010/model_list_health_check.go b/examples/go/go-client/helper/rest/api/v2010/model_list_health_check.go index 17efcb3c8..a9f927205 100644 --- a/examples/go/go-client/helper/rest/api/v2010/model_list_health_check.go +++ b/examples/go/go-client/helper/rest/api/v2010/model_list_health_check.go @@ -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"` diff --git a/examples/go/go-client/helper/rest/api/v2010/model_test_response_object.go b/examples/go/go-client/helper/rest/api/v2010/model_test_response_object.go index ab294fc6c..cf8cd474b 100644 --- a/examples/go/go-client/helper/rest/api/v2010/model_test_response_object.go +++ b/examples/go/go-client/helper/rest/api/v2010/model_test_response_object.go @@ -16,7 +16,6 @@ package openapi import ( "encoding/json" - "github.com/twilio/twilio-go/client" ) diff --git a/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_array_of_objects.go b/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_array_of_objects.go index dd4cf95b1..39a59e17f 100644 --- a/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_array_of_objects.go +++ b/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_array_of_objects.go @@ -16,7 +16,6 @@ package openapi import ( "encoding/json" - "github.com/twilio/twilio-go/client" ) diff --git a/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_object.go b/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_object.go index d14eb45d9..f0c488e02 100644 --- a/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_object.go +++ b/examples/go/go-client/helper/rest/api/v2010/model_test_response_object_test_object.go @@ -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"` diff --git a/examples/go/go-client/helper/rest/flex/v1/credentials_aws.go b/examples/go/go-client/helper/rest/flex/v1/credentials_aws.go index 62cfd6df2..0f905300d 100644 --- a/examples/go/go-client/helper/rest/flex/v1/credentials_aws.go +++ b/examples/go/go-client/helper/rest/flex/v1/credentials_aws.go @@ -18,8 +18,6 @@ import ( "encoding/json" "fmt" "net/url" - "strings" - "time" "github.com/twilio/twilio-go/client" ) diff --git a/examples/go/go-client/helper/rest/flex/v1/credentials_aws_history.go b/examples/go/go-client/helper/rest/flex/v1/credentials_aws_history.go index 9540d4b21..45ada9c8f 100644 --- a/examples/go/go-client/helper/rest/flex/v1/credentials_aws_history.go +++ b/examples/go/go-client/helper/rest/flex/v1/credentials_aws_history.go @@ -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' diff --git a/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response.go b/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response.go index 940a75deb..9a07f02d3 100644 --- a/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response.go +++ b/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response.go @@ -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"` diff --git a/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response_meta.go b/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response_meta.go index 9c879a767..e959c6770 100644 --- a/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response_meta.go +++ b/examples/go/go-client/helper/rest/flex/v1/model_list_credential_aws_response_meta.go @@ -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"` diff --git a/examples/go/go-client/helper/rest/flex/v1/model_test_response_object.go b/examples/go/go-client/helper/rest/flex/v1/model_test_response_object.go index 413f14ab1..0c4729868 100644 --- a/examples/go/go-client/helper/rest/flex/v1/model_test_response_object.go +++ b/examples/go/go-client/helper/rest/flex/v1/model_test_response_object.go @@ -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"` diff --git a/examples/go/go-client/helper/rest/flex/v1/model_update_call_response.go b/examples/go/go-client/helper/rest/flex/v1/model_update_call_response.go index 293492b39..ab64b2b11 100644 --- a/examples/go/go-client/helper/rest/flex/v1/model_update_call_response.go +++ b/examples/go/go-client/helper/rest/flex/v1/model_update_call_response.go @@ -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. diff --git a/examples/go/go-client/helper/rest/flex/v1/voice.go b/examples/go/go-client/helper/rest/flex/v1/voice.go index 0e9a4646c..c5c21a959 100644 --- a/examples/go/go-client/helper/rest/flex/v1/voice.go +++ b/examples/go/go-client/helper/rest/flex/v1/voice.go @@ -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) { diff --git a/examples/go/go-client/terraform/resources/api/v2010/api_default.go b/examples/go/go-client/terraform/resources/api/v2010/api_default.go index 2072bce32..af7d801bb 100644 --- a/examples/go/go-client/terraform/resources/api/v2010/api_default.go +++ b/examples/go/go-client/terraform/resources/api/v2010/api_default.go @@ -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 { diff --git a/examples/go/go-client/terraform/resources/flex/v1/api_default.go b/examples/go/go-client/terraform/resources/flex/v1/api_default.go index 420852747..c3da0b8c7 100644 --- a/examples/go/go-client/terraform/resources/flex/v1/api_default.go +++ b/examples/go/go-client/terraform/resources/flex/v1/api_default.go @@ -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 { diff --git a/src/main/resources/twilio-go/partial_serialization.mustache b/src/main/resources/twilio-go/partial_serialization.mustache index d58573c3e..6faa08809 100644 --- a/src/main/resources/twilio-go/partial_serialization.mustache +++ b/src/main/resources/twilio-go/partial_serialization.mustache @@ -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{}