diff --git a/client/base_client.go b/client/base_client.go index 974560dcd..bd0aefb74 100644 --- a/client/base_client.go +++ b/client/base_client.go @@ -10,5 +10,5 @@ type BaseClient interface { AccountSid() string SetTimeout(timeout time.Duration) SendRequest(method string, rawURL string, data url.Values, - headers map[string]interface{}) (*http.Response, error) + headers map[string]interface{}, queryParams url.Values) (*http.Response, error) } diff --git a/client/client.go b/client/client.go index b7b8f874a..79e553c76 100644 --- a/client/client.go +++ b/client/client.go @@ -2,95 +2,96 @@ package client import ( - "encoding/json" - "fmt" - "net/http" - "net/url" - "regexp" - "runtime" - "strconv" - "strings" - "time" - - "github.com/pkg/errors" - "github.com/twilio/twilio-go/client/form" + "encoding/json" + "fmt" + "net/http" + "net/url" + "regexp" + "runtime" + "strconv" + "strings" + "time" + + "github.com/pkg/errors" + "github.com/twilio/twilio-go/client/form" ) // Credentials store user authentication credentials. type Credentials struct { - Username string - Password string + Username string + Password string } func NewCredentials(username string, password string) *Credentials { - return &Credentials{Username: username, Password: password} + return &Credentials{Username: username, Password: password} } // Client encapsulates a standard HTTP backend with authorization. type Client struct { - *Credentials - HTTPClient *http.Client - accountSid string - UserAgentExtensions []string + *Credentials + HTTPClient *http.Client + accountSid string + UserAgentExtensions []string } // default http Client should not follow redirects and return the most recent response. func defaultHTTPClient() *http.Client { - return &http.Client{ - CheckRedirect: func(req *http.Request, via []*http.Request) error { - return http.ErrUseLastResponse - }, - Timeout: time.Second * 10, - } + return &http.Client{ + CheckRedirect: func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + }, + Timeout: time.Second * 10, + } } func (c *Client) basicAuth() (string, string) { - return c.Credentials.Username, c.Credentials.Password + return c.Credentials.Username, c.Credentials.Password } // SetTimeout sets the Timeout for HTTP requests. func (c *Client) SetTimeout(timeout time.Duration) { - if c.HTTPClient == nil { - c.HTTPClient = defaultHTTPClient() - } - c.HTTPClient.Timeout = timeout + if c.HTTPClient == nil { + c.HTTPClient = defaultHTTPClient() + } + c.HTTPClient.Timeout = timeout } const ( - keepZeros = true - delimiter = '.' - escapee = '\\' + keepZeros = true + delimiter = '.' + escapee = '\\' ) func (c *Client) doWithErr(req *http.Request) (*http.Response, error) { - client := c.HTTPClient - - if client == nil { - client = defaultHTTPClient() - } - - res, err := client.Do(req) - if err != nil { - return nil, err - } - - // Note that 3XX response codes are allowed for fetches - if res.StatusCode < 200 || res.StatusCode >= 400 { - err = &TwilioRestError{} - if decodeErr := json.NewDecoder(res.Body).Decode(err); decodeErr != nil { - err = errors.Wrap(decodeErr, "error decoding the response for an HTTP error code: "+strconv.Itoa(res.StatusCode)) - return nil, err - } - - return nil, err - } - return res, nil + client := c.HTTPClient + + if client == nil { + client = defaultHTTPClient() + } + + res, err := client.Do(req) + if err != nil { + return nil, err + } + + // Note that 3XX response codes are allowed for fetches + if res.StatusCode < 200 || res.StatusCode >= 400 { + err = &TwilioRestError{} + if decodeErr := json.NewDecoder(res.Body).Decode(err); decodeErr != nil { + err = errors.Wrap(decodeErr, "error decoding the response for an HTTP error code: "+strconv.Itoa(res.StatusCode)) + return nil, err + } + + return nil, err + } + return res, nil } // SendRequest verifies, constructs, and authorizes an HTTP request. func (c *Client) SendRequest(method string, rawURL string, data url.Values, - headers map[string]interface{}) (*http.Response, error) { - u, err := url.Parse(rawURL) + headers map[string]interface{}, queryParams ...url.Values) (*http.Response, error) { + + u, err := url.Parse(rawURL) if err != nil { return nil, err } @@ -98,15 +99,14 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values, valueReader := &strings.Reader{} goVersion := runtime.Version() - if method == http.MethodGet { - if data != nil { - v, _ := form.EncodeToStringWith(data, delimiter, escapee, keepZeros) - regex := regexp.MustCompile(`\.\d+`) - s := regex.ReplaceAllString(v, "") + if queryParams != nil { + v, _ := form.EncodeToStringWith(queryParams, delimiter, escapee, keepZeros) + regex := regexp.MustCompile(`\.\d+`) + s := regex.ReplaceAllString(v, "") - u.RawQuery = s - } - } + u.RawQuery = s + + } if method == http.MethodPost { valueReader = strings.NewReader(data.Encode()) @@ -135,16 +135,15 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values, for k, v := range headers { req.Header.Add(k, fmt.Sprint(v)) } - - return c.doWithErr(req) + return c.doWithErr(req) } // SetAccountSid sets the Client's accountSid field func (c *Client) SetAccountSid(sid string) { - c.accountSid = sid + c.accountSid = sid } // Returns the Account SID. func (c *Client) AccountSid() string { - return c.accountSid + return c.accountSid } diff --git a/client/request_handler.go b/client/request_handler.go index 89fe7883f..e3d8ceed8 100644 --- a/client/request_handler.go +++ b/client/request_handler.go @@ -23,13 +23,13 @@ func NewRequestHandler(client BaseClient) *RequestHandler { } func (c *RequestHandler) sendRequest(method string, rawURL string, data url.Values, - headers map[string]interface{}) (*http.Response, error) { + headers map[string]interface{}, queryParams url.Values) (*http.Response, error) { parsedURL, err := c.BuildUrl(rawURL) if err != nil { return nil, err } - return c.Client.SendRequest(method, parsedURL, data, headers) + return c.Client.SendRequest(method, parsedURL, data, headers, queryParams) } // BuildUrl builds the target host string taking into account region and edge configurations. @@ -83,14 +83,14 @@ func (c *RequestHandler) BuildUrl(rawURL string) (string, error) { return u.String(), nil } -func (c *RequestHandler) Post(path string, bodyData url.Values, headers map[string]interface{}) (*http.Response, error) { - return c.sendRequest(http.MethodPost, path, bodyData, headers) +func (c *RequestHandler) Post(path string, bodyData url.Values, headers map[string]interface{}, queryParams url.Values) (*http.Response, error) { + return c.sendRequest(http.MethodPost, path, bodyData, headers, queryParams) } -func (c *RequestHandler) Get(path string, queryData url.Values, headers map[string]interface{}) (*http.Response, error) { - return c.sendRequest(http.MethodGet, path, queryData, headers) +func (c *RequestHandler) Get(path string, queryData url.Values, headers map[string]interface{}, queryParams url.Values) (*http.Response, error) { + return c.sendRequest(http.MethodGet, path, queryData, headers, queryParams) } -func (c *RequestHandler) Delete(path string, nothing url.Values, headers map[string]interface{}) (*http.Response, error) { - return c.sendRequest(http.MethodDelete, path, nil, headers) +func (c *RequestHandler) Delete(path string, nothing url.Values, headers map[string]interface{}, queryParams url.Values) (*http.Response, error) { + return c.sendRequest(http.MethodDelete, path, nil, headers, queryParams) } diff --git a/rest/accounts/v1/auth_tokens_promote.go b/rest/accounts/v1/auth_tokens_promote.go index 1f1f50146..fecaf6b14 100644 --- a/rest/accounts/v1/auth_tokens_promote.go +++ b/rest/accounts/v1/auth_tokens_promote.go @@ -24,9 +24,10 @@ func (c *ApiService) UpdateAuthTokenPromotion() (*AccountsV1AuthTokenPromotion, path := "/v1/AuthTokens/Promote" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/accounts/v1/auth_tokens_secondary.go b/rest/accounts/v1/auth_tokens_secondary.go index a187a99d1..c1b7dae9d 100644 --- a/rest/accounts/v1/auth_tokens_secondary.go +++ b/rest/accounts/v1/auth_tokens_secondary.go @@ -24,9 +24,10 @@ func (c *ApiService) CreateSecondaryAuthToken() (*AccountsV1SecondaryAuthToken, path := "/v1/AuthTokens/Secondary" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -46,9 +47,10 @@ func (c *ApiService) DeleteSecondaryAuthToken() error { path := "/v1/AuthTokens/Secondary" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } diff --git a/rest/accounts/v1/credentials_aws.go b/rest/accounts/v1/credentials_aws.go index 3ec1b2945..3a38cebfd 100644 --- a/rest/accounts/v1/credentials_aws.go +++ b/rest/accounts/v1/credentials_aws.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac path := "/v1/Credentials/AWS" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Credentials != nil { @@ -63,7 +64,7 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac data.Set("AccountSid", *params.AccountSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -84,9 +85,10 @@ func (c *ApiService) DeleteCredentialAws(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -102,9 +104,10 @@ func (c *ApiService) FetchCredentialAws(Sid string) (*AccountsV1CredentialAws, e path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,10 +144,11 @@ func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToke path := "/v1/Credentials/AWS" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +158,7 @@ func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +245,7 @@ func (c *ApiService) getNextListCredentialAwsResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -272,13 +276,14 @@ func (c *ApiService) UpdateCredentialAws(Sid string, params *UpdateCredentialAws path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/accounts/v1/credentials_public_keys.go b/rest/accounts/v1/credentials_public_keys.go index 8e78888e7..773483f20 100644 --- a/rest/accounts/v1/credentials_public_keys.go +++ b/rest/accounts/v1/credentials_public_keys.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey path := "/v1/Credentials/PublicKeys" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PublicKey != nil { @@ -63,7 +64,7 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey data.Set("AccountSid", *params.AccountSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -84,9 +85,10 @@ func (c *ApiService) DeleteCredentialPublicKey(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -102,9 +104,10 @@ func (c *ApiService) FetchCredentialPublicKey(Sid string) (*AccountsV1Credential path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,10 +144,11 @@ func (c *ApiService) PageCredentialPublicKey(params *ListCredentialPublicKeyPara path := "/v1/Credentials/PublicKeys" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +158,7 @@ func (c *ApiService) PageCredentialPublicKey(params *ListCredentialPublicKeyPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +245,7 @@ func (c *ApiService) getNextListCredentialPublicKeyResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -272,13 +276,14 @@ func (c *ApiService) UpdateCredentialPublicKey(Sid string, params *UpdateCredent path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/accounts/v1/safe_list_numbers.go b/rest/accounts/v1/safe_list_numbers.go index a15dd6c53..8e212bce7 100644 --- a/rest/accounts/v1/safe_list_numbers.go +++ b/rest/accounts/v1/safe_list_numbers.go @@ -35,13 +35,14 @@ func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*AccountsV1Sa path := "/v1/SafeList/Numbers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { data.Set("PhoneNumber", *params.PhoneNumber) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -72,13 +73,14 @@ func (c *ApiService) DeleteSafelist(params *DeleteSafelistParams) error { path := "/v1/SafeList/Numbers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -104,13 +106,14 @@ func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*AccountsV1Safe path := "/v1/SafeList/Numbers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/README.md b/rest/api/v2010/README.md index 11418aeb1..147254bfc 100644 --- a/rest/api/v2010/README.md +++ b/rest/api/v2010/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) @@ -368,7 +368,6 @@ Class | Method | HTTP request | Description - [ListRecordingAddOnResultResponse](docs/ListRecordingAddOnResultResponse.md) - [ListIncomingPhoneNumberAssignedAddOnExtensionResponse](docs/ListIncomingPhoneNumberAssignedAddOnExtensionResponse.md) - [ListSipAuthCallsIpAccessControlListMappingResponse](docs/ListSipAuthCallsIpAccessControlListMappingResponse.md) - - [FetchHealthCheck200Response](docs/FetchHealthCheck200Response.md) - [ApiV2010AuthorizedConnectApp](docs/ApiV2010AuthorizedConnectApp.md) - [ListUsageRecordAllTimeResponse](docs/ListUsageRecordAllTimeResponse.md) - [ListSipDomainResponse](docs/ListSipDomainResponse.md) diff --git a/rest/api/v2010/accounts.go b/rest/api/v2010/accounts.go index 9d72732d9..028065ccb 100644 --- a/rest/api/v2010/accounts.go +++ b/rest/api/v2010/accounts.go @@ -39,13 +39,14 @@ func (c *ApiService) CreateAccount(params *CreateAccountParams) (*ApiV2010Accoun path := "/2010-04-01/Accounts.json" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -66,9 +67,10 @@ func (c *ApiService) FetchAccount(Sid string) (*ApiV2010Account, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -117,16 +119,17 @@ func (c *ApiService) PageAccount(params *ListAccountParams, pageToken, pageNumbe path := "/2010-04-01/Accounts.json" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +139,7 @@ func (c *ApiService) PageAccount(params *ListAccountParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +226,7 @@ func (c *ApiService) getNextListAccountResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -260,6 +263,7 @@ func (c *ApiService) UpdateAccount(Sid string, params *UpdateAccountParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -269,7 +273,7 @@ func (c *ApiService) UpdateAccount(Sid string, params *UpdateAccountParams) (*Ap data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_addresses.go b/rest/api/v2010/accounts_addresses.go index 053910881..234c272bc 100644 --- a/rest/api/v2010/accounts_addresses.go +++ b/rest/api/v2010/accounts_addresses.go @@ -94,7 +94,6 @@ func (params *CreateAddressParams) SetStreetSecondary(StreetSecondary string) *C return params } -// func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Address, error) { path := "/2010-04-01/Accounts/{AccountSid}/Addresses.json" if params != nil && params.PathAccountSid != nil { @@ -104,6 +103,7 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Addres } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CustomerName != nil { @@ -137,7 +137,7 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Addres data.Set("StreetSecondary", *params.StreetSecondary) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -163,7 +163,6 @@ func (params *DeleteAddressParams) SetPathAccountSid(PathAccountSid string) *Del return params } -// func (c *ApiService) DeleteAddress(Sid string, params *DeleteAddressParams) error { path := "/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -174,9 +173,10 @@ func (c *ApiService) DeleteAddress(Sid string, params *DeleteAddressParams) erro path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -197,7 +197,6 @@ func (params *FetchAddressParams) SetPathAccountSid(PathAccountSid string) *Fetc return params } -// func (c *ApiService) FetchAddress(Sid string, params *FetchAddressParams) (*ApiV2010Address, error) { path := "/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -208,9 +207,10 @@ func (c *ApiService) FetchAddress(Sid string, params *FetchAddressParams) (*ApiV path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,19 +277,20 @@ func (c *ApiService) PageAddress(params *ListAddressParams, pageToken, pageNumbe } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CustomerName != nil { - data.Set("CustomerName", *params.CustomerName) + queryParams.Set("CustomerName", *params.CustomerName) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) + queryParams.Set("IsoCountry", *params.IsoCountry) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -299,7 +300,7 @@ func (c *ApiService) PageAddress(params *ListAddressParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -386,7 +387,7 @@ func (c *ApiService) getNextListAddressResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -465,7 +466,6 @@ func (params *UpdateAddressParams) SetStreetSecondary(StreetSecondary string) *U return params } -// func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*ApiV2010Address, error) { path := "/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -476,6 +476,7 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -506,7 +507,7 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap data.Set("StreetSecondary", *params.StreetSecondary) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go index f1cf03f13..9e4c1944e 100644 --- a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go +++ b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go @@ -58,10 +58,11 @@ func (c *ApiService) PageDependentPhoneNumber(AddressSid string, params *ListDep path = strings.Replace(path, "{"+"AddressSid"+"}", AddressSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -71,7 +72,7 @@ func (c *ApiService) PageDependentPhoneNumber(AddressSid string, params *ListDep data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -158,7 +159,7 @@ func (c *ApiService) getNextListDependentPhoneNumberResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_applications.go b/rest/api/v2010/accounts_applications.go index 1a2d7f678..1d72583fe 100644 --- a/rest/api/v2010/accounts_applications.go +++ b/rest/api/v2010/accounts_applications.go @@ -140,6 +140,7 @@ func (c *ApiService) CreateApplication(params *CreateApplicationParams) (*ApiV20 } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ApiVersion != nil { @@ -191,7 +192,7 @@ func (c *ApiService) CreateApplication(params *CreateApplicationParams) (*ApiV20 data.Set("PublicApplicationConnectEnabled", fmt.Sprint(*params.PublicApplicationConnectEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,9 +229,10 @@ func (c *ApiService) DeleteApplication(Sid string, params *DeleteApplicationPara path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -262,9 +264,10 @@ func (c *ApiService) FetchApplication(Sid string, params *FetchApplicationParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -319,13 +322,14 @@ func (c *ApiService) PageApplication(params *ListApplicationParams, pageToken, p } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -335,7 +339,7 @@ func (c *ApiService) PageApplication(params *ListApplicationParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -422,7 +426,7 @@ func (c *ApiService) getNextListApplicationResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -554,6 +558,7 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -605,7 +610,7 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara data.Set("PublicApplicationConnectEnabled", fmt.Sprint(*params.PublicApplicationConnectEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_authorized_connect_apps.go b/rest/api/v2010/accounts_authorized_connect_apps.go index c6c0b4e0b..f1c32b4d7 100644 --- a/rest/api/v2010/accounts_authorized_connect_apps.go +++ b/rest/api/v2010/accounts_authorized_connect_apps.go @@ -45,9 +45,10 @@ func (c *ApiService) FetchAuthorizedConnectApp(ConnectAppSid string, params *Fet path = strings.Replace(path, "{"+"ConnectAppSid"+"}", ConnectAppSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -96,10 +97,11 @@ func (c *ApiService) PageAuthorizedConnectApp(params *ListAuthorizedConnectAppPa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -109,7 +111,7 @@ func (c *ApiService) PageAuthorizedConnectApp(params *ListAuthorizedConnectAppPa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -196,7 +198,7 @@ func (c *ApiService) getNextListAuthorizedConnectAppResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers.go b/rest/api/v2010/accounts_available_phone_numbers.go index 5cc813f87..15abadf0b 100644 --- a/rest/api/v2010/accounts_available_phone_numbers.go +++ b/rest/api/v2010/accounts_available_phone_numbers.go @@ -34,7 +34,6 @@ func (params *FetchAvailablePhoneNumberCountryParams) SetPathAccountSid(PathAcco return params } -// func (c *ApiService) FetchAvailablePhoneNumberCountry(CountryCode string, params *FetchAvailablePhoneNumberCountryParams) (*ApiV2010AvailablePhoneNumberCountry, error) { path := "/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}.json" if params != nil && params.PathAccountSid != nil { @@ -45,9 +44,10 @@ func (c *ApiService) FetchAvailablePhoneNumberCountry(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -96,10 +96,11 @@ func (c *ApiService) PageAvailablePhoneNumberCountry(params *ListAvailablePhoneN } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -109,7 +110,7 @@ func (c *ApiService) PageAvailablePhoneNumberCountry(params *ListAvailablePhoneN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -196,7 +197,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberCountryResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_local.go b/rest/api/v2010/accounts_available_phone_numbers_local.go index 9d7ffaecf..c7f742fe1 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_local.go +++ b/rest/api/v2010/accounts_available_phone_numbers_local.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberLocal(CountryCode string, params *L path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberLocal(CountryCode string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberLocalResponse(nextPageUrl st if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go b/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go index 30f22af46..0c9363fd7 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go +++ b/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberMachineToMachine(CountryCode string path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberMachineToMachine(CountryCode string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberMachineToMachineResponse(nex if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_mobile.go b/rest/api/v2010/accounts_available_phone_numbers_mobile.go index df649b4d0..a19608705 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_available_phone_numbers_mobile.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberMobile(CountryCode string, params * path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberMobile(CountryCode string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberMobileResponse(nextPageUrl s if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_national.go b/rest/api/v2010/accounts_available_phone_numbers_national.go index 46f936ea2..40c7e5bf4 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_national.go +++ b/rest/api/v2010/accounts_available_phone_numbers_national.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberNational(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberNational(CountryCode string, params data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberNationalResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go b/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go index 9c6abff87..12d654ab6 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go +++ b/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberSharedCost(CountryCode string, para path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberSharedCost(CountryCode string, para data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberSharedCostResponse(nextPageU if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_toll_free.go b/rest/api/v2010/accounts_available_phone_numbers_toll_free.go index 7d4be3c1f..781b00130 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_available_phone_numbers_toll_free.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberTollFree(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberTollFree(CountryCode string, params data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberTollFreeResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_available_phone_numbers_voip.go b/rest/api/v2010/accounts_available_phone_numbers_voip.go index a2534d8e5..b2c8b3dd7 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_voip.go +++ b/rest/api/v2010/accounts_available_phone_numbers_voip.go @@ -166,64 +166,65 @@ func (c *ApiService) PageAvailablePhoneNumberVoip(CountryCode string, params *Li path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + queryParams.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) + queryParams.Set("Contains", *params.Contains) } if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + queryParams.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) } if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + queryParams.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) } if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + queryParams.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + queryParams.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) } if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + queryParams.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) } if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + queryParams.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) } if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) + queryParams.Set("NearNumber", *params.NearNumber) } if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) + queryParams.Set("NearLatLong", *params.NearLatLong) } if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) + queryParams.Set("Distance", fmt.Sprint(*params.Distance)) } if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) + queryParams.Set("InPostalCode", *params.InPostalCode) } if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) + queryParams.Set("InRegion", *params.InRegion) } if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) + queryParams.Set("InRateCenter", *params.InRateCenter) } if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) + queryParams.Set("InLata", *params.InLata) } if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) + queryParams.Set("InLocality", *params.InLocality) } if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + queryParams.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -233,7 +234,7 @@ func (c *ApiService) PageAvailablePhoneNumberVoip(CountryCode string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -320,7 +321,7 @@ func (c *ApiService) getNextListAvailablePhoneNumberVoipResponse(nextPageUrl str if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_balance.go b/rest/api/v2010/accounts_balance.go index 043ab1aad..61258d5cf 100644 --- a/rest/api/v2010/accounts_balance.go +++ b/rest/api/v2010/accounts_balance.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchBalance(params *FetchBalanceParams) (*ApiV2010Balance, } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls.go b/rest/api/v2010/accounts_calls.go index cb5b0cf61..bc6a114fc 100644 --- a/rest/api/v2010/accounts_calls.go +++ b/rest/api/v2010/accounts_calls.go @@ -255,6 +255,7 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010Call, error) } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { @@ -367,7 +368,7 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010Call, error) data.Set("ApplicationSid", *params.ApplicationSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -404,9 +405,10 @@ func (c *ApiService) DeleteCall(Sid string, params *DeleteCallParams) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -438,9 +440,10 @@ func (c *ApiService) FetchCall(Sid string, params *FetchCallParams) (*ApiV2010Ca path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -549,40 +552,41 @@ func (c *ApiService) PageCall(params *ListCallParams, pageToken, pageNumber stri } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { - data.Set("To", *params.To) + queryParams.Set("To", *params.To) } if params != nil && params.From != nil { - data.Set("From", *params.From) + queryParams.Set("From", *params.From) } if params != nil && params.ParentCallSid != nil { - data.Set("ParentCallSid", *params.ParentCallSid) + queryParams.Set("ParentCallSid", *params.ParentCallSid) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.StartTime != nil { - data.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) + queryParams.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) } if params != nil && params.StartTimeBefore != nil { - data.Set("StartTime<", fmt.Sprint((*params.StartTimeBefore).Format(time.RFC3339))) + queryParams.Set("StartTime<", fmt.Sprint((*params.StartTimeBefore).Format(time.RFC3339))) } if params != nil && params.StartTimeAfter != nil { - data.Set("StartTime>", fmt.Sprint((*params.StartTimeAfter).Format(time.RFC3339))) + queryParams.Set("StartTime>", fmt.Sprint((*params.StartTimeAfter).Format(time.RFC3339))) } if params != nil && params.EndTime != nil { - data.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) + queryParams.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) } if params != nil && params.EndTimeBefore != nil { - data.Set("EndTime<", fmt.Sprint((*params.EndTimeBefore).Format(time.RFC3339))) + queryParams.Set("EndTime<", fmt.Sprint((*params.EndTimeBefore).Format(time.RFC3339))) } if params != nil && params.EndTimeAfter != nil { - data.Set("EndTime>", fmt.Sprint((*params.EndTimeAfter).Format(time.RFC3339))) + queryParams.Set("EndTime>", fmt.Sprint((*params.EndTimeAfter).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -592,7 +596,7 @@ func (c *ApiService) PageCall(params *ListCallParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -679,7 +683,7 @@ func (c *ApiService) getNextListCallResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -769,6 +773,7 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Url != nil { @@ -799,7 +804,7 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_events.go b/rest/api/v2010/accounts_calls_events.go index 07ce9789a..0fada76c8 100644 --- a/rest/api/v2010/accounts_calls_events.go +++ b/rest/api/v2010/accounts_calls_events.go @@ -58,10 +58,11 @@ func (c *ApiService) PageCallEvent(CallSid string, params *ListCallEventParams, path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -71,7 +72,7 @@ func (c *ApiService) PageCallEvent(CallSid string, params *ListCallEventParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -158,7 +159,7 @@ func (c *ApiService) getNextListCallEventResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_feedback.go b/rest/api/v2010/accounts_calls_feedback.go index 93e2b9a43..3356cfc83 100644 --- a/rest/api/v2010/accounts_calls_feedback.go +++ b/rest/api/v2010/accounts_calls_feedback.go @@ -43,9 +43,10 @@ func (c *ApiService) FetchCallFeedback(CallSid string, params *FetchCallFeedback path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -94,6 +95,7 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.QualityScore != nil { @@ -105,7 +107,7 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_feedback_summary.go b/rest/api/v2010/accounts_calls_feedback_summary.go index 0cdef1d54..3584edd62 100644 --- a/rest/api/v2010/accounts_calls_feedback_summary.go +++ b/rest/api/v2010/accounts_calls_feedback_summary.go @@ -72,6 +72,7 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.StartDate != nil { @@ -90,7 +91,7 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -127,9 +128,10 @@ func (c *ApiService) DeleteCallFeedbackSummary(Sid string, params *DeleteCallFee path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -161,9 +163,10 @@ func (c *ApiService) FetchCallFeedbackSummary(Sid string, params *FetchCallFeedb path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_notifications.go b/rest/api/v2010/accounts_calls_notifications.go index 4004ae82b..6048b35c7 100644 --- a/rest/api/v2010/accounts_calls_notifications.go +++ b/rest/api/v2010/accounts_calls_notifications.go @@ -34,7 +34,6 @@ func (params *FetchCallNotificationParams) SetPathAccountSid(PathAccountSid stri return params } -// func (c *ApiService) FetchCallNotification(CallSid string, Sid string, params *FetchCallNotificationParams) (*ApiV2010CallNotificationInstance, error) { path := "/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Notifications/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -46,9 +45,10 @@ func (c *ApiService) FetchCallNotification(CallSid string, Sid string, params *F path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -122,22 +122,23 @@ func (c *ApiService) PageCallNotification(CallSid string, params *ListCallNotifi path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Log != nil { - data.Set("Log", fmt.Sprint(*params.Log)) + queryParams.Set("Log", fmt.Sprint(*params.Log)) } if params != nil && params.MessageDate != nil { - data.Set("MessageDate", fmt.Sprint(*params.MessageDate)) + queryParams.Set("MessageDate", fmt.Sprint(*params.MessageDate)) } if params != nil && params.MessageDateBefore != nil { - data.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) + queryParams.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) } if params != nil && params.MessageDateAfter != nil { - data.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) + queryParams.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -147,7 +148,7 @@ func (c *ApiService) PageCallNotification(CallSid string, params *ListCallNotifi data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -234,7 +235,7 @@ func (c *ApiService) getNextListCallNotificationResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_payments.go b/rest/api/v2010/accounts_calls_payments.go index 82e68055c..8c41d66be 100644 --- a/rest/api/v2010/accounts_calls_payments.go +++ b/rest/api/v2010/accounts_calls_payments.go @@ -139,6 +139,7 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IdempotencyKey != nil { @@ -196,7 +197,7 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams data.Set("ValidCardTypes", *params.ValidCardTypes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -258,6 +259,7 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IdempotencyKey != nil { @@ -273,7 +275,7 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_recordings.go b/rest/api/v2010/accounts_calls_recordings.go index 955ded6e5..0a470c02a 100644 --- a/rest/api/v2010/accounts_calls_recordings.go +++ b/rest/api/v2010/accounts_calls_recordings.go @@ -81,6 +81,7 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RecordingStatusCallbackEvent != nil { @@ -104,7 +105,7 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor data.Set("RecordingTrack", *params.RecordingTrack) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -142,9 +143,10 @@ func (c *ApiService) DeleteCallRecording(CallSid string, Sid string, params *Del path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -177,9 +179,10 @@ func (c *ApiService) FetchCallRecording(CallSid string, Sid string, params *Fetc path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -247,19 +250,20 @@ func (c *ApiService) PageCallRecording(CallSid string, params *ListCallRecording path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) + queryParams.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) + queryParams.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) + queryParams.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -269,7 +273,7 @@ func (c *ApiService) PageCallRecording(CallSid string, params *ListCallRecording data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -356,7 +360,7 @@ func (c *ApiService) getNextListCallRecordingResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -405,6 +409,7 @@ func (c *ApiService) UpdateCallRecording(CallSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -414,7 +419,7 @@ func (c *ApiService) UpdateCallRecording(CallSid string, Sid string, params *Upd data.Set("PauseBehavior", *params.PauseBehavior) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_siprec.go b/rest/api/v2010/accounts_calls_siprec.go index b793c9934..d6d8b6124 100644 --- a/rest/api/v2010/accounts_calls_siprec.go +++ b/rest/api/v2010/accounts_calls_siprec.go @@ -1260,6 +1260,7 @@ func (c *ApiService) CreateSiprec(CallSid string, params *CreateSiprecParams) (* path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Name != nil { @@ -1872,7 +1873,7 @@ func (c *ApiService) CreateSiprec(CallSid string, params *CreateSiprecParams) (* data.Set("Parameter99.Value", *params.Parameter99Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -1916,13 +1917,14 @@ func (c *ApiService) UpdateSiprec(CallSid string, Sid string, params *UpdateSipr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_streams.go b/rest/api/v2010/accounts_calls_streams.go index 4e85fe8bc..77fba635f 100644 --- a/rest/api/v2010/accounts_calls_streams.go +++ b/rest/api/v2010/accounts_calls_streams.go @@ -1260,6 +1260,7 @@ func (c *ApiService) CreateStream(CallSid string, params *CreateStreamParams) (* path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Url != nil { @@ -1872,7 +1873,7 @@ func (c *ApiService) CreateStream(CallSid string, params *CreateStreamParams) (* data.Set("Parameter99.Value", *params.Parameter99Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -1916,13 +1917,14 @@ func (c *ApiService) UpdateStream(CallSid string, Sid string, params *UpdateStre path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go b/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go index b31d910d4..9557fea3a 100644 --- a/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go +++ b/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go @@ -60,6 +60,7 @@ func (c *ApiService) CreateUserDefinedMessageSubscription(CallSid string, params path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Callback != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateUserDefinedMessageSubscription(CallSid string, params data.Set("Method", *params.Method) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -110,9 +111,10 @@ func (c *ApiService) DeleteUserDefinedMessageSubscription(CallSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } diff --git a/rest/api/v2010/accounts_calls_user_defined_messages.go b/rest/api/v2010/accounts_calls_user_defined_messages.go index b17e6428e..d6d7375f1 100644 --- a/rest/api/v2010/accounts_calls_user_defined_messages.go +++ b/rest/api/v2010/accounts_calls_user_defined_messages.go @@ -54,6 +54,7 @@ func (c *ApiService) CreateUserDefinedMessage(CallSid string, params *CreateUser path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Content != nil { @@ -63,7 +64,7 @@ func (c *ApiService) CreateUserDefinedMessage(CallSid string, params *CreateUser data.Set("IdempotencyKey", *params.IdempotencyKey) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_conferences.go b/rest/api/v2010/accounts_conferences.go index 2897051e7..7414b6a3a 100644 --- a/rest/api/v2010/accounts_conferences.go +++ b/rest/api/v2010/accounts_conferences.go @@ -45,9 +45,10 @@ func (c *ApiService) FetchConference(Sid string, params *FetchConferenceParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -144,34 +145,35 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken, pag } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) + queryParams.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) + queryParams.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) + queryParams.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) } if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint(*params.DateUpdated)) + queryParams.Set("DateUpdated", fmt.Sprint(*params.DateUpdated)) } if params != nil && params.DateUpdatedBefore != nil { - data.Set("DateUpdated<", fmt.Sprint(*params.DateUpdatedBefore)) + queryParams.Set("DateUpdated<", fmt.Sprint(*params.DateUpdatedBefore)) } if params != nil && params.DateUpdatedAfter != nil { - data.Set("DateUpdated>", fmt.Sprint(*params.DateUpdatedAfter)) + queryParams.Set("DateUpdated>", fmt.Sprint(*params.DateUpdatedAfter)) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -181,7 +183,7 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -268,7 +270,7 @@ func (c *ApiService) getNextListConferenceResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -311,7 +313,6 @@ func (params *UpdateConferenceParams) SetAnnounceMethod(AnnounceMethod string) * return params } -// func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams) (*ApiV2010Conference, error) { path := "/2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -322,6 +323,7 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -334,7 +336,7 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams data.Set("AnnounceMethod", *params.AnnounceMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_conferences_participants.go b/rest/api/v2010/accounts_conferences_participants.go index 32ba1ec10..364581ec5 100644 --- a/rest/api/v2010/accounts_conferences_participants.go +++ b/rest/api/v2010/accounts_conferences_participants.go @@ -322,7 +322,6 @@ func (params *CreateParticipantParams) SetCallToken(CallToken string) *CreatePar return params } -// func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParticipantParams) (*ApiV2010Participant, error) { path := "/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants.json" if params != nil && params.PathAccountSid != nil { @@ -333,6 +332,7 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.From != nil { @@ -488,7 +488,7 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti data.Set("CallToken", *params.CallToken) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -526,9 +526,10 @@ func (c *ApiService) DeleteParticipant(ConferenceSid string, CallSid string, par path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -561,9 +562,10 @@ func (c *ApiService) FetchParticipant(ConferenceSid string, CallSid string, para path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -631,19 +633,20 @@ func (c *ApiService) PageParticipant(ConferenceSid string, params *ListParticipa path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Muted != nil { - data.Set("Muted", fmt.Sprint(*params.Muted)) + queryParams.Set("Muted", fmt.Sprint(*params.Muted)) } if params != nil && params.Hold != nil { - data.Set("Hold", fmt.Sprint(*params.Hold)) + queryParams.Set("Hold", fmt.Sprint(*params.Hold)) } if params != nil && params.Coaching != nil { - data.Set("Coaching", fmt.Sprint(*params.Coaching)) + queryParams.Set("Coaching", fmt.Sprint(*params.Coaching)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -653,7 +656,7 @@ func (c *ApiService) PageParticipant(ConferenceSid string, params *ListParticipa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -740,7 +743,7 @@ func (c *ApiService) getNextListParticipantResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -849,6 +852,7 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Muted != nil { @@ -888,7 +892,7 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par data.Set("CallSidToCoach", *params.CallSidToCoach) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_conferences_recordings.go b/rest/api/v2010/accounts_conferences_recordings.go index 4d0783ea1..cc5d9b1c2 100644 --- a/rest/api/v2010/accounts_conferences_recordings.go +++ b/rest/api/v2010/accounts_conferences_recordings.go @@ -46,9 +46,10 @@ func (c *ApiService) DeleteConferenceRecording(ConferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -81,9 +82,10 @@ func (c *ApiService) FetchConferenceRecording(ConferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -151,19 +153,20 @@ func (c *ApiService) PageConferenceRecording(ConferenceSid string, params *ListC path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) + queryParams.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) + queryParams.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) + queryParams.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -173,7 +176,7 @@ func (c *ApiService) PageConferenceRecording(ConferenceSid string, params *ListC data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -260,7 +263,7 @@ func (c *ApiService) getNextListConferenceRecordingResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -309,6 +312,7 @@ func (c *ApiService) UpdateConferenceRecording(ConferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -318,7 +322,7 @@ func (c *ApiService) UpdateConferenceRecording(ConferenceSid string, Sid string, data.Set("PauseBehavior", *params.PauseBehavior) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_connect_apps.go b/rest/api/v2010/accounts_connect_apps.go index f37ece34c..969146dd5 100644 --- a/rest/api/v2010/accounts_connect_apps.go +++ b/rest/api/v2010/accounts_connect_apps.go @@ -45,9 +45,10 @@ func (c *ApiService) DeleteConnectApp(Sid string, params *DeleteConnectAppParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -79,9 +80,10 @@ func (c *ApiService) FetchConnectApp(Sid string, params *FetchConnectAppParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -130,10 +132,11 @@ func (c *ApiService) PageConnectApp(params *ListConnectAppParams, pageToken, pag } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -143,7 +146,7 @@ func (c *ApiService) PageConnectApp(params *ListConnectAppParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -230,7 +233,7 @@ func (c *ApiService) getNextListConnectAppResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -314,6 +317,7 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AuthorizeRedirectUrl != nil { @@ -343,7 +347,7 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_incoming_phone_numbers.go b/rest/api/v2010/accounts_incoming_phone_numbers.go index a97f6e225..d992a97e8 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers.go @@ -188,6 +188,7 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ApiVersion != nil { @@ -263,7 +264,7 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber data.Set("AreaCode", *params.AreaCode) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -300,9 +301,10 @@ func (c *ApiService) DeleteIncomingPhoneNumber(Sid string, params *DeleteIncomin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -334,9 +336,10 @@ func (c *ApiService) FetchIncomingPhoneNumber(Sid string, params *FetchIncomingP path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -409,22 +412,23 @@ func (c *ApiService) PageIncomingPhoneNumber(params *ListIncomingPhoneNumberPara } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) + queryParams.Set("Origin", *params.Origin) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -434,7 +438,7 @@ func (c *ApiService) PageIncomingPhoneNumber(params *ListIncomingPhoneNumberPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -521,7 +525,7 @@ func (c *ApiService) getNextListIncomingPhoneNumberResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -695,6 +699,7 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AccountSid != nil { @@ -767,7 +772,7 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin data.Set("BundleSid", *params.BundleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go index c6ccd00d5..b71382215 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go @@ -51,13 +51,14 @@ func (c *ApiService) CreateIncomingPhoneNumberAssignedAddOn(ResourceSid string, path = strings.Replace(path, "{"+"ResourceSid"+"}", ResourceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.InstalledAddOnSid != nil { data.Set("InstalledAddOnSid", *params.InstalledAddOnSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -95,9 +96,10 @@ func (c *ApiService) DeleteIncomingPhoneNumberAssignedAddOn(ResourceSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -130,9 +132,10 @@ func (c *ApiService) FetchIncomingPhoneNumberAssignedAddOn(ResourceSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOn(ResourceSid string, pa path = strings.Replace(path, "{"+"ResourceSid"+"}", ResourceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOn(ResourceSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListIncomingPhoneNumberAssignedAddOnResponse(nextPag if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go index 981b2137a..b0c7ecd54 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go @@ -47,9 +47,10 @@ func (c *ApiService) FetchIncomingPhoneNumberAssignedAddOnExtension(ResourceSid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -100,10 +101,11 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOnExtension(ResourceSid s path = strings.Replace(path, "{"+"AssignedAddOnSid"+"}", AssignedAddOnSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -113,7 +115,7 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOnExtension(ResourceSid s data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -200,7 +202,7 @@ func (c *ApiService) getNextListIncomingPhoneNumberAssignedAddOnExtensionRespons if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_local.go b/rest/api/v2010/accounts_incoming_phone_numbers_local.go index e40f5ff44..663cb040a 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_local.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_local.go @@ -172,7 +172,6 @@ func (params *CreateIncomingPhoneNumberLocalParams) SetBundleSid(BundleSid strin return params } -// func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneNumberLocalParams) (*ApiV2010IncomingPhoneNumberLocal, error) { path := "/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Local.json" if params != nil && params.PathAccountSid != nil { @@ -182,6 +181,7 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { @@ -254,7 +254,7 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN data.Set("BundleSid", *params.BundleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -327,22 +327,23 @@ func (c *ApiService) PageIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) + queryParams.Set("Origin", *params.Origin) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -352,7 +353,7 @@ func (c *ApiService) PageIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -439,7 +440,7 @@ func (c *ApiService) getNextListIncomingPhoneNumberLocalResponse(nextPageUrl str if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go index feaef417a..ded9b746f 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go @@ -172,7 +172,6 @@ func (params *CreateIncomingPhoneNumberMobileParams) SetBundleSid(BundleSid stri return params } -// func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhoneNumberMobileParams) (*ApiV2010IncomingPhoneNumberMobile, error) { path := "/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Mobile.json" if params != nil && params.PathAccountSid != nil { @@ -182,6 +181,7 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { @@ -254,7 +254,7 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone data.Set("BundleSid", *params.BundleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -327,22 +327,23 @@ func (c *ApiService) PageIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) + queryParams.Set("Origin", *params.Origin) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -352,7 +353,7 @@ func (c *ApiService) PageIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -439,7 +440,7 @@ func (c *ApiService) getNextListIncomingPhoneNumberMobileResponse(nextPageUrl st if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go b/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go index f178aed9e..0bc1c8000 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go @@ -172,7 +172,6 @@ func (params *CreateIncomingPhoneNumberTollFreeParams) SetBundleSid(BundleSid st return params } -// func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPhoneNumberTollFreeParams) (*ApiV2010IncomingPhoneNumberTollFree, error) { path := "/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/TollFree.json" if params != nil && params.PathAccountSid != nil { @@ -182,6 +181,7 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { @@ -254,7 +254,7 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho data.Set("BundleSid", *params.BundleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -327,22 +327,23 @@ func (c *ApiService) PageIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) + queryParams.Set("Beta", fmt.Sprint(*params.Beta)) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) + queryParams.Set("Origin", *params.Origin) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -352,7 +353,7 @@ func (c *ApiService) PageIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -439,7 +440,7 @@ func (c *ApiService) getNextListIncomingPhoneNumberTollFreeResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_keys.go b/rest/api/v2010/accounts_keys.go index 47e4335d5..44215e101 100644 --- a/rest/api/v2010/accounts_keys.go +++ b/rest/api/v2010/accounts_keys.go @@ -40,7 +40,6 @@ func (params *CreateNewKeyParams) SetFriendlyName(FriendlyName string) *CreateNe return params } -// func (c *ApiService) CreateNewKey(params *CreateNewKeyParams) (*ApiV2010NewKey, error) { path := "/2010-04-01/Accounts/{AccountSid}/Keys.json" if params != nil && params.PathAccountSid != nil { @@ -50,13 +49,14 @@ func (c *ApiService) CreateNewKey(params *CreateNewKeyParams) (*ApiV2010NewKey, } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -82,7 +82,6 @@ func (params *DeleteKeyParams) SetPathAccountSid(PathAccountSid string) *DeleteK return params } -// func (c *ApiService) DeleteKey(Sid string, params *DeleteKeyParams) error { path := "/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -93,9 +92,10 @@ func (c *ApiService) DeleteKey(Sid string, params *DeleteKeyParams) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,7 +116,6 @@ func (params *FetchKeyParams) SetPathAccountSid(PathAccountSid string) *FetchKey return params } -// func (c *ApiService) FetchKey(Sid string, params *FetchKeyParams) (*ApiV2010Key, error) { path := "/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -127,9 +126,10 @@ func (c *ApiService) FetchKey(Sid string, params *FetchKeyParams) (*ApiV2010Key, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -178,10 +178,11 @@ func (c *ApiService) PageKey(params *ListKeyParams, pageToken, pageNumber string } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -191,7 +192,7 @@ func (c *ApiService) PageKey(params *ListKeyParams, pageToken, pageNumber string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -278,7 +279,7 @@ func (c *ApiService) getNextListKeyResponse(nextPageUrl string) (interface{}, er if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -309,7 +310,6 @@ func (params *UpdateKeyParams) SetFriendlyName(FriendlyName string) *UpdateKeyPa return params } -// func (c *ApiService) UpdateKey(Sid string, params *UpdateKeyParams) (*ApiV2010Key, error) { path := "/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -320,13 +320,14 @@ func (c *ApiService) UpdateKey(Sid string, params *UpdateKeyParams) (*ApiV2010Ke path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_messages.go b/rest/api/v2010/accounts_messages.go index f9845a5af..4e275556e 100644 --- a/rest/api/v2010/accounts_messages.go +++ b/rest/api/v2010/accounts_messages.go @@ -183,6 +183,7 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Messag } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { @@ -259,7 +260,7 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Messag data.Set("ContentSid", *params.ContentSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -296,9 +297,10 @@ func (c *ApiService) DeleteMessage(Sid string, params *DeleteMessageParams) erro path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -330,9 +332,10 @@ func (c *ApiService) FetchMessage(Sid string, params *FetchMessageParams) (*ApiV path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -411,25 +414,26 @@ func (c *ApiService) PageMessage(params *ListMessageParams, pageToken, pageNumbe } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { - data.Set("To", *params.To) + queryParams.Set("To", *params.To) } if params != nil && params.From != nil { - data.Set("From", *params.From) + queryParams.Set("From", *params.From) } if params != nil && params.DateSent != nil { - data.Set("DateSent", fmt.Sprint((*params.DateSent).Format(time.RFC3339))) + queryParams.Set("DateSent", fmt.Sprint((*params.DateSent).Format(time.RFC3339))) } if params != nil && params.DateSentBefore != nil { - data.Set("DateSent<", fmt.Sprint((*params.DateSentBefore).Format(time.RFC3339))) + queryParams.Set("DateSent<", fmt.Sprint((*params.DateSentBefore).Format(time.RFC3339))) } if params != nil && params.DateSentAfter != nil { - data.Set("DateSent>", fmt.Sprint((*params.DateSentAfter).Format(time.RFC3339))) + queryParams.Set("DateSent>", fmt.Sprint((*params.DateSentAfter).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -439,7 +443,7 @@ func (c *ApiService) PageMessage(params *ListMessageParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -526,7 +530,7 @@ func (c *ApiService) getNextListMessageResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -574,6 +578,7 @@ func (c *ApiService) UpdateMessage(Sid string, params *UpdateMessageParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -583,7 +588,7 @@ func (c *ApiService) UpdateMessage(Sid string, params *UpdateMessageParams) (*Ap data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_messages_feedback.go b/rest/api/v2010/accounts_messages_feedback.go index 43e0a8e26..38136a8dd 100644 --- a/rest/api/v2010/accounts_messages_feedback.go +++ b/rest/api/v2010/accounts_messages_feedback.go @@ -48,13 +48,14 @@ func (c *ApiService) CreateMessageFeedback(MessageSid string, params *CreateMess path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Outcome != nil { data.Set("Outcome", *params.Outcome) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_messages_media.go b/rest/api/v2010/accounts_messages_media.go index 4f0f81578..5bb3b7221 100644 --- a/rest/api/v2010/accounts_messages_media.go +++ b/rest/api/v2010/accounts_messages_media.go @@ -47,9 +47,10 @@ func (c *ApiService) DeleteMedia(MessageSid string, Sid string, params *DeleteMe path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -82,9 +83,10 @@ func (c *ApiService) FetchMedia(MessageSid string, Sid string, params *FetchMedi path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -152,19 +154,20 @@ func (c *ApiService) PageMedia(MessageSid string, params *ListMediaParams, pageT path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + queryParams.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -174,7 +177,7 @@ func (c *ApiService) PageMedia(MessageSid string, params *ListMediaParams, pageT data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -261,7 +264,7 @@ func (c *ApiService) getNextListMediaResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_notifications.go b/rest/api/v2010/accounts_notifications.go index 4151a7021..7c3cb2b3c 100644 --- a/rest/api/v2010/accounts_notifications.go +++ b/rest/api/v2010/accounts_notifications.go @@ -45,9 +45,10 @@ func (c *ApiService) FetchNotification(Sid string, params *FetchNotificationPara path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -120,22 +121,23 @@ func (c *ApiService) PageNotification(params *ListNotificationParams, pageToken, } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Log != nil { - data.Set("Log", fmt.Sprint(*params.Log)) + queryParams.Set("Log", fmt.Sprint(*params.Log)) } if params != nil && params.MessageDate != nil { - data.Set("MessageDate", fmt.Sprint(*params.MessageDate)) + queryParams.Set("MessageDate", fmt.Sprint(*params.MessageDate)) } if params != nil && params.MessageDateBefore != nil { - data.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) + queryParams.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) } if params != nil && params.MessageDateAfter != nil { - data.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) + queryParams.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -145,7 +147,7 @@ func (c *ApiService) PageNotification(params *ListNotificationParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -232,7 +234,7 @@ func (c *ApiService) getNextListNotificationResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_outgoing_caller_ids.go b/rest/api/v2010/accounts_outgoing_caller_ids.go index 1d91a9389..3a7b5dcd4 100644 --- a/rest/api/v2010/accounts_outgoing_caller_ids.go +++ b/rest/api/v2010/accounts_outgoing_caller_ids.go @@ -70,7 +70,6 @@ func (params *CreateValidationRequestParams) SetStatusCallbackMethod(StatusCallb return params } -// func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestParams) (*ApiV2010ValidationRequest, error) { path := "/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json" if params != nil && params.PathAccountSid != nil { @@ -80,6 +79,7 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { @@ -101,7 +101,7 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -138,9 +138,10 @@ func (c *ApiService) DeleteOutgoingCallerId(Sid string, params *DeleteOutgoingCa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -172,9 +173,10 @@ func (c *ApiService) FetchOutgoingCallerId(Sid string, params *FetchOutgoingCall path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -235,16 +237,17 @@ func (c *ApiService) PageOutgoingCallerId(params *ListOutgoingCallerIdParams, pa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -254,7 +257,7 @@ func (c *ApiService) PageOutgoingCallerId(params *ListOutgoingCallerIdParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -341,7 +344,7 @@ func (c *ApiService) getNextListOutgoingCallerIdResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -383,13 +386,14 @@ func (c *ApiService) UpdateOutgoingCallerId(Sid string, params *UpdateOutgoingCa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_queues.go b/rest/api/v2010/accounts_queues.go index 9f6c3e7b2..475404e62 100644 --- a/rest/api/v2010/accounts_queues.go +++ b/rest/api/v2010/accounts_queues.go @@ -56,6 +56,7 @@ func (c *ApiService) CreateQueue(params *CreateQueueParams) (*ApiV2010Queue, err } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -65,7 +66,7 @@ func (c *ApiService) CreateQueue(params *CreateQueueParams) (*ApiV2010Queue, err data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,9 +103,10 @@ func (c *ApiService) DeleteQueue(Sid string, params *DeleteQueueParams) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -136,9 +138,10 @@ func (c *ApiService) FetchQueue(Sid string, params *FetchQueueParams) (*ApiV2010 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -187,10 +190,11 @@ func (c *ApiService) PageQueue(params *ListQueueParams, pageToken, pageNumber st } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -200,7 +204,7 @@ func (c *ApiService) PageQueue(params *ListQueueParams, pageToken, pageNumber st data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -287,7 +291,7 @@ func (c *ApiService) getNextListQueueResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -335,6 +339,7 @@ func (c *ApiService) UpdateQueue(Sid string, params *UpdateQueueParams) (*ApiV20 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -344,7 +349,7 @@ func (c *ApiService) UpdateQueue(Sid string, params *UpdateQueueParams) (*ApiV20 data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_queues_members.go b/rest/api/v2010/accounts_queues_members.go index 93a3f0b24..006477477 100644 --- a/rest/api/v2010/accounts_queues_members.go +++ b/rest/api/v2010/accounts_queues_members.go @@ -46,9 +46,10 @@ func (c *ApiService) FetchMember(QueueSid string, CallSid string, params *FetchM path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -98,10 +99,11 @@ func (c *ApiService) PageMember(QueueSid string, params *ListMemberParams, pageT path = strings.Replace(path, "{"+"QueueSid"+"}", QueueSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -111,7 +113,7 @@ func (c *ApiService) PageMember(QueueSid string, params *ListMemberParams, pageT data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -198,7 +200,7 @@ func (c *ApiService) getNextListMemberResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -247,6 +249,7 @@ func (c *ApiService) UpdateMember(QueueSid string, CallSid string, params *Updat path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Url != nil { @@ -256,7 +259,7 @@ func (c *ApiService) UpdateMember(QueueSid string, CallSid string, params *Updat data.Set("Method", *params.Method) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_recordings.go b/rest/api/v2010/accounts_recordings.go index cae717617..9bb61445a 100644 --- a/rest/api/v2010/accounts_recordings.go +++ b/rest/api/v2010/accounts_recordings.go @@ -46,9 +46,10 @@ func (c *ApiService) DeleteRecording(Sid string, params *DeleteRecordingParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -86,13 +87,14 @@ func (c *ApiService) FetchRecording(Sid string, params *FetchRecordingParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IncludeSoftDeleted != nil { - data.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) + queryParams.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,28 +179,29 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken, pageN } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + queryParams.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.CallSid != nil { - data.Set("CallSid", *params.CallSid) + queryParams.Set("CallSid", *params.CallSid) } if params != nil && params.ConferenceSid != nil { - data.Set("ConferenceSid", *params.ConferenceSid) + queryParams.Set("ConferenceSid", *params.ConferenceSid) } if params != nil && params.IncludeSoftDeleted != nil { - data.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) + queryParams.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -208,7 +211,7 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -295,7 +298,7 @@ func (c *ApiService) getNextListRecordingResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_recordings_add_on_results.go b/rest/api/v2010/accounts_recordings_add_on_results.go index 69857f08e..90f8a9af5 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results.go +++ b/rest/api/v2010/accounts_recordings_add_on_results.go @@ -46,9 +46,10 @@ func (c *ApiService) DeleteRecordingAddOnResult(ReferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -81,9 +82,10 @@ func (c *ApiService) FetchRecordingAddOnResult(ReferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -133,10 +135,11 @@ func (c *ApiService) PageRecordingAddOnResult(ReferenceSid string, params *ListR path = strings.Replace(path, "{"+"ReferenceSid"+"}", ReferenceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -146,7 +149,7 @@ func (c *ApiService) PageRecordingAddOnResult(ReferenceSid string, params *ListR data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -233,7 +236,7 @@ func (c *ApiService) getNextListRecordingAddOnResultResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_recordings_add_on_results_payloads.go b/rest/api/v2010/accounts_recordings_add_on_results_payloads.go index e9738d49a..8c6082b6d 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results_payloads.go +++ b/rest/api/v2010/accounts_recordings_add_on_results_payloads.go @@ -47,9 +47,10 @@ func (c *ApiService) DeleteRecordingAddOnResultPayload(ReferenceSid string, AddO path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -83,9 +84,10 @@ func (c *ApiService) FetchRecordingAddOnResultPayload(ReferenceSid string, AddOn path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -136,10 +138,11 @@ func (c *ApiService) PageRecordingAddOnResultPayload(ReferenceSid string, AddOnR path = strings.Replace(path, "{"+"AddOnResultSid"+"}", AddOnResultSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -149,7 +152,7 @@ func (c *ApiService) PageRecordingAddOnResultPayload(ReferenceSid string, AddOnR data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -236,7 +239,7 @@ func (c *ApiService) getNextListRecordingAddOnResultPayloadResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_recordings_transcriptions.go b/rest/api/v2010/accounts_recordings_transcriptions.go index c1ca8d02e..d7b3a9a6f 100644 --- a/rest/api/v2010/accounts_recordings_transcriptions.go +++ b/rest/api/v2010/accounts_recordings_transcriptions.go @@ -34,7 +34,6 @@ func (params *DeleteRecordingTranscriptionParams) SetPathAccountSid(PathAccountS return params } -// func (c *ApiService) DeleteRecordingTranscription(RecordingSid string, Sid string, params *DeleteRecordingTranscriptionParams) error { path := "/2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -46,9 +45,10 @@ func (c *ApiService) DeleteRecordingTranscription(RecordingSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -69,7 +69,6 @@ func (params *FetchRecordingTranscriptionParams) SetPathAccountSid(PathAccountSi return params } -// func (c *ApiService) FetchRecordingTranscription(RecordingSid string, Sid string, params *FetchRecordingTranscriptionParams) (*ApiV2010RecordingTranscription, error) { path := "/2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -81,9 +80,10 @@ func (c *ApiService) FetchRecordingTranscription(RecordingSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -133,10 +133,11 @@ func (c *ApiService) PageRecordingTranscription(RecordingSid string, params *Lis path = strings.Replace(path, "{"+"RecordingSid"+"}", RecordingSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -146,7 +147,7 @@ func (c *ApiService) PageRecordingTranscription(RecordingSid string, params *Lis data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -233,7 +234,7 @@ func (c *ApiService) getNextListRecordingTranscriptionResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_signing_keys.go b/rest/api/v2010/accounts_signing_keys.go index dd1b18853..90c63874a 100644 --- a/rest/api/v2010/accounts_signing_keys.go +++ b/rest/api/v2010/accounts_signing_keys.go @@ -50,13 +50,14 @@ func (c *ApiService) CreateNewSigningKey(params *CreateNewSigningKeyParams) (*Ap } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -82,7 +83,6 @@ func (params *DeleteSigningKeyParams) SetPathAccountSid(PathAccountSid string) * return params } -// func (c *ApiService) DeleteSigningKey(Sid string, params *DeleteSigningKeyParams) error { path := "/2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -93,9 +93,10 @@ func (c *ApiService) DeleteSigningKey(Sid string, params *DeleteSigningKeyParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,7 +117,6 @@ func (params *FetchSigningKeyParams) SetPathAccountSid(PathAccountSid string) *F return params } -// func (c *ApiService) FetchSigningKey(Sid string, params *FetchSigningKeyParams) (*ApiV2010SigningKey, error) { path := "/2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -127,9 +127,10 @@ func (c *ApiService) FetchSigningKey(Sid string, params *FetchSigningKeyParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -178,10 +179,11 @@ func (c *ApiService) PageSigningKey(params *ListSigningKeyParams, pageToken, pag } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -191,7 +193,7 @@ func (c *ApiService) PageSigningKey(params *ListSigningKeyParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -278,7 +280,7 @@ func (c *ApiService) getNextListSigningKeyResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -309,7 +311,6 @@ func (params *UpdateSigningKeyParams) SetFriendlyName(FriendlyName string) *Upda return params } -// func (c *ApiService) UpdateSigningKey(Sid string, params *UpdateSigningKeyParams) (*ApiV2010SigningKey, error) { path := "/2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -320,13 +321,14 @@ func (c *ApiService) UpdateSigningKey(Sid string, params *UpdateSigningKeyParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_credential_lists.go b/rest/api/v2010/accounts_sip_credential_lists.go index 17a523bc0..5ecd02650 100644 --- a/rest/api/v2010/accounts_sip_credential_lists.go +++ b/rest/api/v2010/accounts_sip_credential_lists.go @@ -50,13 +50,14 @@ func (c *ApiService) CreateSipCredentialList(params *CreateSipCredentialListPara } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteSipCredentialList(Sid string, params *DeleteSipCreden path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -127,9 +129,10 @@ func (c *ApiService) FetchSipCredentialList(Sid string, params *FetchSipCredenti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -178,10 +181,11 @@ func (c *ApiService) PageSipCredentialList(params *ListSipCredentialListParams, } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -191,7 +195,7 @@ func (c *ApiService) PageSipCredentialList(params *ListSipCredentialListParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -278,7 +282,7 @@ func (c *ApiService) getNextListSipCredentialListResponse(nextPageUrl string) (i if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -320,13 +324,14 @@ func (c *ApiService) UpdateSipCredentialList(Sid string, params *UpdateSipCreden path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_credential_lists_credentials.go b/rest/api/v2010/accounts_sip_credential_lists_credentials.go index e82f254f2..d05fe922e 100644 --- a/rest/api/v2010/accounts_sip_credential_lists_credentials.go +++ b/rest/api/v2010/accounts_sip_credential_lists_credentials.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateSipCredential(CredentialListSid string, params *Creat path = strings.Replace(path, "{"+"CredentialListSid"+"}", CredentialListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Username != nil { @@ -66,7 +67,7 @@ func (c *ApiService) CreateSipCredential(CredentialListSid string, params *Creat data.Set("Password", *params.Password) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -104,9 +105,10 @@ func (c *ApiService) DeleteSipCredential(CredentialListSid string, Sid string, p path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -139,9 +141,10 @@ func (c *ApiService) FetchSipCredential(CredentialListSid string, Sid string, pa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -191,10 +194,11 @@ func (c *ApiService) PageSipCredential(CredentialListSid string, params *ListSip path = strings.Replace(path, "{"+"CredentialListSid"+"}", CredentialListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -204,7 +208,7 @@ func (c *ApiService) PageSipCredential(CredentialListSid string, params *ListSip data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -291,7 +295,7 @@ func (c *ApiService) getNextListSipCredentialResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -334,13 +338,14 @@ func (c *ApiService) UpdateSipCredential(CredentialListSid string, Sid string, p path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Password != nil { data.Set("Password", *params.Password) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_domains.go b/rest/api/v2010/accounts_sip_domains.go index e0868c6f0..f5ebd7264 100644 --- a/rest/api/v2010/accounts_sip_domains.go +++ b/rest/api/v2010/accounts_sip_domains.go @@ -122,6 +122,7 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Si } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DomainName != nil { @@ -164,7 +165,7 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Si data.Set("EmergencyCallerSid", *params.EmergencyCallerSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -201,9 +202,10 @@ func (c *ApiService) DeleteSipDomain(Sid string, params *DeleteSipDomainParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -235,9 +237,10 @@ func (c *ApiService) FetchSipDomain(Sid string, params *FetchSipDomainParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -286,10 +289,11 @@ func (c *ApiService) PageSipDomain(params *ListSipDomainParams, pageToken, pageN } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -299,7 +303,7 @@ func (c *ApiService) PageSipDomain(params *ListSipDomainParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -386,7 +390,7 @@ func (c *ApiService) getNextListSipDomainResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -500,6 +504,7 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -542,7 +547,7 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) data.Set("EmergencyCallerSid", *params.EmergencyCallerSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go b/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go index f3d34690e..cc919cfb0 100644 --- a/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go @@ -51,13 +51,14 @@ func (c *ApiService) CreateSipAuthCallsCredentialListMapping(DomainSid string, p path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -95,9 +96,10 @@ func (c *ApiService) DeleteSipAuthCallsCredentialListMapping(DomainSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -130,9 +132,10 @@ func (c *ApiService) FetchSipAuthCallsCredentialListMapping(DomainSid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageSipAuthCallsCredentialListMapping(DomainSid string, par path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageSipAuthCallsCredentialListMapping(DomainSid string, par data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListSipAuthCallsCredentialListMappingResponse(nextPa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go b/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go index 86daa24f0..60387ed49 100644 --- a/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go @@ -51,13 +51,14 @@ func (c *ApiService) CreateSipAuthCallsIpAccessControlListMapping(DomainSid stri path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -95,9 +96,10 @@ func (c *ApiService) DeleteSipAuthCallsIpAccessControlListMapping(DomainSid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -130,9 +132,10 @@ func (c *ApiService) FetchSipAuthCallsIpAccessControlListMapping(DomainSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageSipAuthCallsIpAccessControlListMapping(DomainSid string path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageSipAuthCallsIpAccessControlListMapping(DomainSid string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListSipAuthCallsIpAccessControlListMappingResponse(n if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go b/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go index 431e5099b..eb3e64b84 100644 --- a/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go @@ -51,13 +51,14 @@ func (c *ApiService) CreateSipAuthRegistrationsCredentialListMapping(DomainSid s path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -95,9 +96,10 @@ func (c *ApiService) DeleteSipAuthRegistrationsCredentialListMapping(DomainSid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -130,9 +132,10 @@ func (c *ApiService) FetchSipAuthRegistrationsCredentialListMapping(DomainSid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageSipAuthRegistrationsCredentialListMapping(DomainSid str path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageSipAuthRegistrationsCredentialListMapping(DomainSid str data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListSipAuthRegistrationsCredentialListMappingRespons if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go b/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go index 09ac9162e..e530e3c48 100644 --- a/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go @@ -51,13 +51,14 @@ func (c *ApiService) CreateSipCredentialListMapping(DomainSid string, params *Cr path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -95,9 +96,10 @@ func (c *ApiService) DeleteSipCredentialListMapping(DomainSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -130,9 +132,10 @@ func (c *ApiService) FetchSipCredentialListMapping(DomainSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageSipCredentialListMapping(DomainSid string, params *List path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageSipCredentialListMapping(DomainSid string, params *List data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListSipCredentialListMappingResponse(nextPageUrl str if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go b/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go index e42334eb7..683c7ebfd 100644 --- a/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go @@ -51,13 +51,14 @@ func (c *ApiService) CreateSipIpAccessControlListMapping(DomainSid string, param path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -95,9 +96,10 @@ func (c *ApiService) DeleteSipIpAccessControlListMapping(DomainSid string, Sid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -130,9 +132,10 @@ func (c *ApiService) FetchSipIpAccessControlListMapping(DomainSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageSipIpAccessControlListMapping(DomainSid string, params path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageSipIpAccessControlListMapping(DomainSid string, params data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListSipIpAccessControlListMappingResponse(nextPageUr if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sipip_access_control_lists.go b/rest/api/v2010/accounts_sipip_access_control_lists.go index 390bcfa25..df7a0f715 100644 --- a/rest/api/v2010/accounts_sipip_access_control_lists.go +++ b/rest/api/v2010/accounts_sipip_access_control_lists.go @@ -50,13 +50,14 @@ func (c *ApiService) CreateSipIpAccessControlList(params *CreateSipIpAccessContr } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteSipIpAccessControlList(Sid string, params *DeleteSipI path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -127,9 +129,10 @@ func (c *ApiService) FetchSipIpAccessControlList(Sid string, params *FetchSipIpA path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -178,10 +181,11 @@ func (c *ApiService) PageSipIpAccessControlList(params *ListSipIpAccessControlLi } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -191,7 +195,7 @@ func (c *ApiService) PageSipIpAccessControlList(params *ListSipIpAccessControlLi data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -278,7 +282,7 @@ func (c *ApiService) getNextListSipIpAccessControlListResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -320,13 +324,14 @@ func (c *ApiService) UpdateSipIpAccessControlList(Sid string, params *UpdateSipI path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go b/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go index 0d92df5e6..d21ae858b 100644 --- a/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go +++ b/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go @@ -63,6 +63,7 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C path = strings.Replace(path, "{"+"IpAccessControlListSid"+"}", IpAccessControlListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -75,7 +76,7 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -113,9 +114,10 @@ func (c *ApiService) DeleteSipIpAddress(IpAccessControlListSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -148,9 +150,10 @@ func (c *ApiService) FetchSipIpAddress(IpAccessControlListSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -200,10 +203,11 @@ func (c *ApiService) PageSipIpAddress(IpAccessControlListSid string, params *Lis path = strings.Replace(path, "{"+"IpAccessControlListSid"+"}", IpAccessControlListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -213,7 +217,7 @@ func (c *ApiService) PageSipIpAddress(IpAccessControlListSid string, params *Lis data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -300,7 +304,7 @@ func (c *ApiService) getNextListSipIpAddressResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -355,6 +359,7 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IpAddress != nil { @@ -367,7 +372,7 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_sms_short_codes.go b/rest/api/v2010/accounts_sms_short_codes.go index efac7d190..235619e8a 100644 --- a/rest/api/v2010/accounts_sms_short_codes.go +++ b/rest/api/v2010/accounts_sms_short_codes.go @@ -45,9 +45,10 @@ func (c *ApiService) FetchShortCode(Sid string, params *FetchShortCodeParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -108,16 +109,17 @@ func (c *ApiService) PageShortCode(params *ListShortCodeParams, pageToken, pageN } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.ShortCode != nil { - data.Set("ShortCode", *params.ShortCode) + queryParams.Set("ShortCode", *params.ShortCode) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -127,7 +129,7 @@ func (c *ApiService) PageShortCode(params *ListShortCodeParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -214,7 +216,7 @@ func (c *ApiService) getNextListShortCodeResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -286,6 +288,7 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -307,7 +310,7 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_tokens.go b/rest/api/v2010/accounts_tokens.go index 1784876d1..7c0c19641 100644 --- a/rest/api/v2010/accounts_tokens.go +++ b/rest/api/v2010/accounts_tokens.go @@ -48,13 +48,14 @@ func (c *ApiService) CreateToken(params *CreateTokenParams) (*ApiV2010Token, err } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_transcriptions.go b/rest/api/v2010/accounts_transcriptions.go index c62183a14..bf8fee223 100644 --- a/rest/api/v2010/accounts_transcriptions.go +++ b/rest/api/v2010/accounts_transcriptions.go @@ -45,9 +45,10 @@ func (c *ApiService) DeleteTranscription(Sid string, params *DeleteTranscription path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -79,9 +80,10 @@ func (c *ApiService) FetchTranscription(Sid string, params *FetchTranscriptionPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -130,10 +132,11 @@ func (c *ApiService) PageTranscription(params *ListTranscriptionParams, pageToke } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -143,7 +146,7 @@ func (c *ApiService) PageTranscription(params *ListTranscriptionParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -230,7 +233,7 @@ func (c *ApiService) getNextListTranscriptionResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records.go b/rest/api/v2010/accounts_usage_records.go index d5ed51a3d..3a4d84deb 100644 --- a/rest/api/v2010/accounts_usage_records.go +++ b/rest/api/v2010/accounts_usage_records.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken, p } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_all_time.go b/rest/api/v2010/accounts_usage_records_all_time.go index 2719f2426..9c493afe2 100644 --- a/rest/api/v2010/accounts_usage_records_all_time.go +++ b/rest/api/v2010/accounts_usage_records_all_time.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordAllTime(params *ListUsageRecordAllTimeParams } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordAllTime(params *ListUsageRecordAllTimeParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordAllTimeResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_daily.go b/rest/api/v2010/accounts_usage_records_daily.go index c27a64969..152f5a8d3 100644 --- a/rest/api/v2010/accounts_usage_records_daily.go +++ b/rest/api/v2010/accounts_usage_records_daily.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordDaily(params *ListUsageRecordDailyParams, pa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordDaily(params *ListUsageRecordDailyParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordDailyResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_last_month.go b/rest/api/v2010/accounts_usage_records_last_month.go index 23ec9b62d..2841ed48e 100644 --- a/rest/api/v2010/accounts_usage_records_last_month.go +++ b/rest/api/v2010/accounts_usage_records_last_month.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordLastMonth(params *ListUsageRecordLastMonthPa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordLastMonth(params *ListUsageRecordLastMonthPa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordLastMonthResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_monthly.go b/rest/api/v2010/accounts_usage_records_monthly.go index 82dc2e4ec..b821cda39 100644 --- a/rest/api/v2010/accounts_usage_records_monthly.go +++ b/rest/api/v2010/accounts_usage_records_monthly.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordMonthly(params *ListUsageRecordMonthlyParams } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordMonthly(params *ListUsageRecordMonthlyParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordMonthlyResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_this_month.go b/rest/api/v2010/accounts_usage_records_this_month.go index b3b79e816..67a1e2033 100644 --- a/rest/api/v2010/accounts_usage_records_this_month.go +++ b/rest/api/v2010/accounts_usage_records_this_month.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordThisMonth(params *ListUsageRecordThisMonthPa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordThisMonth(params *ListUsageRecordThisMonthPa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordThisMonthResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_today.go b/rest/api/v2010/accounts_usage_records_today.go index f9ce2c74a..6882ed756 100644 --- a/rest/api/v2010/accounts_usage_records_today.go +++ b/rest/api/v2010/accounts_usage_records_today.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordToday(params *ListUsageRecordTodayParams, pa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordToday(params *ListUsageRecordTodayParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordTodayResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_yearly.go b/rest/api/v2010/accounts_usage_records_yearly.go index e601fd804..5734844df 100644 --- a/rest/api/v2010/accounts_usage_records_yearly.go +++ b/rest/api/v2010/accounts_usage_records_yearly.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordYearly(params *ListUsageRecordYearlyParams, } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordYearly(params *ListUsageRecordYearlyParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordYearlyResponse(nextPageUrl string) (i if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_records_yesterday.go b/rest/api/v2010/accounts_usage_records_yesterday.go index 5293f7a19..c9c684370 100644 --- a/rest/api/v2010/accounts_usage_records_yesterday.go +++ b/rest/api/v2010/accounts_usage_records_yesterday.go @@ -81,22 +81,23 @@ func (c *ApiService) PageUsageRecordYesterday(params *ListUsageRecordYesterdayPa } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Category != nil { - data.Set("Category", *params.Category) + queryParams.Set("Category", *params.Category) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + queryParams.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +107,7 @@ func (c *ApiService) PageUsageRecordYesterday(params *ListUsageRecordYesterdayPa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +194,7 @@ func (c *ApiService) getNextListUsageRecordYesterdayResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/api/v2010/accounts_usage_triggers.go b/rest/api/v2010/accounts_usage_triggers.go index da4333b3a..a9cac2f1d 100644 --- a/rest/api/v2010/accounts_usage_triggers.go +++ b/rest/api/v2010/accounts_usage_triggers.go @@ -86,6 +86,7 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CallbackUrl != nil { @@ -110,7 +111,7 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV data.Set("TriggerBy", *params.TriggerBy) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -136,7 +137,6 @@ func (params *DeleteUsageTriggerParams) SetPathAccountSid(PathAccountSid string) return params } -// func (c *ApiService) DeleteUsageTrigger(Sid string, params *DeleteUsageTriggerParams) error { path := "/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json" if params != nil && params.PathAccountSid != nil { @@ -147,9 +147,10 @@ func (c *ApiService) DeleteUsageTrigger(Sid string, params *DeleteUsageTriggerPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -181,9 +182,10 @@ func (c *ApiService) FetchUsageTrigger(Sid string, params *FetchUsageTriggerPara path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -250,19 +252,20 @@ func (c *ApiService) PageUsageTrigger(params *ListUsageTriggerParams, pageToken, } data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Recurring != nil { - data.Set("Recurring", *params.Recurring) + queryParams.Set("Recurring", *params.Recurring) } if params != nil && params.TriggerBy != nil { - data.Set("TriggerBy", *params.TriggerBy) + queryParams.Set("TriggerBy", *params.TriggerBy) } if params != nil && params.UsageCategory != nil { - data.Set("UsageCategory", *params.UsageCategory) + queryParams.Set("UsageCategory", *params.UsageCategory) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -272,7 +275,7 @@ func (c *ApiService) PageUsageTrigger(params *ListUsageTriggerParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -359,7 +362,7 @@ func (c *ApiService) getNextListUsageTriggerResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -413,6 +416,7 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CallbackMethod != nil { @@ -425,7 +429,7 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/bulkexports/v1/README.md b/rest/bulkexports/v1/README.md index 762993aa8..a04786de2 100644 --- a/rest/bulkexports/v1/README.md +++ b/rest/bulkexports/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/bulkexports/v1/exports.go b/rest/bulkexports/v1/exports.go index 1cbbbe073..71fb91ee7 100644 --- a/rest/bulkexports/v1/exports.go +++ b/rest/bulkexports/v1/exports.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchExport(ResourceType string) (*BulkexportsV1Export, err path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/bulkexports/v1/exports_configuration.go b/rest/bulkexports/v1/exports_configuration.go index 6c9468a05..8a1c5d6d8 100644 --- a/rest/bulkexports/v1/exports_configuration.go +++ b/rest/bulkexports/v1/exports_configuration.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchExportConfiguration(ResourceType string) (*Bulkexports path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,6 +74,7 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Enabled != nil { @@ -85,7 +87,7 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda data.Set("WebhookMethod", *params.WebhookMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/bulkexports/v1/exports_days.go b/rest/bulkexports/v1/exports_days.go index 528c39540..90e2fe210 100644 --- a/rest/bulkexports/v1/exports_days.go +++ b/rest/bulkexports/v1/exports_days.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchDay(ResourceType string, Day string) (*BulkexportsV1Da path = strings.Replace(path, "{"+"Day"+"}", Day, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,10 +72,11 @@ func (c *ApiService) PageDay(ResourceType string, params *ListDayParams, pageTok path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -84,7 +86,7 @@ func (c *ApiService) PageDay(ResourceType string, params *ListDayParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,7 +173,7 @@ func (c *ApiService) getNextListDayResponse(nextPageUrl string) (interface{}, er if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/bulkexports/v1/exports_jobs.go b/rest/bulkexports/v1/exports_jobs.go index 9f940eaf6..709605ed5 100644 --- a/rest/bulkexports/v1/exports_jobs.go +++ b/rest/bulkexports/v1/exports_jobs.go @@ -64,12 +64,12 @@ func (params *CreateExportCustomJobParams) SetEmail(Email string) *CreateExportC return params } -// func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateExportCustomJobParams) (*BulkexportsV1ExportCustomJob, error) { path := "/v1/Exports/{ResourceType}/Jobs" path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.StartDay != nil { @@ -91,7 +91,7 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx data.Set("Email", *params.Email) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -106,15 +106,15 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx return ps, err } -// func (c *ApiService) DeleteJob(JobSid string) error { path := "/v1/Exports/Jobs/{JobSid}" path = strings.Replace(path, "{"+"JobSid"+"}", JobSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -124,15 +124,15 @@ func (c *ApiService) DeleteJob(JobSid string) error { return nil } -// func (c *ApiService) FetchJob(JobSid string) (*BulkexportsV1Job, error) { path := "/v1/Exports/Jobs/{JobSid}" path = strings.Replace(path, "{"+"JobSid"+"}", JobSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,10 +171,11 @@ func (c *ApiService) PageExportCustomJob(ResourceType string, params *ListExport path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -184,7 +185,7 @@ func (c *ApiService) PageExportCustomJob(ResourceType string, params *ListExport data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -271,7 +272,7 @@ func (c *ApiService) getNextListExportCustomJobResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/chat/v1/README.md b/rest/chat/v1/README.md index ee6ebc846..7983b0284 100644 --- a/rest/chat/v1/README.md +++ b/rest/chat/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/chat/v1/credentials.go b/rest/chat/v1/credentials.go index 7d1ce09c1..fbed9fe77 100644 --- a/rest/chat/v1/credentials.go +++ b/rest/chat/v1/credentials.go @@ -70,11 +70,11 @@ func (params *CreateCredentialParams) SetSecret(Secret string) *CreateCredential return params } -// func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Credential, error) { path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -99,7 +99,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -114,15 +114,15 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr return ps, err } -// func (c *ApiService) DeleteCredential(Sid string) error { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -132,15 +132,15 @@ func (c *ApiService) DeleteCredential(Sid string) error { return nil } -// func (c *ApiService) FetchCredential(Sid string) (*ChatV1Credential, error) { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +177,11 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListCredentialResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -332,12 +333,12 @@ func (params *UpdateCredentialParams) SetSecret(Secret string) *UpdateCredential return params } -// func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams) (*ChatV1Credential, error) { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -359,7 +360,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services.go b/rest/chat/v1/services.go index d5b8abda9..65b98cd15 100644 --- a/rest/chat/v1/services.go +++ b/rest/chat/v1/services.go @@ -34,18 +34,18 @@ func (params *CreateServiceParams) SetFriendlyName(FriendlyName string) *CreateS return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV1Service, error) { path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,15 +60,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV1Service, return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -78,15 +78,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*ChatV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,10 +123,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +137,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -566,12 +567,12 @@ func (params *UpdateServiceParams) SetLimitsUserChannels(LimitsUserChannels int) return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*ChatV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -739,7 +740,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_channels.go b/rest/chat/v1/services_channels.go index a4d54b7ea..7cc76dfee 100644 --- a/rest/chat/v1/services_channels.go +++ b/rest/chat/v1/services_channels.go @@ -52,12 +52,12 @@ func (params *CreateChannelParams) SetType(Type string) *CreateChannelParams { return params } -// func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParams) (*ChatV1Channel, error) { path := "/v1/Services/{ServiceSid}/Channels" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -73,7 +73,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam data.Set("Type", *params.Type) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -88,16 +88,16 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam return ps, err } -// func (c *ApiService) DeleteChannel(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -107,16 +107,16 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchChannel(ServiceSid string, Sid string) (*ChatV1Channel, error) { path := "/v1/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -161,15 +161,16 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { for _, item := range *params.Type { - data.Add("Type", item) + queryParams.Add("Type", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -179,7 +180,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -266,7 +267,7 @@ func (c *ApiService) getNextListChannelResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -303,13 +304,13 @@ func (params *UpdateChannelParams) SetAttributes(Attributes string) *UpdateChann return params } -// func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *UpdateChannelParams) (*ChatV1Channel, error) { path := "/v1/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -322,7 +323,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_channels_invites.go b/rest/chat/v1/services_channels_invites.go index 9c7293663..2dfdb60dc 100644 --- a/rest/chat/v1/services_channels_invites.go +++ b/rest/chat/v1/services_channels_invites.go @@ -40,13 +40,13 @@ func (params *CreateInviteParams) SetRoleSid(RoleSid string) *CreateInviteParams return params } -// func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params *CreateInviteParams) (*ChatV1Invite, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Invites" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -56,7 +56,7 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * data.Set("RoleSid", *params.RoleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,7 +71,6 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * return ps, err } -// func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -79,9 +78,10 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -91,7 +91,6 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid string) (*ChatV1Invite, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -99,9 +98,10 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,15 +147,16 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListInviteResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_channels_members.go b/rest/chat/v1/services_channels_members.go index 43c63e650..122e4a27b 100644 --- a/rest/chat/v1/services_channels_members.go +++ b/rest/chat/v1/services_channels_members.go @@ -40,13 +40,13 @@ func (params *CreateMemberParams) SetRoleSid(RoleSid string) *CreateMemberParams return params } -// func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params *CreateMemberParams) (*ChatV1Member, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -56,7 +56,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * data.Set("RoleSid", *params.RoleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,7 +71,6 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * return ps, err } -// func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -79,9 +78,10 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -91,7 +91,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid string) (*ChatV1Member, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -99,9 +98,10 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,15 +147,16 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListMemberResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -283,7 +284,6 @@ func (params *UpdateMemberParams) SetLastConsumedMessageIndex(LastConsumedMessag return params } -// func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid string, params *UpdateMemberParams) (*ChatV1Member, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -291,6 +291,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -300,7 +301,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_channels_messages.go b/rest/chat/v1/services_channels_messages.go index d66d42370..8df7feb48 100644 --- a/rest/chat/v1/services_channels_messages.go +++ b/rest/chat/v1/services_channels_messages.go @@ -46,13 +46,13 @@ func (params *CreateMessageParams) SetAttributes(Attributes string) *CreateMessa return params } -// func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params *CreateMessageParams) (*ChatV1Message, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -65,7 +65,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -80,7 +80,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params return ps, err } -// func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -88,9 +87,10 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -100,7 +100,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str return nil } -// func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid string) (*ChatV1Message, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -108,9 +107,10 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -156,13 +156,14 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +173,7 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +260,7 @@ func (c *ApiService) getNextListMessageResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -290,7 +291,6 @@ func (params *UpdateMessageParams) SetAttributes(Attributes string) *UpdateMessa return params } -// func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid string, params *UpdateMessageParams) (*ChatV1Message, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -298,6 +298,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -307,7 +308,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_roles.go b/rest/chat/v1/services_roles.go index f7474658b..b7726e7b8 100644 --- a/rest/chat/v1/services_roles.go +++ b/rest/chat/v1/services_roles.go @@ -46,12 +46,12 @@ func (params *CreateRoleParams) SetPermission(Permission []string) *CreateRolePa return params } -// func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*ChatV1Role, error) { path := "/v1/Services/{ServiceSid}/Roles" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -66,7 +66,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -81,16 +81,16 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C return ps, err } -// func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -100,16 +100,16 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchRole(ServiceSid string, Sid string) (*ChatV1Role, error) { path := "/v1/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,10 +148,11 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -161,7 +162,7 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -248,7 +249,7 @@ func (c *ApiService) getNextListRoleResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -273,13 +274,13 @@ func (params *UpdateRoleParams) SetPermission(Permission []string) *UpdateRolePa return params } -// func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRoleParams) (*ChatV1Role, error) { path := "/v1/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Permission != nil { @@ -288,7 +289,7 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_users.go b/rest/chat/v1/services_users.go index 7a58491fd..82cba33e0 100644 --- a/rest/chat/v1/services_users.go +++ b/rest/chat/v1/services_users.go @@ -52,12 +52,12 @@ func (params *CreateUserParams) SetFriendlyName(FriendlyName string) *CreateUser return params } -// func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*ChatV1User, error) { path := "/v1/Services/{ServiceSid}/Users" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -73,7 +73,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -88,16 +88,16 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C return ps, err } -// func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -107,16 +107,16 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchUser(ServiceSid string, Sid string) (*ChatV1User, error) { path := "/v1/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -155,10 +155,11 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -168,7 +169,7 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,7 +256,7 @@ func (c *ApiService) getNextListUserResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -292,13 +293,13 @@ func (params *UpdateUserParams) SetFriendlyName(FriendlyName string) *UpdateUser return params } -// func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUserParams) (*ChatV1User, error) { path := "/v1/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -311,7 +312,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v1/services_users_channels.go b/rest/chat/v1/services_users_channels.go index eb3c21f9a..b7ae912ab 100644 --- a/rest/chat/v1/services_users_channels.go +++ b/rest/chat/v1/services_users_channels.go @@ -48,10 +48,11 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -61,7 +62,7 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,7 +149,7 @@ func (c *ApiService) getNextListUserChannelResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/chat/v2/README.md b/rest/chat/v2/README.md index 3fbd48ed7..529adec9d 100644 --- a/rest/chat/v2/README.md +++ b/rest/chat/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/chat/v2/credentials.go b/rest/chat/v2/credentials.go index 376caa738..0f0121cb9 100644 --- a/rest/chat/v2/credentials.go +++ b/rest/chat/v2/credentials.go @@ -70,11 +70,11 @@ func (params *CreateCredentialParams) SetSecret(Secret string) *CreateCredential return params } -// func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Credential, error) { path := "/v2/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -99,7 +99,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -114,15 +114,15 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr return ps, err } -// func (c *ApiService) DeleteCredential(Sid string) error { path := "/v2/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -132,15 +132,15 @@ func (c *ApiService) DeleteCredential(Sid string) error { return nil } -// func (c *ApiService) FetchCredential(Sid string) (*ChatV2Credential, error) { path := "/v2/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +177,11 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag path := "/v2/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListCredentialResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -332,12 +333,12 @@ func (params *UpdateCredentialParams) SetSecret(Secret string) *UpdateCredential return params } -// func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams) (*ChatV2Credential, error) { path := "/v2/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -359,7 +360,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services.go b/rest/chat/v2/services.go index 8a5a3e2a1..709d3dffb 100644 --- a/rest/chat/v2/services.go +++ b/rest/chat/v2/services.go @@ -34,18 +34,18 @@ func (params *CreateServiceParams) SetFriendlyName(FriendlyName string) *CreateS return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV2Service, error) { path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,15 +60,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV2Service, return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v2/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -78,15 +78,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*ChatV2Service, error) { path := "/v2/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,10 +123,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +137,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -428,12 +429,12 @@ func (params *UpdateServiceParams) SetNotificationsLogEnabled(NotificationsLogEn return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*ChatV2Service, error) { path := "/v2/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -532,7 +533,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch data.Set("Notifications.LogEnabled", fmt.Sprint(*params.NotificationsLogEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_bindings.go b/rest/chat/v2/services_bindings.go index 74d6d4a21..48e6b8f9d 100644 --- a/rest/chat/v2/services_bindings.go +++ b/rest/chat/v2/services_bindings.go @@ -23,16 +23,16 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) DeleteBinding(ServiceSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -42,16 +42,16 @@ func (c *ApiService) DeleteBinding(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchBinding(ServiceSid string, Sid string) (*ChatV2Binding, error) { path := "/v2/Services/{ServiceSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,20 +102,21 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { - data.Add("BindingType", item) + queryParams.Add("BindingType", item) } } if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -125,7 +126,7 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -212,7 +213,7 @@ func (c *ApiService) getNextListBindingResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_channels.go b/rest/chat/v2/services_channels.go index 66ebff7d7..5a73ce20d 100644 --- a/rest/chat/v2/services_channels.go +++ b/rest/chat/v2/services_channels.go @@ -77,12 +77,12 @@ func (params *CreateChannelParams) SetCreatedBy(CreatedBy string) *CreateChannel return params } -// func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParams) (*ChatV2Channel, error) { path := "/v2/Services/{ServiceSid}/Channels" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -110,7 +110,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -136,19 +136,19 @@ func (params *DeleteChannelParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnable return params } -// func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *DeleteChannelParams) error { path := "/v2/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -158,16 +158,16 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete return nil } -// func (c *ApiService) FetchChannel(ServiceSid string, Sid string) (*ChatV2Channel, error) { path := "/v2/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -212,15 +212,16 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { for _, item := range *params.Type { - data.Add("Type", item) + queryParams.Add("Type", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -230,7 +231,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -317,7 +318,7 @@ func (c *ApiService) getNextListChannelResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -378,13 +379,13 @@ func (params *UpdateChannelParams) SetCreatedBy(CreatedBy string) *UpdateChannel return params } -// func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *UpdateChannelParams) (*ChatV2Channel, error) { path := "/v2/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -409,7 +410,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_channels_invites.go b/rest/chat/v2/services_channels_invites.go index 0b02c00d2..a816ffb9a 100644 --- a/rest/chat/v2/services_channels_invites.go +++ b/rest/chat/v2/services_channels_invites.go @@ -40,13 +40,13 @@ func (params *CreateInviteParams) SetRoleSid(RoleSid string) *CreateInviteParams return params } -// func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params *CreateInviteParams) (*ChatV2Invite, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Invites" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -56,7 +56,7 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * data.Set("RoleSid", *params.RoleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,7 +71,6 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * return ps, err } -// func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -79,9 +78,10 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -91,7 +91,6 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid string) (*ChatV2Invite, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -99,9 +98,10 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,15 +147,16 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListInviteResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_channels_members.go b/rest/chat/v2/services_channels_members.go index 015ed0684..e46a7080f 100644 --- a/rest/chat/v2/services_channels_members.go +++ b/rest/chat/v2/services_channels_members.go @@ -77,13 +77,13 @@ func (params *CreateMemberParams) SetAttributes(Attributes string) *CreateMember return params } -// func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params *CreateMemberParams) (*ChatV2Member, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -111,7 +111,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,7 +137,6 @@ func (params *DeleteMemberParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnabled return params } -// func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid string, params *DeleteMemberParams) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -145,12 +144,13 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -160,7 +160,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid string) (*ChatV2Member, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -168,9 +167,10 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -216,15 +216,16 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -234,7 +235,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -321,7 +322,7 @@ func (c *ApiService) getNextListMemberResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -382,7 +383,6 @@ func (params *UpdateMemberParams) SetAttributes(Attributes string) *UpdateMember return params } -// func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid string, params *UpdateMemberParams) (*ChatV2Member, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -390,6 +390,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -414,7 +415,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_channels_messages.go b/rest/chat/v2/services_channels_messages.go index 3cca69276..fe7c5bfdf 100644 --- a/rest/chat/v2/services_channels_messages.go +++ b/rest/chat/v2/services_channels_messages.go @@ -77,13 +77,13 @@ func (params *CreateMessageParams) SetMediaSid(MediaSid string) *CreateMessagePa return params } -// func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params *CreateMessageParams) (*ChatV2Message, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.From != nil { @@ -111,7 +111,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,7 +137,6 @@ func (params *DeleteMessageParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnable return params } -// func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid string, params *DeleteMessageParams) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -145,12 +144,13 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -160,7 +160,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str return nil } -// func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid string) (*ChatV2Message, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -168,9 +167,10 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -216,13 +216,14 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -232,7 +233,7 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -319,7 +320,7 @@ func (c *ApiService) getNextListMessageResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -380,7 +381,6 @@ func (params *UpdateMessageParams) SetFrom(From string) *UpdateMessageParams { return params } -// func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid string, params *UpdateMessageParams) (*ChatV2Message, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -388,6 +388,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -412,7 +413,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_channels_webhooks.go b/rest/chat/v2/services_channels_webhooks.go index 6db76bd24..a986099eb 100644 --- a/rest/chat/v2/services_channels_webhooks.go +++ b/rest/chat/v2/services_channels_webhooks.go @@ -70,13 +70,13 @@ func (params *CreateChannelWebhookParams) SetConfigurationRetryCount(Configurati return params } -// func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, params *CreateChannelWebhookParams) (*ChatV2ChannelWebhook, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -105,7 +105,7 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -120,7 +120,6 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, return ps, err } -// func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -128,9 +127,10 @@ func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -140,7 +140,6 @@ func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, return nil } -// func (c *ApiService) FetchChannelWebhook(ServiceSid string, ChannelSid string, Sid string) (*ChatV2ChannelWebhook, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -148,9 +147,10 @@ func (c *ApiService) FetchChannelWebhook(ServiceSid string, ChannelSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -190,10 +190,11 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -203,7 +204,7 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -290,7 +291,7 @@ func (c *ApiService) getNextListChannelWebhookResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -345,7 +346,6 @@ func (params *UpdateChannelWebhookParams) SetConfigurationRetryCount(Configurati return params } -// func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, Sid string, params *UpdateChannelWebhookParams) (*ChatV2ChannelWebhook, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -353,6 +353,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ConfigurationUrl != nil { @@ -378,7 +379,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_roles.go b/rest/chat/v2/services_roles.go index 36ea514eb..eb8d2f817 100644 --- a/rest/chat/v2/services_roles.go +++ b/rest/chat/v2/services_roles.go @@ -46,12 +46,12 @@ func (params *CreateRoleParams) SetPermission(Permission []string) *CreateRolePa return params } -// func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*ChatV2Role, error) { path := "/v2/Services/{ServiceSid}/Roles" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -66,7 +66,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -81,16 +81,16 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C return ps, err } -// func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -100,16 +100,16 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchRole(ServiceSid string, Sid string) (*ChatV2Role, error) { path := "/v2/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,10 +148,11 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -161,7 +162,7 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -248,7 +249,7 @@ func (c *ApiService) getNextListRoleResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -273,13 +274,13 @@ func (params *UpdateRoleParams) SetPermission(Permission []string) *UpdateRolePa return params } -// func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRoleParams) (*ChatV2Role, error) { path := "/v2/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Permission != nil { @@ -288,7 +289,7 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_users.go b/rest/chat/v2/services_users.go index 8ed504420..387ced9e4 100644 --- a/rest/chat/v2/services_users.go +++ b/rest/chat/v2/services_users.go @@ -58,12 +58,12 @@ func (params *CreateUserParams) SetFriendlyName(FriendlyName string) *CreateUser return params } -// func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*ChatV2User, error) { path := "/v2/Services/{ServiceSid}/Users" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -82,7 +82,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C return ps, err } -// func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,16 +116,16 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchUser(ServiceSid string, Sid string) (*ChatV2User, error) { path := "/v2/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -164,10 +164,11 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -177,7 +178,7 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (c *ApiService) getNextListUserResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -307,13 +308,13 @@ func (params *UpdateUserParams) SetFriendlyName(FriendlyName string) *UpdateUser return params } -// func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUserParams) (*ChatV2User, error) { path := "/v2/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -329,7 +330,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_users_bindings.go b/rest/chat/v2/services_users_bindings.go index eec6334c4..1038470b9 100644 --- a/rest/chat/v2/services_users_bindings.go +++ b/rest/chat/v2/services_users_bindings.go @@ -23,7 +23,6 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -31,9 +30,10 @@ func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -43,7 +43,6 @@ func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid st return nil } -// func (c *ApiService) FetchUserBinding(ServiceSid string, UserSid string, Sid string) (*ChatV2UserBinding, error) { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -51,9 +50,10 @@ func (c *ApiService) FetchUserBinding(ServiceSid string, UserSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -99,15 +99,16 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { - data.Add("BindingType", item) + queryParams.Add("BindingType", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -117,7 +118,7 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -204,7 +205,7 @@ func (c *ApiService) getNextListUserBindingResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/chat/v2/services_users_channels.go b/rest/chat/v2/services_users_channels.go index 2545d1270..553d12bb4 100644 --- a/rest/chat/v2/services_users_channels.go +++ b/rest/chat/v2/services_users_channels.go @@ -43,12 +43,13 @@ func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -58,7 +59,6 @@ func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, Channe return nil } -// func (c *ApiService) FetchUserChannel(ServiceSid string, UserSid string, ChannelSid string) (*ChatV2UserChannel, error) { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Channels/{ChannelSid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -66,9 +66,10 @@ func (c *ApiService) FetchUserChannel(ServiceSid string, UserSid string, Channel path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -108,10 +109,11 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -121,7 +123,7 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -208,7 +210,7 @@ func (c *ApiService) getNextListUserChannelResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -245,7 +247,6 @@ func (params *UpdateUserChannelParams) SetLastConsumptionTimestamp(LastConsumpti return params } -// func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, ChannelSid string, params *UpdateUserChannelParams) (*ChatV2UserChannel, error) { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Channels/{ChannelSid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -253,6 +254,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.NotificationLevel != nil { @@ -265,7 +267,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/chat/v3/README.md b/rest/chat/v3/README.md index 5b5194c49..cc0e5d5f6 100644 --- a/rest/chat/v3/README.md +++ b/rest/chat/v3/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/chat/v3/services_channels.go b/rest/chat/v3/services_channels.go index f9c7a1dae..7c8abad83 100644 --- a/rest/chat/v3/services_channels.go +++ b/rest/chat/v3/services_channels.go @@ -50,6 +50,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -62,7 +63,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/content/v1/README.md b/rest/content/v1/README.md index e90a57872..cb0aed843 100644 --- a/rest/content/v1/README.md +++ b/rest/content/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/content/v1/content.go b/rest/content/v1/content.go index 316fe37bf..934132bd8 100644 --- a/rest/content/v1/content.go +++ b/rest/content/v1/content.go @@ -29,9 +29,10 @@ func (c *ApiService) DeleteContent(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -47,9 +48,10 @@ func (c *ApiService) FetchContent(Sid string) (*ContentV1Content, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,10 +88,11 @@ func (c *ApiService) PageContent(params *ListContentParams, pageToken, pageNumbe path := "/v1/Content" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -99,7 +102,7 @@ func (c *ApiService) PageContent(params *ListContentParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -186,7 +189,7 @@ func (c *ApiService) getNextListContentResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/content/v1/content_and_approvals.go b/rest/content/v1/content_and_approvals.go index 2c8ea60b8..b8605c812 100644 --- a/rest/content/v1/content_and_approvals.go +++ b/rest/content/v1/content_and_approvals.go @@ -44,10 +44,11 @@ func (c *ApiService) PageContentAndApprovals(params *ListContentAndApprovalsPara path := "/v1/ContentAndApprovals" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -57,7 +58,7 @@ func (c *ApiService) PageContentAndApprovals(params *ListContentAndApprovalsPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -144,7 +145,7 @@ func (c *ApiService) getNextListContentAndApprovalsResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/content/v1/content_approval_requests.go b/rest/content/v1/content_approval_requests.go index 8810e823c..fbf3ad226 100644 --- a/rest/content/v1/content_approval_requests.go +++ b/rest/content/v1/content_approval_requests.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchApprovalFetch(Sid string) (*ContentV1ApprovalFetch, er path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/content/v1/legacy_content.go b/rest/content/v1/legacy_content.go index 3215b7e40..b77610fa8 100644 --- a/rest/content/v1/legacy_content.go +++ b/rest/content/v1/legacy_content.go @@ -44,10 +44,11 @@ func (c *ApiService) PageLegacyContent(params *ListLegacyContentParams, pageToke path := "/v1/LegacyContent" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -57,7 +58,7 @@ func (c *ApiService) PageLegacyContent(params *ListLegacyContentParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -144,7 +145,7 @@ func (c *ApiService) getNextListLegacyContentResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/README.md b/rest/conversations/v1/README.md index c67618ffe..9d8724304 100644 --- a/rest/conversations/v1/README.md +++ b/rest/conversations/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/conversations/v1/configuration.go b/rest/conversations/v1/configuration.go index 04e02a8ac..a6888df5b 100644 --- a/rest/conversations/v1/configuration.go +++ b/rest/conversations/v1/configuration.go @@ -24,9 +24,10 @@ func (c *ApiService) FetchConfiguration() (*ConversationsV1Configuration, error) path := "/v1/Configuration" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -75,6 +76,7 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co path := "/v1/Configuration" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DefaultChatServiceSid != nil { @@ -90,7 +92,7 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co data.Set("DefaultClosedTimer", *params.DefaultClosedTimer) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/configuration_addresses.go b/rest/conversations/v1/configuration_addresses.go index 79628a76e..c45c5c25e 100644 --- a/rest/conversations/v1/configuration_addresses.go +++ b/rest/conversations/v1/configuration_addresses.go @@ -105,6 +105,7 @@ func (c *ApiService) CreateConfigurationAddress(params *CreateConfigurationAddre path := "/v1/Configuration/Addresses" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -146,7 +147,7 @@ func (c *ApiService) CreateConfigurationAddress(params *CreateConfigurationAddre data.Set("AddressCountry", *params.AddressCountry) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -167,9 +168,10 @@ func (c *ApiService) DeleteConfigurationAddress(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -185,9 +187,10 @@ func (c *ApiService) FetchConfigurationAddress(Sid string) (*ConversationsV1Conf path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -230,13 +233,14 @@ func (c *ApiService) PageConfigurationAddress(params *ListConfigurationAddressPa path := "/v1/Configuration/Addresses" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { - data.Set("Type", *params.Type) + queryParams.Set("Type", *params.Type) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -246,7 +250,7 @@ func (c *ApiService) PageConfigurationAddress(params *ListConfigurationAddressPa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -333,7 +337,7 @@ func (c *ApiService) getNextListConfigurationAddressResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -412,6 +416,7 @@ func (c *ApiService) UpdateConfigurationAddress(Sid string, params *UpdateConfig path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -444,7 +449,7 @@ func (c *ApiService) UpdateConfigurationAddress(Sid string, params *UpdateConfig data.Set("AutoCreation.StudioRetryCount", fmt.Sprint(*params.AutoCreationStudioRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/configuration_webhooks.go b/rest/conversations/v1/configuration_webhooks.go index bece581d0..945cc7fdd 100644 --- a/rest/conversations/v1/configuration_webhooks.go +++ b/rest/conversations/v1/configuration_webhooks.go @@ -19,14 +19,14 @@ import ( "net/url" ) -// func (c *ApiService) FetchConfigurationWebhook() (*ConversationsV1ConfigurationWebhook, error) { path := "/v1/Configuration/Webhooks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -76,11 +76,11 @@ func (params *UpdateConfigurationWebhookParams) SetTarget(Target string) *Update return params } -// func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebhookParams) (*ConversationsV1ConfigurationWebhook, error) { path := "/v1/Configuration/Webhooks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Method != nil { @@ -101,7 +101,7 @@ func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebho data.Set("Target", *params.Target) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/conversations.go b/rest/conversations/v1/conversations.go index c3f7c3b7a..58017cf07 100644 --- a/rest/conversations/v1/conversations.go +++ b/rest/conversations/v1/conversations.go @@ -106,6 +106,7 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv path := "/v1/Conversations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -145,7 +146,7 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,12 +178,13 @@ func (c *ApiService) DeleteConversation(Sid string, params *DeleteConversationPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -198,9 +200,10 @@ func (c *ApiService) FetchConversation(Sid string) (*ConversationsV1Conversation path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,19 +258,20 @@ func (c *ApiService) PageConversation(params *ListConversationParams, pageToken, path := "/v1/Conversations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.StartDate != nil { - data.Set("StartDate", *params.StartDate) + queryParams.Set("StartDate", *params.StartDate) } if params != nil && params.EndDate != nil { - data.Set("EndDate", *params.EndDate) + queryParams.Set("EndDate", *params.EndDate) } if params != nil && params.State != nil { - data.Set("State", *params.State) + queryParams.Set("State", *params.State) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -277,7 +281,7 @@ func (c *ApiService) PageConversation(params *ListConversationParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -364,7 +368,7 @@ func (c *ApiService) getNextListConversationResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -461,6 +465,7 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -500,7 +505,7 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/conversations_messages.go b/rest/conversations/v1/conversations_messages.go index 7d88ca0a3..d06515962 100644 --- a/rest/conversations/v1/conversations_messages.go +++ b/rest/conversations/v1/conversations_messages.go @@ -95,6 +95,7 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Author != nil { @@ -128,7 +129,7 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -161,12 +162,13 @@ func (c *ApiService) DeleteConversationMessage(ConversationSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -183,9 +185,10 @@ func (c *ApiService) FetchConversationMessage(ConversationSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -230,13 +233,14 @@ func (c *ApiService) PageConversationMessage(ConversationSid string, params *Lis path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -246,7 +250,7 @@ func (c *ApiService) PageConversationMessage(ConversationSid string, params *Lis data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -333,7 +337,7 @@ func (c *ApiService) getNextListConversationMessageResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -401,6 +405,7 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Author != nil { @@ -425,7 +430,7 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/conversations_messages_receipts.go b/rest/conversations/v1/conversations_messages_receipts.go index 25cb7fd58..9b449c219 100644 --- a/rest/conversations/v1/conversations_messages_receipts.go +++ b/rest/conversations/v1/conversations_messages_receipts.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchConversationMessageReceipt(ConversationSid string, Mes path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageConversationMessageReceipt(ConversationSid string, Mess path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageConversationMessageReceipt(ConversationSid string, Mess data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListConversationMessageReceiptResponse(nextPageUrl s if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/conversations_participants.go b/rest/conversations/v1/conversations_participants.go index bd3ebb455..836f079ad 100644 --- a/rest/conversations/v1/conversations_participants.go +++ b/rest/conversations/v1/conversations_participants.go @@ -89,6 +89,7 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -119,7 +120,7 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -152,12 +153,13 @@ func (c *ApiService) DeleteConversationParticipant(ConversationSid string, Sid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -174,9 +176,10 @@ func (c *ApiService) FetchConversationParticipant(ConversationSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -215,10 +218,11 @@ func (c *ApiService) PageConversationParticipant(ConversationSid string, params path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -228,7 +232,7 @@ func (c *ApiService) PageConversationParticipant(ConversationSid string, params data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -315,7 +319,7 @@ func (c *ApiService) getNextListConversationParticipantResponse(nextPageUrl stri if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -401,6 +405,7 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { @@ -434,7 +439,7 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/conversations_webhooks.go b/rest/conversations/v1/conversations_webhooks.go index bb6609d3d..2167c9bcb 100644 --- a/rest/conversations/v1/conversations_webhooks.go +++ b/rest/conversations/v1/conversations_webhooks.go @@ -76,6 +76,7 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Target != nil { @@ -104,7 +105,7 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par data.Set("Configuration.ReplayAfter", fmt.Sprint(*params.ConfigurationReplayAfter)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -126,9 +127,10 @@ func (c *ApiService) DeleteConversationScopedWebhook(ConversationSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -145,9 +147,10 @@ func (c *ApiService) FetchConversationScopedWebhook(ConversationSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -186,10 +189,11 @@ func (c *ApiService) PageConversationScopedWebhook(ConversationSid string, param path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -199,7 +203,7 @@ func (c *ApiService) PageConversationScopedWebhook(ConversationSid string, param data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -286,7 +290,7 @@ func (c *ApiService) getNextListConversationScopedWebhookResponse(nextPageUrl st if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -342,6 +346,7 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ConfigurationUrl != nil { @@ -364,7 +369,7 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/credentials.go b/rest/conversations/v1/credentials.go index be3d3d586..425c5583c 100644 --- a/rest/conversations/v1/credentials.go +++ b/rest/conversations/v1/credentials.go @@ -75,6 +75,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -99,7 +100,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -120,9 +121,10 @@ func (c *ApiService) DeleteCredential(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -138,9 +140,10 @@ func (c *ApiService) FetchCredential(Sid string) (*ConversationsV1Credential, er path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +180,11 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +194,7 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +281,7 @@ func (c *ApiService) getNextListCredentialResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -344,6 +348,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -368,7 +373,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/participant_conversations.go b/rest/conversations/v1/participant_conversations.go index 955743211..2339be8dc 100644 --- a/rest/conversations/v1/participant_conversations.go +++ b/rest/conversations/v1/participant_conversations.go @@ -56,16 +56,17 @@ func (c *ApiService) PageParticipantConversation(params *ListParticipantConversa path := "/v1/ParticipantConversations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) + queryParams.Set("Identity", *params.Identity) } if params != nil && params.Address != nil { - data.Set("Address", *params.Address) + queryParams.Set("Address", *params.Address) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -75,7 +76,7 @@ func (c *ApiService) PageParticipantConversation(params *ListParticipantConversa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -162,7 +163,7 @@ func (c *ApiService) getNextListParticipantConversationResponse(nextPageUrl stri if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/roles.go b/rest/conversations/v1/roles.go index cfe820454..2bbd72b99 100644 --- a/rest/conversations/v1/roles.go +++ b/rest/conversations/v1/roles.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, path := "/v1/Roles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -65,7 +66,7 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,9 +87,10 @@ func (c *ApiService) DeleteRole(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -104,9 +106,10 @@ func (c *ApiService) FetchRole(Sid string) (*ConversationsV1Role, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -143,10 +146,11 @@ func (c *ApiService) PageRole(params *ListRoleParams, pageToken, pageNumber stri path := "/v1/Roles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -156,7 +160,7 @@ func (c *ApiService) PageRole(params *ListRoleParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -243,7 +247,7 @@ func (c *ApiService) getNextListRoleResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -274,6 +278,7 @@ func (c *ApiService) UpdateRole(Sid string, params *UpdateRoleParams) (*Conversa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Permission != nil { @@ -282,7 +287,7 @@ func (c *ApiService) UpdateRole(Sid string, params *UpdateRoleParams) (*Conversa } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services.go b/rest/conversations/v1/services.go index 495afe477..f4d974372 100644 --- a/rest/conversations/v1/services.go +++ b/rest/conversations/v1/services.go @@ -39,13 +39,14 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ConversationsV path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -66,9 +67,10 @@ func (c *ApiService) DeleteService(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -84,9 +86,10 @@ func (c *ApiService) FetchService(Sid string) (*ConversationsV1Service, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,10 +126,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +140,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +227,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_bindings.go b/rest/conversations/v1/services_bindings.go index 00708fbc6..ff11c9a07 100644 --- a/rest/conversations/v1/services_bindings.go +++ b/rest/conversations/v1/services_bindings.go @@ -30,9 +30,10 @@ func (c *ApiService) DeleteServiceBinding(ChatServiceSid string, Sid string) err path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -49,9 +50,10 @@ func (c *ApiService) FetchServiceBinding(ChatServiceSid string, Sid string) (*Co path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,20 +104,21 @@ func (c *ApiService) PageServiceBinding(ChatServiceSid string, params *ListServi path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { - data.Add("BindingType", item) + queryParams.Add("BindingType", item) } } if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -125,7 +128,7 @@ func (c *ApiService) PageServiceBinding(ChatServiceSid string, params *ListServi data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -212,7 +215,7 @@ func (c *ApiService) getNextListServiceBindingResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_configuration.go b/rest/conversations/v1/services_configuration.go index 6c5579d0b..0d7d59b63 100644 --- a/rest/conversations/v1/services_configuration.go +++ b/rest/conversations/v1/services_configuration.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchServiceConfiguration(ChatServiceSid string) (*Conversa path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,6 +80,7 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DefaultConversationCreatorRoleSid != nil { @@ -94,7 +96,7 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_configuration_notifications.go b/rest/conversations/v1/services_configuration_notifications.go index 18218bdeb..a68e722d3 100644 --- a/rest/conversations/v1/services_configuration_notifications.go +++ b/rest/conversations/v1/services_configuration_notifications.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchServiceNotification(ChatServiceSid string) (*Conversat path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -133,6 +134,7 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.LogEnabled != nil { @@ -175,7 +177,7 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up data.Set("NewMessage.WithMedia.Template", *params.NewMessageWithMediaTemplate) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_configuration_webhooks.go b/rest/conversations/v1/services_configuration_webhooks.go index 8f2504f3a..a49bad3c4 100644 --- a/rest/conversations/v1/services_configuration_webhooks.go +++ b/rest/conversations/v1/services_configuration_webhooks.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchServiceWebhookConfiguration(ChatServiceSid string) (*C path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -78,6 +79,7 @@ func (c *ApiService) UpdateServiceWebhookConfiguration(ChatServiceSid string, pa path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PreWebhookUrl != nil { @@ -95,7 +97,7 @@ func (c *ApiService) UpdateServiceWebhookConfiguration(ChatServiceSid string, pa data.Set("Method", *params.Method) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_conversations.go b/rest/conversations/v1/services_conversations.go index 5ad76e3d2..7800d7d5c 100644 --- a/rest/conversations/v1/services_conversations.go +++ b/rest/conversations/v1/services_conversations.go @@ -107,6 +107,7 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -146,7 +147,7 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -179,12 +180,13 @@ func (c *ApiService) DeleteServiceConversation(ChatServiceSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -201,9 +203,10 @@ func (c *ApiService) FetchServiceConversation(ChatServiceSid string, Sid string) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -260,19 +263,20 @@ func (c *ApiService) PageServiceConversation(ChatServiceSid string, params *List path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.StartDate != nil { - data.Set("StartDate", *params.StartDate) + queryParams.Set("StartDate", *params.StartDate) } if params != nil && params.EndDate != nil { - data.Set("EndDate", *params.EndDate) + queryParams.Set("EndDate", *params.EndDate) } if params != nil && params.State != nil { - data.Set("State", *params.State) + queryParams.Set("State", *params.State) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -282,7 +286,7 @@ func (c *ApiService) PageServiceConversation(ChatServiceSid string, params *List data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -369,7 +373,7 @@ func (c *ApiService) getNextListServiceConversationResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -467,6 +471,7 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -506,7 +511,7 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_conversations_messages.go b/rest/conversations/v1/services_conversations_messages.go index e1489a7f5..3474a41ba 100644 --- a/rest/conversations/v1/services_conversations_messages.go +++ b/rest/conversations/v1/services_conversations_messages.go @@ -96,6 +96,7 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Author != nil { @@ -129,7 +130,7 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -163,12 +164,13 @@ func (c *ApiService) DeleteServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -186,9 +188,10 @@ func (c *ApiService) FetchServiceConversationMessage(ChatServiceSid string, Conv path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -234,13 +237,14 @@ func (c *ApiService) PageServiceConversationMessage(ChatServiceSid string, Conve path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -250,7 +254,7 @@ func (c *ApiService) PageServiceConversationMessage(ChatServiceSid string, Conve data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -337,7 +341,7 @@ func (c *ApiService) getNextListServiceConversationMessageResponse(nextPageUrl s if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -406,6 +410,7 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Author != nil { @@ -430,7 +435,7 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_conversations_messages_receipts.go b/rest/conversations/v1/services_conversations_messages_receipts.go index a722e39c2..ce4decfc9 100644 --- a/rest/conversations/v1/services_conversations_messages_receipts.go +++ b/rest/conversations/v1/services_conversations_messages_receipts.go @@ -32,9 +32,10 @@ func (c *ApiService) FetchServiceConversationMessageReceipt(ChatServiceSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -75,10 +76,11 @@ func (c *ApiService) PageServiceConversationMessageReceipt(ChatServiceSid string path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -88,7 +90,7 @@ func (c *ApiService) PageServiceConversationMessageReceipt(ChatServiceSid string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -175,7 +177,7 @@ func (c *ApiService) getNextListServiceConversationMessageReceiptResponse(nextPa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_conversations_participants.go b/rest/conversations/v1/services_conversations_participants.go index 4357eb6bc..77202372c 100644 --- a/rest/conversations/v1/services_conversations_participants.go +++ b/rest/conversations/v1/services_conversations_participants.go @@ -90,6 +90,7 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -120,7 +121,7 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -154,12 +155,13 @@ func (c *ApiService) DeleteServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -177,9 +179,10 @@ func (c *ApiService) FetchServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -219,10 +222,11 @@ func (c *ApiService) PageServiceConversationParticipant(ChatServiceSid string, C path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -232,7 +236,7 @@ func (c *ApiService) PageServiceConversationParticipant(ChatServiceSid string, C data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -319,7 +323,7 @@ func (c *ApiService) getNextListServiceConversationParticipantResponse(nextPageU if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -406,6 +410,7 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreated != nil { @@ -439,7 +444,7 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_conversations_webhooks.go b/rest/conversations/v1/services_conversations_webhooks.go index 6bdc940ce..7ede0f283 100644 --- a/rest/conversations/v1/services_conversations_webhooks.go +++ b/rest/conversations/v1/services_conversations_webhooks.go @@ -77,6 +77,7 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Target != nil { @@ -105,7 +106,7 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin data.Set("Configuration.ReplayAfter", fmt.Sprint(*params.ConfigurationReplayAfter)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,9 +129,10 @@ func (c *ApiService) DeleteServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -148,9 +150,10 @@ func (c *ApiService) FetchServiceConversationScopedWebhook(ChatServiceSid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -190,10 +193,11 @@ func (c *ApiService) PageServiceConversationScopedWebhook(ChatServiceSid string, path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -203,7 +207,7 @@ func (c *ApiService) PageServiceConversationScopedWebhook(ChatServiceSid string, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -290,7 +294,7 @@ func (c *ApiService) getNextListServiceConversationScopedWebhookResponse(nextPag if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -347,6 +351,7 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ConfigurationUrl != nil { @@ -369,7 +374,7 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_participant_conversations.go b/rest/conversations/v1/services_participant_conversations.go index 745cea43f..381824346 100644 --- a/rest/conversations/v1/services_participant_conversations.go +++ b/rest/conversations/v1/services_participant_conversations.go @@ -59,16 +59,17 @@ func (c *ApiService) PageServiceParticipantConversation(ChatServiceSid string, p path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) + queryParams.Set("Identity", *params.Identity) } if params != nil && params.Address != nil { - data.Set("Address", *params.Address) + queryParams.Set("Address", *params.Address) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -78,7 +79,7 @@ func (c *ApiService) PageServiceParticipantConversation(ChatServiceSid string, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -165,7 +166,7 @@ func (c *ApiService) getNextListServiceParticipantConversationResponse(nextPageU if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_roles.go b/rest/conversations/v1/services_roles.go index 9e97aa28d..cec119191 100644 --- a/rest/conversations/v1/services_roles.go +++ b/rest/conversations/v1/services_roles.go @@ -52,6 +52,7 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -66,7 +67,7 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -88,9 +89,10 @@ func (c *ApiService) DeleteServiceRole(ChatServiceSid string, Sid string) error path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -107,9 +109,10 @@ func (c *ApiService) FetchServiceRole(ChatServiceSid string, Sid string) (*Conve path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,10 +151,11 @@ func (c *ApiService) PageServiceRole(ChatServiceSid string, params *ListServiceR path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -161,7 +165,7 @@ func (c *ApiService) PageServiceRole(ChatServiceSid string, params *ListServiceR data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -248,7 +252,7 @@ func (c *ApiService) getNextListServiceRoleResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -280,6 +284,7 @@ func (c *ApiService) UpdateServiceRole(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Permission != nil { @@ -288,7 +293,7 @@ func (c *ApiService) UpdateServiceRole(ChatServiceSid string, Sid string, params } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_users.go b/rest/conversations/v1/services_users.go index 40e29b09d..4739ddf62 100644 --- a/rest/conversations/v1/services_users.go +++ b/rest/conversations/v1/services_users.go @@ -64,6 +64,7 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -82,7 +83,7 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -115,12 +116,13 @@ func (c *ApiService) DeleteServiceUser(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -137,9 +139,10 @@ func (c *ApiService) FetchServiceUser(ChatServiceSid string, Sid string) (*Conve path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -178,10 +181,11 @@ func (c *ApiService) PageServiceUser(ChatServiceSid string, params *ListServiceU path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -191,7 +195,7 @@ func (c *ApiService) PageServiceUser(ChatServiceSid string, params *ListServiceU data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -278,7 +282,7 @@ func (c *ApiService) getNextListServiceUserResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -328,6 +332,7 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -343,7 +348,7 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/services_users_conversations.go b/rest/conversations/v1/services_users_conversations.go index 9db74c531..07e755557 100644 --- a/rest/conversations/v1/services_users_conversations.go +++ b/rest/conversations/v1/services_users_conversations.go @@ -32,9 +32,10 @@ func (c *ApiService) DeleteServiceUserConversation(ChatServiceSid string, UserSi path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -52,9 +53,10 @@ func (c *ApiService) FetchServiceUserConversation(ChatServiceSid string, UserSid path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -94,10 +96,11 @@ func (c *ApiService) PageServiceUserConversation(ChatServiceSid string, UserSid path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -107,7 +110,7 @@ func (c *ApiService) PageServiceUserConversation(ChatServiceSid string, UserSid data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -194,7 +197,7 @@ func (c *ApiService) getNextListServiceUserConversationResponse(nextPageUrl stri if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -239,6 +242,7 @@ func (c *ApiService) UpdateServiceUserConversation(ChatServiceSid string, UserSi path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.NotificationLevel != nil { @@ -251,7 +255,7 @@ func (c *ApiService) UpdateServiceUserConversation(ChatServiceSid string, UserSi data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/users.go b/rest/conversations/v1/users.go index a02e51542..7f54396a1 100644 --- a/rest/conversations/v1/users.go +++ b/rest/conversations/v1/users.go @@ -63,6 +63,7 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, path := "/v1/Users" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -81,7 +82,7 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -113,12 +114,13 @@ func (c *ApiService) DeleteUser(Sid string, params *DeleteUserParams) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -134,9 +136,10 @@ func (c *ApiService) FetchUser(Sid string) (*ConversationsV1User, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,10 +176,11 @@ func (c *ApiService) PageUser(params *ListUserParams, pageToken, pageNumber stri path := "/v1/Users" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -186,7 +190,7 @@ func (c *ApiService) PageUser(params *ListUserParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -273,7 +277,7 @@ func (c *ApiService) getNextListUserResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -322,6 +326,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -337,7 +342,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/conversations/v1/users_conversations.go b/rest/conversations/v1/users_conversations.go index 9e31f8968..687ebdacb 100644 --- a/rest/conversations/v1/users_conversations.go +++ b/rest/conversations/v1/users_conversations.go @@ -31,9 +31,10 @@ func (c *ApiService) DeleteUserConversation(UserSid string, ConversationSid stri path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -50,9 +51,10 @@ func (c *ApiService) FetchUserConversation(UserSid string, ConversationSid strin path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -91,10 +93,11 @@ func (c *ApiService) PageUserConversation(UserSid string, params *ListUserConver path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -104,7 +107,7 @@ func (c *ApiService) PageUserConversation(UserSid string, params *ListUserConver data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -191,7 +194,7 @@ func (c *ApiService) getNextListUserConversationResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -235,6 +238,7 @@ func (c *ApiService) UpdateUserConversation(UserSid string, ConversationSid stri path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.NotificationLevel != nil { @@ -247,7 +251,7 @@ func (c *ApiService) UpdateUserConversation(UserSid string, ConversationSid stri data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/README.md b/rest/events/v1/README.md index c2fa6c7b5..0442dd949 100644 --- a/rest/events/v1/README.md +++ b/rest/events/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/events/v1/schemas.go b/rest/events/v1/schemas.go index f17c80ec5..40a3c821c 100644 --- a/rest/events/v1/schemas.go +++ b/rest/events/v1/schemas.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchSchema(Id string) (*EventsV1Schema, error) { path = strings.Replace(path, "{"+"Id"+"}", Id, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/schemas_versions.go b/rest/events/v1/schemas_versions.go index 84aaa0292..2123a67aa 100644 --- a/rest/events/v1/schemas_versions.go +++ b/rest/events/v1/schemas_versions.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchSchemaVersion(Id string, SchemaVersion int) (*EventsV1 path = strings.Replace(path, "{"+"SchemaVersion"+"}", fmt.Sprint(SchemaVersion), -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,10 +72,11 @@ func (c *ApiService) PageSchemaVersion(Id string, params *ListSchemaVersionParam path = strings.Replace(path, "{"+"Id"+"}", Id, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -84,7 +86,7 @@ func (c *ApiService) PageSchemaVersion(Id string, params *ListSchemaVersionParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,7 +173,7 @@ func (c *ApiService) getNextListSchemaVersionResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/events/v1/sinks.go b/rest/events/v1/sinks.go index d8be25b86..9c47a9559 100644 --- a/rest/events/v1/sinks.go +++ b/rest/events/v1/sinks.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) path := "/v1/Sinks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Description != nil { @@ -69,7 +70,7 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) data.Set("SinkType", *params.SinkType) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -90,9 +91,10 @@ func (c *ApiService) DeleteSink(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -108,9 +110,10 @@ func (c *ApiService) FetchSink(Sid string) (*EventsV1Sink, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -159,16 +162,17 @@ func (c *ApiService) PageSink(params *ListSinkParams, pageToken, pageNumber stri path := "/v1/Sinks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.InUse != nil { - data.Set("InUse", fmt.Sprint(*params.InUse)) + queryParams.Set("InUse", fmt.Sprint(*params.InUse)) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -178,7 +182,7 @@ func (c *ApiService) PageSink(params *ListSinkParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -265,7 +269,7 @@ func (c *ApiService) getNextListSinkResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -296,13 +300,14 @@ func (c *ApiService) UpdateSink(Sid string, params *UpdateSinkParams) (*EventsV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Description != nil { data.Set("Description", *params.Description) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/sinks_test_.go b/rest/events/v1/sinks_test_.go index 4fb88f431..02224c49e 100644 --- a/rest/events/v1/sinks_test_.go +++ b/rest/events/v1/sinks_test_.go @@ -26,9 +26,10 @@ func (c *ApiService) CreateSinkTest(Sid string) (*EventsV1SinkTest, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/sinks_validate.go b/rest/events/v1/sinks_validate.go index 691d80272..a5eb36e76 100644 --- a/rest/events/v1/sinks_validate.go +++ b/rest/events/v1/sinks_validate.go @@ -37,13 +37,14 @@ func (c *ApiService) CreateSinkValidate(Sid string, params *CreateSinkValidatePa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TestId != nil { data.Set("TestId", *params.TestId) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/subscriptions.go b/rest/events/v1/subscriptions.go index d7dcbb567..39ef88ca7 100644 --- a/rest/events/v1/subscriptions.go +++ b/rest/events/v1/subscriptions.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even path := "/v1/Subscriptions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Description != nil { @@ -71,7 +72,7 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -92,9 +93,10 @@ func (c *ApiService) DeleteSubscription(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -110,9 +112,10 @@ func (c *ApiService) FetchSubscription(Sid string) (*EventsV1Subscription, error path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -155,13 +158,14 @@ func (c *ApiService) PageSubscription(params *ListSubscriptionParams, pageToken, path := "/v1/Subscriptions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SinkSid != nil { - data.Set("SinkSid", *params.SinkSid) + queryParams.Set("SinkSid", *params.SinkSid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -171,7 +175,7 @@ func (c *ApiService) PageSubscription(params *ListSubscriptionParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -258,7 +262,7 @@ func (c *ApiService) getNextListSubscriptionResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -295,6 +299,7 @@ func (c *ApiService) UpdateSubscription(Sid string, params *UpdateSubscriptionPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Description != nil { @@ -304,7 +309,7 @@ func (c *ApiService) UpdateSubscription(Sid string, params *UpdateSubscriptionPa data.Set("SinkSid", *params.SinkSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/subscriptions_subscribed_events.go b/rest/events/v1/subscriptions_subscribed_events.go index 3e9f72655..1675a8880 100644 --- a/rest/events/v1/subscriptions_subscribed_events.go +++ b/rest/events/v1/subscriptions_subscribed_events.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateSubscribedEvent(SubscriptionSid string, params *Creat path = strings.Replace(path, "{"+"SubscriptionSid"+"}", SubscriptionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateSubscribedEvent(SubscriptionSid string, params *Creat data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteSubscribedEvent(SubscriptionSid string, Type string) path = strings.Replace(path, "{"+"Type"+"}", Type, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchSubscribedEvent(SubscriptionSid string, Type string) ( path = strings.Replace(path, "{"+"Type"+"}", Type, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageSubscribedEvent(SubscriptionSid string, params *ListSub path = strings.Replace(path, "{"+"SubscriptionSid"+"}", SubscriptionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageSubscribedEvent(SubscriptionSid string, params *ListSub data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListSubscribedEventResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -269,13 +273,14 @@ func (c *ApiService) UpdateSubscribedEvent(SubscriptionSid string, Type string, path = strings.Replace(path, "{"+"Type"+"}", Type, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SchemaVersion != nil { data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/events/v1/types.go b/rest/events/v1/types.go index a0423bc62..347e0eb0c 100644 --- a/rest/events/v1/types.go +++ b/rest/events/v1/types.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchEventType(Type string) (*EventsV1EventType, error) { path = strings.Replace(path, "{"+"Type"+"}", Type, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -74,13 +75,14 @@ func (c *ApiService) PageEventType(params *ListEventTypeParams, pageToken, pageN path := "/v1/Types" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SchemaId != nil { - data.Set("SchemaId", *params.SchemaId) + queryParams.Set("SchemaId", *params.SchemaId) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -90,7 +92,7 @@ func (c *ApiService) PageEventType(params *ListEventTypeParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,7 +179,7 @@ func (c *ApiService) getNextListEventTypeResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/flex/v1/README.md b/rest/flex/v1/README.md index 52e44678b..5dd05be67 100644 --- a/rest/flex/v1/README.md +++ b/rest/flex/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/flex/v1/account_provision_status.go b/rest/flex/v1/account_provision_status.go index f24e5a0e4..9ff250ff3 100644 --- a/rest/flex/v1/account_provision_status.go +++ b/rest/flex/v1/account_provision_status.go @@ -19,14 +19,14 @@ import ( "net/url" ) -// func (c *ApiService) FetchProvisioningStatus() (*FlexV1ProvisioningStatus, error) { path := "/v1/account/provision/status" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/channels.go b/rest/flex/v1/channels.go index ddf91c9f7..3843e318b 100644 --- a/rest/flex/v1/channels.go +++ b/rest/flex/v1/channels.go @@ -88,11 +88,11 @@ func (params *CreateChannelParams) SetLongLived(LongLived bool) *CreateChannelPa return params } -// func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, error) { path := "/v1/Channels" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FlexFlowSid != nil { @@ -126,7 +126,7 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, data.Set("LongLived", fmt.Sprint(*params.LongLived)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,15 +141,15 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, return ps, err } -// func (c *ApiService) DeleteChannel(Sid string) error { path := "/v1/Channels/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -159,15 +159,15 @@ func (c *ApiService) DeleteChannel(Sid string) error { return nil } -// func (c *ApiService) FetchChannel(Sid string) (*FlexV1Channel, error) { path := "/v1/Channels/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -204,10 +204,11 @@ func (c *ApiService) PageChannel(params *ListChannelParams, pageToken, pageNumbe path := "/v1/Channels" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -217,7 +218,7 @@ func (c *ApiService) PageChannel(params *ListChannelParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -304,7 +305,7 @@ func (c *ApiService) getNextListChannelResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/flex/v1/configuration.go b/rest/flex/v1/configuration.go index a106cb399..c9c8fa8b9 100644 --- a/rest/flex/v1/configuration.go +++ b/rest/flex/v1/configuration.go @@ -30,18 +30,18 @@ func (params *FetchConfigurationParams) SetUiVersion(UiVersion string) *FetchCon return params } -// func (c *ApiService) FetchConfiguration(params *FetchConfigurationParams) (*FlexV1Configuration, error) { path := "/v1/Configuration" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UiVersion != nil { - data.Set("UiVersion", *params.UiVersion) + queryParams.Set("UiVersion", *params.UiVersion) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/flex_flows.go b/rest/flex/v1/flex_flows.go index 705066713..5b66d976a 100644 --- a/rest/flex/v1/flex_flows.go +++ b/rest/flex/v1/flex_flows.go @@ -130,11 +130,11 @@ func (params *CreateFlexFlowParams) SetIntegrationRetryCount(IntegrationRetryCou return params } -// func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFlow, error) { path := "/v1/FlexFlows" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -189,7 +189,7 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl data.Set("Integration.RetryCount", fmt.Sprint(*params.IntegrationRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -204,15 +204,15 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl return ps, err } -// func (c *ApiService) DeleteFlexFlow(Sid string) error { path := "/v1/FlexFlows/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -222,15 +222,15 @@ func (c *ApiService) DeleteFlexFlow(Sid string) error { return nil } -// func (c *ApiService) FetchFlexFlow(Sid string) (*FlexV1FlexFlow, error) { path := "/v1/FlexFlows/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -273,13 +273,14 @@ func (c *ApiService) PageFlexFlow(params *ListFlexFlowParams, pageToken, pageNum path := "/v1/FlexFlows" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -289,7 +290,7 @@ func (c *ApiService) PageFlexFlow(params *ListFlexFlowParams, pageToken, pageNum data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -376,7 +377,7 @@ func (c *ApiService) getNextListFlexFlowResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -497,12 +498,12 @@ func (params *UpdateFlexFlowParams) SetIntegrationRetryCount(IntegrationRetryCou return params } -// func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (*FlexV1FlexFlow, error) { path := "/v1/FlexFlows/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -557,7 +558,7 @@ func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (* data.Set("Integration.RetryCount", fmt.Sprint(*params.IntegrationRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_conversations.go b/rest/flex/v1/insights_conversations.go index e11742e53..6fe579ae7 100644 --- a/rest/flex/v1/insights_conversations.go +++ b/rest/flex/v1/insights_conversations.go @@ -56,13 +56,14 @@ func (c *ApiService) PageInsightsConversations(params *ListInsightsConversations path := "/v1/Insights/Conversations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) + queryParams.Set("SegmentId", *params.SegmentId) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -72,7 +73,7 @@ func (c *ApiService) PageInsightsConversations(params *ListInsightsConversations data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -159,7 +160,7 @@ func (c *ApiService) getNextListInsightsConversationsResponse(nextPageUrl string if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_assessments.go b/rest/flex/v1/insights_quality_management_assessments.go index 4ccb6e843..a517bc11b 100644 --- a/rest/flex/v1/insights_quality_management_assessments.go +++ b/rest/flex/v1/insights_quality_management_assessments.go @@ -99,6 +99,7 @@ func (c *ApiService) CreateInsightsAssessments(params *CreateInsightsAssessments path := "/v1/Insights/QualityManagement/Assessments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CategorySid != nil { @@ -135,7 +136,7 @@ func (c *ApiService) CreateInsightsAssessments(params *CreateInsightsAssessments if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -184,13 +185,14 @@ func (c *ApiService) PageInsightsAssessments(params *ListInsightsAssessmentsPara path := "/v1/Insights/QualityManagement/Assessments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) + queryParams.Set("SegmentId", *params.SegmentId) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -200,7 +202,7 @@ func (c *ApiService) PageInsightsAssessments(params *ListInsightsAssessmentsPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -287,7 +289,7 @@ func (c *ApiService) getNextListInsightsAssessmentsResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -336,6 +338,7 @@ func (c *ApiService) UpdateInsightsAssessments(AssessmentSid string, params *Upd path = strings.Replace(path, "{"+"AssessmentSid"+"}", AssessmentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Offset != nil { @@ -351,7 +354,7 @@ func (c *ApiService) UpdateInsightsAssessments(AssessmentSid string, params *Upd if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_assessments_comments.go b/rest/flex/v1/insights_quality_management_assessments_comments.go index cd454e340..e8d09dee7 100644 --- a/rest/flex/v1/insights_quality_management_assessments_comments.go +++ b/rest/flex/v1/insights_quality_management_assessments_comments.go @@ -74,6 +74,7 @@ func (c *ApiService) CreateInsightsAssessmentsComment(params *CreateInsightsAsse path := "/v1/Insights/QualityManagement/Assessments/Comments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CategoryId != nil { @@ -98,7 +99,7 @@ func (c *ApiService) CreateInsightsAssessmentsComment(params *CreateInsightsAsse if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -153,16 +154,17 @@ func (c *ApiService) PageInsightsAssessmentsComment(params *ListInsightsAssessme path := "/v1/Insights/QualityManagement/Assessments/Comments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) + queryParams.Set("SegmentId", *params.SegmentId) } if params != nil && params.AgentId != nil { - data.Set("AgentId", *params.AgentId) + queryParams.Set("AgentId", *params.AgentId) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +174,7 @@ func (c *ApiService) PageInsightsAssessmentsComment(params *ListInsightsAssessme data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +261,7 @@ func (c *ApiService) getNextListInsightsAssessmentsCommentResponse(nextPageUrl s if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_categories.go b/rest/flex/v1/insights_quality_management_categories.go index 8e1d5d795..c9ad16576 100644 --- a/rest/flex/v1/insights_quality_management_categories.go +++ b/rest/flex/v1/insights_quality_management_categories.go @@ -45,6 +45,7 @@ func (c *ApiService) CreateInsightsQuestionnairesCategory(params *CreateInsights path := "/v1/Insights/QualityManagement/Categories" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Name != nil { @@ -54,7 +55,7 @@ func (c *ApiService) CreateInsightsQuestionnairesCategory(params *CreateInsights if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -80,18 +81,18 @@ func (params *DeleteInsightsQuestionnairesCategoryParams) SetAuthorization(Autho return params } -// func (c *ApiService) DeleteInsightsQuestionnairesCategory(CategorySid string, params *DeleteInsightsQuestionnairesCategoryParams) error { path := "/v1/Insights/QualityManagement/Categories/{CategorySid}" path = strings.Replace(path, "{"+"CategorySid"+"}", CategorySid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -129,10 +130,11 @@ func (c *ApiService) PageInsightsQuestionnairesCategory(params *ListInsightsQues path := "/v1/Insights/QualityManagement/Categories" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -142,7 +144,7 @@ func (c *ApiService) PageInsightsQuestionnairesCategory(params *ListInsightsQues data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -229,7 +231,7 @@ func (c *ApiService) getNextListInsightsQuestionnairesCategoryResponse(nextPageU if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -266,6 +268,7 @@ func (c *ApiService) UpdateInsightsQuestionnairesCategory(CategorySid string, pa path = strings.Replace(path, "{"+"CategorySid"+"}", CategorySid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Name != nil { @@ -275,7 +278,7 @@ func (c *ApiService) UpdateInsightsQuestionnairesCategory(CategorySid string, pa if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_questionnaires.go b/rest/flex/v1/insights_quality_management_questionnaires.go index b494dd3fc..9022a93dd 100644 --- a/rest/flex/v1/insights_quality_management_questionnaires.go +++ b/rest/flex/v1/insights_quality_management_questionnaires.go @@ -63,6 +63,7 @@ func (c *ApiService) CreateInsightsQuestionnaires(params *CreateInsightsQuestion path := "/v1/Insights/QualityManagement/Questionnaires" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Name != nil { @@ -83,7 +84,7 @@ func (c *ApiService) CreateInsightsQuestionnaires(params *CreateInsightsQuestion if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -115,12 +116,13 @@ func (c *ApiService) DeleteInsightsQuestionnaires(QuestionnaireSid string, param path = strings.Replace(path, "{"+"QuestionnaireSid"+"}", QuestionnaireSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -147,12 +149,13 @@ func (c *ApiService) FetchInsightsQuestionnaires(QuestionnaireSid string, params path = strings.Replace(path, "{"+"QuestionnaireSid"+"}", QuestionnaireSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -201,13 +204,14 @@ func (c *ApiService) PageInsightsQuestionnaires(params *ListInsightsQuestionnair path := "/v1/Insights/QualityManagement/Questionnaires" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IncludeInactive != nil { - data.Set("IncludeInactive", fmt.Sprint(*params.IncludeInactive)) + queryParams.Set("IncludeInactive", fmt.Sprint(*params.IncludeInactive)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -217,7 +221,7 @@ func (c *ApiService) PageInsightsQuestionnaires(params *ListInsightsQuestionnair data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -304,7 +308,7 @@ func (c *ApiService) getNextListInsightsQuestionnairesResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -359,6 +363,7 @@ func (c *ApiService) UpdateInsightsQuestionnaires(QuestionnaireSid string, param path = strings.Replace(path, "{"+"QuestionnaireSid"+"}", QuestionnaireSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Active != nil { @@ -379,7 +384,7 @@ func (c *ApiService) UpdateInsightsQuestionnaires(QuestionnaireSid string, param if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_questions.go b/rest/flex/v1/insights_quality_management_questions.go index b2128f4ca..c1bce3426 100644 --- a/rest/flex/v1/insights_quality_management_questions.go +++ b/rest/flex/v1/insights_quality_management_questions.go @@ -69,6 +69,7 @@ func (c *ApiService) CreateInsightsQuestionnairesQuestion(params *CreateInsights path := "/v1/Insights/QualityManagement/Questions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CategorySid != nil { @@ -90,7 +91,7 @@ func (c *ApiService) CreateInsightsQuestionnairesQuestion(params *CreateInsights if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -116,18 +117,18 @@ func (params *DeleteInsightsQuestionnairesQuestionParams) SetAuthorization(Autho return params } -// func (c *ApiService) DeleteInsightsQuestionnairesQuestion(QuestionSid string, params *DeleteInsightsQuestionnairesQuestionParams) error { path := "/v1/Insights/QualityManagement/Questions/{QuestionSid}" path = strings.Replace(path, "{"+"QuestionSid"+"}", QuestionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -171,15 +172,16 @@ func (c *ApiService) PageInsightsQuestionnairesQuestion(params *ListInsightsQues path := "/v1/Insights/QualityManagement/Questions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CategorySid != nil { for _, item := range *params.CategorySid { - data.Add("CategorySid", item) + queryParams.Add("CategorySid", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -189,7 +191,7 @@ func (c *ApiService) PageInsightsQuestionnairesQuestion(params *ListInsightsQues data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -276,7 +278,7 @@ func (c *ApiService) getNextListInsightsQuestionnairesQuestionResponse(nextPageU if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -337,6 +339,7 @@ func (c *ApiService) UpdateInsightsQuestionnairesQuestion(QuestionSid string, pa path = strings.Replace(path, "{"+"QuestionSid"+"}", QuestionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AllowNa != nil { @@ -358,7 +361,7 @@ func (c *ApiService) UpdateInsightsQuestionnairesQuestion(QuestionSid string, pa if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_settings_answer_sets.go b/rest/flex/v1/insights_quality_management_settings_answer_sets.go index 00a60d9eb..82c33f16f 100644 --- a/rest/flex/v1/insights_quality_management_settings_answer_sets.go +++ b/rest/flex/v1/insights_quality_management_settings_answer_sets.go @@ -35,12 +35,13 @@ func (c *ApiService) FetchInsightsSettingsAnswersets(params *FetchInsightsSettin path := "/v1/Insights/QualityManagement/Settings/AnswerSets" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_quality_management_settings_comment_tags.go b/rest/flex/v1/insights_quality_management_settings_comment_tags.go index fece2f75a..f07ea4d7d 100644 --- a/rest/flex/v1/insights_quality_management_settings_comment_tags.go +++ b/rest/flex/v1/insights_quality_management_settings_comment_tags.go @@ -35,12 +35,13 @@ func (c *ApiService) FetchInsightsSettingsComment(params *FetchInsightsSettingsC path := "/v1/Insights/QualityManagement/Settings/CommentTags" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_segments.go b/rest/flex/v1/insights_segments.go index bd0514767..3549316cc 100644 --- a/rest/flex/v1/insights_segments.go +++ b/rest/flex/v1/insights_segments.go @@ -62,18 +62,19 @@ func (c *ApiService) PageInsightsSegments(params *ListInsightsSegmentsParams, pa path := "/v1/Insights/Segments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) + queryParams.Set("SegmentId", *params.SegmentId) } if params != nil && params.ReservationId != nil { for _, item := range *params.ReservationId { - data.Add("ReservationId", item) + queryParams.Add("ReservationId", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -83,7 +84,7 @@ func (c *ApiService) PageInsightsSegments(params *ListInsightsSegmentsParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -170,7 +171,7 @@ func (c *ApiService) getNextListInsightsSegmentsResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_session.go b/rest/flex/v1/insights_session.go index 3ce21ef98..794a9954b 100644 --- a/rest/flex/v1/insights_session.go +++ b/rest/flex/v1/insights_session.go @@ -35,12 +35,13 @@ func (c *ApiService) CreateInsightsSession(params *CreateInsightsSessionParams) path := "/v1/Insights/Session" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/insights_user_roles.go b/rest/flex/v1/insights_user_roles.go index 18b96566d..be38641b7 100644 --- a/rest/flex/v1/insights_user_roles.go +++ b/rest/flex/v1/insights_user_roles.go @@ -35,12 +35,13 @@ func (c *ApiService) FetchInsightsUserRoles(params *FetchInsightsUserRolesParams path := "/v1/Insights/UserRoles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/interactions.go b/rest/flex/v1/interactions.go index fb0d949a7..e846d98f0 100644 --- a/rest/flex/v1/interactions.go +++ b/rest/flex/v1/interactions.go @@ -48,6 +48,7 @@ func (c *ApiService) CreateInteraction(params *CreateInteractionParams) (*FlexV1 path := "/v1/Interactions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Channel != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateInteraction(params *CreateInteractionParams) (*FlexV1 data.Set("InteractionContextSid", *params.InteractionContextSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -87,15 +88,15 @@ func (c *ApiService) CreateInteraction(params *CreateInteractionParams) (*FlexV1 return ps, err } -// func (c *ApiService) FetchInteraction(Sid string) (*FlexV1Interaction, error) { path := "/v1/Interactions/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/interactions_channels.go b/rest/flex/v1/interactions_channels.go index 594818e16..ecae7da09 100644 --- a/rest/flex/v1/interactions_channels.go +++ b/rest/flex/v1/interactions_channels.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchInteractionChannel(InteractionSid string, Sid string) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,10 +72,11 @@ func (c *ApiService) PageInteractionChannel(InteractionSid string, params *ListI path = strings.Replace(path, "{"+"InteractionSid"+"}", InteractionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -84,7 +86,7 @@ func (c *ApiService) PageInteractionChannel(InteractionSid string, params *ListI data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,7 +173,7 @@ func (c *ApiService) getNextListInteractionChannelResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -209,6 +211,7 @@ func (c *ApiService) UpdateInteractionChannel(InteractionSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -224,7 +227,7 @@ func (c *ApiService) UpdateInteractionChannel(InteractionSid string, Sid string, data.Set("Routing", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/interactions_channels_invites.go b/rest/flex/v1/interactions_channels_invites.go index 9f831a849..5613e1585 100644 --- a/rest/flex/v1/interactions_channels_invites.go +++ b/rest/flex/v1/interactions_channels_invites.go @@ -41,6 +41,7 @@ func (c *ApiService) CreateInteractionChannelInvite(InteractionSid string, Chann path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Routing != nil { @@ -53,7 +54,7 @@ func (c *ApiService) CreateInteractionChannelInvite(InteractionSid string, Chann data.Set("Routing", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,10 +94,11 @@ func (c *ApiService) PageInteractionChannelInvite(InteractionSid string, Channel path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +108,7 @@ func (c *ApiService) PageInteractionChannelInvite(InteractionSid string, Channel data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +195,7 @@ func (c *ApiService) getNextListInteractionChannelInviteResponse(nextPageUrl str if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/flex/v1/interactions_channels_participants.go b/rest/flex/v1/interactions_channels_participants.go index 3550249c1..9cef90416 100644 --- a/rest/flex/v1/interactions_channels_participants.go +++ b/rest/flex/v1/interactions_channels_participants.go @@ -47,6 +47,7 @@ func (c *ApiService) CreateInteractionChannelParticipant(InteractionSid string, path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -62,7 +63,7 @@ func (c *ApiService) CreateInteractionChannelParticipant(InteractionSid string, data.Set("MediaProperties", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,10 +103,11 @@ func (c *ApiService) PageInteractionChannelParticipant(InteractionSid string, Ch path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -115,7 +117,7 @@ func (c *ApiService) PageInteractionChannelParticipant(InteractionSid string, Ch data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -202,7 +204,7 @@ func (c *ApiService) getNextListInteractionChannelParticipantResponse(nextPageUr if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -235,13 +237,14 @@ func (c *ApiService) UpdateInteractionChannelParticipant(InteractionSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v1/web_channels.go b/rest/flex/v1/web_channels.go index 589a70e06..8ba77d222 100644 --- a/rest/flex/v1/web_channels.go +++ b/rest/flex/v1/web_channels.go @@ -64,11 +64,11 @@ func (params *CreateWebChannelParams) SetPreEngagementData(PreEngagementData str return params } -// func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1WebChannel, error) { path := "/v1/WebChannels" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FlexFlowSid != nil { @@ -90,7 +90,7 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We data.Set("PreEngagementData", *params.PreEngagementData) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -105,15 +105,15 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We return ps, err } -// func (c *ApiService) DeleteWebChannel(Sid string) error { path := "/v1/WebChannels/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -123,15 +123,15 @@ func (c *ApiService) DeleteWebChannel(Sid string) error { return nil } -// func (c *ApiService) FetchWebChannel(Sid string) (*FlexV1WebChannel, error) { path := "/v1/WebChannels/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,10 +168,11 @@ func (c *ApiService) PageWebChannel(params *ListWebChannelParams, pageToken, pag path := "/v1/WebChannels" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -181,7 +182,7 @@ func (c *ApiService) PageWebChannel(params *ListWebChannelParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -268,7 +269,7 @@ func (c *ApiService) getNextListWebChannelResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -299,12 +300,12 @@ func (params *UpdateWebChannelParams) SetPostEngagementData(PostEngagementData s return params } -// func (c *ApiService) UpdateWebChannel(Sid string, params *UpdateWebChannelParams) (*FlexV1WebChannel, error) { path := "/v1/WebChannels/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ChatStatus != nil { @@ -314,7 +315,7 @@ func (c *ApiService) UpdateWebChannel(Sid string, params *UpdateWebChannelParams data.Set("PostEngagementData", *params.PostEngagementData) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/flex/v2/README.md b/rest/flex/v2/README.md index 6c7e842e2..e59505bba 100644 --- a/rest/flex/v2/README.md +++ b/rest/flex/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/flex/v2/web_chats.go b/rest/flex/v2/web_chats.go index e54716669..2cc2b82c6 100644 --- a/rest/flex/v2/web_chats.go +++ b/rest/flex/v2/web_chats.go @@ -48,11 +48,11 @@ func (params *CreateWebChannelParams) SetPreEngagementData(PreEngagementData str return params } -// func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV2WebChannel, error) { path := "/v2/WebChats" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AddressSid != nil { @@ -68,7 +68,7 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV2We data.Set("PreEngagementData", *params.PreEngagementData) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/frontline/v1/README.md b/rest/frontline/v1/README.md index 23f396812..762beecd2 100644 --- a/rest/frontline/v1/README.md +++ b/rest/frontline/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/frontline/v1/users.go b/rest/frontline/v1/users.go index b6994cab2..d4d7b933c 100644 --- a/rest/frontline/v1/users.go +++ b/rest/frontline/v1/users.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchUser(Sid string) (*FrontlineV1User, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,6 +80,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -94,7 +96,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin data.Set("IsAvailable", fmt.Sprint(*params.IsAvailable)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/insights/v1/README.md b/rest/insights/v1/README.md index 3a36b9d6a..5f624bb1d 100644 --- a/rest/insights/v1/README.md +++ b/rest/insights/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/insights/v1/conferences.go b/rest/insights/v1/conferences.go index 9572448bf..72792bf3d 100644 --- a/rest/insights/v1/conferences.go +++ b/rest/insights/v1/conferences.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchConference(ConferenceSid string) (*InsightsV1Conferenc path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,40 +129,41 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken, pag path := "/v1/Conferences" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ConferenceSid != nil { - data.Set("ConferenceSid", *params.ConferenceSid) + queryParams.Set("ConferenceSid", *params.ConferenceSid) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.CreatedAfter != nil { - data.Set("CreatedAfter", *params.CreatedAfter) + queryParams.Set("CreatedAfter", *params.CreatedAfter) } if params != nil && params.CreatedBefore != nil { - data.Set("CreatedBefore", *params.CreatedBefore) + queryParams.Set("CreatedBefore", *params.CreatedBefore) } if params != nil && params.MixerRegion != nil { - data.Set("MixerRegion", *params.MixerRegion) + queryParams.Set("MixerRegion", *params.MixerRegion) } if params != nil && params.Tags != nil { - data.Set("Tags", *params.Tags) + queryParams.Set("Tags", *params.Tags) } if params != nil && params.Subaccount != nil { - data.Set("Subaccount", *params.Subaccount) + queryParams.Set("Subaccount", *params.Subaccount) } if params != nil && params.DetectedIssues != nil { - data.Set("DetectedIssues", *params.DetectedIssues) + queryParams.Set("DetectedIssues", *params.DetectedIssues) } if params != nil && params.EndReason != nil { - data.Set("EndReason", *params.EndReason) + queryParams.Set("EndReason", *params.EndReason) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -171,7 +173,7 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -258,7 +260,7 @@ func (c *ApiService) getNextListConferenceResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/conferences_participants.go b/rest/insights/v1/conferences_participants.go index c007560af..c9d8c6be3 100644 --- a/rest/insights/v1/conferences_participants.go +++ b/rest/insights/v1/conferences_participants.go @@ -47,16 +47,17 @@ func (c *ApiService) FetchConferenceParticipant(ConferenceSid string, Participan path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Events != nil { - data.Set("Events", *params.Events) + queryParams.Set("Events", *params.Events) } if params != nil && params.Metrics != nil { - data.Set("Metrics", *params.Metrics) + queryParams.Set("Metrics", *params.Metrics) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -113,19 +114,20 @@ func (c *ApiService) PageConferenceParticipant(ConferenceSid string, params *Lis path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ParticipantSid != nil { - data.Set("ParticipantSid", *params.ParticipantSid) + queryParams.Set("ParticipantSid", *params.ParticipantSid) } if params != nil && params.Label != nil { - data.Set("Label", *params.Label) + queryParams.Set("Label", *params.Label) } if params != nil && params.Events != nil { - data.Set("Events", *params.Events) + queryParams.Set("Events", *params.Events) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -135,7 +137,7 @@ func (c *ApiService) PageConferenceParticipant(ConferenceSid string, params *Lis data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -222,7 +224,7 @@ func (c *ApiService) getNextListConferenceParticipantResponse(nextPageUrl string if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/video_rooms.go b/rest/insights/v1/video_rooms.go index 632bb3a94..81604532c 100644 --- a/rest/insights/v1/video_rooms.go +++ b/rest/insights/v1/video_rooms.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchVideoRoomSummary(RoomSid string) (*InsightsV1VideoRoom path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -99,29 +100,30 @@ func (c *ApiService) PageVideoRoomSummary(params *ListVideoRoomSummaryParams, pa path := "/v1/Video/Rooms" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoomType != nil { for _, item := range *params.RoomType { - data.Add("RoomType", item) + queryParams.Add("RoomType", item) } } if params != nil && params.Codec != nil { for _, item := range *params.Codec { - data.Add("Codec", item) + queryParams.Add("Codec", item) } } if params != nil && params.RoomName != nil { - data.Set("RoomName", *params.RoomName) + queryParams.Set("RoomName", *params.RoomName) } if params != nil && params.CreatedAfter != nil { - data.Set("CreatedAfter", fmt.Sprint((*params.CreatedAfter).Format(time.RFC3339))) + queryParams.Set("CreatedAfter", fmt.Sprint((*params.CreatedAfter).Format(time.RFC3339))) } if params != nil && params.CreatedBefore != nil { - data.Set("CreatedBefore", fmt.Sprint((*params.CreatedBefore).Format(time.RFC3339))) + queryParams.Set("CreatedBefore", fmt.Sprint((*params.CreatedBefore).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -131,7 +133,7 @@ func (c *ApiService) PageVideoRoomSummary(params *ListVideoRoomSummaryParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -218,7 +220,7 @@ func (c *ApiService) getNextListVideoRoomSummaryResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/video_rooms_participants.go b/rest/insights/v1/video_rooms_participants.go index 9606f4ca6..70608e85c 100644 --- a/rest/insights/v1/video_rooms_participants.go +++ b/rest/insights/v1/video_rooms_participants.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchVideoParticipantSummary(RoomSid string, ParticipantSid path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,10 +72,11 @@ func (c *ApiService) PageVideoParticipantSummary(RoomSid string, params *ListVid path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -84,7 +86,7 @@ func (c *ApiService) PageVideoParticipantSummary(RoomSid string, params *ListVid data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,7 +173,7 @@ func (c *ApiService) getNextListVideoParticipantSummaryResponse(nextPageUrl stri if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice.go b/rest/insights/v1/voice.go index e78674854..f99b10e15 100644 --- a/rest/insights/v1/voice.go +++ b/rest/insights/v1/voice.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) FetchCall(Sid string) (*InsightsV1Call, error) { path := "/v1/Voice/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice_annotation.go b/rest/insights/v1/voice_annotation.go index ac6b88f5e..bbec40d61 100644 --- a/rest/insights/v1/voice_annotation.go +++ b/rest/insights/v1/voice_annotation.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchAnnotation(CallSid string) (*InsightsV1Annotation, err path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,6 +98,7 @@ func (c *ApiService) UpdateAnnotation(CallSid string, params *UpdateAnnotationPa path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AnsweredBy != nil { @@ -121,7 +123,7 @@ func (c *ApiService) UpdateAnnotation(CallSid string, params *UpdateAnnotationPa data.Set("Incident", *params.Incident) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice_events.go b/rest/insights/v1/voice_events.go index bdf7f2047..66a4c4d7c 100644 --- a/rest/insights/v1/voice_events.go +++ b/rest/insights/v1/voice_events.go @@ -53,13 +53,14 @@ func (c *ApiService) PageEvent(CallSid string, params *ListEventParams, pageToke path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Edge != nil { - data.Set("Edge", *params.Edge) + queryParams.Set("Edge", *params.Edge) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -69,7 +70,7 @@ func (c *ApiService) PageEvent(CallSid string, params *ListEventParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -156,7 +157,7 @@ func (c *ApiService) getNextListEventResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice_metrics.go b/rest/insights/v1/voice_metrics.go index d90683c0e..a020facd3 100644 --- a/rest/insights/v1/voice_metrics.go +++ b/rest/insights/v1/voice_metrics.go @@ -59,16 +59,17 @@ func (c *ApiService) PageMetric(CallSid string, params *ListMetricParams, pageTo path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Edge != nil { - data.Set("Edge", *params.Edge) + queryParams.Set("Edge", *params.Edge) } if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) + queryParams.Set("Direction", *params.Direction) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -78,7 +79,7 @@ func (c *ApiService) PageMetric(CallSid string, params *ListMetricParams, pageTo data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -165,7 +166,7 @@ func (c *ApiService) getNextListMetricResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice_settings.go b/rest/insights/v1/voice_settings.go index 7376eff22..5edf6cba7 100644 --- a/rest/insights/v1/voice_settings.go +++ b/rest/insights/v1/voice_settings.go @@ -36,13 +36,14 @@ func (c *ApiService) FetchAccountSettings(params *FetchAccountSettingsParams) (* path := "/v1/Voice/Settings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SubaccountSid != nil { - data.Set("SubaccountSid", *params.SubaccountSid) + queryParams.Set("SubaccountSid", *params.SubaccountSid) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -85,6 +86,7 @@ func (c *ApiService) UpdateAccountSettings(params *UpdateAccountSettingsParams) path := "/v1/Voice/Settings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AdvancedFeatures != nil { @@ -97,7 +99,7 @@ func (c *ApiService) UpdateAccountSettings(params *UpdateAccountSettingsParams) data.Set("SubaccountSid", *params.SubaccountSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice_summaries.go b/rest/insights/v1/voice_summaries.go index 1eb0fd7f9..3a098efb8 100644 --- a/rest/insights/v1/voice_summaries.go +++ b/rest/insights/v1/voice_summaries.go @@ -188,82 +188,83 @@ func (c *ApiService) PageCallSummaries(params *ListCallSummariesParams, pageToke path := "/v1/Voice/Summaries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.From != nil { - data.Set("From", *params.From) + queryParams.Set("From", *params.From) } if params != nil && params.To != nil { - data.Set("To", *params.To) + queryParams.Set("To", *params.To) } if params != nil && params.FromCarrier != nil { - data.Set("FromCarrier", *params.FromCarrier) + queryParams.Set("FromCarrier", *params.FromCarrier) } if params != nil && params.ToCarrier != nil { - data.Set("ToCarrier", *params.ToCarrier) + queryParams.Set("ToCarrier", *params.ToCarrier) } if params != nil && params.FromCountryCode != nil { - data.Set("FromCountryCode", *params.FromCountryCode) + queryParams.Set("FromCountryCode", *params.FromCountryCode) } if params != nil && params.ToCountryCode != nil { - data.Set("ToCountryCode", *params.ToCountryCode) + queryParams.Set("ToCountryCode", *params.ToCountryCode) } if params != nil && params.Branded != nil { - data.Set("Branded", fmt.Sprint(*params.Branded)) + queryParams.Set("Branded", fmt.Sprint(*params.Branded)) } if params != nil && params.VerifiedCaller != nil { - data.Set("VerifiedCaller", fmt.Sprint(*params.VerifiedCaller)) + queryParams.Set("VerifiedCaller", fmt.Sprint(*params.VerifiedCaller)) } if params != nil && params.HasTag != nil { - data.Set("HasTag", fmt.Sprint(*params.HasTag)) + queryParams.Set("HasTag", fmt.Sprint(*params.HasTag)) } if params != nil && params.StartTime != nil { - data.Set("StartTime", *params.StartTime) + queryParams.Set("StartTime", *params.StartTime) } if params != nil && params.EndTime != nil { - data.Set("EndTime", *params.EndTime) + queryParams.Set("EndTime", *params.EndTime) } if params != nil && params.CallType != nil { - data.Set("CallType", *params.CallType) + queryParams.Set("CallType", *params.CallType) } if params != nil && params.CallState != nil { - data.Set("CallState", *params.CallState) + queryParams.Set("CallState", *params.CallState) } if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) + queryParams.Set("Direction", *params.Direction) } if params != nil && params.ProcessingState != nil { - data.Set("ProcessingState", *params.ProcessingState) + queryParams.Set("ProcessingState", *params.ProcessingState) } if params != nil && params.SortBy != nil { - data.Set("SortBy", *params.SortBy) + queryParams.Set("SortBy", *params.SortBy) } if params != nil && params.Subaccount != nil { - data.Set("Subaccount", *params.Subaccount) + queryParams.Set("Subaccount", *params.Subaccount) } if params != nil && params.AbnormalSession != nil { - data.Set("AbnormalSession", fmt.Sprint(*params.AbnormalSession)) + queryParams.Set("AbnormalSession", fmt.Sprint(*params.AbnormalSession)) } if params != nil && params.AnsweredBy != nil { - data.Set("AnsweredBy", *params.AnsweredBy) + queryParams.Set("AnsweredBy", *params.AnsweredBy) } if params != nil && params.AnsweredByAnnotation != nil { - data.Set("AnsweredByAnnotation", *params.AnsweredByAnnotation) + queryParams.Set("AnsweredByAnnotation", *params.AnsweredByAnnotation) } if params != nil && params.ConnectivityIssueAnnotation != nil { - data.Set("ConnectivityIssueAnnotation", *params.ConnectivityIssueAnnotation) + queryParams.Set("ConnectivityIssueAnnotation", *params.ConnectivityIssueAnnotation) } if params != nil && params.QualityIssueAnnotation != nil { - data.Set("QualityIssueAnnotation", *params.QualityIssueAnnotation) + queryParams.Set("QualityIssueAnnotation", *params.QualityIssueAnnotation) } if params != nil && params.SpamAnnotation != nil { - data.Set("SpamAnnotation", fmt.Sprint(*params.SpamAnnotation)) + queryParams.Set("SpamAnnotation", fmt.Sprint(*params.SpamAnnotation)) } if params != nil && params.CallScoreAnnotation != nil { - data.Set("CallScoreAnnotation", *params.CallScoreAnnotation) + queryParams.Set("CallScoreAnnotation", *params.CallScoreAnnotation) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -273,7 +274,7 @@ func (c *ApiService) PageCallSummaries(params *ListCallSummariesParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -360,7 +361,7 @@ func (c *ApiService) getNextListCallSummariesResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/insights/v1/voice_summary.go b/rest/insights/v1/voice_summary.go index bd66f3148..a677216d1 100644 --- a/rest/insights/v1/voice_summary.go +++ b/rest/insights/v1/voice_summary.go @@ -37,13 +37,14 @@ func (c *ApiService) FetchSummary(CallSid string, params *FetchSummaryParams) (* path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ProcessingState != nil { - data.Set("ProcessingState", *params.ProcessingState) + queryParams.Set("ProcessingState", *params.ProcessingState) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/intelligence/v2/README.md b/rest/intelligence/v2/README.md index e698b61b3..26eb292db 100644 --- a/rest/intelligence/v2/README.md +++ b/rest/intelligence/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/intelligence/v2/services.go b/rest/intelligence/v2/services.go index 736d0c442..3c92b15de 100644 --- a/rest/intelligence/v2/services.go +++ b/rest/intelligence/v2/services.go @@ -87,6 +87,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IntelligenceV2 path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -117,7 +118,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IntelligenceV2 data.Set("WebhookHttpMethod", *params.WebhookHttpMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -138,9 +139,10 @@ func (c *ApiService) DeleteService(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -156,9 +158,10 @@ func (c *ApiService) FetchService(Sid string) (*IntelligenceV2Service, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -195,10 +198,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -208,7 +212,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -295,7 +299,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -380,6 +384,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*In path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AutoTranscribe != nil { @@ -413,7 +418,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*In if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/intelligence/v2/transcripts.go b/rest/intelligence/v2/transcripts.go index bb98dbd84..ec39144fc 100644 --- a/rest/intelligence/v2/transcripts.go +++ b/rest/intelligence/v2/transcripts.go @@ -58,6 +58,7 @@ func (c *ApiService) CreateTranscript(params *CreateTranscriptParams) (*Intellig path := "/v2/Transcripts" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ServiceSid != nil { @@ -79,7 +80,7 @@ func (c *ApiService) CreateTranscript(params *CreateTranscriptParams) (*Intellig data.Set("MediaStartTime", fmt.Sprint((*params.MediaStartTime).Format(time.RFC3339))) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -100,9 +101,10 @@ func (c *ApiService) DeleteTranscript(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -118,9 +120,10 @@ func (c *ApiService) FetchTranscript(Sid string) (*IntelligenceV2Transcript, err path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -205,34 +208,35 @@ func (c *ApiService) PageTranscript(params *ListTranscriptParams, pageToken, pag path := "/v2/Transcripts" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ServiceSid != nil { - data.Set("ServiceSid", *params.ServiceSid) + queryParams.Set("ServiceSid", *params.ServiceSid) } if params != nil && params.BeforeStartTime != nil { - data.Set("BeforeStartTime", *params.BeforeStartTime) + queryParams.Set("BeforeStartTime", *params.BeforeStartTime) } if params != nil && params.AfterStartTime != nil { - data.Set("AfterStartTime", *params.AfterStartTime) + queryParams.Set("AfterStartTime", *params.AfterStartTime) } if params != nil && params.BeforeDateCreated != nil { - data.Set("BeforeDateCreated", *params.BeforeDateCreated) + queryParams.Set("BeforeDateCreated", *params.BeforeDateCreated) } if params != nil && params.AfterDateCreated != nil { - data.Set("AfterDateCreated", *params.AfterDateCreated) + queryParams.Set("AfterDateCreated", *params.AfterDateCreated) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.LanguageCode != nil { - data.Set("LanguageCode", *params.LanguageCode) + queryParams.Set("LanguageCode", *params.LanguageCode) } if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) + queryParams.Set("SourceSid", *params.SourceSid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -242,7 +246,7 @@ func (c *ApiService) PageTranscript(params *ListTranscriptParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -329,7 +333,7 @@ func (c *ApiService) getNextListTranscriptResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/intelligence/v2/transcripts_media.go b/rest/intelligence/v2/transcripts_media.go index d54171b4f..80ddb13d5 100644 --- a/rest/intelligence/v2/transcripts_media.go +++ b/rest/intelligence/v2/transcripts_media.go @@ -38,13 +38,14 @@ func (c *ApiService) FetchMedia(Sid string, params *FetchMediaParams) (*Intellig path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) + queryParams.Set("Redacted", fmt.Sprint(*params.Redacted)) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/intelligence/v2/transcripts_operator_results.go b/rest/intelligence/v2/transcripts_operator_results.go index 15e922c66..d3dbd9b7d 100644 --- a/rest/intelligence/v2/transcripts_operator_results.go +++ b/rest/intelligence/v2/transcripts_operator_results.go @@ -41,13 +41,14 @@ func (c *ApiService) FetchOperatorResult(TranscriptSid string, OperatorSid strin path = strings.Replace(path, "{"+"OperatorSid"+"}", OperatorSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) + queryParams.Set("Redacted", fmt.Sprint(*params.Redacted)) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -92,13 +93,14 @@ func (c *ApiService) PageOperatorResult(TranscriptSid string, params *ListOperat path = strings.Replace(path, "{"+"TranscriptSid"+"}", TranscriptSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) + queryParams.Set("Redacted", fmt.Sprint(*params.Redacted)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -108,7 +110,7 @@ func (c *ApiService) PageOperatorResult(TranscriptSid string, params *ListOperat data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -195,7 +197,7 @@ func (c *ApiService) getNextListOperatorResultResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/intelligence/v2/transcripts_sentences.go b/rest/intelligence/v2/transcripts_sentences.go index 6b257de78..80955ee4a 100644 --- a/rest/intelligence/v2/transcripts_sentences.go +++ b/rest/intelligence/v2/transcripts_sentences.go @@ -53,13 +53,14 @@ func (c *ApiService) PageSentence(TranscriptSid string, params *ListSentencePara path = strings.Replace(path, "{"+"TranscriptSid"+"}", TranscriptSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) + queryParams.Set("Redacted", fmt.Sprint(*params.Redacted)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -69,7 +70,7 @@ func (c *ApiService) PageSentence(TranscriptSid string, params *ListSentencePara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -156,7 +157,7 @@ func (c *ApiService) getNextListSentenceResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/README.md b/rest/ip_messaging/v1/README.md index 1a93a7c31..79f4aeed4 100644 --- a/rest/ip_messaging/v1/README.md +++ b/rest/ip_messaging/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/ip_messaging/v1/credentials.go b/rest/ip_messaging/v1/credentials.go index 850c839e0..f35874d2e 100644 --- a/rest/ip_messaging/v1/credentials.go +++ b/rest/ip_messaging/v1/credentials.go @@ -70,11 +70,11 @@ func (params *CreateCredentialParams) SetSecret(Secret string) *CreateCredential return params } -// func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessagingV1Credential, error) { path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -99,7 +99,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -114,15 +114,15 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag return ps, err } -// func (c *ApiService) DeleteCredential(Sid string) error { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -132,15 +132,15 @@ func (c *ApiService) DeleteCredential(Sid string) error { return nil } -// func (c *ApiService) FetchCredential(Sid string) (*IpMessagingV1Credential, error) { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +177,11 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListCredentialResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -332,12 +333,12 @@ func (params *UpdateCredentialParams) SetSecret(Secret string) *UpdateCredential return params } -// func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams) (*IpMessagingV1Credential, error) { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -359,7 +360,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services.go b/rest/ip_messaging/v1/services.go index a1370fc84..373a90416 100644 --- a/rest/ip_messaging/v1/services.go +++ b/rest/ip_messaging/v1/services.go @@ -34,18 +34,18 @@ func (params *CreateServiceParams) SetFriendlyName(FriendlyName string) *CreateS return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV1Service, error) { path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,15 +60,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV1S return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -78,15 +78,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*IpMessagingV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,10 +123,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +137,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -566,12 +567,12 @@ func (params *UpdateServiceParams) SetLimitsUserChannels(LimitsUserChannels int) return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*IpMessagingV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -739,7 +740,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_channels.go b/rest/ip_messaging/v1/services_channels.go index 22d296a9e..5196516bd 100644 --- a/rest/ip_messaging/v1/services_channels.go +++ b/rest/ip_messaging/v1/services_channels.go @@ -52,12 +52,12 @@ func (params *CreateChannelParams) SetType(Type string) *CreateChannelParams { return params } -// func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParams) (*IpMessagingV1Channel, error) { path := "/v1/Services/{ServiceSid}/Channels" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -73,7 +73,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam data.Set("Type", *params.Type) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -88,16 +88,16 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam return ps, err } -// func (c *ApiService) DeleteChannel(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -107,16 +107,16 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchChannel(ServiceSid string, Sid string) (*IpMessagingV1Channel, error) { path := "/v1/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -161,15 +161,16 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { for _, item := range *params.Type { - data.Add("Type", item) + queryParams.Add("Type", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -179,7 +180,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -266,7 +267,7 @@ func (c *ApiService) getNextListChannelResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -303,13 +304,13 @@ func (params *UpdateChannelParams) SetAttributes(Attributes string) *UpdateChann return params } -// func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *UpdateChannelParams) (*IpMessagingV1Channel, error) { path := "/v1/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -322,7 +323,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_channels_invites.go b/rest/ip_messaging/v1/services_channels_invites.go index 30253d330..34054387c 100644 --- a/rest/ip_messaging/v1/services_channels_invites.go +++ b/rest/ip_messaging/v1/services_channels_invites.go @@ -40,13 +40,13 @@ func (params *CreateInviteParams) SetRoleSid(RoleSid string) *CreateInviteParams return params } -// func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params *CreateInviteParams) (*IpMessagingV1Invite, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Invites" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -56,7 +56,7 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * data.Set("RoleSid", *params.RoleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,7 +71,6 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * return ps, err } -// func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -79,9 +78,10 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -91,7 +91,6 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV1Invite, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -99,9 +98,10 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,15 +147,16 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListInviteResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_channels_members.go b/rest/ip_messaging/v1/services_channels_members.go index 77b1b4e90..d31a78028 100644 --- a/rest/ip_messaging/v1/services_channels_members.go +++ b/rest/ip_messaging/v1/services_channels_members.go @@ -40,13 +40,13 @@ func (params *CreateMemberParams) SetRoleSid(RoleSid string) *CreateMemberParams return params } -// func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params *CreateMemberParams) (*IpMessagingV1Member, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -56,7 +56,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * data.Set("RoleSid", *params.RoleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,7 +71,6 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * return ps, err } -// func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -79,9 +78,10 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -91,7 +91,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV1Member, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -99,9 +98,10 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,15 +147,16 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListMemberResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -283,7 +284,6 @@ func (params *UpdateMemberParams) SetLastConsumedMessageIndex(LastConsumedMessag return params } -// func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid string, params *UpdateMemberParams) (*IpMessagingV1Member, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -291,6 +291,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -300,7 +301,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_channels_messages.go b/rest/ip_messaging/v1/services_channels_messages.go index 28f929dda..7aefc0766 100644 --- a/rest/ip_messaging/v1/services_channels_messages.go +++ b/rest/ip_messaging/v1/services_channels_messages.go @@ -46,13 +46,13 @@ func (params *CreateMessageParams) SetAttributes(Attributes string) *CreateMessa return params } -// func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params *CreateMessageParams) (*IpMessagingV1Message, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -65,7 +65,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -80,7 +80,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params return ps, err } -// func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -88,9 +87,10 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -100,7 +100,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str return nil } -// func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV1Message, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -108,9 +107,10 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -156,13 +156,14 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +173,7 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +260,7 @@ func (c *ApiService) getNextListMessageResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -290,7 +291,6 @@ func (params *UpdateMessageParams) SetAttributes(Attributes string) *UpdateMessa return params } -// func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid string, params *UpdateMessageParams) (*IpMessagingV1Message, error) { path := "/v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -298,6 +298,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -307,7 +308,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_roles.go b/rest/ip_messaging/v1/services_roles.go index 3d562e6c0..f1fe14ec9 100644 --- a/rest/ip_messaging/v1/services_roles.go +++ b/rest/ip_messaging/v1/services_roles.go @@ -46,12 +46,12 @@ func (params *CreateRoleParams) SetPermission(Permission []string) *CreateRolePa return params } -// func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*IpMessagingV1Role, error) { path := "/v1/Services/{ServiceSid}/Roles" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -66,7 +66,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -81,16 +81,16 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I return ps, err } -// func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -100,16 +100,16 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchRole(ServiceSid string, Sid string) (*IpMessagingV1Role, error) { path := "/v1/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,10 +148,11 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -161,7 +162,7 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -248,7 +249,7 @@ func (c *ApiService) getNextListRoleResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -273,13 +274,13 @@ func (params *UpdateRoleParams) SetPermission(Permission []string) *UpdateRolePa return params } -// func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRoleParams) (*IpMessagingV1Role, error) { path := "/v1/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Permission != nil { @@ -288,7 +289,7 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_users.go b/rest/ip_messaging/v1/services_users.go index 8fe15c616..22c6f3373 100644 --- a/rest/ip_messaging/v1/services_users.go +++ b/rest/ip_messaging/v1/services_users.go @@ -52,12 +52,12 @@ func (params *CreateUserParams) SetFriendlyName(FriendlyName string) *CreateUser return params } -// func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*IpMessagingV1User, error) { path := "/v1/Services/{ServiceSid}/Users" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -73,7 +73,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -88,16 +88,16 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I return ps, err } -// func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -107,16 +107,16 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchUser(ServiceSid string, Sid string) (*IpMessagingV1User, error) { path := "/v1/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -155,10 +155,11 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -168,7 +169,7 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,7 +256,7 @@ func (c *ApiService) getNextListUserResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -292,13 +293,13 @@ func (params *UpdateUserParams) SetFriendlyName(FriendlyName string) *UpdateUser return params } -// func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUserParams) (*IpMessagingV1User, error) { path := "/v1/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -311,7 +312,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v1/services_users_channels.go b/rest/ip_messaging/v1/services_users_channels.go index 32b0dfc05..4be689958 100644 --- a/rest/ip_messaging/v1/services_users_channels.go +++ b/rest/ip_messaging/v1/services_users_channels.go @@ -48,10 +48,11 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -61,7 +62,7 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,7 +149,7 @@ func (c *ApiService) getNextListUserChannelResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/README.md b/rest/ip_messaging/v2/README.md index 999a29006..9a2ab5166 100644 --- a/rest/ip_messaging/v2/README.md +++ b/rest/ip_messaging/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/ip_messaging/v2/credentials.go b/rest/ip_messaging/v2/credentials.go index 7d4227335..941f1b413 100644 --- a/rest/ip_messaging/v2/credentials.go +++ b/rest/ip_messaging/v2/credentials.go @@ -70,11 +70,11 @@ func (params *CreateCredentialParams) SetSecret(Secret string) *CreateCredential return params } -// func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessagingV2Credential, error) { path := "/v2/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -99,7 +99,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -114,15 +114,15 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag return ps, err } -// func (c *ApiService) DeleteCredential(Sid string) error { path := "/v2/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -132,15 +132,15 @@ func (c *ApiService) DeleteCredential(Sid string) error { return nil } -// func (c *ApiService) FetchCredential(Sid string) (*IpMessagingV2Credential, error) { path := "/v2/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +177,11 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag path := "/v2/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListCredentialResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -332,12 +333,12 @@ func (params *UpdateCredentialParams) SetSecret(Secret string) *UpdateCredential return params } -// func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams) (*IpMessagingV2Credential, error) { path := "/v2/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -359,7 +360,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services.go b/rest/ip_messaging/v2/services.go index 3b093dcd5..3e4215eb9 100644 --- a/rest/ip_messaging/v2/services.go +++ b/rest/ip_messaging/v2/services.go @@ -34,18 +34,18 @@ func (params *CreateServiceParams) SetFriendlyName(FriendlyName string) *CreateS return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV2Service, error) { path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,15 +60,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV2S return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v2/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -78,15 +78,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*IpMessagingV2Service, error) { path := "/v2/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,10 +123,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +137,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -428,12 +429,12 @@ func (params *UpdateServiceParams) SetNotificationsLogEnabled(NotificationsLogEn return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*IpMessagingV2Service, error) { path := "/v2/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -532,7 +533,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip data.Set("Notifications.LogEnabled", fmt.Sprint(*params.NotificationsLogEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_bindings.go b/rest/ip_messaging/v2/services_bindings.go index 248da0f90..deba8c4e5 100644 --- a/rest/ip_messaging/v2/services_bindings.go +++ b/rest/ip_messaging/v2/services_bindings.go @@ -23,16 +23,16 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) DeleteBinding(ServiceSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -42,16 +42,16 @@ func (c *ApiService) DeleteBinding(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchBinding(ServiceSid string, Sid string) (*IpMessagingV2Binding, error) { path := "/v2/Services/{ServiceSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,20 +102,21 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { - data.Add("BindingType", item) + queryParams.Add("BindingType", item) } } if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -125,7 +126,7 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -212,7 +213,7 @@ func (c *ApiService) getNextListBindingResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_channels.go b/rest/ip_messaging/v2/services_channels.go index fe06ed53e..d796b8554 100644 --- a/rest/ip_messaging/v2/services_channels.go +++ b/rest/ip_messaging/v2/services_channels.go @@ -77,12 +77,12 @@ func (params *CreateChannelParams) SetCreatedBy(CreatedBy string) *CreateChannel return params } -// func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParams) (*IpMessagingV2Channel, error) { path := "/v2/Services/{ServiceSid}/Channels" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -110,7 +110,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -136,19 +136,19 @@ func (params *DeleteChannelParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnable return params } -// func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *DeleteChannelParams) error { path := "/v2/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -158,16 +158,16 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete return nil } -// func (c *ApiService) FetchChannel(ServiceSid string, Sid string) (*IpMessagingV2Channel, error) { path := "/v2/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -212,15 +212,16 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { for _, item := range *params.Type { - data.Add("Type", item) + queryParams.Add("Type", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -230,7 +231,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -317,7 +318,7 @@ func (c *ApiService) getNextListChannelResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -378,13 +379,13 @@ func (params *UpdateChannelParams) SetCreatedBy(CreatedBy string) *UpdateChannel return params } -// func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *UpdateChannelParams) (*IpMessagingV2Channel, error) { path := "/v2/Services/{ServiceSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -409,7 +410,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_channels_invites.go b/rest/ip_messaging/v2/services_channels_invites.go index f02e2cbbc..e5df8a6cf 100644 --- a/rest/ip_messaging/v2/services_channels_invites.go +++ b/rest/ip_messaging/v2/services_channels_invites.go @@ -40,13 +40,13 @@ func (params *CreateInviteParams) SetRoleSid(RoleSid string) *CreateInviteParams return params } -// func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params *CreateInviteParams) (*IpMessagingV2Invite, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Invites" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -56,7 +56,7 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * data.Set("RoleSid", *params.RoleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,7 +71,6 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * return ps, err } -// func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -79,9 +78,10 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -91,7 +91,6 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV2Invite, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Invites/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -99,9 +98,10 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,15 +147,16 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListInviteResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_channels_members.go b/rest/ip_messaging/v2/services_channels_members.go index e3f23a9d7..e7dff0c83 100644 --- a/rest/ip_messaging/v2/services_channels_members.go +++ b/rest/ip_messaging/v2/services_channels_members.go @@ -77,13 +77,13 @@ func (params *CreateMemberParams) SetAttributes(Attributes string) *CreateMember return params } -// func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params *CreateMemberParams) (*IpMessagingV2Member, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -111,7 +111,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,7 +137,6 @@ func (params *DeleteMemberParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnabled return params } -// func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid string, params *DeleteMemberParams) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -145,12 +144,13 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -160,7 +160,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri return nil } -// func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV2Member, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -168,9 +167,10 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -216,15 +216,16 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -234,7 +235,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -321,7 +322,7 @@ func (c *ApiService) getNextListMemberResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -382,7 +383,6 @@ func (params *UpdateMemberParams) SetAttributes(Attributes string) *UpdateMember return params } -// func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid string, params *UpdateMemberParams) (*IpMessagingV2Member, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -390,6 +390,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -414,7 +415,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_channels_messages.go b/rest/ip_messaging/v2/services_channels_messages.go index d8d0e8415..86f5f49c6 100644 --- a/rest/ip_messaging/v2/services_channels_messages.go +++ b/rest/ip_messaging/v2/services_channels_messages.go @@ -77,13 +77,13 @@ func (params *CreateMessageParams) SetMediaSid(MediaSid string) *CreateMessagePa return params } -// func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params *CreateMessageParams) (*IpMessagingV2Message, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.From != nil { @@ -111,7 +111,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,7 +137,6 @@ func (params *DeleteMessageParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnable return params } -// func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid string, params *DeleteMessageParams) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -145,12 +144,13 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -160,7 +160,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str return nil } -// func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV2Message, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -168,9 +167,10 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -216,13 +216,14 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -232,7 +233,7 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -319,7 +320,7 @@ func (c *ApiService) getNextListMessageResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -380,7 +381,6 @@ func (params *UpdateMessageParams) SetFrom(From string) *UpdateMessageParams { return params } -// func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid string, params *UpdateMessageParams) (*IpMessagingV2Message, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -388,6 +388,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -412,7 +413,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_channels_webhooks.go b/rest/ip_messaging/v2/services_channels_webhooks.go index 76535a9e2..f72e88949 100644 --- a/rest/ip_messaging/v2/services_channels_webhooks.go +++ b/rest/ip_messaging/v2/services_channels_webhooks.go @@ -70,13 +70,13 @@ func (params *CreateChannelWebhookParams) SetConfigurationRetryCount(Configurati return params } -// func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, params *CreateChannelWebhookParams) (*IpMessagingV2ChannelWebhook, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -105,7 +105,7 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -120,7 +120,6 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, return ps, err } -// func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -128,9 +127,10 @@ func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -140,7 +140,6 @@ func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, return nil } -// func (c *ApiService) FetchChannelWebhook(ServiceSid string, ChannelSid string, Sid string) (*IpMessagingV2ChannelWebhook, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -148,9 +147,10 @@ func (c *ApiService) FetchChannelWebhook(ServiceSid string, ChannelSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -190,10 +190,11 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -203,7 +204,7 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -290,7 +291,7 @@ func (c *ApiService) getNextListChannelWebhookResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -345,7 +346,6 @@ func (params *UpdateChannelWebhookParams) SetConfigurationRetryCount(Configurati return params } -// func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, Sid string, params *UpdateChannelWebhookParams) (*IpMessagingV2ChannelWebhook, error) { path := "/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -353,6 +353,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ConfigurationUrl != nil { @@ -378,7 +379,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_roles.go b/rest/ip_messaging/v2/services_roles.go index 62bc98a4d..4f6b8b0a3 100644 --- a/rest/ip_messaging/v2/services_roles.go +++ b/rest/ip_messaging/v2/services_roles.go @@ -46,12 +46,12 @@ func (params *CreateRoleParams) SetPermission(Permission []string) *CreateRolePa return params } -// func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*IpMessagingV2Role, error) { path := "/v2/Services/{ServiceSid}/Roles" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -66,7 +66,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -81,16 +81,16 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I return ps, err } -// func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -100,16 +100,16 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchRole(ServiceSid string, Sid string) (*IpMessagingV2Role, error) { path := "/v2/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -148,10 +148,11 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -161,7 +162,7 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -248,7 +249,7 @@ func (c *ApiService) getNextListRoleResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -273,13 +274,13 @@ func (params *UpdateRoleParams) SetPermission(Permission []string) *UpdateRolePa return params } -// func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRoleParams) (*IpMessagingV2Role, error) { path := "/v2/Services/{ServiceSid}/Roles/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Permission != nil { @@ -288,7 +289,7 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_users.go b/rest/ip_messaging/v2/services_users.go index fbe2eb131..06b2e42dc 100644 --- a/rest/ip_messaging/v2/services_users.go +++ b/rest/ip_messaging/v2/services_users.go @@ -58,12 +58,12 @@ func (params *CreateUserParams) SetFriendlyName(FriendlyName string) *CreateUser return params } -// func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*IpMessagingV2User, error) { path := "/v2/Services/{ServiceSid}/Users" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -82,7 +82,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I return ps, err } -// func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,16 +116,16 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchUser(ServiceSid string, Sid string) (*IpMessagingV2User, error) { path := "/v2/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -164,10 +164,11 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -177,7 +178,7 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (c *ApiService) getNextListUserResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -307,13 +308,13 @@ func (params *UpdateUserParams) SetFriendlyName(FriendlyName string) *UpdateUser return params } -// func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUserParams) (*IpMessagingV2User, error) { path := "/v2/Services/{ServiceSid}/Users/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoleSid != nil { @@ -329,7 +330,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_users_bindings.go b/rest/ip_messaging/v2/services_users_bindings.go index 3ee4e8c86..4da661b46 100644 --- a/rest/ip_messaging/v2/services_users_bindings.go +++ b/rest/ip_messaging/v2/services_users_bindings.go @@ -23,7 +23,6 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid string) error { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -31,9 +30,10 @@ func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -43,7 +43,6 @@ func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid st return nil } -// func (c *ApiService) FetchUserBinding(ServiceSid string, UserSid string, Sid string) (*IpMessagingV2UserBinding, error) { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -51,9 +50,10 @@ func (c *ApiService) FetchUserBinding(ServiceSid string, UserSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -99,15 +99,16 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { - data.Add("BindingType", item) + queryParams.Add("BindingType", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -117,7 +118,7 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -204,7 +205,7 @@ func (c *ApiService) getNextListUserBindingResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/ip_messaging/v2/services_users_channels.go b/rest/ip_messaging/v2/services_users_channels.go index 08d882ce7..f785e9482 100644 --- a/rest/ip_messaging/v2/services_users_channels.go +++ b/rest/ip_messaging/v2/services_users_channels.go @@ -24,7 +24,6 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, ChannelSid string) error { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Channels/{ChannelSid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -32,9 +31,10 @@ func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -44,7 +44,6 @@ func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, Channe return nil } -// func (c *ApiService) FetchUserChannel(ServiceSid string, UserSid string, ChannelSid string) (*IpMessagingV2UserChannel, error) { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Channels/{ChannelSid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -52,9 +51,10 @@ func (c *ApiService) FetchUserChannel(ServiceSid string, UserSid string, Channel path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -94,10 +94,11 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -107,7 +108,7 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -194,7 +195,7 @@ func (c *ApiService) getNextListUserChannelResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -231,7 +232,6 @@ func (params *UpdateUserChannelParams) SetLastConsumptionTimestamp(LastConsumpti return params } -// func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, ChannelSid string, params *UpdateUserChannelParams) (*IpMessagingV2UserChannel, error) { path := "/v2/Services/{ServiceSid}/Users/{UserSid}/Channels/{ChannelSid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -239,6 +239,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.NotificationLevel != nil { @@ -251,7 +252,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/lookups/v1/README.md b/rest/lookups/v1/README.md index 8b5bdcb34..c11cb3b7d 100644 --- a/rest/lookups/v1/README.md +++ b/rest/lookups/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/lookups/v1/phone_numbers.go b/rest/lookups/v1/phone_numbers.go index 437c00a8f..db4ae0d45 100644 --- a/rest/lookups/v1/phone_numbers.go +++ b/rest/lookups/v1/phone_numbers.go @@ -49,25 +49,25 @@ func (params *FetchPhoneNumberParams) SetAddOnsData(AddOnsData map[string]interf return params } -// func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumberParams) (*LookupsV1PhoneNumber, error) { path := "/v1/PhoneNumbers/{PhoneNumber}" path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CountryCode != nil { - data.Set("CountryCode", *params.CountryCode) + queryParams.Set("CountryCode", *params.CountryCode) } if params != nil && params.Type != nil { for _, item := range *params.Type { - data.Add("Type", item) + queryParams.Add("Type", item) } } if params != nil && params.AddOns != nil { for _, item := range *params.AddOns { - data.Add("AddOns", item) + queryParams.Add("AddOns", item) } } if params != nil && params.AddOnsData != nil { @@ -77,10 +77,10 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb return nil, err } - data.Set("AddOnsData", string(v)) + queryParams.Set("AddOnsData", string(v)) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/lookups/v2/README.md b/rest/lookups/v2/README.md index 39327c3c2..f6bcdef08 100644 --- a/rest/lookups/v2/README.md +++ b/rest/lookups/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/lookups/v2/phone_numbers.go b/rest/lookups/v2/phone_numbers.go index 0d293086c..6f93562dd 100644 --- a/rest/lookups/v2/phone_numbers.go +++ b/rest/lookups/v2/phone_numbers.go @@ -103,55 +103,55 @@ func (params *FetchPhoneNumberParams) SetLastVerifiedDate(LastVerifiedDate strin return params } -// func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumberParams) (*LookupsV2PhoneNumber, error) { path := "/v2/PhoneNumbers/{PhoneNumber}" path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Fields != nil { - data.Set("Fields", *params.Fields) + queryParams.Set("Fields", *params.Fields) } if params != nil && params.CountryCode != nil { - data.Set("CountryCode", *params.CountryCode) + queryParams.Set("CountryCode", *params.CountryCode) } if params != nil && params.FirstName != nil { - data.Set("FirstName", *params.FirstName) + queryParams.Set("FirstName", *params.FirstName) } if params != nil && params.LastName != nil { - data.Set("LastName", *params.LastName) + queryParams.Set("LastName", *params.LastName) } if params != nil && params.AddressLine1 != nil { - data.Set("AddressLine1", *params.AddressLine1) + queryParams.Set("AddressLine1", *params.AddressLine1) } if params != nil && params.AddressLine2 != nil { - data.Set("AddressLine2", *params.AddressLine2) + queryParams.Set("AddressLine2", *params.AddressLine2) } if params != nil && params.City != nil { - data.Set("City", *params.City) + queryParams.Set("City", *params.City) } if params != nil && params.State != nil { - data.Set("State", *params.State) + queryParams.Set("State", *params.State) } if params != nil && params.PostalCode != nil { - data.Set("PostalCode", *params.PostalCode) + queryParams.Set("PostalCode", *params.PostalCode) } if params != nil && params.AddressCountryCode != nil { - data.Set("AddressCountryCode", *params.AddressCountryCode) + queryParams.Set("AddressCountryCode", *params.AddressCountryCode) } if params != nil && params.NationalId != nil { - data.Set("NationalId", *params.NationalId) + queryParams.Set("NationalId", *params.NationalId) } if params != nil && params.DateOfBirth != nil { - data.Set("DateOfBirth", *params.DateOfBirth) + queryParams.Set("DateOfBirth", *params.DateOfBirth) } if params != nil && params.LastVerifiedDate != nil { - data.Set("LastVerifiedDate", *params.LastVerifiedDate) + queryParams.Set("LastVerifiedDate", *params.LastVerifiedDate) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/media/v1/README.md b/rest/media/v1/README.md index 70398fd2c..c16e374e3 100644 --- a/rest/media/v1/README.md +++ b/rest/media/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/media/v1/media_processors.go b/rest/media/v1/media_processors.go index 90fd7b7f2..4023e8c1b 100644 --- a/rest/media/v1/media_processors.go +++ b/rest/media/v1/media_processors.go @@ -64,11 +64,11 @@ func (params *CreateMediaProcessorParams) SetMaxDuration(MaxDuration int) *Creat return params } -// func (c *ApiService) CreateMediaProcessor(params *CreateMediaProcessorParams) (*MediaV1MediaProcessor, error) { path := "/v1/MediaProcessors" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Extension != nil { @@ -96,7 +96,7 @@ func (c *ApiService) CreateMediaProcessor(params *CreateMediaProcessorParams) (* data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -117,9 +117,10 @@ func (c *ApiService) FetchMediaProcessor(Sid string) (*MediaV1MediaProcessor, er path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,16 +169,17 @@ func (c *ApiService) PageMediaProcessor(params *ListMediaProcessorParams, pageTo path := "/v1/MediaProcessors" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -187,7 +189,7 @@ func (c *ApiService) PageMediaProcessor(params *ListMediaProcessorParams, pageTo data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -274,7 +276,7 @@ func (c *ApiService) getNextListMediaProcessorResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -305,13 +307,14 @@ func (c *ApiService) UpdateMediaProcessor(Sid string, params *UpdateMediaProcess path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/media/v1/media_recordings.go b/rest/media/v1/media_recordings.go index 631f8a8c2..c78b7dfe1 100644 --- a/rest/media/v1/media_recordings.go +++ b/rest/media/v1/media_recordings.go @@ -29,9 +29,10 @@ func (c *ApiService) DeleteMediaRecording(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -47,9 +48,10 @@ func (c *ApiService) FetchMediaRecording(Sid string) (*MediaV1MediaRecording, er path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -110,22 +112,23 @@ func (c *ApiService) PageMediaRecording(params *ListMediaRecordingParams, pageTo path := "/v1/MediaRecordings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.ProcessorSid != nil { - data.Set("ProcessorSid", *params.ProcessorSid) + queryParams.Set("ProcessorSid", *params.ProcessorSid) } if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) + queryParams.Set("SourceSid", *params.SourceSid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -135,7 +138,7 @@ func (c *ApiService) PageMediaRecording(params *ListMediaRecordingParams, pageTo data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -222,7 +225,7 @@ func (c *ApiService) getNextListMediaRecordingResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/media/v1/player_streamers.go b/rest/media/v1/player_streamers.go index 88938ee7b..68f47a333 100644 --- a/rest/media/v1/player_streamers.go +++ b/rest/media/v1/player_streamers.go @@ -52,11 +52,11 @@ func (params *CreatePlayerStreamerParams) SetMaxDuration(MaxDuration int) *Creat return params } -// func (c *ApiService) CreatePlayerStreamer(params *CreatePlayerStreamerParams) (*MediaV1PlayerStreamer, error) { path := "/v1/PlayerStreamers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Video != nil { @@ -72,7 +72,7 @@ func (c *ApiService) CreatePlayerStreamer(params *CreatePlayerStreamerParams) (* data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +93,10 @@ func (c *ApiService) FetchPlayerStreamer(Sid string) (*MediaV1PlayerStreamer, er path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -144,16 +145,17 @@ func (c *ApiService) PagePlayerStreamer(params *ListPlayerStreamerParams, pageTo path := "/v1/PlayerStreamers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -163,7 +165,7 @@ func (c *ApiService) PagePlayerStreamer(params *ListPlayerStreamerParams, pageTo data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -250,7 +252,7 @@ func (c *ApiService) getNextListPlayerStreamerResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -281,13 +283,14 @@ func (c *ApiService) UpdatePlayerStreamer(Sid string, params *UpdatePlayerStream path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/media/v1/player_streamers_playback_grant.go b/rest/media/v1/player_streamers_playback_grant.go index 9ad55e06a..a2ab7f63f 100644 --- a/rest/media/v1/player_streamers_playback_grant.go +++ b/rest/media/v1/player_streamers_playback_grant.go @@ -38,12 +38,12 @@ func (params *CreatePlayerStreamerPlaybackGrantParams) SetAccessControlAllowOrig return params } -// func (c *ApiService) CreatePlayerStreamerPlaybackGrant(Sid string, params *CreatePlayerStreamerPlaybackGrantParams) (*MediaV1PlayerStreamerPlaybackGrant, error) { path := "/v1/PlayerStreamers/{Sid}/PlaybackGrant" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Ttl != nil { @@ -53,7 +53,7 @@ func (c *ApiService) CreatePlayerStreamerPlaybackGrant(Sid string, params *Creat data.Set("AccessControlAllowOrigin", *params.AccessControlAllowOrigin) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -74,9 +74,10 @@ func (c *ApiService) FetchPlayerStreamerPlaybackGrant(Sid string) (*MediaV1Playe path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/README.md b/rest/messaging/v1/README.md index 22cd0a8d2..67d897451 100644 --- a/rest/messaging/v1/README.md +++ b/rest/messaging/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/messaging/v1/a2p_brand_registrations.go b/rest/messaging/v1/a2p_brand_registrations.go index a6ce88b3f..61caa5a69 100644 --- a/rest/messaging/v1/a2p_brand_registrations.go +++ b/rest/messaging/v1/a2p_brand_registrations.go @@ -58,11 +58,11 @@ func (params *CreateBrandRegistrationsParams) SetSkipAutomaticSecVet(SkipAutomat return params } -// func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsParams) (*MessagingV1BrandRegistrations, error) { path := "/v1/a2p/BrandRegistrations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CustomerProfileBundleSid != nil { @@ -81,7 +81,7 @@ func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsPa data.Set("SkipAutomaticSecVet", fmt.Sprint(*params.SkipAutomaticSecVet)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -96,15 +96,15 @@ func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsPa return ps, err } -// func (c *ApiService) FetchBrandRegistrations(Sid string) (*MessagingV1BrandRegistrations, error) { path := "/v1/a2p/BrandRegistrations/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,10 +141,11 @@ func (c *ApiService) PageBrandRegistrations(params *ListBrandRegistrationsParams path := "/v1/a2p/BrandRegistrations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +155,7 @@ func (c *ApiService) PageBrandRegistrations(params *ListBrandRegistrationsParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +242,7 @@ func (c *ApiService) getNextListBrandRegistrationsResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -255,15 +256,15 @@ func (c *ApiService) getNextListBrandRegistrationsResponse(nextPageUrl string) ( return ps, nil } -// func (c *ApiService) UpdateBrandRegistrations(Sid string) (*MessagingV1BrandRegistrations, error) { path := "/v1/a2p/BrandRegistrations/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/a2p_brand_registrations_sms_otp.go b/rest/messaging/v1/a2p_brand_registrations_sms_otp.go index 17fcb9614..8991c8bec 100644 --- a/rest/messaging/v1/a2p_brand_registrations_sms_otp.go +++ b/rest/messaging/v1/a2p_brand_registrations_sms_otp.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) CreateBrandRegistrationOtp(BrandRegistrationSid string) (*MessagingV1BrandRegistrationOtp, error) { path := "/v1/a2p/BrandRegistrations/{BrandRegistrationSid}/SmsOtp" path = strings.Replace(path, "{"+"BrandRegistrationSid"+"}", BrandRegistrationSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/a2p_brand_registrations_vettings.go b/rest/messaging/v1/a2p_brand_registrations_vettings.go index b7e46cdcd..700080963 100644 --- a/rest/messaging/v1/a2p_brand_registrations_vettings.go +++ b/rest/messaging/v1/a2p_brand_registrations_vettings.go @@ -40,12 +40,12 @@ func (params *CreateBrandVettingParams) SetVettingId(VettingId string) *CreateBr return params } -// func (c *ApiService) CreateBrandVetting(BrandSid string, params *CreateBrandVettingParams) (*MessagingV1BrandVetting, error) { path := "/v1/a2p/BrandRegistrations/{BrandSid}/Vettings" path = strings.Replace(path, "{"+"BrandSid"+"}", BrandSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.VettingProvider != nil { @@ -55,7 +55,7 @@ func (c *ApiService) CreateBrandVetting(BrandSid string, params *CreateBrandVett data.Set("VettingId", *params.VettingId) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -70,16 +70,16 @@ func (c *ApiService) CreateBrandVetting(BrandSid string, params *CreateBrandVett return ps, err } -// func (c *ApiService) FetchBrandVetting(BrandSid string, BrandVettingSid string) (*MessagingV1BrandVetting, error) { path := "/v1/a2p/BrandRegistrations/{BrandSid}/Vettings/{BrandVettingSid}" path = strings.Replace(path, "{"+"BrandSid"+"}", BrandSid, -1) path = strings.Replace(path, "{"+"BrandVettingSid"+"}", BrandVettingSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -124,13 +124,14 @@ func (c *ApiService) PageBrandVetting(BrandSid string, params *ListBrandVettingP path = strings.Replace(path, "{"+"BrandSid"+"}", BrandSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.VettingProvider != nil { - data.Set("VettingProvider", *params.VettingProvider) + queryParams.Set("VettingProvider", *params.VettingProvider) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -140,7 +141,7 @@ func (c *ApiService) PageBrandVetting(BrandSid string, params *ListBrandVettingP data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -227,7 +228,7 @@ func (c *ApiService) getNextListBrandVettingResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/messaging/v1/deactivations.go b/rest/messaging/v1/deactivations.go index 198672a9f..c127b96d2 100644 --- a/rest/messaging/v1/deactivations.go +++ b/rest/messaging/v1/deactivations.go @@ -36,13 +36,14 @@ func (c *ApiService) FetchDeactivation(params *FetchDeactivationParams) (*Messag path := "/v1/Deactivations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Date != nil { - data.Set("Date", fmt.Sprint(*params.Date)) + queryParams.Set("Date", fmt.Sprint(*params.Date)) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/link_shortening_domains_certificate.go b/rest/messaging/v1/link_shortening_domains_certificate.go index 8447978d3..712b5a201 100644 --- a/rest/messaging/v1/link_shortening_domains_certificate.go +++ b/rest/messaging/v1/link_shortening_domains_certificate.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) DeleteDomainCertV4(DomainSid string) error { path := "/v1/LinkShortening/Domains/{DomainSid}/Certificate" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -38,15 +38,15 @@ func (c *ApiService) DeleteDomainCertV4(DomainSid string) error { return nil } -// func (c *ApiService) FetchDomainCertV4(DomainSid string) (*MessagingV1DomainCertV4, error) { path := "/v1/LinkShortening/Domains/{DomainSid}/Certificate" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -72,19 +72,19 @@ func (params *UpdateDomainCertV4Params) SetTlsCert(TlsCert string) *UpdateDomain return params } -// func (c *ApiService) UpdateDomainCertV4(DomainSid string, params *UpdateDomainCertV4Params) (*MessagingV1DomainCertV4, error) { path := "/v1/LinkShortening/Domains/{DomainSid}/Certificate" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TlsCert != nil { data.Set("TlsCert", *params.TlsCert) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/link_shortening_domains_config.go b/rest/messaging/v1/link_shortening_domains_config.go index 04e34b090..4ab953dab 100644 --- a/rest/messaging/v1/link_shortening_domains_config.go +++ b/rest/messaging/v1/link_shortening_domains_config.go @@ -21,15 +21,15 @@ import ( "strings" ) -// func (c *ApiService) FetchDomainConfig(DomainSid string) (*MessagingV1DomainConfig, error) { path := "/v1/LinkShortening/Domains/{DomainSid}/Config" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,12 +73,12 @@ func (params *UpdateDomainConfigParams) SetDisableHttps(DisableHttps bool) *Upda return params } -// func (c *ApiService) UpdateDomainConfig(DomainSid string, params *UpdateDomainConfigParams) (*MessagingV1DomainConfig, error) { path := "/v1/LinkShortening/Domains/{DomainSid}/Config" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FallbackUrl != nil { @@ -94,7 +94,7 @@ func (c *ApiService) UpdateDomainConfig(DomainSid string, params *UpdateDomainCo data.Set("DisableHttps", fmt.Sprint(*params.DisableHttps)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/link_shortening_domains_messaging_services.go b/rest/messaging/v1/link_shortening_domains_messaging_services.go index 44f94e76f..9d861a13f 100644 --- a/rest/messaging/v1/link_shortening_domains_messaging_services.go +++ b/rest/messaging/v1/link_shortening_domains_messaging_services.go @@ -20,16 +20,16 @@ import ( "strings" ) -// func (c *ApiService) CreateLinkshorteningMessagingService(DomainSid string, MessagingServiceSid string) (*MessagingV1LinkshorteningMessagingService, error) { path := "/v1/LinkShortening/Domains/{DomainSid}/MessagingServices/{MessagingServiceSid}" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -44,16 +44,16 @@ func (c *ApiService) CreateLinkshorteningMessagingService(DomainSid string, Mess return ps, err } -// func (c *ApiService) DeleteLinkshorteningMessagingService(DomainSid string, MessagingServiceSid string) error { path := "/v1/LinkShortening/Domains/{DomainSid}/MessagingServices/{MessagingServiceSid}" path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } diff --git a/rest/messaging/v1/link_shortening_messaging_service_domain_config.go b/rest/messaging/v1/link_shortening_messaging_service_domain_config.go index 9d2291f27..31fdb7bc8 100644 --- a/rest/messaging/v1/link_shortening_messaging_service_domain_config.go +++ b/rest/messaging/v1/link_shortening_messaging_service_domain_config.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) FetchDomainConfigMessagingService(MessagingServiceSid string) (*MessagingV1DomainConfigMessagingService, error) { path := "/v1/LinkShortening/MessagingService/{MessagingServiceSid}/DomainConfig" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/link_shortening_messaging_services_domain.go b/rest/messaging/v1/link_shortening_messaging_services_domain.go index 5d23d2737..924fa81df 100644 --- a/rest/messaging/v1/link_shortening_messaging_services_domain.go +++ b/rest/messaging/v1/link_shortening_messaging_services_domain.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) FetchLinkshorteningMessagingServiceDomainAssociation(MessagingServiceSid string) (*MessagingV1LinkshorteningMessagingServiceDomainAssociation, error) { path := "/v1/LinkShortening/MessagingServices/{MessagingServiceSid}/Domain" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services.go b/rest/messaging/v1/services.go index df8bfbe4a..8d655a602 100644 --- a/rest/messaging/v1/services.go +++ b/rest/messaging/v1/services.go @@ -124,11 +124,11 @@ func (params *CreateServiceParams) SetUseInboundWebhookOnNumber(UseInboundWebhoo return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Service, error) { path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -180,7 +180,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser data.Set("UseInboundWebhookOnNumber", fmt.Sprint(*params.UseInboundWebhookOnNumber)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -195,15 +195,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -213,15 +213,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*MessagingV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -258,10 +258,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -271,7 +272,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -358,7 +359,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -473,12 +474,12 @@ func (params *UpdateServiceParams) SetUseInboundWebhookOnNumber(UseInboundWebhoo return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*MessagingV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -530,7 +531,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Me data.Set("UseInboundWebhookOnNumber", fmt.Sprint(*params.UseInboundWebhookOnNumber)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_alpha_senders.go b/rest/messaging/v1/services_alpha_senders.go index c8a5639cb..9e32bbb1f 100644 --- a/rest/messaging/v1/services_alpha_senders.go +++ b/rest/messaging/v1/services_alpha_senders.go @@ -34,19 +34,19 @@ func (params *CreateAlphaSenderParams) SetAlphaSender(AlphaSender string) *Creat return params } -// func (c *ApiService) CreateAlphaSender(ServiceSid string, params *CreateAlphaSenderParams) (*MessagingV1AlphaSender, error) { path := "/v1/Services/{ServiceSid}/AlphaSenders" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AlphaSender != nil { data.Set("AlphaSender", *params.AlphaSender) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -61,16 +61,16 @@ func (c *ApiService) CreateAlphaSender(ServiceSid string, params *CreateAlphaSen return ps, err } -// func (c *ApiService) DeleteAlphaSender(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/AlphaSenders/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -80,16 +80,16 @@ func (c *ApiService) DeleteAlphaSender(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchAlphaSender(ServiceSid string, Sid string) (*MessagingV1AlphaSender, error) { path := "/v1/Services/{ServiceSid}/AlphaSenders/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +128,11 @@ func (c *ApiService) PageAlphaSender(ServiceSid string, params *ListAlphaSenderP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +142,7 @@ func (c *ApiService) PageAlphaSender(ServiceSid string, params *ListAlphaSenderP data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +229,7 @@ func (c *ApiService) getNextListAlphaSenderResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_channel_senders.go b/rest/messaging/v1/services_channel_senders.go index 27408c83d..58324d854 100644 --- a/rest/messaging/v1/services_channel_senders.go +++ b/rest/messaging/v1/services_channel_senders.go @@ -23,16 +23,16 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchChannelSender(MessagingServiceSid string, Sid string) (*MessagingV1ChannelSender, error) { path := "/v1/Services/{MessagingServiceSid}/ChannelSenders/{Sid}" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,10 +71,11 @@ func (c *ApiService) PageChannelSender(MessagingServiceSid string, params *ListC path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -84,7 +85,7 @@ func (c *ApiService) PageChannelSender(MessagingServiceSid string, params *ListC data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,7 +172,7 @@ func (c *ApiService) getNextListChannelSenderResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_compliance_usa2p.go b/rest/messaging/v1/services_compliance_usa2p.go index 5f71d6804..fea2c6788 100644 --- a/rest/messaging/v1/services_compliance_usa2p.go +++ b/rest/messaging/v1/services_compliance_usa2p.go @@ -106,12 +106,12 @@ func (params *CreateUsAppToPersonParams) SetHelpKeywords(HelpKeywords []string) return params } -// func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *CreateUsAppToPersonParams) (*MessagingV1UsAppToPerson, error) { path := "/v1/Services/{MessagingServiceSid}/Compliance/Usa2p" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BrandRegistrationSid != nil { @@ -162,7 +162,7 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,16 +177,16 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre return ps, err } -// func (c *ApiService) DeleteUsAppToPerson(MessagingServiceSid string, Sid string) error { path := "/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -196,16 +196,16 @@ func (c *ApiService) DeleteUsAppToPerson(MessagingServiceSid string, Sid string) return nil } -// func (c *ApiService) FetchUsAppToPerson(MessagingServiceSid string, Sid string) (*MessagingV1UsAppToPerson, error) { path := "/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -244,10 +244,11 @@ func (c *ApiService) PageUsAppToPerson(MessagingServiceSid string, params *ListU path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -257,7 +258,7 @@ func (c *ApiService) PageUsAppToPerson(MessagingServiceSid string, params *ListU data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -344,7 +345,7 @@ func (c *ApiService) getNextListUsAppToPersonResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_compliance_usa2p_usecases.go b/rest/messaging/v1/services_compliance_usa2p_usecases.go index 93a7586c0..a9dc6c66b 100644 --- a/rest/messaging/v1/services_compliance_usa2p_usecases.go +++ b/rest/messaging/v1/services_compliance_usa2p_usecases.go @@ -31,19 +31,19 @@ func (params *FetchUsAppToPersonUsecaseParams) SetBrandRegistrationSid(BrandRegi return params } -// func (c *ApiService) FetchUsAppToPersonUsecase(MessagingServiceSid string, params *FetchUsAppToPersonUsecaseParams) (*MessagingV1UsAppToPersonUsecase, error) { path := "/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/Usecases" path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BrandRegistrationSid != nil { - data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) + queryParams.Set("BrandRegistrationSid", *params.BrandRegistrationSid) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_phone_numbers.go b/rest/messaging/v1/services_phone_numbers.go index 1f2f48fbb..2408ba49a 100644 --- a/rest/messaging/v1/services_phone_numbers.go +++ b/rest/messaging/v1/services_phone_numbers.go @@ -34,19 +34,19 @@ func (params *CreatePhoneNumberParams) SetPhoneNumberSid(PhoneNumberSid string) return params } -// func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNumberParams) (*MessagingV1PhoneNumber, error) { path := "/v1/Services/{ServiceSid}/PhoneNumbers" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumberSid != nil { data.Set("PhoneNumberSid", *params.PhoneNumberSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -61,16 +61,16 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum return ps, err } -// func (c *ApiService) DeletePhoneNumber(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/PhoneNumbers/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -80,16 +80,16 @@ func (c *ApiService) DeletePhoneNumber(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchPhoneNumber(ServiceSid string, Sid string) (*MessagingV1PhoneNumber, error) { path := "/v1/Services/{ServiceSid}/PhoneNumbers/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +128,11 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +142,7 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +229,7 @@ func (c *ApiService) getNextListPhoneNumberResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_preregistered_usa2p.go b/rest/messaging/v1/services_preregistered_usa2p.go index f188b45af..ece42022e 100644 --- a/rest/messaging/v1/services_preregistered_usa2p.go +++ b/rest/messaging/v1/services_preregistered_usa2p.go @@ -36,11 +36,11 @@ func (params *CreateExternalCampaignParams) SetMessagingServiceSid(MessagingServ return params } -// func (c *ApiService) CreateExternalCampaign(params *CreateExternalCampaignParams) (*MessagingV1ExternalCampaign, error) { path := "/v1/Services/PreregisteredUsa2p" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CampaignId != nil { @@ -50,7 +50,7 @@ func (c *ApiService) CreateExternalCampaign(params *CreateExternalCampaignParams data.Set("MessagingServiceSid", *params.MessagingServiceSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_short_codes.go b/rest/messaging/v1/services_short_codes.go index 19745e3d4..c7c8051e0 100644 --- a/rest/messaging/v1/services_short_codes.go +++ b/rest/messaging/v1/services_short_codes.go @@ -34,19 +34,19 @@ func (params *CreateShortCodeParams) SetShortCodeSid(ShortCodeSid string) *Creat return params } -// func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeParams) (*MessagingV1ShortCode, error) { path := "/v1/Services/{ServiceSid}/ShortCodes" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ShortCodeSid != nil { data.Set("ShortCodeSid", *params.ShortCodeSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -61,16 +61,16 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP return ps, err } -// func (c *ApiService) DeleteShortCode(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/ShortCodes/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -80,16 +80,16 @@ func (c *ApiService) DeleteShortCode(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchShortCode(ServiceSid string, Sid string) (*MessagingV1ShortCode, error) { path := "/v1/Services/{ServiceSid}/ShortCodes/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +128,11 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +142,7 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +229,7 @@ func (c *ApiService) getNextListShortCodeResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/messaging/v1/services_usecases.go b/rest/messaging/v1/services_usecases.go index 6fd408723..83dbf1e8e 100644 --- a/rest/messaging/v1/services_usecases.go +++ b/rest/messaging/v1/services_usecases.go @@ -19,14 +19,14 @@ import ( "net/url" ) -// func (c *ApiService) FetchUsecase() (*MessagingV1Usecase, error) { path := "/v1/Services/Usecases" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/messaging/v1/tollfree_verifications.go b/rest/messaging/v1/tollfree_verifications.go index e3555d68a..0885329b3 100644 --- a/rest/messaging/v1/tollfree_verifications.go +++ b/rest/messaging/v1/tollfree_verifications.go @@ -166,11 +166,11 @@ func (params *CreateTollfreeVerificationParams) SetExternalReferenceId(ExternalR return params } -// func (c *ApiService) CreateTollfreeVerification(params *CreateTollfreeVerificationParams) (*MessagingV1TollfreeVerification, error) { path := "/v1/Tollfree/Verifications" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BusinessName != nil { @@ -247,7 +247,7 @@ func (c *ApiService) CreateTollfreeVerification(params *CreateTollfreeVerificati data.Set("ExternalReferenceId", *params.ExternalReferenceId) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -262,15 +262,15 @@ func (c *ApiService) CreateTollfreeVerification(params *CreateTollfreeVerificati return ps, err } -// func (c *ApiService) DeleteTollfreeVerification(Sid string) error { path := "/v1/Tollfree/Verifications/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -280,15 +280,15 @@ func (c *ApiService) DeleteTollfreeVerification(Sid string) error { return nil } -// func (c *ApiService) FetchTollfreeVerification(Sid string) (*MessagingV1TollfreeVerification, error) { path := "/v1/Tollfree/Verifications/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -337,16 +337,17 @@ func (c *ApiService) PageTollfreeVerification(params *ListTollfreeVerificationPa path := "/v1/Tollfree/Verifications" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TollfreePhoneNumberSid != nil { - data.Set("TollfreePhoneNumberSid", *params.TollfreePhoneNumberSid) + queryParams.Set("TollfreePhoneNumberSid", *params.TollfreePhoneNumberSid) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -356,7 +357,7 @@ func (c *ApiService) PageTollfreeVerification(params *ListTollfreeVerificationPa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -443,7 +444,7 @@ func (c *ApiService) getNextListTollfreeVerificationResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -588,12 +589,12 @@ func (params *UpdateTollfreeVerificationParams) SetEditReason(EditReason string) return params } -// func (c *ApiService) UpdateTollfreeVerification(Sid string, params *UpdateTollfreeVerificationParams) (*MessagingV1TollfreeVerification, error) { path := "/v1/Tollfree/Verifications/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BusinessName != nil { @@ -664,7 +665,7 @@ func (c *ApiService) UpdateTollfreeVerification(Sid string, params *UpdateTollfr data.Set("EditReason", *params.EditReason) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/README.md b/rest/microvisor/v1/README.md index f2b961876..c26bd6248 100644 --- a/rest/microvisor/v1/README.md +++ b/rest/microvisor/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/microvisor/v1/apps.go b/rest/microvisor/v1/apps.go index 31c92a719..7ba878a1a 100644 --- a/rest/microvisor/v1/apps.go +++ b/rest/microvisor/v1/apps.go @@ -29,9 +29,10 @@ func (c *ApiService) DeleteApp(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -47,9 +48,10 @@ func (c *ApiService) FetchApp(Sid string) (*MicrovisorV1App, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,10 +88,11 @@ func (c *ApiService) PageApp(params *ListAppParams, pageToken, pageNumber string path := "/v1/Apps" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -99,7 +102,7 @@ func (c *ApiService) PageApp(params *ListAppParams, pageToken, pageNumber string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -186,7 +189,7 @@ func (c *ApiService) getNextListAppResponse(nextPageUrl string) (interface{}, er if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/apps_manifest.go b/rest/microvisor/v1/apps_manifest.go index c9eb9bf24..a9fd94b39 100644 --- a/rest/microvisor/v1/apps_manifest.go +++ b/rest/microvisor/v1/apps_manifest.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchAppManifest(AppSid string) (*MicrovisorV1AppManifest, path = strings.Replace(path, "{"+"AppSid"+"}", AppSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/configs.go b/rest/microvisor/v1/configs.go index b1b5ad71e..011074003 100644 --- a/rest/microvisor/v1/configs.go +++ b/rest/microvisor/v1/configs.go @@ -45,6 +45,7 @@ func (c *ApiService) CreateAccountConfig(params *CreateAccountConfigParams) (*Mi path := "/v1/Configs" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -54,7 +55,7 @@ func (c *ApiService) CreateAccountConfig(params *CreateAccountConfigParams) (*Mi data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -75,9 +76,10 @@ func (c *ApiService) DeleteAccountConfig(Key string) error { path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -93,9 +95,10 @@ func (c *ApiService) FetchAccountConfig(Key string) (*MicrovisorV1AccountConfig, path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -132,10 +135,11 @@ func (c *ApiService) PageAccountConfig(params *ListAccountConfigParams, pageToke path := "/v1/Configs" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -145,7 +149,7 @@ func (c *ApiService) PageAccountConfig(params *ListAccountConfigParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -232,7 +236,7 @@ func (c *ApiService) getNextListAccountConfigResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -263,13 +267,14 @@ func (c *ApiService) UpdateAccountConfig(Key string, params *UpdateAccountConfig path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Value != nil { data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/devices.go b/rest/microvisor/v1/devices.go index 731efd963..b47cee97c 100644 --- a/rest/microvisor/v1/devices.go +++ b/rest/microvisor/v1/devices.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchDevice(Sid string) (*MicrovisorV1Device, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageDevice(params *ListDeviceParams, pageToken, pageNumber path := "/v1/Devices" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageDevice(params *ListDeviceParams, pageToken, pageNumber data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListDeviceResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -217,6 +219,7 @@ func (c *ApiService) UpdateDevice(Sid string, params *UpdateDeviceParams) (*Micr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -232,7 +235,7 @@ func (c *ApiService) UpdateDevice(Sid string, params *UpdateDeviceParams) (*Micr data.Set("RestartApp", fmt.Sprint(*params.RestartApp)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/devices_configs.go b/rest/microvisor/v1/devices_configs.go index ebaebfb23..23951aa9d 100644 --- a/rest/microvisor/v1/devices_configs.go +++ b/rest/microvisor/v1/devices_configs.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateDeviceConfig(DeviceSid string, params *CreateDeviceCo path = strings.Replace(path, "{"+"DeviceSid"+"}", DeviceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateDeviceConfig(DeviceSid string, params *CreateDeviceCo data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteDeviceConfig(DeviceSid string, Key string) error { path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchDeviceConfig(DeviceSid string, Key string) (*Microviso path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageDeviceConfig(DeviceSid string, params *ListDeviceConfig path = strings.Replace(path, "{"+"DeviceSid"+"}", DeviceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageDeviceConfig(DeviceSid string, params *ListDeviceConfig data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListDeviceConfigResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -269,13 +273,14 @@ func (c *ApiService) UpdateDeviceConfig(DeviceSid string, Key string, params *Up path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Value != nil { data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/devices_secrets.go b/rest/microvisor/v1/devices_secrets.go index be0e7320a..bf1f8ab9d 100644 --- a/rest/microvisor/v1/devices_secrets.go +++ b/rest/microvisor/v1/devices_secrets.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateDeviceSecret(DeviceSid string, params *CreateDeviceSe path = strings.Replace(path, "{"+"DeviceSid"+"}", DeviceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateDeviceSecret(DeviceSid string, params *CreateDeviceSe data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteDeviceSecret(DeviceSid string, Key string) error { path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchDeviceSecret(DeviceSid string, Key string) (*Microviso path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageDeviceSecret(DeviceSid string, params *ListDeviceSecret path = strings.Replace(path, "{"+"DeviceSid"+"}", DeviceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageDeviceSecret(DeviceSid string, params *ListDeviceSecret data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListDeviceSecretResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -269,13 +273,14 @@ func (c *ApiService) UpdateDeviceSecret(DeviceSid string, Key string, params *Up path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Value != nil { data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/microvisor/v1/secrets.go b/rest/microvisor/v1/secrets.go index 12d2ce8e1..279a494c2 100644 --- a/rest/microvisor/v1/secrets.go +++ b/rest/microvisor/v1/secrets.go @@ -45,6 +45,7 @@ func (c *ApiService) CreateAccountSecret(params *CreateAccountSecretParams) (*Mi path := "/v1/Secrets" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -54,7 +55,7 @@ func (c *ApiService) CreateAccountSecret(params *CreateAccountSecretParams) (*Mi data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -75,9 +76,10 @@ func (c *ApiService) DeleteAccountSecret(Key string) error { path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -93,9 +95,10 @@ func (c *ApiService) FetchAccountSecret(Key string) (*MicrovisorV1AccountSecret, path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -132,10 +135,11 @@ func (c *ApiService) PageAccountSecret(params *ListAccountSecretParams, pageToke path := "/v1/Secrets" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -145,7 +149,7 @@ func (c *ApiService) PageAccountSecret(params *ListAccountSecretParams, pageToke data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -232,7 +236,7 @@ func (c *ApiService) getNextListAccountSecretResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -263,13 +267,14 @@ func (c *ApiService) UpdateAccountSecret(Key string, params *UpdateAccountSecret path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Value != nil { data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/monitor/v1/README.md b/rest/monitor/v1/README.md index 0a2837eff..e3e9e5e07 100644 --- a/rest/monitor/v1/README.md +++ b/rest/monitor/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/monitor/v1/alerts.go b/rest/monitor/v1/alerts.go index 7fc808c65..fe4f3527d 100644 --- a/rest/monitor/v1/alerts.go +++ b/rest/monitor/v1/alerts.go @@ -24,15 +24,15 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchAlert(Sid string) (*MonitorV1AlertInstance, error) { path := "/v1/Alerts/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -87,19 +87,20 @@ func (c *ApiService) PageAlert(params *ListAlertParams, pageToken, pageNumber st path := "/v1/Alerts" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.LogLevel != nil { - data.Set("LogLevel", *params.LogLevel) + queryParams.Set("LogLevel", *params.LogLevel) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -109,7 +110,7 @@ func (c *ApiService) PageAlert(params *ListAlertParams, pageToken, pageNumber st data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -196,7 +197,7 @@ func (c *ApiService) getNextListAlertResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/monitor/v1/events.go b/rest/monitor/v1/events.go index 98492ac46..a6f67cd41 100644 --- a/rest/monitor/v1/events.go +++ b/rest/monitor/v1/events.go @@ -24,15 +24,15 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchEvent(Sid string) (*MonitorV1Event, error) { path := "/v1/Events/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -105,28 +105,29 @@ func (c *ApiService) PageEvent(params *ListEventParams, pageToken, pageNumber st path := "/v1/Events" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ActorSid != nil { - data.Set("ActorSid", *params.ActorSid) + queryParams.Set("ActorSid", *params.ActorSid) } if params != nil && params.EventType != nil { - data.Set("EventType", *params.EventType) + queryParams.Set("EventType", *params.EventType) } if params != nil && params.ResourceSid != nil { - data.Set("ResourceSid", *params.ResourceSid) + queryParams.Set("ResourceSid", *params.ResourceSid) } if params != nil && params.SourceIpAddress != nil { - data.Set("SourceIpAddress", *params.SourceIpAddress) + queryParams.Set("SourceIpAddress", *params.SourceIpAddress) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +137,7 @@ func (c *ApiService) PageEvent(params *ListEventParams, pageToken, pageNumber st data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func (c *ApiService) getNextListEventResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/notify/v1/README.md b/rest/notify/v1/README.md index 6ed7b5994..a8e72651b 100644 --- a/rest/notify/v1/README.md +++ b/rest/notify/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/notify/v1/credentials.go b/rest/notify/v1/credentials.go index 196d912d3..6889a9ae9 100644 --- a/rest/notify/v1/credentials.go +++ b/rest/notify/v1/credentials.go @@ -70,11 +70,11 @@ func (params *CreateCredentialParams) SetSecret(Secret string) *CreateCredential return params } -// func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1Credential, error) { path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Type != nil { @@ -99,7 +99,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -114,15 +114,15 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 return ps, err } -// func (c *ApiService) DeleteCredential(Sid string) error { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -132,15 +132,15 @@ func (c *ApiService) DeleteCredential(Sid string) error { return nil } -// func (c *ApiService) FetchCredential(Sid string) (*NotifyV1Credential, error) { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +177,11 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag path := "/v1/Credentials" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListCredentialResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -332,12 +333,12 @@ func (params *UpdateCredentialParams) SetSecret(Secret string) *UpdateCredential return params } -// func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams) (*NotifyV1Credential, error) { path := "/v1/Credentials/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -359,7 +360,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data.Set("Secret", *params.Secret) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/notify/v1/services.go b/rest/notify/v1/services.go index e19cdb3d3..aa02d6bc3 100644 --- a/rest/notify/v1/services.go +++ b/rest/notify/v1/services.go @@ -112,11 +112,11 @@ func (params *CreateServiceParams) SetDeliveryCallbackEnabled(DeliveryCallbackEn return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Service, error) { path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -162,7 +162,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic data.Set("DeliveryCallbackEnabled", fmt.Sprint(*params.DeliveryCallbackEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,15 +177,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -195,15 +195,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*NotifyV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -246,13 +246,14 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -262,7 +263,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -349,7 +350,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -452,12 +453,12 @@ func (params *UpdateServiceParams) SetDeliveryCallbackEnabled(DeliveryCallbackEn return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*NotifyV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -503,7 +504,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*No data.Set("DeliveryCallbackEnabled", fmt.Sprint(*params.DeliveryCallbackEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/notify/v1/services_bindings.go b/rest/notify/v1/services_bindings.go index 6240d68eb..be5f138b2 100644 --- a/rest/notify/v1/services_bindings.go +++ b/rest/notify/v1/services_bindings.go @@ -70,12 +70,12 @@ func (params *CreateBindingParams) SetEndpoint(Endpoint string) *CreateBindingPa return params } -// func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParams) (*NotifyV1Binding, error) { path := "/v1/Services/{ServiceSid}/Bindings" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -102,7 +102,7 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam data.Set("Endpoint", *params.Endpoint) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -117,16 +117,16 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam return ps, err } -// func (c *ApiService) DeleteBinding(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -136,16 +136,16 @@ func (c *ApiService) DeleteBinding(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchBinding(ServiceSid string, Sid string) (*NotifyV1Binding, error) { path := "/v1/Services/{ServiceSid}/Bindings/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -208,26 +208,27 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) + queryParams.Set("StartDate", fmt.Sprint(*params.StartDate)) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) + queryParams.Set("EndDate", fmt.Sprint(*params.EndDate)) } if params != nil && params.Identity != nil { for _, item := range *params.Identity { - data.Add("Identity", item) + queryParams.Add("Identity", item) } } if params != nil && params.Tag != nil { for _, item := range *params.Tag { - data.Add("Tag", item) + queryParams.Add("Tag", item) } } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -237,7 +238,7 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -324,7 +325,7 @@ func (c *ApiService) getNextListBindingResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/notify/v1/services_notifications.go b/rest/notify/v1/services_notifications.go index 8a1f70e1f..066ebb54c 100644 --- a/rest/notify/v1/services_notifications.go +++ b/rest/notify/v1/services_notifications.go @@ -134,12 +134,12 @@ func (params *CreateNotificationParams) SetTag(Tag []string) *CreateNotification return params } -// func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotificationParams) (*NotifyV1Notification, error) { path := "/v1/Services/{ServiceSid}/Notifications" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -247,7 +247,7 @@ func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotific } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v1/README.md b/rest/numbers/v1/README.md index f8388987d..257d408c1 100644 --- a/rest/numbers/v1/README.md +++ b/rest/numbers/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/numbers/v1/hosted_number_eligibility_bulk.go b/rest/numbers/v1/hosted_number_eligibility_bulk.go index 9bdfdaa90..a0d03cf70 100644 --- a/rest/numbers/v1/hosted_number_eligibility_bulk.go +++ b/rest/numbers/v1/hosted_number_eligibility_bulk.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchBulkEligibility(RequestId string) (*NumbersV1BulkEligi path = strings.Replace(path, "{"+"RequestId"+"}", RequestId, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v1/porting_port_in.go b/rest/numbers/v1/porting_port_in.go index 06060c37a..b2e7620cd 100644 --- a/rest/numbers/v1/porting_port_in.go +++ b/rest/numbers/v1/porting_port_in.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchPortingPortInFetch(PortInRequestSid string) (*NumbersV path = strings.Replace(path, "{"+"PortInRequestSid"+"}", PortInRequestSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v1/porting_portability.go b/rest/numbers/v1/porting_portability.go index 813ecdfb1..e23f24e37 100644 --- a/rest/numbers/v1/porting_portability.go +++ b/rest/numbers/v1/porting_portability.go @@ -36,6 +36,7 @@ func (c *ApiService) CreatePortingBulkPortability(params *CreatePortingBulkPorta path := "/v1/Porting/Portability" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumbers != nil { @@ -44,7 +45,7 @@ func (c *ApiService) CreatePortingBulkPortability(params *CreatePortingBulkPorta } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -65,9 +66,10 @@ func (c *ApiService) FetchPortingBulkPortability(Sid string) (*NumbersV1PortingB path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v1/porting_portability_phone_number.go b/rest/numbers/v1/porting_portability_phone_number.go index 22279148c..abc11befe 100644 --- a/rest/numbers/v1/porting_portability_phone_number.go +++ b/rest/numbers/v1/porting_portability_phone_number.go @@ -37,13 +37,14 @@ func (c *ApiService) FetchPortingPortability(PhoneNumber string, params *FetchPo path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TargetAccountSid != nil { - data.Set("TargetAccountSid", *params.TargetAccountSid) + queryParams.Set("TargetAccountSid", *params.TargetAccountSid) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v2/README.md b/rest/numbers/v2/README.md index e0c6103ee..320bed485 100644 --- a/rest/numbers/v2/README.md +++ b/rest/numbers/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/numbers/v2/hosted_number_authorization_documents.go b/rest/numbers/v2/hosted_number_authorization_documents.go index f258fe604..bc8a4e8c4 100644 --- a/rest/numbers/v2/hosted_number_authorization_documents.go +++ b/rest/numbers/v2/hosted_number_authorization_documents.go @@ -69,6 +69,7 @@ func (c *ApiService) CreateAuthorizationDocument(params *CreateAuthorizationDocu path := "/v2/HostedNumber/AuthorizationDocuments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AddressSid != nil { @@ -94,7 +95,7 @@ func (c *ApiService) CreateAuthorizationDocument(params *CreateAuthorizationDocu } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -115,9 +116,10 @@ func (c *ApiService) DeleteAuthorizationDocument(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -133,9 +135,10 @@ func (c *ApiService) FetchAuthorizationDocument(Sid string) (*NumbersV2Authoriza path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -184,16 +187,17 @@ func (c *ApiService) PageAuthorizationDocument(params *ListAuthorizationDocument path := "/v2/HostedNumber/AuthorizationDocuments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Email != nil { - data.Set("Email", *params.Email) + queryParams.Set("Email", *params.Email) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -203,7 +207,7 @@ func (c *ApiService) PageAuthorizationDocument(params *ListAuthorizationDocument data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -290,7 +294,7 @@ func (c *ApiService) getNextListAuthorizationDocumentResponse(nextPageUrl string if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go b/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go index 5e5c55323..3871d63f8 100644 --- a/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go +++ b/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go @@ -71,22 +71,23 @@ func (c *ApiService) PageDependentHostedNumberOrder(SigningDocumentSid string, p path = strings.Replace(path, "{"+"SigningDocumentSid"+"}", SigningDocumentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.IncomingPhoneNumberSid != nil { - data.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) + queryParams.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -96,7 +97,7 @@ func (c *ApiService) PageDependentHostedNumberOrder(SigningDocumentSid string, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -183,7 +184,7 @@ func (c *ApiService) getNextListDependentHostedNumberOrderResponse(nextPageUrl s if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/hosted_number_orders.go b/rest/numbers/v2/hosted_number_orders.go index 2b61d2000..d7407ec4d 100644 --- a/rest/numbers/v2/hosted_number_orders.go +++ b/rest/numbers/v2/hosted_number_orders.go @@ -129,6 +129,7 @@ func (c *ApiService) CreateHostedNumberOrder(params *CreateHostedNumberOrderPara path := "/v2/HostedNumber/Orders" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { @@ -182,7 +183,7 @@ func (c *ApiService) CreateHostedNumberOrder(params *CreateHostedNumberOrderPara data.Set("ContactTitle", *params.ContactTitle) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -203,9 +204,10 @@ func (c *ApiService) DeleteHostedNumberOrder(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -221,9 +223,10 @@ func (c *ApiService) FetchHostedNumberOrder(Sid string) (*NumbersV2HostedNumberO path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -290,25 +293,26 @@ func (c *ApiService) PageHostedNumberOrder(params *ListHostedNumberOrderParams, path := "/v2/HostedNumber/Orders" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.SmsCapability != nil { - data.Set("SmsCapability", fmt.Sprint(*params.SmsCapability)) + queryParams.Set("SmsCapability", fmt.Sprint(*params.SmsCapability)) } if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) + queryParams.Set("PhoneNumber", *params.PhoneNumber) } if params != nil && params.IncomingPhoneNumberSid != nil { - data.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) + queryParams.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -318,7 +322,7 @@ func (c *ApiService) PageHostedNumberOrder(params *ListHostedNumberOrderParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -405,7 +409,7 @@ func (c *ApiService) getNextListHostedNumberOrderResponse(nextPageUrl string) (i if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/hosted_number_orders_bulk.go b/rest/numbers/v2/hosted_number_orders_bulk.go index 341c7eee2..61103031f 100644 --- a/rest/numbers/v2/hosted_number_orders_bulk.go +++ b/rest/numbers/v2/hosted_number_orders_bulk.go @@ -37,13 +37,14 @@ func (c *ApiService) FetchBulkHostedNumberOrder(BulkHostingSid string, params *F path = strings.Replace(path, "{"+"BulkHostingSid"+"}", BulkHostingSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.OrderStatus != nil { - data.Set("OrderStatus", *params.OrderStatus) + queryParams.Set("OrderStatus", *params.OrderStatus) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_bundles.go b/rest/numbers/v2/regulatory_compliance_bundles.go index cd0a3c8d2..2b1a8bbbe 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles.go +++ b/rest/numbers/v2/regulatory_compliance_bundles.go @@ -76,6 +76,7 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Bundle, path := "/v2/RegulatoryCompliance/Bundles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -100,7 +101,7 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Bundle, data.Set("NumberType", *params.NumberType) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -121,9 +122,10 @@ func (c *ApiService) DeleteBundle(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -139,9 +141,10 @@ func (c *ApiService) FetchBundle(Sid string) (*NumbersV2Bundle, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -244,43 +247,44 @@ func (c *ApiService) PageBundle(params *ListBundleParams, pageToken, pageNumber path := "/v2/RegulatoryCompliance/Bundles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.RegulationSid != nil { - data.Set("RegulationSid", *params.RegulationSid) + queryParams.Set("RegulationSid", *params.RegulationSid) } if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) + queryParams.Set("IsoCountry", *params.IsoCountry) } if params != nil && params.NumberType != nil { - data.Set("NumberType", *params.NumberType) + queryParams.Set("NumberType", *params.NumberType) } if params != nil && params.HasValidUntilDate != nil { - data.Set("HasValidUntilDate", fmt.Sprint(*params.HasValidUntilDate)) + queryParams.Set("HasValidUntilDate", fmt.Sprint(*params.HasValidUntilDate)) } if params != nil && params.SortBy != nil { - data.Set("SortBy", *params.SortBy) + queryParams.Set("SortBy", *params.SortBy) } if params != nil && params.SortDirection != nil { - data.Set("SortDirection", *params.SortDirection) + queryParams.Set("SortDirection", *params.SortDirection) } if params != nil && params.ValidUntilDate != nil { - data.Set("ValidUntilDate", fmt.Sprint((*params.ValidUntilDate).Format(time.RFC3339))) + queryParams.Set("ValidUntilDate", fmt.Sprint((*params.ValidUntilDate).Format(time.RFC3339))) } if params != nil && params.ValidUntilDateBefore != nil { - data.Set("ValidUntilDate<", fmt.Sprint((*params.ValidUntilDateBefore).Format(time.RFC3339))) + queryParams.Set("ValidUntilDate<", fmt.Sprint((*params.ValidUntilDateBefore).Format(time.RFC3339))) } if params != nil && params.ValidUntilDateAfter != nil { - data.Set("ValidUntilDate>", fmt.Sprint((*params.ValidUntilDateAfter).Format(time.RFC3339))) + queryParams.Set("ValidUntilDate>", fmt.Sprint((*params.ValidUntilDateAfter).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -290,7 +294,7 @@ func (c *ApiService) PageBundle(params *ListBundleParams, pageToken, pageNumber data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -377,7 +381,7 @@ func (c *ApiService) getNextListBundleResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -426,6 +430,7 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -441,7 +446,7 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb data.Set("Email", *params.Email) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_bundles_copies.go b/rest/numbers/v2/regulatory_compliance_bundles_copies.go index b8e6f66e3..23f052270 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_copies.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_copies.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateBundleCopy(BundleSid string, params *CreateBundleCopy path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -85,10 +86,11 @@ func (c *ApiService) PageBundleCopy(BundleSid string, params *ListBundleCopyPara path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -98,7 +100,7 @@ func (c *ApiService) PageBundleCopy(BundleSid string, params *ListBundleCopyPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -185,7 +187,7 @@ func (c *ApiService) getNextListBundleCopyResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go index b40de2007..b6685ab11 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go @@ -29,9 +29,10 @@ func (c *ApiService) CreateEvaluation(BundleSid string) (*NumbersV2Evaluation, e path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -53,9 +54,10 @@ func (c *ApiService) FetchEvaluation(BundleSid string, Sid string) (*NumbersV2Ev path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -94,10 +96,11 @@ func (c *ApiService) PageEvaluation(BundleSid string, params *ListEvaluationPara path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -107,7 +110,7 @@ func (c *ApiService) PageEvaluation(BundleSid string, params *ListEvaluationPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -194,7 +197,7 @@ func (c *ApiService) getNextListEvaluationResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go index bdc63e88c..35e78c107 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateItemAssignment(BundleSid string, params *CreateItemAs path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteItemAssignment(BundleSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchItemAssignment(BundleSid string, Sid string) (*Numbers path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageItemAssignment(BundleSid string, params *ListItemAssign path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageItemAssignment(BundleSid string, params *ListItemAssign data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListItemAssignmentResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go b/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go index 47fdfeafd..34aad139a 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go @@ -37,13 +37,14 @@ func (c *ApiService) CreateReplaceItems(BundleSid string, params *CreateReplaceI path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FromBundleSid != nil { data.Set("FromBundleSid", *params.FromBundleSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_end_user_types.go b/rest/numbers/v2/regulatory_compliance_end_user_types.go index 586950315..cba82c89f 100644 --- a/rest/numbers/v2/regulatory_compliance_end_user_types.go +++ b/rest/numbers/v2/regulatory_compliance_end_user_types.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchEndUserType(Sid string) (*NumbersV2EndUserType, error) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken, p path := "/v2/RegulatoryCompliance/EndUserTypes" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListEndUserTypeResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_end_users.go b/rest/numbers/v2/regulatory_compliance_end_users.go index 334497be3..b5bce6736 100644 --- a/rest/numbers/v2/regulatory_compliance_end_users.go +++ b/rest/numbers/v2/regulatory_compliance_end_users.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2EndUs path := "/v2/RegulatoryCompliance/EndUsers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -69,7 +70,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2EndUs data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -90,9 +91,10 @@ func (c *ApiService) DeleteEndUser(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -108,9 +110,10 @@ func (c *ApiService) FetchEndUser(Sid string) (*NumbersV2EndUser, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,10 +150,11 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken, pageNumbe path := "/v2/RegulatoryCompliance/EndUsers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -160,7 +164,7 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -247,7 +251,7 @@ func (c *ApiService) getNextListEndUserResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -284,6 +288,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -299,7 +304,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_regulations.go b/rest/numbers/v2/regulatory_compliance_regulations.go index f4d28ab92..96d8ecdf0 100644 --- a/rest/numbers/v2/regulatory_compliance_regulations.go +++ b/rest/numbers/v2/regulatory_compliance_regulations.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchRegulation(Sid string) (*NumbersV2Regulation, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,19 +87,20 @@ func (c *ApiService) PageRegulation(params *ListRegulationParams, pageToken, pag path := "/v2/RegulatoryCompliance/Regulations" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndUserType != nil { - data.Set("EndUserType", *params.EndUserType) + queryParams.Set("EndUserType", *params.EndUserType) } if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) + queryParams.Set("IsoCountry", *params.IsoCountry) } if params != nil && params.NumberType != nil { - data.Set("NumberType", *params.NumberType) + queryParams.Set("NumberType", *params.NumberType) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -108,7 +110,7 @@ func (c *ApiService) PageRegulation(params *ListRegulationParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -195,7 +197,7 @@ func (c *ApiService) getNextListRegulationResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go index 8891d7476..8130ec9d0 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchSupportingDocumentType(Sid string) (*NumbersV2Supporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy path := "/v2/RegulatoryCompliance/SupportingDocumentTypes" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListSupportingDocumentTypeResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/numbers/v2/regulatory_compliance_supporting_documents.go b/rest/numbers/v2/regulatory_compliance_supporting_documents.go index 596fc9232..3b80cc1d7 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_documents.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_documents.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa path := "/v2/RegulatoryCompliance/SupportingDocuments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -69,7 +70,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -90,9 +91,10 @@ func (c *ApiService) DeleteSupportingDocument(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -108,9 +110,10 @@ func (c *ApiService) FetchSupportingDocument(Sid string) (*NumbersV2SupportingDo path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,10 +150,11 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams path := "/v2/RegulatoryCompliance/SupportingDocuments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -160,7 +164,7 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -247,7 +251,7 @@ func (c *ApiService) getNextListSupportingDocumentResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -284,6 +288,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -299,7 +304,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/pricing/v1/README.md b/rest/pricing/v1/README.md index a21cd8d53..3a392e931 100644 --- a/rest/pricing/v1/README.md +++ b/rest/pricing/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/pricing/v1/messaging_countries.go b/rest/pricing/v1/messaging_countries.go index 44948443b..afdd6d40b 100644 --- a/rest/pricing/v1/messaging_countries.go +++ b/rest/pricing/v1/messaging_countries.go @@ -23,15 +23,15 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchMessagingCountry(IsoCountry string) (*PricingV1MessagingCountryInstance, error) { path := "/v1/Messaging/Countries/{IsoCountry}" path = strings.Replace(path, "{"+"IsoCountry"+"}", IsoCountry, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +68,11 @@ func (c *ApiService) PageMessagingCountry(params *ListMessagingCountryParams, pa path := "/v1/Messaging/Countries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +82,7 @@ func (c *ApiService) PageMessagingCountry(params *ListMessagingCountryParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +169,7 @@ func (c *ApiService) getNextListMessagingCountryResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/pricing/v1/phone_numbers_countries.go b/rest/pricing/v1/phone_numbers_countries.go index 45e54bb34..c946fd4bb 100644 --- a/rest/pricing/v1/phone_numbers_countries.go +++ b/rest/pricing/v1/phone_numbers_countries.go @@ -23,15 +23,15 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchPhoneNumberCountry(IsoCountry string) (*PricingV1PhoneNumberCountryInstance, error) { path := "/v1/PhoneNumbers/Countries/{IsoCountry}" path = strings.Replace(path, "{"+"IsoCountry"+"}", IsoCountry, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +68,11 @@ func (c *ApiService) PagePhoneNumberCountry(params *ListPhoneNumberCountryParams path := "/v1/PhoneNumbers/Countries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +82,7 @@ func (c *ApiService) PagePhoneNumberCountry(params *ListPhoneNumberCountryParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +169,7 @@ func (c *ApiService) getNextListPhoneNumberCountryResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/pricing/v1/voice_countries.go b/rest/pricing/v1/voice_countries.go index 97a5dce22..dcd9dde2c 100644 --- a/rest/pricing/v1/voice_countries.go +++ b/rest/pricing/v1/voice_countries.go @@ -23,15 +23,15 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchVoiceCountry(IsoCountry string) (*PricingV1VoiceCountryInstance, error) { path := "/v1/Voice/Countries/{IsoCountry}" path = strings.Replace(path, "{"+"IsoCountry"+"}", IsoCountry, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +68,11 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, path := "/v1/Voice/Countries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +82,7 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +169,7 @@ func (c *ApiService) getNextListVoiceCountryResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/pricing/v1/voice_numbers.go b/rest/pricing/v1/voice_numbers.go index a7993a1bb..4d77e91e0 100644 --- a/rest/pricing/v1/voice_numbers.go +++ b/rest/pricing/v1/voice_numbers.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) FetchVoiceNumber(Number string) (*PricingV1VoiceNumber, error) { path := "/v1/Voice/Numbers/{Number}" path = strings.Replace(path, "{"+"Number"+"}", Number, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/pricing/v2/README.md b/rest/pricing/v2/README.md index 1ef1636ca..8ca94bd4a 100644 --- a/rest/pricing/v2/README.md +++ b/rest/pricing/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/pricing/v2/trunking_countries.go b/rest/pricing/v2/trunking_countries.go index 4a8b32d7c..c73967b23 100644 --- a/rest/pricing/v2/trunking_countries.go +++ b/rest/pricing/v2/trunking_countries.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchTrunkingCountry(IsoCountry string) (*PricingV2Trunking path = strings.Replace(path, "{"+"IsoCountry"+"}", IsoCountry, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageTrunkingCountry(params *ListTrunkingCountryParams, page path := "/v2/Trunking/Countries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageTrunkingCountry(params *ListTrunkingCountryParams, page data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListTrunkingCountryResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/pricing/v2/trunking_numbers.go b/rest/pricing/v2/trunking_numbers.go index 7ecd14fe0..7360132d3 100644 --- a/rest/pricing/v2/trunking_numbers.go +++ b/rest/pricing/v2/trunking_numbers.go @@ -37,13 +37,14 @@ func (c *ApiService) FetchTrunkingNumber(DestinationNumber string, params *Fetch path = strings.Replace(path, "{"+"DestinationNumber"+"}", DestinationNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.OriginationNumber != nil { - data.Set("OriginationNumber", *params.OriginationNumber) + queryParams.Set("OriginationNumber", *params.OriginationNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/pricing/v2/voice_countries.go b/rest/pricing/v2/voice_countries.go index 21ba246d8..fb5493207 100644 --- a/rest/pricing/v2/voice_countries.go +++ b/rest/pricing/v2/voice_countries.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchVoiceCountry(IsoCountry string) (*PricingV2VoiceCountr path = strings.Replace(path, "{"+"IsoCountry"+"}", IsoCountry, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, path := "/v2/Voice/Countries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListVoiceCountryResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/pricing/v2/voice_numbers.go b/rest/pricing/v2/voice_numbers.go index bb56cee05..25936000a 100644 --- a/rest/pricing/v2/voice_numbers.go +++ b/rest/pricing/v2/voice_numbers.go @@ -37,13 +37,14 @@ func (c *ApiService) FetchVoiceNumber(DestinationNumber string, params *FetchVoi path = strings.Replace(path, "{"+"DestinationNumber"+"}", DestinationNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.OriginationNumber != nil { - data.Set("OriginationNumber", *params.OriginationNumber) + queryParams.Set("OriginationNumber", *params.OriginationNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/proxy/v1/README.md b/rest/proxy/v1/README.md index b9d72fa06..512a88f42 100644 --- a/rest/proxy/v1/README.md +++ b/rest/proxy/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/proxy/v1/services.go b/rest/proxy/v1/services.go index 20600cde4..d45605846 100644 --- a/rest/proxy/v1/services.go +++ b/rest/proxy/v1/services.go @@ -81,6 +81,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -108,7 +109,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service data.Set("ChatInstanceSid", *params.ChatInstanceSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -129,9 +130,10 @@ func (c *ApiService) DeleteService(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -147,9 +149,10 @@ func (c *ApiService) FetchService(Sid string) (*ProxyV1Service, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -186,10 +189,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -199,7 +203,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -286,7 +290,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -359,6 +363,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -386,7 +391,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr data.Set("ChatInstanceSid", *params.ChatInstanceSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/proxy/v1/services_phone_numbers.go b/rest/proxy/v1/services_phone_numbers.go index be0ae2d89..cbb20c016 100644 --- a/rest/proxy/v1/services_phone_numbers.go +++ b/rest/proxy/v1/services_phone_numbers.go @@ -52,6 +52,7 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sid != nil { @@ -64,7 +65,7 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,9 +87,10 @@ func (c *ApiService) DeletePhoneNumber(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -105,9 +107,10 @@ func (c *ApiService) FetchPhoneNumber(ServiceSid string, Sid string) (*ProxyV1Ph path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -146,10 +149,11 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -159,7 +163,7 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -246,7 +250,7 @@ func (c *ApiService) getNextListPhoneNumberResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -278,13 +282,14 @@ func (c *ApiService) UpdatePhoneNumber(ServiceSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/proxy/v1/services_sessions.go b/rest/proxy/v1/services_sessions.go index 6b1cff4d7..ae14eac76 100644 --- a/rest/proxy/v1/services_sessions.go +++ b/rest/proxy/v1/services_sessions.go @@ -71,6 +71,7 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -100,7 +101,7 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -122,9 +123,10 @@ func (c *ApiService) DeleteSession(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -141,9 +143,10 @@ func (c *ApiService) FetchSession(ServiceSid string, Sid string) (*ProxyV1Sessio path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,10 +185,11 @@ func (c *ApiService) PageSession(ServiceSid string, params *ListSessionParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -195,7 +199,7 @@ func (c *ApiService) PageSession(ServiceSid string, params *ListSessionParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -282,7 +286,7 @@ func (c *ApiService) getNextListSessionResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -326,6 +330,7 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateExpiry != nil { @@ -338,7 +343,7 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/proxy/v1/services_sessions_interactions.go b/rest/proxy/v1/services_sessions_interactions.go index 106d43666..6e68aa58a 100644 --- a/rest/proxy/v1/services_sessions_interactions.go +++ b/rest/proxy/v1/services_sessions_interactions.go @@ -31,9 +31,10 @@ func (c *ApiService) DeleteInteraction(ServiceSid string, SessionSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -51,9 +52,10 @@ func (c *ApiService) FetchInteraction(ServiceSid string, SessionSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,10 +95,11 @@ func (c *ApiService) PageInteraction(ServiceSid string, SessionSid string, param path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +109,7 @@ func (c *ApiService) PageInteraction(ServiceSid string, SessionSid string, param data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +196,7 @@ func (c *ApiService) getNextListInteractionResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/proxy/v1/services_sessions_participants.go b/rest/proxy/v1/services_sessions_participants.go index dd9262e19..5fb6d3e8a 100644 --- a/rest/proxy/v1/services_sessions_participants.go +++ b/rest/proxy/v1/services_sessions_participants.go @@ -59,6 +59,7 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identifier != nil { @@ -74,7 +75,7 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par data.Set("ProxyIdentifierSid", *params.ProxyIdentifierSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,9 +98,10 @@ func (c *ApiService) DeleteParticipant(ServiceSid string, SessionSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -117,9 +119,10 @@ func (c *ApiService) FetchParticipant(ServiceSid string, SessionSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -159,10 +162,11 @@ func (c *ApiService) PageParticipant(ServiceSid string, SessionSid string, param path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +176,7 @@ func (c *ApiService) PageParticipant(ServiceSid string, SessionSid string, param data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +263,7 @@ func (c *ApiService) getNextListParticipantResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/proxy/v1/services_sessions_participants_message_interactions.go b/rest/proxy/v1/services_sessions_participants_message_interactions.go index e942021e0..7796c3656 100644 --- a/rest/proxy/v1/services_sessions_participants_message_interactions.go +++ b/rest/proxy/v1/services_sessions_participants_message_interactions.go @@ -48,6 +48,7 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Body != nil { @@ -59,7 +60,7 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -74,7 +75,6 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri return ps, err } -// func (c *ApiService) FetchMessageInteraction(ServiceSid string, SessionSid string, ParticipantSid string, Sid string) (*ProxyV1MessageInteraction, error) { path := "/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{ParticipantSid}/MessageInteractions/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -83,9 +83,10 @@ func (c *ApiService) FetchMessageInteraction(ServiceSid string, SessionSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -126,10 +127,11 @@ func (c *ApiService) PageMessageInteraction(ServiceSid string, SessionSid string path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -139,7 +141,7 @@ func (c *ApiService) PageMessageInteraction(ServiceSid string, SessionSid string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -226,7 +228,7 @@ func (c *ApiService) getNextListMessageInteractionResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/proxy/v1/services_short_codes.go b/rest/proxy/v1/services_short_codes.go index 48cac26a9..5b998bc0d 100644 --- a/rest/proxy/v1/services_short_codes.go +++ b/rest/proxy/v1/services_short_codes.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sid != nil { data.Set("Sid", *params.Sid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteShortCode(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchShortCode(ServiceSid string, Sid string) (*ProxyV1Shor path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListShortCodeResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -260,13 +264,14 @@ func (c *ApiService) UpdateShortCode(ServiceSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/routes/v2/README.md b/rest/routes/v2/README.md index ca36a0567..725f02a00 100644 --- a/rest/routes/v2/README.md +++ b/rest/routes/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/routes/v2/phone_numbers.go b/rest/routes/v2/phone_numbers.go index 7614b6d2a..998222e5f 100644 --- a/rest/routes/v2/phone_numbers.go +++ b/rest/routes/v2/phone_numbers.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string) (*RoutesV2PhoneNumber, path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -66,6 +67,7 @@ func (c *ApiService) UpdatePhoneNumber(PhoneNumber string, params *UpdatePhoneNu path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.VoiceRegion != nil { @@ -75,7 +77,7 @@ func (c *ApiService) UpdatePhoneNumber(PhoneNumber string, params *UpdatePhoneNu data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/routes/v2/sip_domains.go b/rest/routes/v2/sip_domains.go index bdaa766ef..1594f1d49 100644 --- a/rest/routes/v2/sip_domains.go +++ b/rest/routes/v2/sip_domains.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) FetchSipDomain(SipDomain string) (*RoutesV2SipDomain, error) { path := "/v2/SipDomains/{SipDomain}" path = strings.Replace(path, "{"+"SipDomain"+"}", SipDomain, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,12 +60,12 @@ func (params *UpdateSipDomainParams) SetFriendlyName(FriendlyName string) *Updat return params } -// func (c *ApiService) UpdateSipDomain(SipDomain string, params *UpdateSipDomainParams) (*RoutesV2SipDomain, error) { path := "/v2/SipDomains/{SipDomain}" path = strings.Replace(path, "{"+"SipDomain"+"}", SipDomain, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.VoiceRegion != nil { @@ -75,7 +75,7 @@ func (c *ApiService) UpdateSipDomain(SipDomain string, params *UpdateSipDomainPa data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/routes/v2/trunks.go b/rest/routes/v2/trunks.go index e5734e5fa..f2f7ec942 100644 --- a/rest/routes/v2/trunks.go +++ b/rest/routes/v2/trunks.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchTrunks(SipTrunkDomain string) (*RoutesV2Trunks, error) path = strings.Replace(path, "{"+"SipTrunkDomain"+"}", SipTrunkDomain, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -66,6 +67,7 @@ func (c *ApiService) UpdateTrunks(SipTrunkDomain string, params *UpdateTrunksPar path = strings.Replace(path, "{"+"SipTrunkDomain"+"}", SipTrunkDomain, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.VoiceRegion != nil { @@ -75,7 +77,7 @@ func (c *ApiService) UpdateTrunks(SipTrunkDomain string, params *UpdateTrunksPar data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/serverless/v1/README.md b/rest/serverless/v1/README.md index f4a73b1d4..84de1e926 100644 --- a/rest/serverless/v1/README.md +++ b/rest/serverless/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/serverless/v1/services.go b/rest/serverless/v1/services.go index cc1c5abca..25da18cf7 100644 --- a/rest/serverless/v1/services.go +++ b/rest/serverless/v1/services.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteService(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -111,9 +113,10 @@ func (c *ApiService) FetchService(Sid string) (*ServerlessV1Service, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -150,10 +153,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -163,7 +167,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -250,7 +254,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -293,6 +297,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IncludeCredentials != nil { @@ -305,7 +310,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_assets.go b/rest/serverless/v1/services_assets.go index 5ce0a10a6..6d9104256 100644 --- a/rest/serverless/v1/services_assets.go +++ b/rest/serverless/v1/services_assets.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateAsset(ServiceSid string, params *CreateAssetParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteAsset(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchAsset(ServiceSid string, Sid string) (*ServerlessV1Ass path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageAsset(ServiceSid string, params *ListAssetParams, pageT path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageAsset(ServiceSid string, params *ListAssetParams, pageT data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListAssetResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -260,13 +264,14 @@ func (c *ApiService) UpdateAsset(ServiceSid string, Sid string, params *UpdateAs path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_assets_versions.go b/rest/serverless/v1/services_assets_versions.go index f3a8e510b..76403b9d9 100644 --- a/rest/serverless/v1/services_assets_versions.go +++ b/rest/serverless/v1/services_assets_versions.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchAssetVersion(ServiceSid string, AssetSid string, Sid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageAssetVersion(ServiceSid string, AssetSid string, params path = strings.Replace(path, "{"+"AssetSid"+"}", AssetSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageAssetVersion(ServiceSid string, AssetSid string, params data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListAssetVersionResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_builds.go b/rest/serverless/v1/services_builds.go index 838001d90..ac72f5012 100644 --- a/rest/serverless/v1/services_builds.go +++ b/rest/serverless/v1/services_builds.go @@ -58,6 +58,7 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AssetVersions != nil { @@ -77,7 +78,7 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( data.Set("Runtime", *params.Runtime) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -99,9 +100,10 @@ func (c *ApiService) DeleteBuild(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -118,9 +120,10 @@ func (c *ApiService) FetchBuild(ServiceSid string, Sid string) (*ServerlessV1Bui path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -159,10 +162,11 @@ func (c *ApiService) PageBuild(ServiceSid string, params *ListBuildParams, pageT path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +176,7 @@ func (c *ApiService) PageBuild(ServiceSid string, params *ListBuildParams, pageT data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +263,7 @@ func (c *ApiService) getNextListBuildResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_builds_status.go b/rest/serverless/v1/services_builds_status.go index 81a3e2553..7152a2c05 100644 --- a/rest/serverless/v1/services_builds_status.go +++ b/rest/serverless/v1/services_builds_status.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchBuildStatus(ServiceSid string, Sid string) (*Serverles path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_environments.go b/rest/serverless/v1/services_environments.go index 0dd9b37b4..5e7872a9a 100644 --- a/rest/serverless/v1/services_environments.go +++ b/rest/serverless/v1/services_environments.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateEnvironment(ServiceSid string, params *CreateEnvironm path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateEnvironment(ServiceSid string, params *CreateEnvironm data.Set("DomainSuffix", *params.DomainSuffix) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteEnvironment(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchEnvironment(ServiceSid string, Sid string) (*Serverles path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageEnvironment(ServiceSid string, params *ListEnvironmentP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageEnvironment(ServiceSid string, params *ListEnvironmentP data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListEnvironmentResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_environments_deployments.go b/rest/serverless/v1/services_environments_deployments.go index d061c40c0..3c1b40c8f 100644 --- a/rest/serverless/v1/services_environments_deployments.go +++ b/rest/serverless/v1/services_environments_deployments.go @@ -41,13 +41,14 @@ func (c *ApiService) CreateDeployment(ServiceSid string, EnvironmentSid string, path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.BuildSid != nil { data.Set("BuildSid", *params.BuildSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -70,9 +71,10 @@ func (c *ApiService) FetchDeployment(ServiceSid string, EnvironmentSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -112,10 +114,11 @@ func (c *ApiService) PageDeployment(ServiceSid string, EnvironmentSid string, pa path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -125,7 +128,7 @@ func (c *ApiService) PageDeployment(ServiceSid string, EnvironmentSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -212,7 +215,7 @@ func (c *ApiService) getNextListDeploymentResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_environments_logs.go b/rest/serverless/v1/services_environments_logs.go index 7fbbc264d..21a11da14 100644 --- a/rest/serverless/v1/services_environments_logs.go +++ b/rest/serverless/v1/services_environments_logs.go @@ -32,9 +32,10 @@ func (c *ApiService) FetchLog(ServiceSid string, EnvironmentSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -92,19 +93,20 @@ func (c *ApiService) PageLog(ServiceSid string, EnvironmentSid string, params *L path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FunctionSid != nil { - data.Set("FunctionSid", *params.FunctionSid) + queryParams.Set("FunctionSid", *params.FunctionSid) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -114,7 +116,7 @@ func (c *ApiService) PageLog(ServiceSid string, EnvironmentSid string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -201,7 +203,7 @@ func (c *ApiService) getNextListLogResponse(nextPageUrl string) (interface{}, er if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_environments_variables.go b/rest/serverless/v1/services_environments_variables.go index 891919414..1b0a821ba 100644 --- a/rest/serverless/v1/services_environments_variables.go +++ b/rest/serverless/v1/services_environments_variables.go @@ -47,6 +47,7 @@ func (c *ApiService) CreateVariable(ServiceSid string, EnvironmentSid string, pa path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -56,7 +57,7 @@ func (c *ApiService) CreateVariable(ServiceSid string, EnvironmentSid string, pa data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,9 +80,10 @@ func (c *ApiService) DeleteVariable(ServiceSid string, EnvironmentSid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -99,9 +101,10 @@ func (c *ApiService) FetchVariable(ServiceSid string, EnvironmentSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,10 +144,11 @@ func (c *ApiService) PageVariable(ServiceSid string, EnvironmentSid string, para path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +158,7 @@ func (c *ApiService) PageVariable(ServiceSid string, EnvironmentSid string, para data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +245,7 @@ func (c *ApiService) getNextListVariableResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -280,6 +284,7 @@ func (c *ApiService) UpdateVariable(ServiceSid string, EnvironmentSid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -289,7 +294,7 @@ func (c *ApiService) UpdateVariable(ServiceSid string, EnvironmentSid string, Si data.Set("Value", *params.Value) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_functions.go b/rest/serverless/v1/services_functions.go index 73dd19964..b803d4fff 100644 --- a/rest/serverless/v1/services_functions.go +++ b/rest/serverless/v1/services_functions.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateFunction(ServiceSid string, params *CreateFunctionPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteFunction(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchFunction(ServiceSid string, Sid string) (*ServerlessV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageFunction(ServiceSid string, params *ListFunctionParams, path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageFunction(ServiceSid string, params *ListFunctionParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListFunctionResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -260,13 +264,14 @@ func (c *ApiService) UpdateFunction(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_functions_versions.go b/rest/serverless/v1/services_functions_versions.go index 28f14f84a..304b3a5da 100644 --- a/rest/serverless/v1/services_functions_versions.go +++ b/rest/serverless/v1/services_functions_versions.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchFunctionVersion(ServiceSid string, FunctionSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageFunctionVersion(ServiceSid string, FunctionSid string, path = strings.Replace(path, "{"+"FunctionSid"+"}", FunctionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageFunctionVersion(ServiceSid string, FunctionSid string, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListFunctionVersionResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/serverless/v1/services_functions_versions_content.go b/rest/serverless/v1/services_functions_versions_content.go index d4524759a..b79aa7369 100644 --- a/rest/serverless/v1/services_functions_versions_content.go +++ b/rest/serverless/v1/services_functions_versions_content.go @@ -28,9 +28,10 @@ func (c *ApiService) FetchFunctionVersionContent(ServiceSid string, FunctionSid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v1/README.md b/rest/studio/v1/README.md index 30d686e2f..b2f3ac170 100644 --- a/rest/studio/v1/README.md +++ b/rest/studio/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/studio/v1/flows.go b/rest/studio/v1/flows.go index 4cf073e28..1f74358c4 100644 --- a/rest/studio/v1/flows.go +++ b/rest/studio/v1/flows.go @@ -29,9 +29,10 @@ func (c *ApiService) DeleteFlow(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -47,9 +48,10 @@ func (c *ApiService) FetchFlow(Sid string) (*StudioV1Flow, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,10 +88,11 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken, pageNumber stri path := "/v1/Flows" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -99,7 +102,7 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -186,7 +189,7 @@ func (c *ApiService) getNextListFlowResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_engagements.go b/rest/studio/v1/flows_engagements.go index 2d51100b2..793cbff86 100644 --- a/rest/studio/v1/flows_engagements.go +++ b/rest/studio/v1/flows_engagements.go @@ -52,6 +52,7 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { @@ -70,7 +71,7 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa data.Set("Parameters", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -92,9 +93,10 @@ func (c *ApiService) DeleteEngagement(FlowSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -111,9 +113,10 @@ func (c *ApiService) FetchEngagement(FlowSid string, Sid string) (*StudioV1Engag path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -152,10 +155,11 @@ func (c *ApiService) PageEngagement(FlowSid string, params *ListEngagementParams path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +169,7 @@ func (c *ApiService) PageEngagement(FlowSid string, params *ListEngagementParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +256,7 @@ func (c *ApiService) getNextListEngagementResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_engagements_context.go b/rest/studio/v1/flows_engagements_context.go index d6d963662..a3991be5d 100644 --- a/rest/studio/v1/flows_engagements_context.go +++ b/rest/studio/v1/flows_engagements_context.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchEngagementContext(FlowSid string, EngagementSid string path = strings.Replace(path, "{"+"EngagementSid"+"}", EngagementSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_engagements_steps.go b/rest/studio/v1/flows_engagements_steps.go index 11dac1105..26af73bde 100644 --- a/rest/studio/v1/flows_engagements_steps.go +++ b/rest/studio/v1/flows_engagements_steps.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchStep(FlowSid string, EngagementSid string, Sid string) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageStep(FlowSid string, EngagementSid string, params *List path = strings.Replace(path, "{"+"EngagementSid"+"}", EngagementSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageStep(FlowSid string, EngagementSid string, params *List data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListStepResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_engagements_steps_context.go b/rest/studio/v1/flows_engagements_steps_context.go index 882d50c84..115b0c45d 100644 --- a/rest/studio/v1/flows_engagements_steps_context.go +++ b/rest/studio/v1/flows_engagements_steps_context.go @@ -28,9 +28,10 @@ func (c *ApiService) FetchStepContext(FlowSid string, EngagementSid string, Step path = strings.Replace(path, "{"+"StepSid"+"}", StepSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_executions.go b/rest/studio/v1/flows_executions.go index 6e6f9287a..8103b2532 100644 --- a/rest/studio/v1/flows_executions.go +++ b/rest/studio/v1/flows_executions.go @@ -53,6 +53,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { @@ -71,7 +72,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara data.Set("Parameters", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteExecution(FlowSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -112,9 +114,10 @@ func (c *ApiService) FetchExecution(FlowSid string, Sid string) (*StudioV1Execut path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -165,16 +168,17 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreatedFrom != nil { - data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) + queryParams.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) } if params != nil && params.DateCreatedTo != nil { - data.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) + queryParams.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -184,7 +188,7 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -271,7 +275,7 @@ func (c *ApiService) getNextListExecutionResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -303,13 +307,14 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_executions_context.go b/rest/studio/v1/flows_executions_context.go index c7eb6665a..a82bb8d53 100644 --- a/rest/studio/v1/flows_executions_context.go +++ b/rest/studio/v1/flows_executions_context.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchExecutionContext(FlowSid string, ExecutionSid string) path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_executions_steps.go b/rest/studio/v1/flows_executions_steps.go index c4423c3ff..bda40c261 100644 --- a/rest/studio/v1/flows_executions_steps.go +++ b/rest/studio/v1/flows_executions_steps.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchExecutionStep(FlowSid string, ExecutionSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListExecutionStepResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/studio/v1/flows_executions_steps_context.go b/rest/studio/v1/flows_executions_steps_context.go index 338594176..12ed46fb8 100644 --- a/rest/studio/v1/flows_executions_steps_context.go +++ b/rest/studio/v1/flows_executions_steps_context.go @@ -28,9 +28,10 @@ func (c *ApiService) FetchExecutionStepContext(FlowSid string, ExecutionSid stri path = strings.Replace(path, "{"+"StepSid"+"}", StepSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v2/README.md b/rest/studio/v2/README.md index f28cafdcd..1329db5c3 100644 --- a/rest/studio/v2/README.md +++ b/rest/studio/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/studio/v2/flows.go b/rest/studio/v2/flows.go index faa9f4dd3..8588e4d69 100644 --- a/rest/studio/v2/flows.go +++ b/rest/studio/v2/flows.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) path := "/v2/Flows" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -78,7 +79,7 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) data.Set("CommitMessage", *params.CommitMessage) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -99,9 +100,10 @@ func (c *ApiService) DeleteFlow(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -117,9 +119,10 @@ func (c *ApiService) FetchFlow(Sid string) (*StudioV2Flow, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -156,10 +159,11 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken, pageNumber stri path := "/v2/Flows" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -169,7 +173,7 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -256,7 +260,7 @@ func (c *ApiService) getNextListFlowResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -305,6 +309,7 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -326,7 +331,7 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 data.Set("CommitMessage", *params.CommitMessage) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_executions.go b/rest/studio/v2/flows_executions.go index f3f74c070..d21e1920d 100644 --- a/rest/studio/v2/flows_executions.go +++ b/rest/studio/v2/flows_executions.go @@ -53,6 +53,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { @@ -71,7 +72,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara data.Set("Parameters", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteExecution(FlowSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -112,9 +114,10 @@ func (c *ApiService) FetchExecution(FlowSid string, Sid string) (*StudioV2Execut path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -165,16 +168,17 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreatedFrom != nil { - data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) + queryParams.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) } if params != nil && params.DateCreatedTo != nil { - data.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) + queryParams.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -184,7 +188,7 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -271,7 +275,7 @@ func (c *ApiService) getNextListExecutionResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -303,13 +307,14 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_executions_context.go b/rest/studio/v2/flows_executions_context.go index 63082ea22..78c184891 100644 --- a/rest/studio/v2/flows_executions_context.go +++ b/rest/studio/v2/flows_executions_context.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchExecutionContext(FlowSid string, ExecutionSid string) path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_executions_steps.go b/rest/studio/v2/flows_executions_steps.go index f614e28c0..ece93cc08 100644 --- a/rest/studio/v2/flows_executions_steps.go +++ b/rest/studio/v2/flows_executions_steps.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchExecutionStep(FlowSid string, ExecutionSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListExecutionStepResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_executions_steps_context.go b/rest/studio/v2/flows_executions_steps_context.go index c1cf4ecfd..764af2e5b 100644 --- a/rest/studio/v2/flows_executions_steps_context.go +++ b/rest/studio/v2/flows_executions_steps_context.go @@ -28,9 +28,10 @@ func (c *ApiService) FetchExecutionStepContext(FlowSid string, ExecutionSid stri path = strings.Replace(path, "{"+"StepSid"+"}", StepSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_revisions.go b/rest/studio/v2/flows_revisions.go index 5d04f5e41..a12688d83 100644 --- a/rest/studio/v2/flows_revisions.go +++ b/rest/studio/v2/flows_revisions.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchFlowRevision(Sid string, Revision string) (*StudioV2Fl path = strings.Replace(path, "{"+"Revision"+"}", Revision, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -71,10 +72,11 @@ func (c *ApiService) PageFlowRevision(Sid string, params *ListFlowRevisionParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -84,7 +86,7 @@ func (c *ApiService) PageFlowRevision(Sid string, params *ListFlowRevisionParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -171,7 +173,7 @@ func (c *ApiService) getNextListFlowRevisionResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_test_users.go b/rest/studio/v2/flows_test_users.go index cab908acf..4c78c24a9 100644 --- a/rest/studio/v2/flows_test_users.go +++ b/rest/studio/v2/flows_test_users.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchTestUser(Sid string) (*StudioV2TestUser, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,6 +61,7 @@ func (c *ApiService) UpdateTestUser(Sid string, params *UpdateTestUserParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TestUsers != nil { @@ -68,7 +70,7 @@ func (c *ApiService) UpdateTestUser(Sid string, params *UpdateTestUserParams) (* } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/studio/v2/flows_validate.go b/rest/studio/v2/flows_validate.go index b589afdc4..3fe77bef0 100644 --- a/rest/studio/v2/flows_validate.go +++ b/rest/studio/v2/flows_validate.go @@ -53,6 +53,7 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud path := "/v2/Flows/Validate" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -74,7 +75,7 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud data.Set("CommitMessage", *params.CommitMessage) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/supersim/v1/README.md b/rest/supersim/v1/README.md index 21e11de32..84aa8b736 100644 --- a/rest/supersim/v1/README.md +++ b/rest/supersim/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/supersim/v1/e_sim_profiles.go b/rest/supersim/v1/e_sim_profiles.go index 992ecf9d4..4e74fb02a 100644 --- a/rest/supersim/v1/e_sim_profiles.go +++ b/rest/supersim/v1/e_sim_profiles.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateEsimProfile(params *CreateEsimProfileParams) (*Supers path := "/v1/ESimProfiles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CallbackUrl != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateEsimProfile(params *CreateEsimProfileParams) (*Supers data.Set("Eid", *params.Eid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) FetchEsimProfile(Sid string) (*SupersimV1EsimProfile, error path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -150,19 +152,20 @@ func (c *ApiService) PageEsimProfile(params *ListEsimProfileParams, pageToken, p path := "/v1/ESimProfiles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Eid != nil { - data.Set("Eid", *params.Eid) + queryParams.Set("Eid", *params.Eid) } if params != nil && params.SimSid != nil { - data.Set("SimSid", *params.SimSid) + queryParams.Set("SimSid", *params.SimSid) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +175,7 @@ func (c *ApiService) PageEsimProfile(params *ListEsimProfileParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +262,7 @@ func (c *ApiService) getNextListEsimProfileResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/fleets.go b/rest/supersim/v1/fleets.go index 848aeb7a5..9156898f4 100644 --- a/rest/supersim/v1/fleets.go +++ b/rest/supersim/v1/fleets.go @@ -87,6 +87,7 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e path := "/v1/Fleets" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.NetworkAccessProfile != nil { @@ -117,7 +118,7 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e data.Set("SmsCommandsMethod", *params.SmsCommandsMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -138,9 +139,10 @@ func (c *ApiService) FetchFleet(Sid string) (*SupersimV1Fleet, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -183,13 +185,14 @@ func (c *ApiService) PageFleet(params *ListFleetParams, pageToken, pageNumber st path := "/v1/Fleets" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.NetworkAccessProfile != nil { - data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) + queryParams.Set("NetworkAccessProfile", *params.NetworkAccessProfile) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -199,7 +202,7 @@ func (c *ApiService) PageFleet(params *ListFleetParams, pageToken, pageNumber st data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -286,7 +289,7 @@ func (c *ApiService) getNextListFleetResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -353,6 +356,7 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -377,7 +381,7 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/supersim/v1/ip_commands.go b/rest/supersim/v1/ip_commands.go index d553bd305..a83a84424 100644 --- a/rest/supersim/v1/ip_commands.go +++ b/rest/supersim/v1/ip_commands.go @@ -69,6 +69,7 @@ func (c *ApiService) CreateIpCommand(params *CreateIpCommandParams) (*SupersimV1 path := "/v1/IpCommands" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { @@ -90,7 +91,7 @@ func (c *ApiService) CreateIpCommand(params *CreateIpCommandParams) (*SupersimV1 data.Set("CallbackMethod", *params.CallbackMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -111,9 +112,10 @@ func (c *ApiService) FetchIpCommand(Sid string) (*SupersimV1IpCommand, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -174,22 +176,23 @@ func (c *ApiService) PageIpCommand(params *ListIpCommandParams, pageToken, pageN path := "/v1/IpCommands" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) + queryParams.Set("Sim", *params.Sim) } if params != nil && params.SimIccid != nil { - data.Set("SimIccid", *params.SimIccid) + queryParams.Set("SimIccid", *params.SimIccid) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) + queryParams.Set("Direction", *params.Direction) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -199,7 +202,7 @@ func (c *ApiService) PageIpCommand(params *ListIpCommandParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -286,7 +289,7 @@ func (c *ApiService) getNextListIpCommandResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/network_access_profiles.go b/rest/supersim/v1/network_access_profiles.go index c82957dce..367b1774a 100644 --- a/rest/supersim/v1/network_access_profiles.go +++ b/rest/supersim/v1/network_access_profiles.go @@ -45,6 +45,7 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi path := "/v1/NetworkAccessProfiles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -56,7 +57,7 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi } } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) FetchNetworkAccessProfile(Sid string) (*SupersimV1NetworkAc path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -116,10 +118,11 @@ func (c *ApiService) PageNetworkAccessProfile(params *ListNetworkAccessProfilePa path := "/v1/NetworkAccessProfiles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -129,7 +132,7 @@ func (c *ApiService) PageNetworkAccessProfile(params *ListNetworkAccessProfilePa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -216,7 +219,7 @@ func (c *ApiService) getNextListNetworkAccessProfileResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -247,13 +250,14 @@ func (c *ApiService) UpdateNetworkAccessProfile(Sid string, params *UpdateNetwor path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/supersim/v1/network_access_profiles_networks.go b/rest/supersim/v1/network_access_profiles_networks.go index b711accbb..e3036ef29 100644 --- a/rest/supersim/v1/network_access_profiles_networks.go +++ b/rest/supersim/v1/network_access_profiles_networks.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateNetworkAccessProfileNetwork(NetworkAccessProfileSid s path = strings.Replace(path, "{"+"NetworkAccessProfileSid"+"}", NetworkAccessProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Network != nil { data.Set("Network", *params.Network) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteNetworkAccessProfileNetwork(NetworkAccessProfileSid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchNetworkAccessProfileNetwork(NetworkAccessProfileSid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageNetworkAccessProfileNetwork(NetworkAccessProfileSid str path = strings.Replace(path, "{"+"NetworkAccessProfileSid"+"}", NetworkAccessProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageNetworkAccessProfileNetwork(NetworkAccessProfileSid str data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListNetworkAccessProfileNetworkResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/networks.go b/rest/supersim/v1/networks.go index d49f3300b..cdcf5133b 100644 --- a/rest/supersim/v1/networks.go +++ b/rest/supersim/v1/networks.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchNetwork(Sid string) (*SupersimV1Network, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -86,19 +87,20 @@ func (c *ApiService) PageNetwork(params *ListNetworkParams, pageToken, pageNumbe path := "/v1/Networks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) + queryParams.Set("IsoCountry", *params.IsoCountry) } if params != nil && params.Mcc != nil { - data.Set("Mcc", *params.Mcc) + queryParams.Set("Mcc", *params.Mcc) } if params != nil && params.Mnc != nil { - data.Set("Mnc", *params.Mnc) + queryParams.Set("Mnc", *params.Mnc) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -108,7 +110,7 @@ func (c *ApiService) PageNetwork(params *ListNetworkParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -195,7 +197,7 @@ func (c *ApiService) getNextListNetworkResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/settings_updates.go b/rest/supersim/v1/settings_updates.go index 69134286a..1ba95c409 100644 --- a/rest/supersim/v1/settings_updates.go +++ b/rest/supersim/v1/settings_updates.go @@ -56,16 +56,17 @@ func (c *ApiService) PageSettingsUpdate(params *ListSettingsUpdateParams, pageTo path := "/v1/SettingsUpdates" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) + queryParams.Set("Sim", *params.Sim) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -75,7 +76,7 @@ func (c *ApiService) PageSettingsUpdate(params *ListSettingsUpdateParams, pageTo data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -162,7 +163,7 @@ func (c *ApiService) getNextListSettingsUpdateResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/sims.go b/rest/supersim/v1/sims.go index c988a08e0..eefa128ee 100644 --- a/rest/supersim/v1/sims.go +++ b/rest/supersim/v1/sims.go @@ -45,6 +45,7 @@ func (c *ApiService) CreateSim(params *CreateSimParams) (*SupersimV1Sim, error) path := "/v1/Sims" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Iccid != nil { @@ -54,7 +55,7 @@ func (c *ApiService) CreateSim(params *CreateSimParams) (*SupersimV1Sim, error) data.Set("RegistrationCode", *params.RegistrationCode) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -75,9 +76,10 @@ func (c *ApiService) FetchSim(Sid string) (*SupersimV1Sim, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -132,19 +134,20 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string path := "/v1/Sims" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Fleet != nil { - data.Set("Fleet", *params.Fleet) + queryParams.Set("Fleet", *params.Fleet) } if params != nil && params.Iccid != nil { - data.Set("Iccid", *params.Iccid) + queryParams.Set("Iccid", *params.Iccid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +157,7 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +244,7 @@ func (c *ApiService) getNextListSimResponse(nextPageUrl string) (interface{}, er if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -302,6 +305,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -323,7 +327,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 data.Set("AccountSid", *params.AccountSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/supersim/v1/sims_billing_periods.go b/rest/supersim/v1/sims_billing_periods.go index c6b866fed..1dddad17b 100644 --- a/rest/supersim/v1/sims_billing_periods.go +++ b/rest/supersim/v1/sims_billing_periods.go @@ -47,10 +47,11 @@ func (c *ApiService) PageBillingPeriod(SimSid string, params *ListBillingPeriodP path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -60,7 +61,7 @@ func (c *ApiService) PageBillingPeriod(SimSid string, params *ListBillingPeriodP data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,7 +148,7 @@ func (c *ApiService) getNextListBillingPeriodResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/sims_ip_addresses.go b/rest/supersim/v1/sims_ip_addresses.go index f1e73eab5..4cbacfe98 100644 --- a/rest/supersim/v1/sims_ip_addresses.go +++ b/rest/supersim/v1/sims_ip_addresses.go @@ -47,10 +47,11 @@ func (c *ApiService) PageSimIpAddress(SimSid string, params *ListSimIpAddressPar path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -60,7 +61,7 @@ func (c *ApiService) PageSimIpAddress(SimSid string, params *ListSimIpAddressPar data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,7 +148,7 @@ func (c *ApiService) getNextListSimIpAddressResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/sms_commands.go b/rest/supersim/v1/sms_commands.go index 5e36deb00..9eacfc669 100644 --- a/rest/supersim/v1/sms_commands.go +++ b/rest/supersim/v1/sms_commands.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim path := "/v1/SmsCommands" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim data.Set("CallbackUrl", *params.CallbackUrl) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) FetchSmsCommand(Sid string) (*SupersimV1SmsCommand, error) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -150,19 +152,20 @@ func (c *ApiService) PageSmsCommand(params *ListSmsCommandParams, pageToken, pag path := "/v1/SmsCommands" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) + queryParams.Set("Sim", *params.Sim) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) + queryParams.Set("Direction", *params.Direction) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -172,7 +175,7 @@ func (c *ApiService) PageSmsCommand(params *ListSmsCommandParams, pageToken, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -259,7 +262,7 @@ func (c *ApiService) getNextListSmsCommandResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/supersim/v1/usage_records.go b/rest/supersim/v1/usage_records.go index 1b31e5bae..2c2cdc056 100644 --- a/rest/supersim/v1/usage_records.go +++ b/rest/supersim/v1/usage_records.go @@ -93,34 +93,35 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken, p path := "/v1/UsageRecords" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) + queryParams.Set("Sim", *params.Sim) } if params != nil && params.Fleet != nil { - data.Set("Fleet", *params.Fleet) + queryParams.Set("Fleet", *params.Fleet) } if params != nil && params.Network != nil { - data.Set("Network", *params.Network) + queryParams.Set("Network", *params.Network) } if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) + queryParams.Set("IsoCountry", *params.IsoCountry) } if params != nil && params.Group != nil { - data.Set("Group", *params.Group) + queryParams.Set("Group", *params.Group) } if params != nil && params.Granularity != nil { - data.Set("Granularity", *params.Granularity) + queryParams.Set("Granularity", *params.Granularity) } if params != nil && params.StartTime != nil { - data.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) + queryParams.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) } if params != nil && params.EndTime != nil { - data.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) + queryParams.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -130,7 +131,7 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -217,7 +218,7 @@ func (c *ApiService) getNextListUsageRecordResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/sync/v1/README.md b/rest/sync/v1/README.md index 093a727a9..f23e6a236 100644 --- a/rest/sync/v1/README.md +++ b/rest/sync/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/sync/v1/services.go b/rest/sync/v1/services.go index 848858339..b40157ddb 100644 --- a/rest/sync/v1/services.go +++ b/rest/sync/v1/services.go @@ -70,11 +70,11 @@ func (params *CreateServiceParams) SetWebhooksFromRestEnabled(WebhooksFromRestEn return params } -// func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, error) { path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -99,7 +99,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -114,15 +114,15 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, return ps, err } -// func (c *ApiService) DeleteService(Sid string) error { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -132,15 +132,15 @@ func (c *ApiService) DeleteService(Sid string) error { return nil } -// func (c *ApiService) FetchService(Sid string) (*SyncV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -177,10 +177,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v1/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -338,12 +339,12 @@ func (params *UpdateServiceParams) SetWebhooksFromRestEnabled(WebhooksFromRestEn return params } -// func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*SyncV1Service, error) { path := "/v1/Services/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.WebhookUrl != nil { @@ -368,7 +369,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Sy data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_documents.go b/rest/sync/v1/services_documents.go index 6aae3ba8b..a4be980f5 100644 --- a/rest/sync/v1/services_documents.go +++ b/rest/sync/v1/services_documents.go @@ -46,12 +46,12 @@ func (params *CreateDocumentParams) SetTtl(Ttl int) *CreateDocumentParams { return params } -// func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentParams) (*SyncV1Document, error) { path := "/v1/Services/{ServiceSid}/Documents" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -70,7 +70,7 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -85,16 +85,16 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar return ps, err } -// func (c *ApiService) DeleteDocument(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Documents/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -104,16 +104,16 @@ func (c *ApiService) DeleteDocument(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchDocument(ServiceSid string, Sid string) (*SyncV1Document, error) { path := "/v1/Services/{ServiceSid}/Documents/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -152,10 +152,11 @@ func (c *ApiService) PageDocument(ServiceSid string, params *ListDocumentParams, path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -165,7 +166,7 @@ func (c *ApiService) PageDocument(ServiceSid string, params *ListDocumentParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (c *ApiService) getNextListDocumentResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -289,13 +290,13 @@ func (params *UpdateDocumentParams) SetTtl(Ttl int) *UpdateDocumentParams { return params } -// func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *UpdateDocumentParams) (*SyncV1Document, error) { path := "/v1/Services/{ServiceSid}/Documents/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Data != nil { @@ -314,7 +315,7 @@ func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *Updat if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_documents_permissions.go b/rest/sync/v1/services_documents_permissions.go index d4517d884..e6c672ca1 100644 --- a/rest/sync/v1/services_documents_permissions.go +++ b/rest/sync/v1/services_documents_permissions.go @@ -31,9 +31,10 @@ func (c *ApiService) DeleteDocumentPermission(ServiceSid string, DocumentSid str path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -51,9 +52,10 @@ func (c *ApiService) FetchDocumentPermission(ServiceSid string, DocumentSid stri path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,10 +95,11 @@ func (c *ApiService) PageDocumentPermission(ServiceSid string, DocumentSid strin path = strings.Replace(path, "{"+"DocumentSid"+"}", DocumentSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +109,7 @@ func (c *ApiService) PageDocumentPermission(ServiceSid string, DocumentSid strin data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +196,7 @@ func (c *ApiService) getNextListDocumentPermissionResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -238,6 +241,7 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Read != nil { @@ -250,7 +254,7 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str data.Set("Manage", fmt.Sprint(*params.Manage)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_lists.go b/rest/sync/v1/services_lists.go index 358ea56bf..0ad377977 100644 --- a/rest/sync/v1/services_lists.go +++ b/rest/sync/v1/services_lists.go @@ -46,12 +46,12 @@ func (params *CreateSyncListParams) SetCollectionTtl(CollectionTtl int) *CreateS return params } -// func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListParams) (*SyncV1SyncList, error) { path := "/v1/Services/{ServiceSid}/Lists" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -64,7 +64,7 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,16 +79,16 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar return ps, err } -// func (c *ApiService) DeleteSyncList(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Lists/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -98,16 +98,16 @@ func (c *ApiService) DeleteSyncList(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchSyncList(ServiceSid string, Sid string) (*SyncV1SyncList, error) { path := "/v1/Services/{ServiceSid}/Lists/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -146,10 +146,11 @@ func (c *ApiService) PageSyncList(ServiceSid string, params *ListSyncListParams, path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -159,7 +160,7 @@ func (c *ApiService) PageSyncList(ServiceSid string, params *ListSyncListParams, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (c *ApiService) getNextListSyncListResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -277,13 +278,13 @@ func (params *UpdateSyncListParams) SetCollectionTtl(CollectionTtl int) *UpdateS return params } -// func (c *ApiService) UpdateSyncList(ServiceSid string, Sid string, params *UpdateSyncListParams) (*SyncV1SyncList, error) { path := "/v1/Services/{ServiceSid}/Lists/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Ttl != nil { @@ -293,7 +294,7 @@ func (c *ApiService) UpdateSyncList(ServiceSid string, Sid string, params *Updat data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_lists_items.go b/rest/sync/v1/services_lists_items.go index 572df5abc..af65c2e17 100644 --- a/rest/sync/v1/services_lists_items.go +++ b/rest/sync/v1/services_lists_items.go @@ -52,13 +52,13 @@ func (params *CreateSyncListItemParams) SetCollectionTtl(CollectionTtl int) *Cre return params } -// func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, params *CreateSyncListItemParams) (*SyncV1SyncListItem, error) { path := "/v1/Services/{ServiceSid}/Lists/{ListSid}/Items" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Data != nil { @@ -80,7 +80,7 @@ func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, param data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -106,7 +106,6 @@ func (params *DeleteSyncListItemParams) SetIfMatch(IfMatch string) *DeleteSyncLi return params } -// func (c *ApiService) DeleteSyncListItem(ServiceSid string, ListSid string, Index int, params *DeleteSyncListItemParams) error { path := "/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -114,12 +113,13 @@ func (c *ApiService) DeleteSyncListItem(ServiceSid string, ListSid string, Index path = strings.Replace(path, "{"+"Index"+"}", fmt.Sprint(Index), -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -129,7 +129,6 @@ func (c *ApiService) DeleteSyncListItem(ServiceSid string, ListSid string, Index return nil } -// func (c *ApiService) FetchSyncListItem(ServiceSid string, ListSid string, Index int) (*SyncV1SyncListItem, error) { path := "/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -137,9 +136,10 @@ func (c *ApiService) FetchSyncListItem(ServiceSid string, ListSid string, Index path = strings.Replace(path, "{"+"Index"+"}", fmt.Sprint(Index), -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -197,19 +197,20 @@ func (c *ApiService) PageSyncListItem(ServiceSid string, ListSid string, params path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.From != nil { - data.Set("From", *params.From) + queryParams.Set("From", *params.From) } if params != nil && params.Bounds != nil { - data.Set("Bounds", *params.Bounds) + queryParams.Set("Bounds", *params.Bounds) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -219,7 +220,7 @@ func (c *ApiService) PageSyncListItem(ServiceSid string, ListSid string, params data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -306,7 +307,7 @@ func (c *ApiService) getNextListSyncListItemResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -355,7 +356,6 @@ func (params *UpdateSyncListItemParams) SetCollectionTtl(CollectionTtl int) *Upd return params } -// func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index int, params *UpdateSyncListItemParams) (*SyncV1SyncListItem, error) { path := "/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -363,6 +363,7 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index path = strings.Replace(path, "{"+"Index"+"}", fmt.Sprint(Index), -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Data != nil { @@ -387,7 +388,7 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_lists_permissions.go b/rest/sync/v1/services_lists_permissions.go index d0a3bae2d..be83643a6 100644 --- a/rest/sync/v1/services_lists_permissions.go +++ b/rest/sync/v1/services_lists_permissions.go @@ -31,9 +31,10 @@ func (c *ApiService) DeleteSyncListPermission(ServiceSid string, ListSid string, path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -51,9 +52,10 @@ func (c *ApiService) FetchSyncListPermission(ServiceSid string, ListSid string, path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,10 +95,11 @@ func (c *ApiService) PageSyncListPermission(ServiceSid string, ListSid string, p path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +109,7 @@ func (c *ApiService) PageSyncListPermission(ServiceSid string, ListSid string, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +196,7 @@ func (c *ApiService) getNextListSyncListPermissionResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -238,6 +241,7 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Read != nil { @@ -250,7 +254,7 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, data.Set("Manage", fmt.Sprint(*params.Manage)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_maps.go b/rest/sync/v1/services_maps.go index 731ada14d..b6da586d0 100644 --- a/rest/sync/v1/services_maps.go +++ b/rest/sync/v1/services_maps.go @@ -46,12 +46,12 @@ func (params *CreateSyncMapParams) SetCollectionTtl(CollectionTtl int) *CreateSy return params } -// func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParams) (*SyncV1SyncMap, error) { path := "/v1/Services/{ServiceSid}/Maps" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -64,7 +64,7 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,16 +79,16 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam return ps, err } -// func (c *ApiService) DeleteSyncMap(ServiceSid string, Sid string) error { path := "/v1/Services/{ServiceSid}/Maps/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -98,16 +98,16 @@ func (c *ApiService) DeleteSyncMap(ServiceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchSyncMap(ServiceSid string, Sid string) (*SyncV1SyncMap, error) { path := "/v1/Services/{ServiceSid}/Maps/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -146,10 +146,11 @@ func (c *ApiService) PageSyncMap(ServiceSid string, params *ListSyncMapParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -159,7 +160,7 @@ func (c *ApiService) PageSyncMap(ServiceSid string, params *ListSyncMapParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (c *ApiService) getNextListSyncMapResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -277,13 +278,13 @@ func (params *UpdateSyncMapParams) SetCollectionTtl(CollectionTtl int) *UpdateSy return params } -// func (c *ApiService) UpdateSyncMap(ServiceSid string, Sid string, params *UpdateSyncMapParams) (*SyncV1SyncMap, error) { path := "/v1/Services/{ServiceSid}/Maps/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Ttl != nil { @@ -293,7 +294,7 @@ func (c *ApiService) UpdateSyncMap(ServiceSid string, Sid string, params *Update data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_maps_items.go b/rest/sync/v1/services_maps_items.go index 961e98735..1050ae691 100644 --- a/rest/sync/v1/services_maps_items.go +++ b/rest/sync/v1/services_maps_items.go @@ -58,13 +58,13 @@ func (params *CreateSyncMapItemParams) SetCollectionTtl(CollectionTtl int) *Crea return params } -// func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params *CreateSyncMapItemParams) (*SyncV1SyncMapItem, error) { path := "/v1/Services/{ServiceSid}/Maps/{MapSid}/Items" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Key != nil { @@ -89,7 +89,7 @@ func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -115,7 +115,6 @@ func (params *DeleteSyncMapItemParams) SetIfMatch(IfMatch string) *DeleteSyncMap return params } -// func (c *ApiService) DeleteSyncMapItem(ServiceSid string, MapSid string, Key string, params *DeleteSyncMapItemParams) error { path := "/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -123,12 +122,13 @@ func (c *ApiService) DeleteSyncMapItem(ServiceSid string, MapSid string, Key str path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -138,7 +138,6 @@ func (c *ApiService) DeleteSyncMapItem(ServiceSid string, MapSid string, Key str return nil } -// func (c *ApiService) FetchSyncMapItem(ServiceSid string, MapSid string, Key string) (*SyncV1SyncMapItem, error) { path := "/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -146,9 +145,10 @@ func (c *ApiService) FetchSyncMapItem(ServiceSid string, MapSid string, Key stri path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -206,19 +206,20 @@ func (c *ApiService) PageSyncMapItem(ServiceSid string, MapSid string, params *L path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.From != nil { - data.Set("From", *params.From) + queryParams.Set("From", *params.From) } if params != nil && params.Bounds != nil { - data.Set("Bounds", *params.Bounds) + queryParams.Set("Bounds", *params.Bounds) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -228,7 +229,7 @@ func (c *ApiService) PageSyncMapItem(ServiceSid string, MapSid string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -315,7 +316,7 @@ func (c *ApiService) getNextListSyncMapItemResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -364,7 +365,6 @@ func (params *UpdateSyncMapItemParams) SetCollectionTtl(CollectionTtl int) *Upda return params } -// func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key string, params *UpdateSyncMapItemParams) (*SyncV1SyncMapItem, error) { path := "/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) @@ -372,6 +372,7 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Data != nil { @@ -396,7 +397,7 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_maps_permissions.go b/rest/sync/v1/services_maps_permissions.go index 70b4dd777..2a6f6daa4 100644 --- a/rest/sync/v1/services_maps_permissions.go +++ b/rest/sync/v1/services_maps_permissions.go @@ -31,9 +31,10 @@ func (c *ApiService) DeleteSyncMapPermission(ServiceSid string, MapSid string, I path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -51,9 +52,10 @@ func (c *ApiService) FetchSyncMapPermission(ServiceSid string, MapSid string, Id path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,10 +95,11 @@ func (c *ApiService) PageSyncMapPermission(ServiceSid string, MapSid string, par path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -106,7 +109,7 @@ func (c *ApiService) PageSyncMapPermission(ServiceSid string, MapSid string, par data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,7 +196,7 @@ func (c *ApiService) getNextListSyncMapPermissionResponse(nextPageUrl string) (i if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -238,6 +241,7 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Read != nil { @@ -250,7 +254,7 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I data.Set("Manage", fmt.Sprint(*params.Manage)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_streams.go b/rest/sync/v1/services_streams.go index d16add427..24ff3ef15 100644 --- a/rest/sync/v1/services_streams.go +++ b/rest/sync/v1/services_streams.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateSyncStream(ServiceSid string, params *CreateSyncStrea path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateSyncStream(ServiceSid string, params *CreateSyncStrea data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteSyncStream(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchSyncStream(ServiceSid string, Sid string) (*SyncV1Sync path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageSyncStream(ServiceSid string, params *ListSyncStreamPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageSyncStream(ServiceSid string, params *ListSyncStreamPar data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListSyncStreamResponse(nextPageUrl string) (interfac if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -269,13 +273,14 @@ func (c *ApiService) UpdateSyncStream(ServiceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/sync/v1/services_streams_messages.go b/rest/sync/v1/services_streams_messages.go index ab4a47f4e..4fa6ffaae 100644 --- a/rest/sync/v1/services_streams_messages.go +++ b/rest/sync/v1/services_streams_messages.go @@ -38,6 +38,7 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa path = strings.Replace(path, "{"+"StreamSid"+"}", StreamSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Data != nil { @@ -50,7 +51,7 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa data.Set("Data", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/README.md b/rest/taskrouter/v1/README.md index 5315185c7..dc804458a 100644 --- a/rest/taskrouter/v1/README.md +++ b/rest/taskrouter/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/taskrouter/v1/workspaces.go b/rest/taskrouter/v1/workspaces.go index a1890a26a..e30b24b35 100644 --- a/rest/taskrouter/v1/workspaces.go +++ b/rest/taskrouter/v1/workspaces.go @@ -64,11 +64,11 @@ func (params *CreateWorkspaceParams) SetPrioritizeQueueOrder(PrioritizeQueueOrde return params } -// func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*TaskrouterV1Workspace, error) { path := "/v1/Workspaces" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -90,7 +90,7 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter data.Set("PrioritizeQueueOrder", *params.PrioritizeQueueOrder) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -105,15 +105,15 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter return ps, err } -// func (c *ApiService) DeleteWorkspace(Sid string) error { path := "/v1/Workspaces/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -123,15 +123,15 @@ func (c *ApiService) DeleteWorkspace(Sid string) error { return nil } -// func (c *ApiService) FetchWorkspace(Sid string) (*TaskrouterV1Workspace, error) { path := "/v1/Workspaces/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -174,13 +174,14 @@ func (c *ApiService) PageWorkspace(params *ListWorkspaceParams, pageToken, pageN path := "/v1/Workspaces" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageWorkspace(params *ListWorkspaceParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListWorkspaceResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -338,12 +339,12 @@ func (params *UpdateWorkspaceParams) SetPrioritizeQueueOrder(PrioritizeQueueOrde return params } -// func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) (*TaskrouterV1Workspace, error) { path := "/v1/Workspaces/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DefaultActivitySid != nil { @@ -368,7 +369,7 @@ func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) data.Set("PrioritizeQueueOrder", *params.PrioritizeQueueOrder) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_activities.go b/rest/taskrouter/v1/workspaces_activities.go index 563c227c4..8d723990f 100644 --- a/rest/taskrouter/v1/workspaces_activities.go +++ b/rest/taskrouter/v1/workspaces_activities.go @@ -40,12 +40,12 @@ func (params *CreateActivityParams) SetAvailable(Available bool) *CreateActivity return params } -// func (c *ApiService) CreateActivity(WorkspaceSid string, params *CreateActivityParams) (*TaskrouterV1Activity, error) { path := "/v1/Workspaces/{WorkspaceSid}/Activities" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -55,7 +55,7 @@ func (c *ApiService) CreateActivity(WorkspaceSid string, params *CreateActivityP data.Set("Available", fmt.Sprint(*params.Available)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -70,16 +70,16 @@ func (c *ApiService) CreateActivity(WorkspaceSid string, params *CreateActivityP return ps, err } -// func (c *ApiService) DeleteActivity(WorkspaceSid string, Sid string) error { path := "/v1/Workspaces/{WorkspaceSid}/Activities/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -89,16 +89,16 @@ func (c *ApiService) DeleteActivity(WorkspaceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchActivity(WorkspaceSid string, Sid string) (*TaskrouterV1Activity, error) { path := "/v1/Workspaces/{WorkspaceSid}/Activities/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -149,16 +149,17 @@ func (c *ApiService) PageActivity(WorkspaceSid string, params *ListActivityParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Available != nil { - data.Set("Available", *params.Available) + queryParams.Set("Available", *params.Available) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -168,7 +169,7 @@ func (c *ApiService) PageActivity(WorkspaceSid string, params *ListActivityParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,7 +256,7 @@ func (c *ApiService) getNextListActivityResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -280,20 +281,20 @@ func (params *UpdateActivityParams) SetFriendlyName(FriendlyName string) *Update return params } -// func (c *ApiService) UpdateActivity(WorkspaceSid string, Sid string, params *UpdateActivityParams) (*TaskrouterV1Activity, error) { path := "/v1/Workspaces/{WorkspaceSid}/Activities/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_cumulative_statistics.go index 5bf253374..e8f834534 100644 --- a/rest/taskrouter/v1/workspaces_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_cumulative_statistics.go @@ -57,31 +57,31 @@ func (params *FetchWorkspaceCumulativeStatisticsParams) SetSplitByWaitTime(Split return params } -// func (c *ApiService) FetchWorkspaceCumulativeStatistics(WorkspaceSid string, params *FetchWorkspaceCumulativeStatisticsParams) (*TaskrouterV1WorkspaceCumulativeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/CumulativeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_events.go b/rest/taskrouter/v1/workspaces_events.go index b9bc46cbf..f5f806084 100644 --- a/rest/taskrouter/v1/workspaces_events.go +++ b/rest/taskrouter/v1/workspaces_events.go @@ -24,16 +24,16 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchEvent(WorkspaceSid string, Sid string) (*TaskrouterV1Event, error) { path := "/v1/Workspaces/{WorkspaceSid}/Events/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -138,43 +138,44 @@ func (c *ApiService) PageEvent(WorkspaceSid string, params *ListEventParams, pag path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.EventType != nil { - data.Set("EventType", *params.EventType) + queryParams.Set("EventType", *params.EventType) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.ReservationSid != nil { - data.Set("ReservationSid", *params.ReservationSid) + queryParams.Set("ReservationSid", *params.ReservationSid) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) + queryParams.Set("TaskQueueSid", *params.TaskQueueSid) } if params != nil && params.TaskSid != nil { - data.Set("TaskSid", *params.TaskSid) + queryParams.Set("TaskSid", *params.TaskSid) } if params != nil && params.WorkerSid != nil { - data.Set("WorkerSid", *params.WorkerSid) + queryParams.Set("WorkerSid", *params.WorkerSid) } if params != nil && params.WorkflowSid != nil { - data.Set("WorkflowSid", *params.WorkflowSid) + queryParams.Set("WorkflowSid", *params.WorkflowSid) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.Sid != nil { - data.Set("Sid", *params.Sid) + queryParams.Set("Sid", *params.Sid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -184,7 +185,7 @@ func (c *ApiService) PageEvent(WorkspaceSid string, params *ListEventParams, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -271,7 +272,7 @@ func (c *ApiService) getNextListEventResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_real_time_statistics.go b/rest/taskrouter/v1/workspaces_real_time_statistics.go index 75593edef..dc770fb74 100644 --- a/rest/taskrouter/v1/workspaces_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_real_time_statistics.go @@ -31,19 +31,19 @@ func (params *FetchWorkspaceRealTimeStatisticsParams) SetTaskChannel(TaskChannel return params } -// func (c *ApiService) FetchWorkspaceRealTimeStatistics(WorkspaceSid string, params *FetchWorkspaceRealTimeStatisticsParams) (*TaskrouterV1WorkspaceRealTimeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/RealTimeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_statistics.go b/rest/taskrouter/v1/workspaces_statistics.go index 1d92d7d28..31f1f6c85 100644 --- a/rest/taskrouter/v1/workspaces_statistics.go +++ b/rest/taskrouter/v1/workspaces_statistics.go @@ -57,31 +57,31 @@ func (params *FetchWorkspaceStatisticsParams) SetSplitByWaitTime(SplitByWaitTime return params } -// func (c *ApiService) FetchWorkspaceStatistics(WorkspaceSid string, params *FetchWorkspaceStatisticsParams) (*TaskrouterV1WorkspaceStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Statistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_task_channels.go b/rest/taskrouter/v1/workspaces_task_channels.go index ab0035c54..58f26ae2a 100644 --- a/rest/taskrouter/v1/workspaces_task_channels.go +++ b/rest/taskrouter/v1/workspaces_task_channels.go @@ -46,12 +46,12 @@ func (params *CreateTaskChannelParams) SetChannelOptimizedRouting(ChannelOptimiz return params } -// func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskChannelParams) (*TaskrouterV1TaskChannel, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskChannels" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -64,7 +64,7 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,16 +79,16 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh return ps, err } -// func (c *ApiService) DeleteTaskChannel(WorkspaceSid string, Sid string) error { path := "/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -98,16 +98,16 @@ func (c *ApiService) DeleteTaskChannel(WorkspaceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchTaskChannel(WorkspaceSid string, Sid string) (*TaskrouterV1TaskChannel, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -146,10 +146,11 @@ func (c *ApiService) PageTaskChannel(WorkspaceSid string, params *ListTaskChanne path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -159,7 +160,7 @@ func (c *ApiService) PageTaskChannel(WorkspaceSid string, params *ListTaskChanne data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (c *ApiService) getNextListTaskChannelResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -277,13 +278,13 @@ func (params *UpdateTaskChannelParams) SetChannelOptimizedRouting(ChannelOptimiz return params } -// func (c *ApiService) UpdateTaskChannel(WorkspaceSid string, Sid string, params *UpdateTaskChannelParams) (*TaskrouterV1TaskChannel, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -293,7 +294,7 @@ func (c *ApiService) UpdateTaskChannel(WorkspaceSid string, Sid string, params * data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_task_queues.go b/rest/taskrouter/v1/workspaces_task_queues.go index 9bdfc7224..547c79e5b 100644 --- a/rest/taskrouter/v1/workspaces_task_queues.go +++ b/rest/taskrouter/v1/workspaces_task_queues.go @@ -64,12 +64,12 @@ func (params *CreateTaskQueueParams) SetAssignmentActivitySid(AssignmentActivity return params } -// func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueueParams) (*TaskrouterV1TaskQueue, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -91,7 +91,7 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -106,16 +106,16 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu return ps, err } -// func (c *ApiService) DeleteTaskQueue(WorkspaceSid string, Sid string) error { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -125,16 +125,16 @@ func (c *ApiService) DeleteTaskQueue(WorkspaceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchTaskQueue(WorkspaceSid string, Sid string) (*TaskrouterV1TaskQueue, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -197,22 +197,23 @@ func (c *ApiService) PageTaskQueue(WorkspaceSid string, params *ListTaskQueuePar path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.EvaluateWorkerAttributes != nil { - data.Set("EvaluateWorkerAttributes", *params.EvaluateWorkerAttributes) + queryParams.Set("EvaluateWorkerAttributes", *params.EvaluateWorkerAttributes) } if params != nil && params.WorkerSid != nil { - data.Set("WorkerSid", *params.WorkerSid) + queryParams.Set("WorkerSid", *params.WorkerSid) } if params != nil && params.Ordering != nil { - data.Set("Ordering", *params.Ordering) + queryParams.Set("Ordering", *params.Ordering) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -222,7 +223,7 @@ func (c *ApiService) PageTaskQueue(WorkspaceSid string, params *ListTaskQueuePar data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -309,7 +310,7 @@ func (c *ApiService) getNextListTaskQueueResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -364,13 +365,13 @@ func (params *UpdateTaskQueueParams) SetTaskOrder(TaskOrder string) *UpdateTaskQ return params } -// func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *UpdateTaskQueueParams) (*TaskrouterV1TaskQueue, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -392,7 +393,7 @@ func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *Up data.Set("TaskOrder", *params.TaskOrder) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go index 2216de575..caa117ae3 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go @@ -57,32 +57,32 @@ func (params *FetchTaskQueueCumulativeStatisticsParams) SetSplitByWaitTime(Split return params } -// func (c *ApiService) FetchTaskQueueCumulativeStatistics(WorkspaceSid string, TaskQueueSid string, params *FetchTaskQueueCumulativeStatisticsParams) (*TaskrouterV1TaskQueueCumulativeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/CumulativeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go index b1605a619..041cfeec3 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go @@ -31,20 +31,20 @@ func (params *FetchTaskQueueRealTimeStatisticsParams) SetTaskChannel(TaskChannel return params } -// func (c *ApiService) FetchTaskQueueRealTimeStatistics(WorkspaceSid string, TaskQueueSid string, params *FetchTaskQueueRealTimeStatisticsParams) (*TaskrouterV1TaskQueueRealTimeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/RealTimeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_task_queues_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_statistics.go index c5ea20fd7..da146ca39 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_statistics.go @@ -59,32 +59,32 @@ func (params *FetchTaskQueueStatisticsParams) SetSplitByWaitTime(SplitByWaitTime return params } -// func (c *ApiService) FetchTaskQueueStatistics(WorkspaceSid string, TaskQueueSid string, params *FetchTaskQueueStatisticsParams) (*TaskrouterV1TaskQueueStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/Statistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -159,28 +159,29 @@ func (c *ApiService) PageTaskQueuesStatistics(WorkspaceSid string, params *ListT path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +191,7 @@ func (c *ApiService) PageTaskQueuesStatistics(WorkspaceSid string, params *ListT data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (c *ApiService) getNextListTaskQueuesStatisticsResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_tasks.go b/rest/taskrouter/v1/workspaces_tasks.go index bdb0b0762..df0ba881e 100644 --- a/rest/taskrouter/v1/workspaces_tasks.go +++ b/rest/taskrouter/v1/workspaces_tasks.go @@ -65,12 +65,12 @@ func (params *CreateTaskParams) SetVirtualStartTime(VirtualStartTime time.Time) return params } -// func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) (*TaskrouterV1Task, error) { path := "/v1/Workspaces/{WorkspaceSid}/Tasks" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Timeout != nil { @@ -92,7 +92,7 @@ func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) ( data.Set("VirtualStartTime", fmt.Sprint((*params.VirtualStartTime).Format(time.RFC3339))) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -118,19 +118,19 @@ func (params *DeleteTaskParams) SetIfMatch(IfMatch string) *DeleteTaskParams { return params } -// func (c *ApiService) DeleteTask(WorkspaceSid string, Sid string, params *DeleteTaskParams) error { path := "/v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -140,16 +140,16 @@ func (c *ApiService) DeleteTask(WorkspaceSid string, Sid string, params *DeleteT return nil } -// func (c *ApiService) FetchTask(WorkspaceSid string, Sid string) (*TaskrouterV1Task, error) { path := "/v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -242,39 +242,40 @@ func (c *ApiService) PageTask(WorkspaceSid string, params *ListTaskParams, pageT path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) + queryParams.Set("Priority", fmt.Sprint(*params.Priority)) } if params != nil && params.AssignmentStatus != nil { for _, item := range *params.AssignmentStatus { - data.Add("AssignmentStatus", item) + queryParams.Add("AssignmentStatus", item) } } if params != nil && params.WorkflowSid != nil { - data.Set("WorkflowSid", *params.WorkflowSid) + queryParams.Set("WorkflowSid", *params.WorkflowSid) } if params != nil && params.WorkflowName != nil { - data.Set("WorkflowName", *params.WorkflowName) + queryParams.Set("WorkflowName", *params.WorkflowName) } if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) + queryParams.Set("TaskQueueSid", *params.TaskQueueSid) } if params != nil && params.TaskQueueName != nil { - data.Set("TaskQueueName", *params.TaskQueueName) + queryParams.Set("TaskQueueName", *params.TaskQueueName) } if params != nil && params.EvaluateTaskAttributes != nil { - data.Set("EvaluateTaskAttributes", *params.EvaluateTaskAttributes) + queryParams.Set("EvaluateTaskAttributes", *params.EvaluateTaskAttributes) } if params != nil && params.Ordering != nil { - data.Set("Ordering", *params.Ordering) + queryParams.Set("Ordering", *params.Ordering) } if params != nil && params.HasAddons != nil { - data.Set("HasAddons", fmt.Sprint(*params.HasAddons)) + queryParams.Set("HasAddons", fmt.Sprint(*params.HasAddons)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -284,7 +285,7 @@ func (c *ApiService) PageTask(WorkspaceSid string, params *ListTaskParams, pageT data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -371,7 +372,7 @@ func (c *ApiService) getNextListTaskResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -432,13 +433,13 @@ func (params *UpdateTaskParams) SetVirtualStartTime(VirtualStartTime time.Time) return params } -// func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateTaskParams) (*TaskrouterV1Task, error) { path := "/v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Attributes != nil { @@ -463,7 +464,7 @@ func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateT if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_tasks_reservations.go b/rest/taskrouter/v1/workspaces_tasks_reservations.go index c6a075d95..81eb23387 100644 --- a/rest/taskrouter/v1/workspaces_tasks_reservations.go +++ b/rest/taskrouter/v1/workspaces_tasks_reservations.go @@ -23,7 +23,6 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchTaskReservation(WorkspaceSid string, TaskSid string, Sid string) (*TaskrouterV1TaskReservation, error) { path := "/v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) @@ -31,9 +30,10 @@ func (c *ApiService) FetchTaskReservation(WorkspaceSid string, TaskSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -85,16 +85,17 @@ func (c *ApiService) PageTaskReservation(WorkspaceSid string, TaskSid string, pa path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ReservationStatus != nil { - data.Set("ReservationStatus", *params.ReservationStatus) + queryParams.Set("ReservationStatus", *params.ReservationStatus) } if params != nil && params.WorkerSid != nil { - data.Set("WorkerSid", *params.WorkerSid) + queryParams.Set("WorkerSid", *params.WorkerSid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -104,7 +105,7 @@ func (c *ApiService) PageTaskReservation(WorkspaceSid string, TaskSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -191,7 +192,7 @@ func (c *ApiService) getNextListTaskReservationResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -540,7 +541,6 @@ func (params *UpdateTaskReservationParams) SetJitterBufferSize(JitterBufferSize return params } -// func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, Sid string, params *UpdateTaskReservationParams) (*TaskrouterV1TaskReservation, error) { path := "/v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) @@ -548,6 +548,7 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ReservationStatus != nil { @@ -722,7 +723,7 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workers.go b/rest/taskrouter/v1/workspaces_workers.go index 88c4f41cf..cd7f8dd15 100644 --- a/rest/taskrouter/v1/workspaces_workers.go +++ b/rest/taskrouter/v1/workspaces_workers.go @@ -46,12 +46,12 @@ func (params *CreateWorkerParams) SetAttributes(Attributes string) *CreateWorker return params } -// func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParams) (*TaskrouterV1Worker, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -64,7 +64,7 @@ func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParam data.Set("Attributes", *params.Attributes) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -90,19 +90,19 @@ func (params *DeleteWorkerParams) SetIfMatch(IfMatch string) *DeleteWorkerParams return params } -// func (c *ApiService) DeleteWorker(WorkspaceSid string, Sid string, params *DeleteWorkerParams) error { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -112,16 +112,16 @@ func (c *ApiService) DeleteWorker(WorkspaceSid string, Sid string, params *Delet return nil } -// func (c *ApiService) FetchWorker(WorkspaceSid string, Sid string) (*TaskrouterV1Worker, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -208,34 +208,35 @@ func (c *ApiService) PageWorker(WorkspaceSid string, params *ListWorkerParams, p path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ActivityName != nil { - data.Set("ActivityName", *params.ActivityName) + queryParams.Set("ActivityName", *params.ActivityName) } if params != nil && params.ActivitySid != nil { - data.Set("ActivitySid", *params.ActivitySid) + queryParams.Set("ActivitySid", *params.ActivitySid) } if params != nil && params.Available != nil { - data.Set("Available", *params.Available) + queryParams.Set("Available", *params.Available) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.TargetWorkersExpression != nil { - data.Set("TargetWorkersExpression", *params.TargetWorkersExpression) + queryParams.Set("TargetWorkersExpression", *params.TargetWorkersExpression) } if params != nil && params.TaskQueueName != nil { - data.Set("TaskQueueName", *params.TaskQueueName) + queryParams.Set("TaskQueueName", *params.TaskQueueName) } if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) + queryParams.Set("TaskQueueSid", *params.TaskQueueSid) } if params != nil && params.Ordering != nil { - data.Set("Ordering", *params.Ordering) + queryParams.Set("Ordering", *params.Ordering) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -245,7 +246,7 @@ func (c *ApiService) PageWorker(WorkspaceSid string, params *ListWorkerParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -332,7 +333,7 @@ func (c *ApiService) getNextListWorkerResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -381,13 +382,13 @@ func (params *UpdateWorkerParams) SetRejectPendingReservations(RejectPendingRese return params } -// func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *UpdateWorkerParams) (*TaskrouterV1Worker, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ActivitySid != nil { @@ -406,7 +407,7 @@ func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *Updat if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workers_channels.go b/rest/taskrouter/v1/workspaces_workers_channels.go index d6e72fafb..076e90501 100644 --- a/rest/taskrouter/v1/workspaces_workers_channels.go +++ b/rest/taskrouter/v1/workspaces_workers_channels.go @@ -23,7 +23,6 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchWorkerChannel(WorkspaceSid string, WorkerSid string, Sid string) (*TaskrouterV1WorkerChannel, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) @@ -31,9 +30,10 @@ func (c *ApiService) FetchWorkerChannel(WorkspaceSid string, WorkerSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +73,11 @@ func (c *ApiService) PageWorkerChannel(WorkspaceSid string, WorkerSid string, pa path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +87,7 @@ func (c *ApiService) PageWorkerChannel(WorkspaceSid string, WorkerSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +174,7 @@ func (c *ApiService) getNextListWorkerChannelResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -204,7 +205,6 @@ func (params *UpdateWorkerChannelParams) SetAvailable(Available bool) *UpdateWor return params } -// func (c *ApiService) UpdateWorkerChannel(WorkspaceSid string, WorkerSid string, Sid string, params *UpdateWorkerChannelParams) (*TaskrouterV1WorkerChannel, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) @@ -212,6 +212,7 @@ func (c *ApiService) UpdateWorkerChannel(WorkspaceSid string, WorkerSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Capacity != nil { @@ -221,7 +222,7 @@ func (c *ApiService) UpdateWorkerChannel(WorkspaceSid string, WorkerSid string, data.Set("Available", fmt.Sprint(*params.Available)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go index a6bdc0626..f99aaeec0 100644 --- a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go @@ -51,28 +51,28 @@ func (params *FetchWorkersCumulativeStatisticsParams) SetTaskChannel(TaskChannel return params } -// func (c *ApiService) FetchWorkersCumulativeStatistics(WorkspaceSid string, params *FetchWorkersCumulativeStatisticsParams) (*TaskrouterV1WorkersCumulativeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/CumulativeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go index 7fa3f4fe4..858fa48ce 100644 --- a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go @@ -31,19 +31,19 @@ func (params *FetchWorkersRealTimeStatisticsParams) SetTaskChannel(TaskChannel s return params } -// func (c *ApiService) FetchWorkersRealTimeStatistics(WorkspaceSid string, params *FetchWorkersRealTimeStatisticsParams) (*TaskrouterV1WorkersRealTimeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/RealTimeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workers_reservations.go b/rest/taskrouter/v1/workspaces_workers_reservations.go index 0f09a20c8..1ca4aa515 100644 --- a/rest/taskrouter/v1/workspaces_workers_reservations.go +++ b/rest/taskrouter/v1/workspaces_workers_reservations.go @@ -23,7 +23,6 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchWorkerReservation(WorkspaceSid string, WorkerSid string, Sid string) (*TaskrouterV1WorkerReservation, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) @@ -31,9 +30,10 @@ func (c *ApiService) FetchWorkerReservation(WorkspaceSid string, WorkerSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,13 +79,14 @@ func (c *ApiService) PageWorkerReservation(WorkspaceSid string, WorkerSid string path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ReservationStatus != nil { - data.Set("ReservationStatus", *params.ReservationStatus) + queryParams.Set("ReservationStatus", *params.ReservationStatus) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -95,7 +96,7 @@ func (c *ApiService) PageWorkerReservation(WorkspaceSid string, WorkerSid string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -182,7 +183,7 @@ func (c *ApiService) getNextListWorkerReservationResponse(nextPageUrl string) (i if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -519,7 +520,6 @@ func (params *UpdateWorkerReservationParams) SetJitterBufferSize(JitterBufferSiz return params } -// func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid string, Sid string, params *UpdateWorkerReservationParams) (*TaskrouterV1WorkerReservation, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) @@ -527,6 +527,7 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ReservationStatus != nil { @@ -695,7 +696,7 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workers_statistics.go b/rest/taskrouter/v1/workspaces_workers_statistics.go index 6d2d96495..1751a2002 100644 --- a/rest/taskrouter/v1/workspaces_workers_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_statistics.go @@ -51,29 +51,29 @@ func (params *FetchWorkerInstanceStatisticsParams) SetTaskChannel(TaskChannel st return params } -// func (c *ApiService) FetchWorkerInstanceStatistics(WorkspaceSid string, WorkerSid string, params *FetchWorkerInstanceStatisticsParams) (*TaskrouterV1WorkerInstanceStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Statistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -135,37 +135,37 @@ func (params *FetchWorkerStatisticsParams) SetTaskChannel(TaskChannel string) *F return params } -// func (c *ApiService) FetchWorkerStatistics(WorkspaceSid string, params *FetchWorkerStatisticsParams) (*TaskrouterV1WorkerStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workers/Statistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) + queryParams.Set("TaskQueueSid", *params.TaskQueueSid) } if params != nil && params.TaskQueueName != nil { - data.Set("TaskQueueName", *params.TaskQueueName) + queryParams.Set("TaskQueueName", *params.TaskQueueName) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workflows.go b/rest/taskrouter/v1/workspaces_workflows.go index e7dadffd7..22dbbfc07 100644 --- a/rest/taskrouter/v1/workspaces_workflows.go +++ b/rest/taskrouter/v1/workspaces_workflows.go @@ -58,12 +58,12 @@ func (params *CreateWorkflowParams) SetTaskReservationTimeout(TaskReservationTim return params } -// func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowParams) (*TaskrouterV1Workflow, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workflows" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -82,7 +82,7 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP return ps, err } -// func (c *ApiService) DeleteWorkflow(WorkspaceSid string, Sid string) error { path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,16 +116,16 @@ func (c *ApiService) DeleteWorkflow(WorkspaceSid string, Sid string) error { return nil } -// func (c *ApiService) FetchWorkflow(WorkspaceSid string, Sid string) (*TaskrouterV1Workflow, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -170,13 +170,14 @@ func (c *ApiService) PageWorkflow(WorkspaceSid string, params *ListWorkflowParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -186,7 +187,7 @@ func (c *ApiService) PageWorkflow(WorkspaceSid string, params *ListWorkflowParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -273,7 +274,7 @@ func (c *ApiService) getNextListWorkflowResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -328,13 +329,13 @@ func (params *UpdateWorkflowParams) SetReEvaluateTasks(ReEvaluateTasks string) * return params } -// func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *UpdateWorkflowParams) (*TaskrouterV1Workflow, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -356,7 +357,7 @@ func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *Upd data.Set("ReEvaluateTasks", *params.ReEvaluateTasks) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go index ee6ebb429..522188e87 100644 --- a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go @@ -57,32 +57,32 @@ func (params *FetchWorkflowCumulativeStatisticsParams) SetSplitByWaitTime(SplitB return params } -// func (c *ApiService) FetchWorkflowCumulativeStatistics(WorkspaceSid string, WorkflowSid string, params *FetchWorkflowCumulativeStatisticsParams) (*TaskrouterV1WorkflowCumulativeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/CumulativeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go index 5fb9ab9aa..4b2f51fca 100644 --- a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go @@ -31,20 +31,20 @@ func (params *FetchWorkflowRealTimeStatisticsParams) SetTaskChannel(TaskChannel return params } -// func (c *ApiService) FetchWorkflowRealTimeStatistics(WorkspaceSid string, WorkflowSid string, params *FetchWorkflowRealTimeStatisticsParams) (*TaskrouterV1WorkflowRealTimeStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/RealTimeStatistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/taskrouter/v1/workspaces_workflows_statistics.go b/rest/taskrouter/v1/workspaces_workflows_statistics.go index 0c20502d5..511a18c6c 100644 --- a/rest/taskrouter/v1/workspaces_workflows_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_statistics.go @@ -57,32 +57,32 @@ func (params *FetchWorkflowStatisticsParams) SetSplitByWaitTime(SplitByWaitTime return params } -// func (c *ApiService) FetchWorkflowStatistics(WorkspaceSid string, WorkflowSid string, params *FetchWorkflowStatisticsParams) (*TaskrouterV1WorkflowStatistics, error) { path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/Statistics" path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) + queryParams.Set("Minutes", fmt.Sprint(*params.Minutes)) } if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + queryParams.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) } if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + queryParams.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) + queryParams.Set("TaskChannel", *params.TaskChannel) } if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) + queryParams.Set("SplitByWaitTime", *params.SplitByWaitTime) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trunking/v1/README.md b/rest/trunking/v1/README.md index 70ee9f3ef..65dec4fbd 100644 --- a/rest/trunking/v1/README.md +++ b/rest/trunking/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/trunking/v1/trunks.go b/rest/trunking/v1/trunks.go index 45a5e80ac..bc65a1420 100644 --- a/rest/trunking/v1/trunks.go +++ b/rest/trunking/v1/trunks.go @@ -76,11 +76,11 @@ func (params *CreateTrunkParams) SetTransferCallerId(TransferCallerId string) *C return params } -// func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, error) { path := "/v1/Trunks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -108,7 +108,7 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e data.Set("TransferCallerId", *params.TransferCallerId) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,15 +123,15 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e return ps, err } -// func (c *ApiService) DeleteTrunk(Sid string) error { path := "/v1/Trunks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -141,15 +141,15 @@ func (c *ApiService) DeleteTrunk(Sid string) error { return nil } -// func (c *ApiService) FetchTrunk(Sid string) (*TrunkingV1Trunk, error) { path := "/v1/Trunks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -186,10 +186,11 @@ func (c *ApiService) PageTrunk(params *ListTrunkParams, pageToken, pageNumber st path := "/v1/Trunks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -199,7 +200,7 @@ func (c *ApiService) PageTrunk(params *ListTrunkParams, pageToken, pageNumber st data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -286,7 +287,7 @@ func (c *ApiService) getNextListTrunkResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -353,12 +354,12 @@ func (params *UpdateTrunkParams) SetTransferCallerId(TransferCallerId string) *U return params } -// func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*TrunkingV1Trunk, error) { path := "/v1/Trunks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -386,7 +387,7 @@ func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*Trunki data.Set("TransferCallerId", *params.TransferCallerId) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trunking/v1/trunks_credential_lists.go b/rest/trunking/v1/trunks_credential_lists.go index 25b8c0f66..3460238f0 100644 --- a/rest/trunking/v1/trunks_credential_lists.go +++ b/rest/trunking/v1/trunks_credential_lists.go @@ -34,19 +34,19 @@ func (params *CreateCredentialListParams) SetCredentialListSid(CredentialListSid return params } -// func (c *ApiService) CreateCredentialList(TrunkSid string, params *CreateCredentialListParams) (*TrunkingV1CredentialList, error) { path := "/v1/Trunks/{TrunkSid}/CredentialLists" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -61,16 +61,16 @@ func (c *ApiService) CreateCredentialList(TrunkSid string, params *CreateCredent return ps, err } -// func (c *ApiService) DeleteCredentialList(TrunkSid string, Sid string) error { path := "/v1/Trunks/{TrunkSid}/CredentialLists/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -80,16 +80,16 @@ func (c *ApiService) DeleteCredentialList(TrunkSid string, Sid string) error { return nil } -// func (c *ApiService) FetchCredentialList(TrunkSid string, Sid string) (*TrunkingV1CredentialList, error) { path := "/v1/Trunks/{TrunkSid}/CredentialLists/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +128,11 @@ func (c *ApiService) PageCredentialList(TrunkSid string, params *ListCredentialL path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +142,7 @@ func (c *ApiService) PageCredentialList(TrunkSid string, params *ListCredentialL data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +229,7 @@ func (c *ApiService) getNextListCredentialListResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trunking/v1/trunks_ip_access_control_lists.go b/rest/trunking/v1/trunks_ip_access_control_lists.go index 3ab9fdf5a..f12262f9d 100644 --- a/rest/trunking/v1/trunks_ip_access_control_lists.go +++ b/rest/trunking/v1/trunks_ip_access_control_lists.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateIpAccessControlList(TrunkSid string, params *CreateIp path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteIpAccessControlList(TrunkSid string, Sid string) erro path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -80,16 +82,16 @@ func (c *ApiService) DeleteIpAccessControlList(TrunkSid string, Sid string) erro return nil } -// func (c *ApiService) FetchIpAccessControlList(TrunkSid string, Sid string) (*TrunkingV1IpAccessControlList, error) { path := "/v1/Trunks/{TrunkSid}/IpAccessControlLists/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +130,11 @@ func (c *ApiService) PageIpAccessControlList(TrunkSid string, params *ListIpAcce path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +144,7 @@ func (c *ApiService) PageIpAccessControlList(TrunkSid string, params *ListIpAcce data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +231,7 @@ func (c *ApiService) getNextListIpAccessControlListResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trunking/v1/trunks_origination_urls.go b/rest/trunking/v1/trunks_origination_urls.go index 147bdb0e1..7f94ec0c6 100644 --- a/rest/trunking/v1/trunks_origination_urls.go +++ b/rest/trunking/v1/trunks_origination_urls.go @@ -58,12 +58,12 @@ func (params *CreateOriginationUrlParams) SetSipUrl(SipUrl string) *CreateOrigin return params } -// func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOriginationUrlParams) (*TrunkingV1OriginationUrl, error) { path := "/v1/Trunks/{TrunkSid}/OriginationUrls" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Weight != nil { @@ -82,7 +82,7 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina data.Set("SipUrl", *params.SipUrl) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina return ps, err } -// func (c *ApiService) DeleteOriginationUrl(TrunkSid string, Sid string) error { path := "/v1/Trunks/{TrunkSid}/OriginationUrls/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,16 +116,16 @@ func (c *ApiService) DeleteOriginationUrl(TrunkSid string, Sid string) error { return nil } -// func (c *ApiService) FetchOriginationUrl(TrunkSid string, Sid string) (*TrunkingV1OriginationUrl, error) { path := "/v1/Trunks/{TrunkSid}/OriginationUrls/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -164,10 +164,11 @@ func (c *ApiService) PageOriginationUrl(TrunkSid string, params *ListOrigination path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -177,7 +178,7 @@ func (c *ApiService) PageOriginationUrl(TrunkSid string, params *ListOrigination data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (c *ApiService) getNextListOriginationUrlResponse(nextPageUrl string) (inte if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -313,13 +314,13 @@ func (params *UpdateOriginationUrlParams) SetSipUrl(SipUrl string) *UpdateOrigin return params } -// func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *UpdateOriginationUrlParams) (*TrunkingV1OriginationUrl, error) { path := "/v1/Trunks/{TrunkSid}/OriginationUrls/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Weight != nil { @@ -338,7 +339,7 @@ func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *U data.Set("SipUrl", *params.SipUrl) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trunking/v1/trunks_phone_numbers.go b/rest/trunking/v1/trunks_phone_numbers.go index 4670e4b37..6cb3a14c0 100644 --- a/rest/trunking/v1/trunks_phone_numbers.go +++ b/rest/trunking/v1/trunks_phone_numbers.go @@ -34,19 +34,19 @@ func (params *CreatePhoneNumberParams) SetPhoneNumberSid(PhoneNumberSid string) return params } -// func (c *ApiService) CreatePhoneNumber(TrunkSid string, params *CreatePhoneNumberParams) (*TrunkingV1PhoneNumber, error) { path := "/v1/Trunks/{TrunkSid}/PhoneNumbers" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumberSid != nil { data.Set("PhoneNumberSid", *params.PhoneNumberSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -61,16 +61,16 @@ func (c *ApiService) CreatePhoneNumber(TrunkSid string, params *CreatePhoneNumbe return ps, err } -// func (c *ApiService) DeletePhoneNumber(TrunkSid string, Sid string) error { path := "/v1/Trunks/{TrunkSid}/PhoneNumbers/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -80,16 +80,16 @@ func (c *ApiService) DeletePhoneNumber(TrunkSid string, Sid string) error { return nil } -// func (c *ApiService) FetchPhoneNumber(TrunkSid string, Sid string) (*TrunkingV1PhoneNumber, error) { path := "/v1/Trunks/{TrunkSid}/PhoneNumbers/{Sid}" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +128,11 @@ func (c *ApiService) PagePhoneNumber(TrunkSid string, params *ListPhoneNumberPar path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +142,7 @@ func (c *ApiService) PagePhoneNumber(TrunkSid string, params *ListPhoneNumberPar data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +229,7 @@ func (c *ApiService) getNextListPhoneNumberResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trunking/v1/trunks_recording.go b/rest/trunking/v1/trunks_recording.go index 615fd2e51..8609d4200 100644 --- a/rest/trunking/v1/trunks_recording.go +++ b/rest/trunking/v1/trunks_recording.go @@ -20,15 +20,15 @@ import ( "strings" ) -// func (c *ApiService) FetchRecording(TrunkSid string) (*TrunkingV1Recording, error) { path := "/v1/Trunks/{TrunkSid}/Recording" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,12 +60,12 @@ func (params *UpdateRecordingParams) SetTrim(Trim string) *UpdateRecordingParams return params } -// func (c *ApiService) UpdateRecording(TrunkSid string, params *UpdateRecordingParams) (*TrunkingV1Recording, error) { path := "/v1/Trunks/{TrunkSid}/Recording" path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Mode != nil { @@ -75,7 +75,7 @@ func (c *ApiService) UpdateRecording(TrunkSid string, params *UpdateRecordingPar data.Set("Trim", *params.Trim) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/README.md b/rest/trusthub/v1/README.md index 37eef9208..1711c5305 100644 --- a/rest/trusthub/v1/README.md +++ b/rest/trusthub/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/trusthub/v1/compliance_inquiries_customers_initialize.go b/rest/trusthub/v1/compliance_inquiries_customers_initialize.go index abe6880a2..75062933c 100644 --- a/rest/trusthub/v1/compliance_inquiries_customers_initialize.go +++ b/rest/trusthub/v1/compliance_inquiries_customers_initialize.go @@ -36,13 +36,14 @@ func (c *ApiService) CreateComplianceInquiry(params *CreateComplianceInquiryPara path := "/v1/ComplianceInquiries/Customers/Initialize" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PrimaryProfileSid != nil { data.Set("PrimaryProfileSid", *params.PrimaryProfileSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -74,13 +75,14 @@ func (c *ApiService) UpdateComplianceInquiry(CustomerId string, params *UpdateCo path = strings.Replace(path, "{"+"CustomerId"+"}", CustomerId, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PrimaryProfileSid != nil { data.Set("PrimaryProfileSid", *params.PrimaryProfileSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/compliance_inquiries_tollfree_initialize.go b/rest/trusthub/v1/compliance_inquiries_tollfree_initialize.go index 63426bdf9..556487fcd 100644 --- a/rest/trusthub/v1/compliance_inquiries_tollfree_initialize.go +++ b/rest/trusthub/v1/compliance_inquiries_tollfree_initialize.go @@ -155,6 +155,7 @@ func (c *ApiService) CreateComplianceTollfreeInquiry(params *CreateComplianceTol path := "/v1/ComplianceInquiries/Tollfree/Initialize" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.TollfreePhoneNumber != nil { @@ -225,7 +226,7 @@ func (c *ApiService) CreateComplianceTollfreeInquiry(params *CreateComplianceTol data.Set("BusinessContactPhone", *params.BusinessContactPhone) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/customer_profiles.go b/rest/trusthub/v1/customer_profiles.go index f6cf893ca..123cfc181 100644 --- a/rest/trusthub/v1/customer_profiles.go +++ b/rest/trusthub/v1/customer_profiles.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) path := "/v1/CustomerProfiles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) data.Set("StatusCallback", *params.StatusCallback) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteCustomerProfile(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -111,9 +113,10 @@ func (c *ApiService) FetchCustomerProfile(Sid string) (*TrusthubV1CustomerProfil path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,19 +171,20 @@ func (c *ApiService) PageCustomerProfile(params *ListCustomerProfileParams, page path := "/v1/CustomerProfiles" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) + queryParams.Set("PolicySid", *params.PolicySid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +194,7 @@ func (c *ApiService) PageCustomerProfile(params *ListCustomerProfileParams, page data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +281,7 @@ func (c *ApiService) getNextListCustomerProfileResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -326,6 +330,7 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -341,7 +346,7 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro data.Set("Email", *params.Email) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go index 81f947b6d..4459ec240 100644 --- a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateCustomerProfileChannelEndpointAssignment(CustomerProf path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ChannelEndpointType != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateCustomerProfileChannelEndpointAssignment(CustomerProf data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteCustomerProfileChannelEndpointAssignment(CustomerProf path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchCustomerProfileChannelEndpointAssignment(CustomerProfi path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -149,16 +152,17 @@ func (c *ApiService) PageCustomerProfileChannelEndpointAssignment(CustomerProfil path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ChannelEndpointSid != nil { - data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) + queryParams.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } if params != nil && params.ChannelEndpointSids != nil { - data.Set("ChannelEndpointSids", *params.ChannelEndpointSids) + queryParams.Set("ChannelEndpointSids", *params.ChannelEndpointSids) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -168,7 +172,7 @@ func (c *ApiService) PageCustomerProfileChannelEndpointAssignment(CustomerProfil data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,7 +259,7 @@ func (c *ApiService) getNextListCustomerProfileChannelEndpointAssignmentResponse if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/customer_profiles_entity_assignments.go b/rest/trusthub/v1/customer_profiles_entity_assignments.go index e21cc9441..0b508132b 100644 --- a/rest/trusthub/v1/customer_profiles_entity_assignments.go +++ b/rest/trusthub/v1/customer_profiles_entity_assignments.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateCustomerProfileEntityAssignment(CustomerProfileSid st path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteCustomerProfileEntityAssignment(CustomerProfileSid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchCustomerProfileEntityAssignment(CustomerProfileSid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageCustomerProfileEntityAssignment(CustomerProfileSid stri path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageCustomerProfileEntityAssignment(CustomerProfileSid stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListCustomerProfileEntityAssignmentResponse(nextPage if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/customer_profiles_evaluations.go b/rest/trusthub/v1/customer_profiles_evaluations.go index e56546485..4c7f26508 100644 --- a/rest/trusthub/v1/customer_profiles_evaluations.go +++ b/rest/trusthub/v1/customer_profiles_evaluations.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateCustomerProfileEvaluation(CustomerProfileSid string, path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PolicySid != nil { data.Set("PolicySid", *params.PolicySid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) FetchCustomerProfileEvaluation(CustomerProfileSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -109,10 +111,11 @@ func (c *ApiService) PageCustomerProfileEvaluation(CustomerProfileSid string, pa path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -122,7 +125,7 @@ func (c *ApiService) PageCustomerProfileEvaluation(CustomerProfileSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -209,7 +212,7 @@ func (c *ApiService) getNextListCustomerProfileEvaluationResponse(nextPageUrl st if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/end_user_types.go b/rest/trusthub/v1/end_user_types.go index 4acde972e..3fe5ce4aa 100644 --- a/rest/trusthub/v1/end_user_types.go +++ b/rest/trusthub/v1/end_user_types.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchEndUserType(Sid string) (*TrusthubV1EndUserType, error path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken, p path := "/v1/EndUserTypes" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListEndUserTypeResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/end_users.go b/rest/trusthub/v1/end_users.go index 47d0b5525..e1b2105f2 100644 --- a/rest/trusthub/v1/end_users.go +++ b/rest/trusthub/v1/end_users.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU path := "/v1/EndUsers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -69,7 +70,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -90,9 +91,10 @@ func (c *ApiService) DeleteEndUser(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -108,9 +110,10 @@ func (c *ApiService) FetchEndUser(Sid string) (*TrusthubV1EndUser, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,10 +150,11 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken, pageNumbe path := "/v1/EndUsers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -160,7 +164,7 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -247,7 +251,7 @@ func (c *ApiService) getNextListEndUserResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -284,6 +288,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -299,7 +304,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/policies.go b/rest/trusthub/v1/policies.go index 2c06d0452..72bac0822 100644 --- a/rest/trusthub/v1/policies.go +++ b/rest/trusthub/v1/policies.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchPolicies(Sid string) (*TrusthubV1Policies, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PagePolicies(params *ListPoliciesParams, pageToken, pageNum path := "/v1/Policies" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PagePolicies(params *ListPoliciesParams, pageToken, pageNum data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListPoliciesResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/supporting_document_types.go b/rest/trusthub/v1/supporting_document_types.go index 6c929f71e..a0f307421 100644 --- a/rest/trusthub/v1/supporting_document_types.go +++ b/rest/trusthub/v1/supporting_document_types.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchSupportingDocumentType(Sid string) (*TrusthubV1Support path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,10 +69,11 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy path := "/v1/SupportingDocumentTypes" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -81,7 +83,7 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,7 +170,7 @@ func (c *ApiService) getNextListSupportingDocumentTypeResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/supporting_documents.go b/rest/trusthub/v1/supporting_documents.go index ac2e78c0b..40b930c14 100644 --- a/rest/trusthub/v1/supporting_documents.go +++ b/rest/trusthub/v1/supporting_documents.go @@ -51,6 +51,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa path := "/v1/SupportingDocuments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -69,7 +70,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -90,9 +91,10 @@ func (c *ApiService) DeleteSupportingDocument(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -108,9 +110,10 @@ func (c *ApiService) FetchSupportingDocument(Sid string) (*TrusthubV1SupportingD path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,10 +150,11 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams path := "/v1/SupportingDocuments" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -160,7 +164,7 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -247,7 +251,7 @@ func (c *ApiService) getNextListSupportingDocumentResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -284,6 +288,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -299,7 +304,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti data.Set("Attributes", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/trust_products.go b/rest/trusthub/v1/trust_products.go index 5d6de413e..bc4cd1baf 100644 --- a/rest/trusthub/v1/trust_products.go +++ b/rest/trusthub/v1/trust_products.go @@ -57,6 +57,7 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus path := "/v1/TrustProducts" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -72,7 +73,7 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus data.Set("StatusCallback", *params.StatusCallback) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) DeleteTrustProduct(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -111,9 +113,10 @@ func (c *ApiService) FetchTrustProduct(Sid string) (*TrusthubV1TrustProduct, err path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -168,19 +171,20 @@ func (c *ApiService) PageTrustProduct(params *ListTrustProductParams, pageToken, path := "/v1/TrustProducts" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) + queryParams.Set("PolicySid", *params.PolicySid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -190,7 +194,7 @@ func (c *ApiService) PageTrustProduct(params *ListTrustProductParams, pageToken, data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -277,7 +281,7 @@ func (c *ApiService) getNextListTrustProductResponse(nextPageUrl string) (interf if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -326,6 +330,7 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { @@ -341,7 +346,7 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa data.Set("Email", *params.Email) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go index c90bc4ca0..d30709367 100644 --- a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateTrustProductChannelEndpointAssignment(TrustProductSid path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ChannelEndpointType != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateTrustProductChannelEndpointAssignment(TrustProductSid data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteTrustProductChannelEndpointAssignment(TrustProductSid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchTrustProductChannelEndpointAssignment(TrustProductSid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -149,16 +152,17 @@ func (c *ApiService) PageTrustProductChannelEndpointAssignment(TrustProductSid s path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ChannelEndpointSid != nil { - data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) + queryParams.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } if params != nil && params.ChannelEndpointSids != nil { - data.Set("ChannelEndpointSids", *params.ChannelEndpointSids) + queryParams.Set("ChannelEndpointSids", *params.ChannelEndpointSids) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -168,7 +172,7 @@ func (c *ApiService) PageTrustProductChannelEndpointAssignment(TrustProductSid s data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,7 +259,7 @@ func (c *ApiService) getNextListTrustProductChannelEndpointAssignmentResponse(ne if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/trust_products_entity_assignments.go b/rest/trusthub/v1/trust_products_entity_assignments.go index cc5bc2b31..c03259b72 100644 --- a/rest/trusthub/v1/trust_products_entity_assignments.go +++ b/rest/trusthub/v1/trust_products_entity_assignments.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateTrustProductEntityAssignment(TrustProductSid string, path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteTrustProductEntityAssignment(TrustProductSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchTrustProductEntityAssignment(TrustProductSid string, S path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageTrustProductEntityAssignment(TrustProductSid string, pa path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageTrustProductEntityAssignment(TrustProductSid string, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListTrustProductEntityAssignmentResponse(nextPageUrl if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/trusthub/v1/trust_products_evaluations.go b/rest/trusthub/v1/trust_products_evaluations.go index 652c6e9b0..2972c74ec 100644 --- a/rest/trusthub/v1/trust_products_evaluations.go +++ b/rest/trusthub/v1/trust_products_evaluations.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateTrustProductEvaluation(TrustProductSid string, params path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PolicySid != nil { data.Set("PolicySid", *params.PolicySid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) FetchTrustProductEvaluation(TrustProductSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -109,10 +111,11 @@ func (c *ApiService) PageTrustProductEvaluation(TrustProductSid string, params * path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -122,7 +125,7 @@ func (c *ApiService) PageTrustProductEvaluation(TrustProductSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -209,7 +212,7 @@ func (c *ApiService) getNextListTrustProductEvaluationResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/verify/v2/README.md b/rest/verify/v2/README.md index a6c35f36d..b3225830f 100644 --- a/rest/verify/v2/README.md +++ b/rest/verify/v2/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/verify/v2/attempts.go b/rest/verify/v2/attempts.go index 426ad0dcc..1fb04081f 100644 --- a/rest/verify/v2/attempts.go +++ b/rest/verify/v2/attempts.go @@ -30,9 +30,10 @@ func (c *ApiService) FetchVerificationAttempt(Sid string) (*VerifyV2Verification path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -117,34 +118,35 @@ func (c *ApiService) PageVerificationAttempt(params *ListVerificationAttemptPara path := "/v2/Attempts" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.ChannelDataTo != nil { - data.Set("ChannelData.To", *params.ChannelDataTo) + queryParams.Set("ChannelData.To", *params.ChannelDataTo) } if params != nil && params.Country != nil { - data.Set("Country", *params.Country) + queryParams.Set("Country", *params.Country) } if params != nil && params.Channel != nil { - data.Set("Channel", *params.Channel) + queryParams.Set("Channel", *params.Channel) } if params != nil && params.VerifyServiceSid != nil { - data.Set("VerifyServiceSid", *params.VerifyServiceSid) + queryParams.Set("VerifyServiceSid", *params.VerifyServiceSid) } if params != nil && params.VerificationSid != nil { - data.Set("VerificationSid", *params.VerificationSid) + queryParams.Set("VerificationSid", *params.VerificationSid) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +156,7 @@ func (c *ApiService) PageVerificationAttempt(params *ListVerificationAttemptPara data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +243,7 @@ func (c *ApiService) getNextListVerificationAttemptResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/verify/v2/attempts_summary.go b/rest/verify/v2/attempts_summary.go index 6bb28cb9d..c89db05cd 100644 --- a/rest/verify/v2/attempts_summary.go +++ b/rest/verify/v2/attempts_summary.go @@ -67,28 +67,29 @@ func (c *ApiService) FetchVerificationAttemptsSummary(params *FetchVerificationA path := "/v2/Attempts/Summary" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.VerifyServiceSid != nil { - data.Set("VerifyServiceSid", *params.VerifyServiceSid) + queryParams.Set("VerifyServiceSid", *params.VerifyServiceSid) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.Country != nil { - data.Set("Country", *params.Country) + queryParams.Set("Country", *params.Country) } if params != nil && params.Channel != nil { - data.Set("Channel", *params.Channel) + queryParams.Set("Channel", *params.Channel) } if params != nil && params.DestinationPrefix != nil { - data.Set("DestinationPrefix", *params.DestinationPrefix) + queryParams.Set("DestinationPrefix", *params.DestinationPrefix) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/forms.go b/rest/verify/v2/forms.go index 16db4c563..38f3f4624 100644 --- a/rest/verify/v2/forms.go +++ b/rest/verify/v2/forms.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchForm(FormType string) (*VerifyV2Form, error) { path = strings.Replace(path, "{"+"FormType"+"}", FormType, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/safe_list_numbers.go b/rest/verify/v2/safe_list_numbers.go index 52594bedf..c20e33b07 100644 --- a/rest/verify/v2/safe_list_numbers.go +++ b/rest/verify/v2/safe_list_numbers.go @@ -36,13 +36,14 @@ func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*VerifyV2Safe path := "/v2/SafeList/Numbers" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PhoneNumber != nil { data.Set("PhoneNumber", *params.PhoneNumber) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -63,9 +64,10 @@ func (c *ApiService) DeleteSafelist(PhoneNumber string) error { path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -81,9 +83,10 @@ func (c *ApiService) FetchSafelist(PhoneNumber string) (*VerifyV2Safelist, error path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services.go b/rest/verify/v2/services.go index 2e3093900..53a3f3bc1 100644 --- a/rest/verify/v2/services.go +++ b/rest/verify/v2/services.go @@ -141,6 +141,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -198,7 +199,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic data.Set("VerifyEventSubscriptionEnabled", fmt.Sprint(*params.VerifyEventSubscriptionEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -219,9 +220,10 @@ func (c *ApiService) DeleteService(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -237,9 +239,10 @@ func (c *ApiService) FetchService(Sid string) (*VerifyV2Service, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -276,10 +279,11 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe path := "/v2/Services" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -289,7 +293,7 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -376,7 +380,7 @@ func (c *ApiService) getNextListServiceResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -509,6 +513,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -566,7 +571,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve data.Set("VerifyEventSubscriptionEnabled", fmt.Sprint(*params.VerifyEventSubscriptionEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_access_tokens.go b/rest/verify/v2/services_access_tokens.go index c2921683f..9116c5b39 100644 --- a/rest/verify/v2/services_access_tokens.go +++ b/rest/verify/v2/services_access_tokens.go @@ -56,6 +56,7 @@ func (c *ApiService) CreateAccessToken(ServiceSid string, params *CreateAccessTo path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { @@ -71,7 +72,7 @@ func (c *ApiService) CreateAccessToken(ServiceSid string, params *CreateAccessTo data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -93,9 +94,10 @@ func (c *ApiService) FetchAccessToken(ServiceSid string, Sid string) (*VerifyV2A path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_entities.go b/rest/verify/v2/services_entities.go index 4f5ce3457..7ec921685 100644 --- a/rest/verify/v2/services_entities.go +++ b/rest/verify/v2/services_entities.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateEntity(ServiceSid string, params *CreateEntityParams) path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -68,9 +69,10 @@ func (c *ApiService) DeleteEntity(ServiceSid string, Identity string) error { path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,9 +89,10 @@ func (c *ApiService) FetchEntity(ServiceSid string, Identity string) (*VerifyV2E path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -128,10 +131,11 @@ func (c *ApiService) PageEntity(ServiceSid string, params *ListEntityParams, pag path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -141,7 +145,7 @@ func (c *ApiService) PageEntity(ServiceSid string, params *ListEntityParams, pag data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -228,7 +232,7 @@ func (c *ApiService) getNextListEntityResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_entities_challenges.go b/rest/verify/v2/services_entities_challenges.go index 9b200d5e4..d0162fa81 100644 --- a/rest/verify/v2/services_entities_challenges.go +++ b/rest/verify/v2/services_entities_challenges.go @@ -72,6 +72,7 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FactorSid != nil { @@ -107,7 +108,7 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params data.Set("AuthPayload", *params.AuthPayload) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -130,9 +131,10 @@ func (c *ApiService) FetchChallenge(ServiceSid string, Identity string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -190,19 +192,20 @@ func (c *ApiService) PageChallenge(ServiceSid string, Identity string, params *L path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FactorSid != nil { - data.Set("FactorSid", *params.FactorSid) + queryParams.Set("FactorSid", *params.FactorSid) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Order != nil { - data.Set("Order", *params.Order) + queryParams.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -212,7 +215,7 @@ func (c *ApiService) PageChallenge(ServiceSid string, Identity string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -299,7 +302,7 @@ func (c *ApiService) getNextListChallengeResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -338,6 +341,7 @@ func (c *ApiService) UpdateChallenge(ServiceSid string, Identity string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AuthPayload != nil { @@ -353,7 +357,7 @@ func (c *ApiService) UpdateChallenge(ServiceSid string, Identity string, Sid str data.Set("Metadata", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_entities_challenges_notifications.go b/rest/verify/v2/services_entities_challenges_notifications.go index 6d36b964a..e5aa09cc3 100644 --- a/rest/verify/v2/services_entities_challenges_notifications.go +++ b/rest/verify/v2/services_entities_challenges_notifications.go @@ -40,13 +40,14 @@ func (c *ApiService) CreateNotification(ServiceSid string, Identity string, Chal path = strings.Replace(path, "{"+"ChallengeSid"+"}", ChallengeSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_entities_factors.go b/rest/verify/v2/services_entities_factors.go index 089255ec7..1c5a2c68f 100644 --- a/rest/verify/v2/services_entities_factors.go +++ b/rest/verify/v2/services_entities_factors.go @@ -119,6 +119,7 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -170,7 +171,7 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params data.Set("Metadata", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -193,9 +194,10 @@ func (c *ApiService) DeleteFactor(ServiceSid string, Identity string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -213,9 +215,10 @@ func (c *ApiService) FetchFactor(ServiceSid string, Identity string, Sid string) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -255,10 +258,11 @@ func (c *ApiService) PageFactor(ServiceSid string, Identity string, params *List path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -268,7 +272,7 @@ func (c *ApiService) PageFactor(ServiceSid string, Identity string, params *List data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -355,7 +359,7 @@ func (c *ApiService) getNextListFactorResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -436,6 +440,7 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.AuthPayload != nil { @@ -466,7 +471,7 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string data.Set("Config.NotificationPlatform", *params.ConfigNotificationPlatform) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_messaging_configurations.go b/rest/verify/v2/services_messaging_configurations.go index 06b8f916a..c1c5cd0be 100644 --- a/rest/verify/v2/services_messaging_configurations.go +++ b/rest/verify/v2/services_messaging_configurations.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateMessagingConfiguration(ServiceSid string, params *Cre path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Country != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateMessagingConfiguration(ServiceSid string, params *Cre data.Set("MessagingServiceSid", *params.MessagingServiceSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteMessagingConfiguration(ServiceSid string, Country str path = strings.Replace(path, "{"+"Country"+"}", Country, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchMessagingConfiguration(ServiceSid string, Country stri path = strings.Replace(path, "{"+"Country"+"}", Country, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageMessagingConfiguration(ServiceSid string, params *ListM path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageMessagingConfiguration(ServiceSid string, params *ListM data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListMessagingConfigurationResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -269,13 +273,14 @@ func (c *ApiService) UpdateMessagingConfiguration(ServiceSid string, Country str path = strings.Replace(path, "{"+"Country"+"}", Country, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_rate_limits.go b/rest/verify/v2/services_rate_limits.go index 82c83ac73..2cbb5eb4c 100644 --- a/rest/verify/v2/services_rate_limits.go +++ b/rest/verify/v2/services_rate_limits.go @@ -46,6 +46,7 @@ func (c *ApiService) CreateRateLimit(ServiceSid string, params *CreateRateLimitP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -55,7 +56,7 @@ func (c *ApiService) CreateRateLimit(ServiceSid string, params *CreateRateLimitP data.Set("Description", *params.Description) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -77,9 +78,10 @@ func (c *ApiService) DeleteRateLimit(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,9 +98,10 @@ func (c *ApiService) FetchRateLimit(ServiceSid string, Sid string) (*VerifyV2Rat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -137,10 +140,11 @@ func (c *ApiService) PageRateLimit(ServiceSid string, params *ListRateLimitParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -150,7 +154,7 @@ func (c *ApiService) PageRateLimit(ServiceSid string, params *ListRateLimitParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -237,7 +241,7 @@ func (c *ApiService) getNextListRateLimitResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -269,13 +273,14 @@ func (c *ApiService) UpdateRateLimit(ServiceSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Description != nil { data.Set("Description", *params.Description) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_rate_limits_buckets.go b/rest/verify/v2/services_rate_limits_buckets.go index 1eb51fac3..09cd2c60c 100644 --- a/rest/verify/v2/services_rate_limits_buckets.go +++ b/rest/verify/v2/services_rate_limits_buckets.go @@ -47,6 +47,7 @@ func (c *ApiService) CreateBucket(ServiceSid string, RateLimitSid string, params path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Max != nil { @@ -56,7 +57,7 @@ func (c *ApiService) CreateBucket(ServiceSid string, RateLimitSid string, params data.Set("Interval", fmt.Sprint(*params.Interval)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -79,9 +80,10 @@ func (c *ApiService) DeleteBucket(ServiceSid string, RateLimitSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -99,9 +101,10 @@ func (c *ApiService) FetchBucket(ServiceSid string, RateLimitSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,10 +144,11 @@ func (c *ApiService) PageBucket(ServiceSid string, RateLimitSid string, params * path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +158,7 @@ func (c *ApiService) PageBucket(ServiceSid string, RateLimitSid string, params * data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +245,7 @@ func (c *ApiService) getNextListBucketResponse(nextPageUrl string) (interface{}, if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -280,6 +284,7 @@ func (c *ApiService) UpdateBucket(ServiceSid string, RateLimitSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Max != nil { @@ -289,7 +294,7 @@ func (c *ApiService) UpdateBucket(ServiceSid string, RateLimitSid string, Sid st data.Set("Interval", fmt.Sprint(*params.Interval)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_verification_check.go b/rest/verify/v2/services_verification_check.go index 0f2caad79..7b808502a 100644 --- a/rest/verify/v2/services_verification_check.go +++ b/rest/verify/v2/services_verification_check.go @@ -61,6 +61,7 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Code != nil { @@ -79,7 +80,7 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe data.Set("Payee", *params.Payee) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_verifications.go b/rest/verify/v2/services_verifications.go index 097e35704..8f789305f 100644 --- a/rest/verify/v2/services_verifications.go +++ b/rest/verify/v2/services_verifications.go @@ -133,6 +133,7 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.To != nil { @@ -199,7 +200,7 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific data.Set("Tags", *params.Tags) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -221,9 +222,10 @@ func (c *ApiService) FetchVerification(ServiceSid string, Sid string) (*VerifyV2 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -256,13 +258,14 @@ func (c *ApiService) UpdateVerification(ServiceSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/services_webhooks.go b/rest/verify/v2/services_webhooks.go index 46dd9318c..b2f163f46 100644 --- a/rest/verify/v2/services_webhooks.go +++ b/rest/verify/v2/services_webhooks.go @@ -64,6 +64,7 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -84,7 +85,7 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam data.Set("Version", *params.Version) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -106,9 +107,10 @@ func (c *ApiService) DeleteWebhook(ServiceSid string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -125,9 +127,10 @@ func (c *ApiService) FetchWebhook(ServiceSid string, Sid string) (*VerifyV2Webho path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -166,10 +169,11 @@ func (c *ApiService) PageWebhook(ServiceSid string, params *ListWebhookParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -179,7 +183,7 @@ func (c *ApiService) PageWebhook(ServiceSid string, params *ListWebhookParams, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -266,7 +270,7 @@ func (c *ApiService) getNextListWebhookResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -315,13 +319,13 @@ func (params *UpdateWebhookParams) SetVersion(Version string) *UpdateWebhookPara return params } -// func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *UpdateWebhookParams) (*VerifyV2Webhook, error) { path := "/v2/Services/{ServiceSid}/Webhooks/{Sid}" path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -342,7 +346,7 @@ func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *Update data.Set("Version", *params.Version) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/verify/v2/templates.go b/rest/verify/v2/templates.go index ef868baca..c6a090ee6 100644 --- a/rest/verify/v2/templates.go +++ b/rest/verify/v2/templates.go @@ -50,13 +50,14 @@ func (c *ApiService) PageVerificationTemplate(params *ListVerificationTemplatePa path := "/v2/Templates" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -66,7 +67,7 @@ func (c *ApiService) PageVerificationTemplate(params *ListVerificationTemplatePa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -153,7 +154,7 @@ func (c *ApiService) getNextListVerificationTemplateResponse(nextPageUrl string) if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/video/v1/README.md b/rest/video/v1/README.md index 6164980fd..d8a1047d2 100644 --- a/rest/video/v1/README.md +++ b/rest/video/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/video/v1/composition_hooks.go b/rest/video/v1/composition_hooks.go index a7a824e18..803aa9f2d 100644 --- a/rest/video/v1/composition_hooks.go +++ b/rest/video/v1/composition_hooks.go @@ -89,11 +89,11 @@ func (params *CreateCompositionHookParams) SetTrim(Trim bool) *CreateComposition return params } -// func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) (*VideoV1CompositionHook, error) { path := "/v1/CompositionHooks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -137,7 +137,7 @@ func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) data.Set("Trim", fmt.Sprint(*params.Trim)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -158,9 +158,10 @@ func (c *ApiService) DeleteCompositionHook(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -176,9 +177,10 @@ func (c *ApiService) FetchCompositionHook(Sid string) (*VideoV1CompositionHook, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -239,22 +241,23 @@ func (c *ApiService) PageCompositionHook(params *ListCompositionHookParams, page path := "/v1/CompositionHooks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) + queryParams.Set("Enabled", fmt.Sprint(*params.Enabled)) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) + queryParams.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -264,7 +267,7 @@ func (c *ApiService) PageCompositionHook(params *ListCompositionHookParams, page data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -351,7 +354,7 @@ func (c *ApiService) getNextListCompositionHookResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -430,12 +433,12 @@ func (params *UpdateCompositionHookParams) SetStatusCallbackMethod(StatusCallbac return params } -// func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateCompositionHookParams) (*VideoV1CompositionHook, error) { path := "/v1/CompositionHooks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -479,7 +482,7 @@ func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateComposition data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/composition_settings_default.go b/rest/video/v1/composition_settings_default.go index cdb7f12fa..b85bdbfc0 100644 --- a/rest/video/v1/composition_settings_default.go +++ b/rest/video/v1/composition_settings_default.go @@ -61,11 +61,11 @@ func (params *CreateCompositionSettingsParams) SetEncryptionEnabled(EncryptionEn return params } -// func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettingsParams) (*VideoV1CompositionSettings, error) { path := "/v1/CompositionSettings/Default" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -87,7 +87,7 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings data.Set("EncryptionEnabled", fmt.Sprint(*params.EncryptionEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,14 +102,14 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings return ps, err } -// func (c *ApiService) FetchCompositionSettings() (*VideoV1CompositionSettings, error) { path := "/v1/CompositionSettings/Default" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/compositions.go b/rest/video/v1/compositions.go index d0dce4ee9..7c13191c6 100644 --- a/rest/video/v1/compositions.go +++ b/rest/video/v1/compositions.go @@ -83,11 +83,11 @@ func (params *CreateCompositionParams) SetTrim(Trim bool) *CreateCompositionPara return params } -// func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV1Composition, error) { path := "/v1/Compositions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.RoomSid != nil { @@ -128,7 +128,7 @@ func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV data.Set("Trim", fmt.Sprint(*params.Trim)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -149,9 +149,10 @@ func (c *ApiService) DeleteComposition(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -167,9 +168,10 @@ func (c *ApiService) FetchComposition(Sid string) (*VideoV1Composition, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -230,22 +232,23 @@ func (c *ApiService) PageComposition(params *ListCompositionParams, pageToken, p path := "/v1/Compositions" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.RoomSid != nil { - data.Set("RoomSid", *params.RoomSid) + queryParams.Set("RoomSid", *params.RoomSid) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -255,7 +258,7 @@ func (c *ApiService) PageComposition(params *ListCompositionParams, pageToken, p data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -342,7 +345,7 @@ func (c *ApiService) getNextListCompositionResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/video/v1/recording_settings_default.go b/rest/video/v1/recording_settings_default.go index 8b675feda..f9ec17091 100644 --- a/rest/video/v1/recording_settings_default.go +++ b/rest/video/v1/recording_settings_default.go @@ -61,11 +61,11 @@ func (params *CreateRecordingSettingsParams) SetEncryptionEnabled(EncryptionEnab return params } -// func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsParams) (*VideoV1RecordingSettings, error) { path := "/v1/RecordingSettings/Default" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -87,7 +87,7 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara data.Set("EncryptionEnabled", fmt.Sprint(*params.EncryptionEnabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -102,14 +102,14 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara return ps, err } -// func (c *ApiService) FetchRecordingSettings() (*VideoV1RecordingSettings, error) { path := "/v1/RecordingSettings/Default" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/recordings.go b/rest/video/v1/recordings.go index fede4f40f..ac39a1938 100644 --- a/rest/video/v1/recordings.go +++ b/rest/video/v1/recordings.go @@ -30,9 +30,10 @@ func (c *ApiService) DeleteRecording(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -48,9 +49,10 @@ func (c *ApiService) FetchRecording(Sid string) (*VideoV1Recording, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,30 +125,31 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken, pageN path := "/v1/Recordings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) + queryParams.Set("SourceSid", *params.SourceSid) } if params != nil && params.GroupingSid != nil { for _, item := range *params.GroupingSid { - data.Add("GroupingSid", item) + queryParams.Add("GroupingSid", item) } } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.MediaType != nil { - data.Set("MediaType", *params.MediaType) + queryParams.Set("MediaType", *params.MediaType) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -156,7 +159,7 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -243,7 +246,7 @@ func (c *ApiService) getNextListRecordingResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms.go b/rest/video/v1/rooms.go index 0ea1b2229..9a17990d3 100644 --- a/rest/video/v1/rooms.go +++ b/rest/video/v1/rooms.go @@ -119,11 +119,11 @@ func (params *CreateRoomParams) SetLargeRoom(LargeRoom bool) *CreateRoomParams { return params } -// func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) { path := "/v1/Rooms" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.EnableTurn != nil { @@ -180,7 +180,7 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) data.Set("LargeRoom", fmt.Sprint(*params.LargeRoom)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -195,15 +195,15 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) return ps, err } -// func (c *ApiService) FetchRoom(Sid string) (*VideoV1Room, error) { path := "/v1/Rooms/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -264,22 +264,23 @@ func (c *ApiService) PageRoom(params *ListRoomParams, pageToken, pageNumber stri path := "/v1/Rooms" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) + queryParams.Set("UniqueName", *params.UniqueName) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -289,7 +290,7 @@ func (c *ApiService) PageRoom(params *ListRoomParams, pageToken, pageNumber stri data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -376,7 +377,7 @@ func (c *ApiService) getNextListRoomResponse(nextPageUrl string) (interface{}, e if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -401,19 +402,19 @@ func (params *UpdateRoomParams) SetStatus(Status string) *UpdateRoomParams { return params } -// func (c *ApiService) UpdateRoom(Sid string, params *UpdateRoomParams) (*VideoV1Room, error) { path := "/v1/Rooms/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_participants.go b/rest/video/v1/rooms_participants.go index af815d01e..f340dac20 100644 --- a/rest/video/v1/rooms_participants.go +++ b/rest/video/v1/rooms_participants.go @@ -24,16 +24,16 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) FetchRoomParticipant(RoomSid string, Sid string) (*VideoV1RoomParticipant, error) { path := "/v1/Rooms/{RoomSid}/Participants/{Sid}" path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -96,22 +96,23 @@ func (c *ApiService) PageRoomParticipant(RoomSid string, params *ListRoomPartici path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) + queryParams.Set("Identity", *params.Identity) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -121,7 +122,7 @@ func (c *ApiService) PageRoomParticipant(RoomSid string, params *ListRoomPartici data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (c *ApiService) getNextListRoomParticipantResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -233,20 +234,20 @@ func (params *UpdateRoomParticipantParams) SetStatus(Status string) *UpdateRoomP return params } -// func (c *ApiService) UpdateRoomParticipant(RoomSid string, Sid string, params *UpdateRoomParticipantParams) (*VideoV1RoomParticipant, error) { path := "/v1/Rooms/{RoomSid}/Participants/{Sid}" path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_participants_anonymize.go b/rest/video/v1/rooms_participants_anonymize.go index 509352a4d..a22811549 100644 --- a/rest/video/v1/rooms_participants_anonymize.go +++ b/rest/video/v1/rooms_participants_anonymize.go @@ -20,16 +20,16 @@ import ( "strings" ) -// func (c *ApiService) UpdateRoomParticipantAnonymize(RoomSid string, Sid string) (*VideoV1RoomParticipantAnonymize, error) { path := "/v1/Rooms/{RoomSid}/Participants/{Sid}/Anonymize" path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_participants_published_tracks.go b/rest/video/v1/rooms_participants_published_tracks.go index 940564dc0..cffde8bb8 100644 --- a/rest/video/v1/rooms_participants_published_tracks.go +++ b/rest/video/v1/rooms_participants_published_tracks.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchRoomParticipantPublishedTrack(RoomSid string, Particip path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageRoomParticipantPublishedTrack(RoomSid string, Participa path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageRoomParticipantPublishedTrack(RoomSid string, Participa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListRoomParticipantPublishedTrackResponse(nextPageUr if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_participants_subscribe_rules.go b/rest/video/v1/rooms_participants_subscribe_rules.go index 551ff66a2..d483dabef 100644 --- a/rest/video/v1/rooms_participants_subscribe_rules.go +++ b/rest/video/v1/rooms_participants_subscribe_rules.go @@ -27,9 +27,10 @@ func (c *ApiService) FetchRoomParticipantSubscribeRule(RoomSid string, Participa path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -62,6 +63,7 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Rules != nil { @@ -74,7 +76,7 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip data.Set("Rules", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_participants_subscribed_tracks.go b/rest/video/v1/rooms_participants_subscribed_tracks.go index fa5525002..64e214f7d 100644 --- a/rest/video/v1/rooms_participants_subscribed_tracks.go +++ b/rest/video/v1/rooms_participants_subscribed_tracks.go @@ -31,9 +31,10 @@ func (c *ApiService) FetchRoomParticipantSubscribedTrack(RoomSid string, Partici path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -73,10 +74,11 @@ func (c *ApiService) PageRoomParticipantSubscribedTrack(RoomSid string, Particip path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -86,7 +88,7 @@ func (c *ApiService) PageRoomParticipantSubscribedTrack(RoomSid string, Particip data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -173,7 +175,7 @@ func (c *ApiService) getNextListRoomParticipantSubscribedTrackResponse(nextPageU if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_recording_rules.go b/rest/video/v1/rooms_recording_rules.go index 2553d3a4b..5d31a24f5 100644 --- a/rest/video/v1/rooms_recording_rules.go +++ b/rest/video/v1/rooms_recording_rules.go @@ -26,9 +26,10 @@ func (c *ApiService) FetchRoomRecordingRule(RoomSid string) (*VideoV1RoomRecordi path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,6 +61,7 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Rules != nil { @@ -72,7 +74,7 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR data.Set("Rules", string(v)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/video/v1/rooms_recordings.go b/rest/video/v1/rooms_recordings.go index 37b72820c..ed9750d7e 100644 --- a/rest/video/v1/rooms_recordings.go +++ b/rest/video/v1/rooms_recordings.go @@ -24,16 +24,16 @@ import ( "github.com/twilio/twilio-go/client" ) -// func (c *ApiService) DeleteRoomRecording(RoomSid string, Sid string) error { path := "/v1/Rooms/{RoomSid}/Recordings/{Sid}" path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -43,16 +43,16 @@ func (c *ApiService) DeleteRoomRecording(RoomSid string, Sid string) error { return nil } -// func (c *ApiService) FetchRoomRecording(RoomSid string, Sid string) (*VideoV1RoomRecording, error) { path := "/v1/Rooms/{RoomSid}/Recordings/{Sid}" path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -115,22 +115,23 @@ func (c *ApiService) PageRoomRecording(RoomSid string, params *ListRoomRecording path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) + queryParams.Set("SourceSid", *params.SourceSid) } if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + queryParams.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + queryParams.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -140,7 +141,7 @@ func (c *ApiService) PageRoomRecording(RoomSid string, params *ListRoomRecording data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -227,7 +228,7 @@ func (c *ApiService) getNextListRoomRecordingResponse(nextPageUrl string) (inter if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/voice/v1/README.md b/rest/voice/v1/README.md index 45a420d95..7a4e21879 100644 --- a/rest/voice/v1/README.md +++ b/rest/voice/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/voice/v1/archives_calls.go b/rest/voice/v1/archives_calls.go index 2749cb824..e33ba20b6 100644 --- a/rest/voice/v1/archives_calls.go +++ b/rest/voice/v1/archives_calls.go @@ -27,9 +27,10 @@ func (c *ApiService) DeleteArchivedCall(Date string, Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } diff --git a/rest/voice/v1/byoc_trunks.go b/rest/voice/v1/byoc_trunks.go index 8bc50ff79..9bde4c932 100644 --- a/rest/voice/v1/byoc_trunks.go +++ b/rest/voice/v1/byoc_trunks.go @@ -88,11 +88,11 @@ func (params *CreateByocTrunkParams) SetFromDomainSid(FromDomainSid string) *Cre return params } -// func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1ByocTrunk, error) { path := "/v1/ByocTrunks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -126,7 +126,7 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo data.Set("FromDomainSid", *params.FromDomainSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,15 +141,15 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo return ps, err } -// func (c *ApiService) DeleteByocTrunk(Sid string) error { path := "/v1/ByocTrunks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -159,15 +159,15 @@ func (c *ApiService) DeleteByocTrunk(Sid string) error { return nil } -// func (c *ApiService) FetchByocTrunk(Sid string) (*VoiceV1ByocTrunk, error) { path := "/v1/ByocTrunks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -204,10 +204,11 @@ func (c *ApiService) PageByocTrunk(params *ListByocTrunkParams, pageToken, pageN path := "/v1/ByocTrunks" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -217,7 +218,7 @@ func (c *ApiService) PageByocTrunk(params *ListByocTrunkParams, pageToken, pageN data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -304,7 +305,7 @@ func (c *ApiService) getNextListByocTrunkResponse(nextPageUrl string) (interface if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -383,12 +384,12 @@ func (params *UpdateByocTrunkParams) SetFromDomainSid(FromDomainSid string) *Upd return params } -// func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) (*VoiceV1ByocTrunk, error) { path := "/v1/ByocTrunks/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -422,7 +423,7 @@ func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) data.Set("FromDomainSid", *params.FromDomainSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/voice/v1/connection_policies.go b/rest/voice/v1/connection_policies.go index 24eda12dd..812a755dc 100644 --- a/rest/voice/v1/connection_policies.go +++ b/rest/voice/v1/connection_policies.go @@ -34,18 +34,18 @@ func (params *CreateConnectionPolicyParams) SetFriendlyName(FriendlyName string) return params } -// func (c *ApiService) CreateConnectionPolicy(params *CreateConnectionPolicyParams) (*VoiceV1ConnectionPolicy, error) { path := "/v1/ConnectionPolicies" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -60,15 +60,15 @@ func (c *ApiService) CreateConnectionPolicy(params *CreateConnectionPolicyParams return ps, err } -// func (c *ApiService) DeleteConnectionPolicy(Sid string) error { path := "/v1/ConnectionPolicies/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -78,15 +78,15 @@ func (c *ApiService) DeleteConnectionPolicy(Sid string) error { return nil } -// func (c *ApiService) FetchConnectionPolicy(Sid string) (*VoiceV1ConnectionPolicy, error) { path := "/v1/ConnectionPolicies/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -123,10 +123,11 @@ func (c *ApiService) PageConnectionPolicy(params *ListConnectionPolicyParams, pa path := "/v1/ConnectionPolicies" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -136,7 +137,7 @@ func (c *ApiService) PageConnectionPolicy(params *ListConnectionPolicyParams, pa data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func (c *ApiService) getNextListConnectionPolicyResponse(nextPageUrl string) (in if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -248,19 +249,19 @@ func (params *UpdateConnectionPolicyParams) SetFriendlyName(FriendlyName string) return params } -// func (c *ApiService) UpdateConnectionPolicy(Sid string, params *UpdateConnectionPolicyParams) (*VoiceV1ConnectionPolicy, error) { path := "/v1/ConnectionPolicies/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/voice/v1/connection_policies_targets.go b/rest/voice/v1/connection_policies_targets.go index 015b0c972..34eec3a74 100644 --- a/rest/voice/v1/connection_policies_targets.go +++ b/rest/voice/v1/connection_policies_targets.go @@ -58,12 +58,12 @@ func (params *CreateConnectionPolicyTargetParams) SetEnabled(Enabled bool) *Crea return params } -// func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, params *CreateConnectionPolicyTargetParams) (*VoiceV1ConnectionPolicyTarget, error) { path := "/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets" path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Target != nil { @@ -82,7 +82,7 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa data.Set("Enabled", fmt.Sprint(*params.Enabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa return ps, err } -// func (c *ApiService) DeleteConnectionPolicyTarget(ConnectionPolicySid string, Sid string) error { path := "/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}" path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -116,16 +116,16 @@ func (c *ApiService) DeleteConnectionPolicyTarget(ConnectionPolicySid string, Si return nil } -// func (c *ApiService) FetchConnectionPolicyTarget(ConnectionPolicySid string, Sid string) (*VoiceV1ConnectionPolicyTarget, error) { path := "/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}" path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -164,10 +164,11 @@ func (c *ApiService) PageConnectionPolicyTarget(ConnectionPolicySid string, para path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -177,7 +178,7 @@ func (c *ApiService) PageConnectionPolicyTarget(ConnectionPolicySid string, para data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (c *ApiService) getNextListConnectionPolicyTargetResponse(nextPageUrl strin if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -313,13 +314,13 @@ func (params *UpdateConnectionPolicyTargetParams) SetEnabled(Enabled bool) *Upda return params } -// func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Sid string, params *UpdateConnectionPolicyTargetParams) (*VoiceV1ConnectionPolicyTarget, error) { path := "/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}" path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { @@ -338,7 +339,7 @@ func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Si data.Set("Enabled", fmt.Sprint(*params.Enabled)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/voice/v1/dialing_permissions_bulk_country_updates.go b/rest/voice/v1/dialing_permissions_bulk_country_updates.go index 7c8a3ddc8..bbecf1e19 100644 --- a/rest/voice/v1/dialing_permissions_bulk_country_updates.go +++ b/rest/voice/v1/dialing_permissions_bulk_country_updates.go @@ -35,13 +35,14 @@ func (c *ApiService) CreateDialingPermissionsCountryBulkUpdate(params *CreateDia path := "/v1/DialingPermissions/BulkCountryUpdates" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UpdateRequest != nil { data.Set("UpdateRequest", *params.UpdateRequest) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/voice/v1/dialing_permissions_countries.go b/rest/voice/v1/dialing_permissions_countries.go index be09fb584..79be603a6 100644 --- a/rest/voice/v1/dialing_permissions_countries.go +++ b/rest/voice/v1/dialing_permissions_countries.go @@ -29,9 +29,10 @@ func (c *ApiService) FetchDialingPermissionsCountry(IsoCode string) (*VoiceV1Dia path = strings.Replace(path, "{"+"IsoCode"+"}", IsoCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -104,28 +105,29 @@ func (c *ApiService) PageDialingPermissionsCountry(params *ListDialingPermission path := "/v1/DialingPermissions/Countries" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IsoCode != nil { - data.Set("IsoCode", *params.IsoCode) + queryParams.Set("IsoCode", *params.IsoCode) } if params != nil && params.Continent != nil { - data.Set("Continent", *params.Continent) + queryParams.Set("Continent", *params.Continent) } if params != nil && params.CountryCode != nil { - data.Set("CountryCode", *params.CountryCode) + queryParams.Set("CountryCode", *params.CountryCode) } if params != nil && params.LowRiskNumbersEnabled != nil { - data.Set("LowRiskNumbersEnabled", fmt.Sprint(*params.LowRiskNumbersEnabled)) + queryParams.Set("LowRiskNumbersEnabled", fmt.Sprint(*params.LowRiskNumbersEnabled)) } if params != nil && params.HighRiskSpecialNumbersEnabled != nil { - data.Set("HighRiskSpecialNumbersEnabled", fmt.Sprint(*params.HighRiskSpecialNumbersEnabled)) + queryParams.Set("HighRiskSpecialNumbersEnabled", fmt.Sprint(*params.HighRiskSpecialNumbersEnabled)) } if params != nil && params.HighRiskTollfraudNumbersEnabled != nil { - data.Set("HighRiskTollfraudNumbersEnabled", fmt.Sprint(*params.HighRiskTollfraudNumbersEnabled)) + queryParams.Set("HighRiskTollfraudNumbersEnabled", fmt.Sprint(*params.HighRiskTollfraudNumbersEnabled)) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -135,7 +137,7 @@ func (c *ApiService) PageDialingPermissionsCountry(params *ListDialingPermission data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -222,7 +224,7 @@ func (c *ApiService) getNextListDialingPermissionsCountryResponse(nextPageUrl st if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go b/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go index db256ce6d..2775e906b 100644 --- a/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go +++ b/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go @@ -47,10 +47,11 @@ func (c *ApiService) PageDialingPermissionsHrsPrefixes(IsoCode string, params *L path = strings.Replace(path, "{"+"IsoCode"+"}", IsoCode, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -60,7 +61,7 @@ func (c *ApiService) PageDialingPermissionsHrsPrefixes(IsoCode string, params *L data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,7 +148,7 @@ func (c *ApiService) getNextListDialingPermissionsHrsPrefixesResponse(nextPageUr if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/voice/v1/ip_records.go b/rest/voice/v1/ip_records.go index 93ed82dde..6ca7772ce 100644 --- a/rest/voice/v1/ip_records.go +++ b/rest/voice/v1/ip_records.go @@ -46,11 +46,11 @@ func (params *CreateIpRecordParams) SetCidrPrefixLength(CidrPrefixLength int) *C return params } -// func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRecord, error) { path := "/v1/IpRecords" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IpAddress != nil { @@ -63,7 +63,7 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -78,15 +78,15 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec return ps, err } -// func (c *ApiService) DeleteIpRecord(Sid string) error { path := "/v1/IpRecords/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -96,15 +96,15 @@ func (c *ApiService) DeleteIpRecord(Sid string) error { return nil } -// func (c *ApiService) FetchIpRecord(Sid string) (*VoiceV1IpRecord, error) { path := "/v1/IpRecords/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -141,10 +141,11 @@ func (c *ApiService) PageIpRecord(params *ListIpRecordParams, pageToken, pageNum path := "/v1/IpRecords" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -154,7 +155,7 @@ func (c *ApiService) PageIpRecord(params *ListIpRecordParams, pageToken, pageNum data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -241,7 +242,7 @@ func (c *ApiService) getNextListIpRecordResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -266,19 +267,19 @@ func (params *UpdateIpRecordParams) SetFriendlyName(FriendlyName string) *Update return params } -// func (c *ApiService) UpdateIpRecord(Sid string, params *UpdateIpRecordParams) (*VoiceV1IpRecord, error) { path := "/v1/IpRecords/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/voice/v1/settings.go b/rest/voice/v1/settings.go index 2906226fc..3e4c989fc 100644 --- a/rest/voice/v1/settings.go +++ b/rest/voice/v1/settings.go @@ -25,9 +25,10 @@ func (c *ApiService) FetchDialingPermissionsSettings() (*VoiceV1DialingPermissio path := "/v1/Settings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -58,13 +59,14 @@ func (c *ApiService) UpdateDialingPermissionsSettings(params *UpdateDialingPermi path := "/v1/Settings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.DialingPermissionsInheritance != nil { data.Set("DialingPermissionsInheritance", fmt.Sprint(*params.DialingPermissionsInheritance)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/voice/v1/source_ip_mappings.go b/rest/voice/v1/source_ip_mappings.go index 083da2e12..7e1995c25 100644 --- a/rest/voice/v1/source_ip_mappings.go +++ b/rest/voice/v1/source_ip_mappings.go @@ -40,11 +40,11 @@ func (params *CreateSourceIpMappingParams) SetSipDomainSid(SipDomainSid string) return params } -// func (c *ApiService) CreateSourceIpMapping(params *CreateSourceIpMappingParams) (*VoiceV1SourceIpMapping, error) { path := "/v1/SourceIpMappings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.IpRecordSid != nil { @@ -54,7 +54,7 @@ func (c *ApiService) CreateSourceIpMapping(params *CreateSourceIpMappingParams) data.Set("SipDomainSid", *params.SipDomainSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -69,15 +69,15 @@ func (c *ApiService) CreateSourceIpMapping(params *CreateSourceIpMappingParams) return ps, err } -// func (c *ApiService) DeleteSourceIpMapping(Sid string) error { path := "/v1/SourceIpMappings/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -87,15 +87,15 @@ func (c *ApiService) DeleteSourceIpMapping(Sid string) error { return nil } -// func (c *ApiService) FetchSourceIpMapping(Sid string) (*VoiceV1SourceIpMapping, error) { path := "/v1/SourceIpMappings/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -132,10 +132,11 @@ func (c *ApiService) PageSourceIpMapping(params *ListSourceIpMappingParams, page path := "/v1/SourceIpMappings" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -145,7 +146,7 @@ func (c *ApiService) PageSourceIpMapping(params *ListSourceIpMappingParams, page data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -232,7 +233,7 @@ func (c *ApiService) getNextListSourceIpMappingResponse(nextPageUrl string) (int if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -257,19 +258,19 @@ func (params *UpdateSourceIpMappingParams) SetSipDomainSid(SipDomainSid string) return params } -// func (c *ApiService) UpdateSourceIpMapping(Sid string, params *UpdateSourceIpMappingParams) (*VoiceV1SourceIpMapping, error) { path := "/v1/SourceIpMappings/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.SipDomainSid != nil { data.Set("SipDomainSid", *params.SipDomainSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/wireless/v1/README.md b/rest/wireless/v1/README.md index 8703f31cf..65ef1ecc7 100644 --- a/rest/wireless/v1/README.md +++ b/rest/wireless/v1/README.md @@ -5,7 +5,7 @@ This is the public Twilio REST API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.52.1 +- API version: 1.52.0 - Package version: 1.0.0 - Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit [https://support.twilio.com](https://support.twilio.com) diff --git a/rest/wireless/v1/commands.go b/rest/wireless/v1/commands.go index 92c40607f..9323717ef 100644 --- a/rest/wireless/v1/commands.go +++ b/rest/wireless/v1/commands.go @@ -75,6 +75,7 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm path := "/v1/Commands" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Command != nil { @@ -99,7 +100,7 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm data.Set("DeliveryReceiptRequested", fmt.Sprint(*params.DeliveryReceiptRequested)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -120,9 +121,10 @@ func (c *ApiService) DeleteCommand(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -138,9 +140,10 @@ func (c *ApiService) FetchCommand(Sid string) (*WirelessV1Command, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -201,22 +204,23 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken, pageNumbe path := "/v1/Commands" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) + queryParams.Set("Sim", *params.Sim) } if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) + queryParams.Set("Direction", *params.Direction) } if params != nil && params.Transport != nil { - data.Set("Transport", *params.Transport) + queryParams.Set("Transport", *params.Transport) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -226,7 +230,7 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken, pageNumbe data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -313,7 +317,7 @@ func (c *ApiService) getNextListCommandResponse(nextPageUrl string) (interface{} if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/wireless/v1/rate_plans.go b/rest/wireless/v1/rate_plans.go index a115db739..4c2e315e7 100644 --- a/rest/wireless/v1/rate_plans.go +++ b/rest/wireless/v1/rate_plans.go @@ -94,11 +94,11 @@ func (params *CreateRatePlanParams) SetInternationalRoamingDataLimit(Internation return params } -// func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1RatePlan, error) { path := "/v1/RatePlans" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -137,7 +137,7 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra data.Set("InternationalRoamingDataLimit", fmt.Sprint(*params.InternationalRoamingDataLimit)) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -152,15 +152,15 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra return ps, err } -// func (c *ApiService) DeleteRatePlan(Sid string) error { path := "/v1/RatePlans/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -170,15 +170,15 @@ func (c *ApiService) DeleteRatePlan(Sid string) error { return nil } -// func (c *ApiService) FetchRatePlan(Sid string) (*WirelessV1RatePlan, error) { path := "/v1/RatePlans/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -215,10 +215,11 @@ func (c *ApiService) PageRatePlan(params *ListRatePlanParams, pageToken, pageNum path := "/v1/RatePlans" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -228,7 +229,7 @@ func (c *ApiService) PageRatePlan(params *ListRatePlanParams, pageToken, pageNum data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -315,7 +316,7 @@ func (c *ApiService) getNextListRatePlanResponse(nextPageUrl string) (interface{ if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -346,12 +347,12 @@ func (params *UpdateRatePlanParams) SetFriendlyName(FriendlyName string) *Update return params } -// func (c *ApiService) UpdateRatePlan(Sid string, params *UpdateRatePlanParams) (*WirelessV1RatePlan, error) { path := "/v1/RatePlans/{Sid}" path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -361,7 +362,7 @@ func (c *ApiService) UpdateRatePlan(Sid string, params *UpdateRatePlanParams) (* data.Set("FriendlyName", *params.FriendlyName) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/wireless/v1/sims.go b/rest/wireless/v1/sims.go index 001f8128a..d199275ba 100644 --- a/rest/wireless/v1/sims.go +++ b/rest/wireless/v1/sims.go @@ -29,9 +29,10 @@ func (c *ApiService) DeleteSim(Sid string) error { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, queryParams) if err != nil { return err } @@ -47,9 +48,10 @@ func (c *ApiService) FetchSim(Sid string) (*WirelessV1Sim, error) { path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -116,25 +118,26 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string path := "/v1/Sims" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.Status != nil { - data.Set("Status", *params.Status) + queryParams.Set("Status", *params.Status) } if params != nil && params.Iccid != nil { - data.Set("Iccid", *params.Iccid) + queryParams.Set("Iccid", *params.Iccid) } if params != nil && params.RatePlan != nil { - data.Set("RatePlan", *params.RatePlan) + queryParams.Set("RatePlan", *params.RatePlan) } if params != nil && params.EId != nil { - data.Set("EId", *params.EId) + queryParams.Set("EId", *params.EId) } if params != nil && params.SimRegistrationCode != nil { - data.Set("SimRegistrationCode", *params.SimRegistrationCode) + queryParams.Set("SimRegistrationCode", *params.SimRegistrationCode) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -144,7 +147,7 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -231,7 +234,7 @@ func (c *ApiService) getNextListSimResponse(nextPageUrl string) (interface{}, er if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } @@ -364,6 +367,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.UniqueName != nil { @@ -421,7 +425,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 data.Set("AccountSid", *params.AccountSid) } - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } diff --git a/rest/wireless/v1/sims_data_sessions.go b/rest/wireless/v1/sims_data_sessions.go index e54aa72f1..fce19f19f 100644 --- a/rest/wireless/v1/sims_data_sessions.go +++ b/rest/wireless/v1/sims_data_sessions.go @@ -47,10 +47,11 @@ func (c *ApiService) PageDataSession(SimSid string, params *ListDataSessionParam path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -60,7 +61,7 @@ func (c *ApiService) PageDataSession(SimSid string, params *ListDataSessionParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -147,7 +148,7 @@ func (c *ApiService) getNextListDataSessionResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/wireless/v1/sims_usage_records.go b/rest/wireless/v1/sims_usage_records.go index db9896288..aa9e3d7e9 100644 --- a/rest/wireless/v1/sims_usage_records.go +++ b/rest/wireless/v1/sims_usage_records.go @@ -66,19 +66,20 @@ func (c *ApiService) PageUsageRecord(SimSid string, params *ListUsageRecordParam path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.End != nil { - data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) + queryParams.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) } if params != nil && params.Start != nil { - data.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) + queryParams.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) } if params != nil && params.Granularity != nil { - data.Set("Granularity", *params.Granularity) + queryParams.Set("Granularity", *params.Granularity) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -88,7 +89,7 @@ func (c *ApiService) PageUsageRecord(SimSid string, params *ListUsageRecordParam data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -175,7 +176,7 @@ func (c *ApiService) getNextListUsageRecordResponse(nextPageUrl string) (interfa if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err } diff --git a/rest/wireless/v1/usage_records.go b/rest/wireless/v1/usage_records.go index 4f22007f3..c8d8f8412 100644 --- a/rest/wireless/v1/usage_records.go +++ b/rest/wireless/v1/usage_records.go @@ -63,19 +63,20 @@ func (c *ApiService) PageAccountUsageRecord(params *ListAccountUsageRecordParams path := "/v1/UsageRecords" data := url.Values{} + queryParams := url.Values{} headers := make(map[string]interface{}) if params != nil && params.End != nil { - data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) + queryParams.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) } if params != nil && params.Start != nil { - data.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) + queryParams.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) } if params != nil && params.Granularity != nil { - data.Set("Granularity", *params.Granularity) + queryParams.Set("Granularity", *params.Granularity) } if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) + queryParams.Set("PageSize", fmt.Sprint(*params.PageSize)) } if pageToken != "" { @@ -85,7 +86,7 @@ func (c *ApiService) PageAccountUsageRecord(params *ListAccountUsageRecordParams data.Set("Page", pageNumber) } - resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers, queryParams) if err != nil { return nil, err } @@ -172,7 +173,7 @@ func (c *ApiService) getNextListAccountUsageRecordResponse(nextPageUrl string) ( if nextPageUrl == "" { return nil, nil } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) + resp, err := c.requestHandler.Get(nextPageUrl, nil, nil, nil) if err != nil { return nil, err }