diff --git a/rest/accounts/v1/credentials_aws.go b/rest/accounts/v1/credentials_aws.go index 95e02debd..6d89612e0 100644 --- a/rest/accounts/v1/credentials_aws.go +++ b/rest/accounts/v1/credentials_aws.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac path := "/v1/Credentials/AWS" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -139,11 +138,10 @@ func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToke path := "/v1/Credentials/AWS" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -267,11 +265,10 @@ func (c *ApiService) UpdateCredentialAws(Sid string, params *UpdateCredentialAws path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/accounts/v1/credentials_public_keys.go b/rest/accounts/v1/credentials_public_keys.go index b157b1fe0..ca4e98e77 100644 --- a/rest/accounts/v1/credentials_public_keys.go +++ b/rest/accounts/v1/credentials_public_keys.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey path := "/v1/Credentials/PublicKeys" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey if params != nil && params.PublicKey != nil { data.Set("PublicKey", *params.PublicKey) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -139,11 +138,10 @@ func (c *ApiService) PageCredentialPublicKey(params *ListCredentialPublicKeyPara path := "/v1/Credentials/PublicKeys" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -267,11 +265,10 @@ func (c *ApiService) UpdateCredentialPublicKey(Sid string, params *UpdateCredent path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts.go b/rest/api/v2010/accounts.go index 11fe2f83e..e0ef32c8f 100644 --- a/rest/api/v2010/accounts.go +++ b/rest/api/v2010/accounts.go @@ -37,11 +37,10 @@ func (c *ApiService) CreateAccount(params *CreateAccountParams) (*ApiV2010Accoun path := "/2010-04-01/Accounts.json" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -115,8 +114,6 @@ func (c *ApiService) PageAccount(params *ListAccountParams, pageToken string, pa path := "/2010-04-01/Accounts.json" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -126,6 +123,7 @@ func (c *ApiService) PageAccount(params *ListAccountParams, pageToken string, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -255,14 +253,13 @@ func (c *ApiService) UpdateAccount(Sid string, params *UpdateAccountParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_addresses.go b/rest/api/v2010/accounts_addresses.go index 570e4d8f4..f747e6337 100644 --- a/rest/api/v2010/accounts_addresses.go +++ b/rest/api/v2010/accounts_addresses.go @@ -95,8 +95,6 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Addres } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AutoCorrectAddress != nil { data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) } @@ -124,6 +122,7 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Addres if params != nil && params.Street != nil { data.Set("Street", *params.Street) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -263,8 +262,6 @@ func (c *ApiService) PageAddress(params *ListAddressParams, pageToken string, pa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CustomerName != nil { data.Set("CustomerName", *params.CustomerName) } @@ -277,6 +274,7 @@ func (c *ApiService) PageAddress(params *ListAddressParams, pageToken string, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -452,8 +450,6 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AutoCorrectAddress != nil { data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) } @@ -478,6 +474,7 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap if params != nil && params.Street != nil { data.Set("Street", *params.Street) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go index f8ead248a..c8a492fa4 100644 --- a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go +++ b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go @@ -56,11 +56,10 @@ func (c *ApiService) PageDependentPhoneNumber(AddressSid string, params *ListDep path = strings.Replace(path, "{"+"AddressSid"+"}", AddressSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_applications.go b/rest/api/v2010/accounts_applications.go index f49088f52..3d2a73dc1 100644 --- a/rest/api/v2010/accounts_applications.go +++ b/rest/api/v2010/accounts_applications.go @@ -132,8 +132,6 @@ func (c *ApiService) CreateApplication(params *CreateApplicationParams) (*ApiV20 } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiVersion != nil { data.Set("ApiVersion", *params.ApiVersion) } @@ -179,6 +177,7 @@ func (c *ApiService) CreateApplication(params *CreateApplicationParams) (*ApiV20 if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -308,14 +307,13 @@ func (c *ApiService) PageApplication(params *ListApplicationParams, pageToken st } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -534,8 +532,6 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiVersion != nil { data.Set("ApiVersion", *params.ApiVersion) } @@ -581,6 +577,7 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_authorized_connect_apps.go b/rest/api/v2010/accounts_authorized_connect_apps.go index 4d473d3d9..bbcc40043 100644 --- a/rest/api/v2010/accounts_authorized_connect_apps.go +++ b/rest/api/v2010/accounts_authorized_connect_apps.go @@ -94,11 +94,10 @@ func (c *ApiService) PageAuthorizedConnectApp(params *ListAuthorizedConnectAppPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers.go b/rest/api/v2010/accounts_available_phone_numbers.go index 7ec43e12b..c3b3e92bd 100644 --- a/rest/api/v2010/accounts_available_phone_numbers.go +++ b/rest/api/v2010/accounts_available_phone_numbers.go @@ -93,11 +93,10 @@ func (c *ApiService) PageAvailablePhoneNumberCountry(params *ListAvailablePhoneN } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_local.go b/rest/api/v2010/accounts_available_phone_numbers_local.go index f1d81d89e..2da277b5d 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_local.go +++ b/rest/api/v2010/accounts_available_phone_numbers_local.go @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberLocal(CountryCode string, params *L path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberLocal(CountryCode string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 04f6e1122..dab58bf87 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 @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberMachineToMachine(CountryCode string path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberMachineToMachine(CountryCode string if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_mobile.go b/rest/api/v2010/accounts_available_phone_numbers_mobile.go index 8a48f1202..93894ba43 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_available_phone_numbers_mobile.go @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberMobile(CountryCode string, params * path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberMobile(CountryCode string, params * if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_national.go b/rest/api/v2010/accounts_available_phone_numbers_national.go index 3cf1ab35d..b16f03d51 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_national.go +++ b/rest/api/v2010/accounts_available_phone_numbers_national.go @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberNational(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberNational(CountryCode string, params if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 534dbca64..148bfce5b 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go +++ b/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberSharedCost(CountryCode string, para path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberSharedCost(CountryCode string, para if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 d2ee4eafb..bba22f424 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_available_phone_numbers_toll_free.go @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberTollFree(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberTollFree(CountryCode string, params if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_voip.go b/rest/api/v2010/accounts_available_phone_numbers_voip.go index 41ad8939d..c786214ed 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_voip.go +++ b/rest/api/v2010/accounts_available_phone_numbers_voip.go @@ -164,8 +164,6 @@ func (c *ApiService) PageAvailablePhoneNumberVoip(CountryCode string, params *Li path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -223,6 +221,7 @@ func (c *ApiService) PageAvailablePhoneNumberVoip(CountryCode string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_calls.go b/rest/api/v2010/accounts_calls.go index 976ca0067..9cd40adec 100644 --- a/rest/api/v2010/accounts_calls.go +++ b/rest/api/v2010/accounts_calls.go @@ -253,8 +253,6 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010Call, error) } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApplicationSid != nil { data.Set("ApplicationSid", *params.ApplicationSid) } @@ -364,6 +362,7 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010Call, error) if params != nil && params.Url != nil { data.Set("Url", *params.Url) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -468,15 +467,15 @@ type ListCallParams struct { // Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. StartTime *time.Time `json:"StartTime,omitempty"` // Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - StartTimeBefore *time.Time `json:"StartTime<,omitempty"` + StartTimeBefore *time.Time `json:"StartTime<,omitempty"` // Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - StartTimeAfter *time.Time `json:"StartTime>,omitempty"` + StartTimeAfter *time.Time `json:"StartTime>,omitempty"` // Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. EndTime *time.Time `json:"EndTime,omitempty"` // Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - EndTimeBefore *time.Time `json:"EndTime<,omitempty"` + EndTimeBefore *time.Time `json:"EndTime<,omitempty"` // Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - EndTimeAfter *time.Time `json:"EndTime>,omitempty"` + EndTimeAfter *time.Time `json:"EndTime>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -547,8 +546,6 @@ func (c *ApiService) PageCall(params *ListCallParams, pageToken string, pageNumb } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.To != nil { data.Set("To", *params.To) } @@ -582,6 +579,7 @@ func (c *ApiService) PageCall(params *ListCallParams, pageToken string, pageNumb if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -764,8 +762,6 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FallbackMethod != nil { data.Set("FallbackMethod", *params.FallbackMethod) } @@ -793,6 +789,7 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 if params != nil && params.Url != nil { data.Set("Url", *params.Url) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_events.go b/rest/api/v2010/accounts_calls_events.go index d319edf61..42105a3ab 100644 --- a/rest/api/v2010/accounts_calls_events.go +++ b/rest/api/v2010/accounts_calls_events.go @@ -56,11 +56,10 @@ func (c *ApiService) PageCallEvent(CallSid string, params *ListCallEventParams, path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_calls_feedback.go b/rest/api/v2010/accounts_calls_feedback.go index 61b30a248..30bb07c24 100644 --- a/rest/api/v2010/accounts_calls_feedback.go +++ b/rest/api/v2010/accounts_calls_feedback.go @@ -92,8 +92,6 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Issue != nil { for _, item := range *params.Issue { data.Add("Issue", item) @@ -102,6 +100,7 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba if params != nil && params.QualityScore != nil { data.Set("QualityScore", fmt.Sprint(*params.QualityScore)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_feedback_summary.go b/rest/api/v2010/accounts_calls_feedback_summary.go index fbefd7db7..6b2a0194b 100644 --- a/rest/api/v2010/accounts_calls_feedback_summary.go +++ b/rest/api/v2010/accounts_calls_feedback_summary.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint(*params.EndDate)) } @@ -87,6 +85,7 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary if params != nil && params.StatusCallbackMethod != nil { data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_notifications.go b/rest/api/v2010/accounts_calls_notifications.go index 0834131c3..d070bc9ed 100644 --- a/rest/api/v2010/accounts_calls_notifications.go +++ b/rest/api/v2010/accounts_calls_notifications.go @@ -69,9 +69,9 @@ type ListCallNotificationParams struct { // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. MessageDate *string `json:"MessageDate,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateBefore *string `json:"MessageDate<,omitempty"` + MessageDateBefore *string `json:"MessageDate<,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateAfter *string `json:"MessageDate>,omitempty"` + MessageDateAfter *string `json:"MessageDate>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -119,8 +119,6 @@ func (c *ApiService) PageCallNotification(CallSid string, params *ListCallNotifi path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Log != nil { data.Set("Log", fmt.Sprint(*params.Log)) } @@ -136,6 +134,7 @@ func (c *ApiService) PageCallNotification(CallSid string, params *ListCallNotifi if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_calls_payments.go b/rest/api/v2010/accounts_calls_payments.go index 86be8a1b8..eb8a24df3 100644 --- a/rest/api/v2010/accounts_calls_payments.go +++ b/rest/api/v2010/accounts_calls_payments.go @@ -137,8 +137,6 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BankAccountType != nil { data.Set("BankAccountType", *params.BankAccountType) } @@ -193,6 +191,7 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams if params != nil && params.ValidCardTypes != nil { data.Set("ValidCardTypes", *params.ValidCardTypes) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -256,8 +255,6 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Capture != nil { data.Set("Capture", *params.Capture) } @@ -270,6 +267,7 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_recordings.go b/rest/api/v2010/accounts_calls_recordings.go index 95e85be06..19e28946a 100644 --- a/rest/api/v2010/accounts_calls_recordings.go +++ b/rest/api/v2010/accounts_calls_recordings.go @@ -79,8 +79,6 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.RecordingChannels != nil { data.Set("RecordingChannels", *params.RecordingChannels) } @@ -101,6 +99,7 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor if params != nil && params.Trim != nil { data.Set("Trim", *params.Trim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -199,9 +198,9 @@ type ListCallRecordingParams struct { // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. DateCreated *string `json:"DateCreated,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedBefore *string `json:"DateCreated<,omitempty"` + DateCreatedBefore *string `json:"DateCreated<,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedAfter *string `json:"DateCreated>,omitempty"` + DateCreatedAfter *string `json:"DateCreated>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -245,8 +244,6 @@ func (c *ApiService) PageCallRecording(CallSid string, params *ListCallRecording path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } @@ -259,6 +256,7 @@ func (c *ApiService) PageCallRecording(CallSid string, params *ListCallRecording if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -400,14 +398,13 @@ func (c *ApiService) UpdateCallRecording(CallSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PauseBehavior != nil { data.Set("PauseBehavior", *params.PauseBehavior) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_conferences.go b/rest/api/v2010/accounts_conferences.go index 038bc99d5..890f739f8 100644 --- a/rest/api/v2010/accounts_conferences.go +++ b/rest/api/v2010/accounts_conferences.go @@ -67,15 +67,15 @@ type ListConferenceParams struct { // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. DateCreated *string `json:"DateCreated,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - DateCreatedBefore *string `json:"DateCreated<,omitempty"` + DateCreatedBefore *string `json:"DateCreated<,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - DateCreatedAfter *string `json:"DateCreated>,omitempty"` + DateCreatedAfter *string `json:"DateCreated>,omitempty"` // The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. DateUpdated *string `json:"DateUpdated,omitempty"` // The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - DateUpdatedBefore *string `json:"DateUpdated<,omitempty"` + DateUpdatedBefore *string `json:"DateUpdated<,omitempty"` // The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - DateUpdatedAfter *string `json:"DateUpdated>,omitempty"` + DateUpdatedAfter *string `json:"DateUpdated>,omitempty"` // The string that identifies the Conference resources to read. FriendlyName *string `json:"FriendlyName,omitempty"` // The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. @@ -142,8 +142,6 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken stri } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } @@ -171,6 +169,7 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken stri if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -316,8 +315,6 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AnnounceMethod != nil { data.Set("AnnounceMethod", *params.AnnounceMethod) } @@ -327,6 +324,7 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_conferences_participants.go b/rest/api/v2010/accounts_conferences_participants.go index 019c6f63b..e1694da27 100644 --- a/rest/api/v2010/accounts_conferences_participants.go +++ b/rest/api/v2010/accounts_conferences_participants.go @@ -276,8 +276,6 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beep != nil { data.Set("Beep", *params.Beep) } @@ -403,6 +401,7 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti if params != nil && params.WaitUrl != nil { data.Set("WaitUrl", *params.WaitUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -547,8 +546,6 @@ func (c *ApiService) PageParticipant(ConferenceSid string, params *ListParticipa path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Muted != nil { data.Set("Muted", fmt.Sprint(*params.Muted)) } @@ -561,6 +558,7 @@ func (c *ApiService) PageParticipant(ConferenceSid string, params *ListParticipa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -762,8 +760,6 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AnnounceMethod != nil { data.Set("AnnounceMethod", *params.AnnounceMethod) } @@ -800,6 +796,7 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par if params != nil && params.WaitUrl != nil { data.Set("WaitUrl", *params.WaitUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_conferences_recordings.go b/rest/api/v2010/accounts_conferences_recordings.go index 619050973..d9b32dc05 100644 --- a/rest/api/v2010/accounts_conferences_recordings.go +++ b/rest/api/v2010/accounts_conferences_recordings.go @@ -103,9 +103,9 @@ type ListConferenceRecordingParams struct { // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. DateCreated *string `json:"DateCreated,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedBefore *string `json:"DateCreated<,omitempty"` + DateCreatedBefore *string `json:"DateCreated<,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedAfter *string `json:"DateCreated>,omitempty"` + DateCreatedAfter *string `json:"DateCreated>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -149,8 +149,6 @@ func (c *ApiService) PageConferenceRecording(ConferenceSid string, params *ListC path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } @@ -163,6 +161,7 @@ func (c *ApiService) PageConferenceRecording(ConferenceSid string, params *ListC if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -304,14 +303,13 @@ func (c *ApiService) UpdateConferenceRecording(ConferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PauseBehavior != nil { data.Set("PauseBehavior", *params.PauseBehavior) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_connect_apps.go b/rest/api/v2010/accounts_connect_apps.go index 2a2c7d021..a7d8ebd53 100644 --- a/rest/api/v2010/accounts_connect_apps.go +++ b/rest/api/v2010/accounts_connect_apps.go @@ -128,11 +128,10 @@ func (c *ApiService) PageConnectApp(params *ListConnectAppParams, pageToken stri } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -309,8 +308,6 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthorizeRedirectUrl != nil { data.Set("AuthorizeRedirectUrl", *params.AuthorizeRedirectUrl) } @@ -337,6 +334,7 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams data.Add("Permissions", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers.go b/rest/api/v2010/accounts_incoming_phone_numbers.go index 4b179a86a..74c3103dd 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers.go @@ -186,8 +186,6 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -260,6 +258,7 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -407,8 +406,6 @@ func (c *ApiService) PageIncomingPhoneNumber(params *ListIncomingPhoneNumberPara } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -424,6 +421,7 @@ func (c *ApiService) PageIncomingPhoneNumber(params *ListIncomingPhoneNumberPara if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -690,8 +688,6 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -761,6 +757,7 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { 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 0befe3f6d..5bf90e119 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 @@ -49,11 +49,10 @@ func (c *ApiService) CreateIncomingPhoneNumberAssignedAddOn(ResourceSid string, path = strings.Replace(path, "{"+"ResourceSid"+"}", ResourceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.InstalledAddOnSid != nil { data.Set("InstalledAddOnSid", *params.InstalledAddOnSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOn(ResourceSid string, pa path = strings.Replace(path, "{"+"ResourceSid"+"}", ResourceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 cfcc69922..8c6d7330c 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 @@ -98,11 +98,10 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOnExtension(ResourceSid s path = strings.Replace(path, "{"+"AssignedAddOnSid"+"}", AssignedAddOnSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_local.go b/rest/api/v2010/accounts_incoming_phone_numbers_local.go index cdc6d1687..fdb8a1556 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_local.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_local.go @@ -178,8 +178,6 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -249,6 +247,7 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -323,8 +322,6 @@ func (c *ApiService) PageIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -340,6 +337,7 @@ func (c *ApiService) PageIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go index 849e58021..9799ce268 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go @@ -178,8 +178,6 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -249,6 +247,7 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -323,8 +322,6 @@ func (c *ApiService) PageIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -340,6 +337,7 @@ func (c *ApiService) PageIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 f8bcd35f9..a529563d7 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go @@ -178,8 +178,6 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -249,6 +247,7 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -323,8 +322,6 @@ func (c *ApiService) PageIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -340,6 +337,7 @@ func (c *ApiService) PageIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_keys.go b/rest/api/v2010/accounts_keys.go index c3ffaa31f..c06a8246e 100644 --- a/rest/api/v2010/accounts_keys.go +++ b/rest/api/v2010/accounts_keys.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateNewKey(params *CreateNewKeyParams) (*ApiV2010NewKey, } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -173,11 +172,10 @@ func (c *ApiService) PageKey(params *ListKeyParams, pageToken string, pageNumber } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -311,11 +309,10 @@ func (c *ApiService) UpdateKey(Sid string, params *UpdateKeyParams) (*ApiV2010Ke path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_messages.go b/rest/api/v2010/accounts_messages.go index 0054dd9aa..ba5e22ea4 100644 --- a/rest/api/v2010/accounts_messages.go +++ b/rest/api/v2010/accounts_messages.go @@ -139,8 +139,6 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Messag } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressRetention != nil { data.Set("AddressRetention", *params.AddressRetention) } @@ -193,6 +191,7 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Messag if params != nil && params.ValidityPeriod != nil { data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -293,9 +292,9 @@ type ListMessageParams struct { // The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. DateSent *time.Time `json:"DateSent,omitempty"` // The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. - DateSentBefore *time.Time `json:"DateSent<,omitempty"` + DateSentBefore *time.Time `json:"DateSent<,omitempty"` // The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. - DateSentAfter *time.Time `json:"DateSent>,omitempty"` + DateSentAfter *time.Time `json:"DateSent>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -346,8 +345,6 @@ func (c *ApiService) PageMessage(params *ListMessageParams, pageToken string, pa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.To != nil { data.Set("To", *params.To) } @@ -366,6 +363,7 @@ func (c *ApiService) PageMessage(params *ListMessageParams, pageToken string, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -500,11 +498,10 @@ func (c *ApiService) UpdateMessage(Sid string, params *UpdateMessageParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Body != nil { data.Set("Body", *params.Body) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_messages_feedback.go b/rest/api/v2010/accounts_messages_feedback.go index be8b547c4..8eaf215b6 100644 --- a/rest/api/v2010/accounts_messages_feedback.go +++ b/rest/api/v2010/accounts_messages_feedback.go @@ -45,11 +45,10 @@ func (c *ApiService) CreateMessageFeedback(MessageSid string, params *CreateMess path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Outcome != nil { data.Set("Outcome", *params.Outcome) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_messages_media.go b/rest/api/v2010/accounts_messages_media.go index c3a4f845f..33db9c84d 100644 --- a/rest/api/v2010/accounts_messages_media.go +++ b/rest/api/v2010/accounts_messages_media.go @@ -104,9 +104,9 @@ type ListMediaParams struct { // Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. DateCreated *time.Time `json:"DateCreated,omitempty"` // Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. - DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` + DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` // Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. - DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` + DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -150,8 +150,6 @@ func (c *ApiService) PageMedia(MessageSid string, params *ListMediaParams, pageT path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) } @@ -164,6 +162,7 @@ func (c *ApiService) PageMedia(MessageSid string, params *ListMediaParams, pageT if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_notifications.go b/rest/api/v2010/accounts_notifications.go index 9cd9160a2..2382936bd 100644 --- a/rest/api/v2010/accounts_notifications.go +++ b/rest/api/v2010/accounts_notifications.go @@ -69,9 +69,9 @@ type ListNotificationParams struct { // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. MessageDate *string `json:"MessageDate,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateBefore *string `json:"MessageDate<,omitempty"` + MessageDateBefore *string `json:"MessageDate<,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateAfter *string `json:"MessageDate>,omitempty"` + MessageDateAfter *string `json:"MessageDate>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` // Max number of records to return. @@ -118,8 +118,6 @@ func (c *ApiService) PageNotification(params *ListNotificationParams, pageToken } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Log != nil { data.Set("Log", fmt.Sprint(*params.Log)) } @@ -135,6 +133,7 @@ func (c *ApiService) PageNotification(params *ListNotificationParams, pageToken if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_outgoing_caller_ids.go b/rest/api/v2010/accounts_outgoing_caller_ids.go index 3db9587a9..3e9657331 100644 --- a/rest/api/v2010/accounts_outgoing_caller_ids.go +++ b/rest/api/v2010/accounts_outgoing_caller_ids.go @@ -77,8 +77,6 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallDelay != nil { data.Set("CallDelay", fmt.Sprint(*params.CallDelay)) } @@ -97,6 +95,7 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara if params != nil && params.StatusCallbackMethod != nil { data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -232,8 +231,6 @@ func (c *ApiService) PageOutgoingCallerId(params *ListOutgoingCallerIdParams, pa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PhoneNumber != nil { data.Set("PhoneNumber", *params.PhoneNumber) } @@ -243,6 +240,7 @@ func (c *ApiService) PageOutgoingCallerId(params *ListOutgoingCallerIdParams, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -377,11 +375,10 @@ func (c *ApiService) UpdateOutgoingCallerId(Sid string, params *UpdateOutgoingCa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_queues.go b/rest/api/v2010/accounts_queues.go index eda368d68..76d7733c4 100644 --- a/rest/api/v2010/accounts_queues.go +++ b/rest/api/v2010/accounts_queues.go @@ -54,14 +54,13 @@ func (c *ApiService) CreateQueue(params *CreateQueueParams) (*ApiV2010Queue, err } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.MaxSize != nil { data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -185,11 +184,10 @@ func (c *ApiService) PageQueue(params *ListQueueParams, pageToken string, pageNu } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -330,14 +328,13 @@ func (c *ApiService) UpdateQueue(Sid string, params *UpdateQueueParams) (*ApiV20 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.MaxSize != nil { data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_queues_members.go b/rest/api/v2010/accounts_queues_members.go index b6f3608d7..cab8d1bf5 100644 --- a/rest/api/v2010/accounts_queues_members.go +++ b/rest/api/v2010/accounts_queues_members.go @@ -96,11 +96,10 @@ func (c *ApiService) PageMember(QueueSid string, params *ListMemberParams, pageT path = strings.Replace(path, "{"+"QueueSid"+"}", QueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -242,14 +241,13 @@ func (c *ApiService) UpdateMember(QueueSid string, CallSid string, params *Updat path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Method != nil { data.Set("Method", *params.Method) } if params != nil && params.Url != nil { data.Set("Url", *params.Url) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_recordings.go b/rest/api/v2010/accounts_recordings.go index 1660b63d6..41269d172 100644 --- a/rest/api/v2010/accounts_recordings.go +++ b/rest/api/v2010/accounts_recordings.go @@ -102,9 +102,9 @@ type ListRecordingParams struct { // Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. DateCreated *time.Time `json:"DateCreated,omitempty"` // Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. - DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` + DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` // Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. - DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` + DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` // The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. CallSid *string `json:"CallSid,omitempty"` // The Conference SID that identifies the conference associated with the recording to read. @@ -159,8 +159,6 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken string } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) } @@ -179,6 +177,7 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken string if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_recordings_add_on_results.go b/rest/api/v2010/accounts_recordings_add_on_results.go index 56278a3e2..fc3983131 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results.go +++ b/rest/api/v2010/accounts_recordings_add_on_results.go @@ -131,11 +131,10 @@ func (c *ApiService) PageRecordingAddOnResult(ReferenceSid string, params *ListR path = strings.Replace(path, "{"+"ReferenceSid"+"}", ReferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 31f65b68d..aeb65a27e 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results_payloads.go +++ b/rest/api/v2010/accounts_recordings_add_on_results_payloads.go @@ -134,11 +134,10 @@ func (c *ApiService) PageRecordingAddOnResultPayload(ReferenceSid string, AddOnR path = strings.Replace(path, "{"+"AddOnResultSid"+"}", AddOnResultSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_recordings_transcriptions.go b/rest/api/v2010/accounts_recordings_transcriptions.go index 8a085b5d2..f835eb1df 100644 --- a/rest/api/v2010/accounts_recordings_transcriptions.go +++ b/rest/api/v2010/accounts_recordings_transcriptions.go @@ -129,11 +129,10 @@ func (c *ApiService) PageRecordingTranscription(RecordingSid string, params *Lis path = strings.Replace(path, "{"+"RecordingSid"+"}", RecordingSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_signing_keys.go b/rest/api/v2010/accounts_signing_keys.go index 6c93d0d0d..dbfa1b584 100644 --- a/rest/api/v2010/accounts_signing_keys.go +++ b/rest/api/v2010/accounts_signing_keys.go @@ -48,11 +48,10 @@ func (c *ApiService) CreateNewSigningKey(params *CreateNewSigningKeyParams) (*Ap } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -174,11 +173,10 @@ func (c *ApiService) PageSigningKey(params *ListSigningKeyParams, pageToken stri } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -312,11 +310,10 @@ func (c *ApiService) UpdateSigningKey(Sid string, params *UpdateSigningKeyParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_credential_lists.go b/rest/api/v2010/accounts_sip_credential_lists.go index 7604e3394..5e2f7092e 100644 --- a/rest/api/v2010/accounts_sip_credential_lists.go +++ b/rest/api/v2010/accounts_sip_credential_lists.go @@ -48,11 +48,10 @@ func (c *ApiService) CreateSipCredentialList(params *CreateSipCredentialListPara } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -176,11 +175,10 @@ func (c *ApiService) PageSipCredentialList(params *ListSipCredentialListParams, } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -315,11 +313,10 @@ func (c *ApiService) UpdateSipCredentialList(Sid string, params *UpdateSipCreden path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_credential_lists_credentials.go b/rest/api/v2010/accounts_sip_credential_lists_credentials.go index dad0fee4e..c508227c4 100644 --- a/rest/api/v2010/accounts_sip_credential_lists_credentials.go +++ b/rest/api/v2010/accounts_sip_credential_lists_credentials.go @@ -55,14 +55,13 @@ func (c *ApiService) CreateSipCredential(CredentialListSid string, params *Creat path = strings.Replace(path, "{"+"CredentialListSid"+"}", CredentialListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Password != nil { data.Set("Password", *params.Password) } if params != nil && params.Username != nil { data.Set("Username", *params.Username) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -189,11 +188,10 @@ func (c *ApiService) PageSipCredential(CredentialListSid string, params *ListSip path = strings.Replace(path, "{"+"CredentialListSid"+"}", CredentialListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,11 +327,10 @@ func (c *ApiService) UpdateSipCredential(CredentialListSid string, Sid string, p path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Password != nil { data.Set("Password", *params.Password) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains.go b/rest/api/v2010/accounts_sip_domains.go index 210806655..0b70e2b7d 100644 --- a/rest/api/v2010/accounts_sip_domains.go +++ b/rest/api/v2010/accounts_sip_domains.go @@ -120,8 +120,6 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Si } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ByocTrunkSid != nil { data.Set("ByocTrunkSid", *params.ByocTrunkSid) } @@ -161,6 +159,7 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Si if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -284,11 +283,10 @@ func (c *ApiService) PageSipDomain(params *ListSipDomainParams, pageToken string } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -495,8 +493,6 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ByocTrunkSid != nil { data.Set("ByocTrunkSid", *params.ByocTrunkSid) } @@ -536,6 +532,7 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { 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 0126fb66a..638a4b83d 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 @@ -49,11 +49,10 @@ func (c *ApiService) CreateSipAuthCallsCredentialListMapping(DomainSid string, p path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) PageSipAuthCallsCredentialListMapping(DomainSid string, par path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 a0ac5b341..660221713 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 @@ -49,11 +49,10 @@ func (c *ApiService) CreateSipAuthCallsIpAccessControlListMapping(DomainSid stri path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) PageSipAuthCallsIpAccessControlListMapping(DomainSid string path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 a91787772..18c5b4ae2 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 @@ -49,11 +49,10 @@ func (c *ApiService) CreateSipAuthRegistrationsCredentialListMapping(DomainSid s path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) PageSipAuthRegistrationsCredentialListMapping(DomainSid str path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 d21a255be..1a153edd6 100644 --- a/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go @@ -49,11 +49,10 @@ func (c *ApiService) CreateSipCredentialListMapping(DomainSid string, params *Cr path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) PageSipCredentialListMapping(DomainSid string, params *List path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 190bfe358..0d5bf8daa 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 @@ -49,11 +49,10 @@ func (c *ApiService) CreateSipIpAccessControlListMapping(DomainSid string, param path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) PageSipIpAccessControlListMapping(DomainSid string, params path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_sipip_access_control_lists.go b/rest/api/v2010/accounts_sipip_access_control_lists.go index e7ba8a0d8..5e4fdf469 100644 --- a/rest/api/v2010/accounts_sipip_access_control_lists.go +++ b/rest/api/v2010/accounts_sipip_access_control_lists.go @@ -48,11 +48,10 @@ func (c *ApiService) CreateSipIpAccessControlList(params *CreateSipIpAccessContr } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -176,11 +175,10 @@ func (c *ApiService) PageSipIpAccessControlList(params *ListSipIpAccessControlLi } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -315,11 +313,10 @@ func (c *ApiService) UpdateSipIpAccessControlList(Sid string, params *UpdateSipI path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { 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 6de975d06..7d9190898 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 @@ -61,8 +61,6 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C path = strings.Replace(path, "{"+"IpAccessControlListSid"+"}", IpAccessControlListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CidrPrefixLength != nil { data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } @@ -72,6 +70,7 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C if params != nil && params.IpAddress != nil { data.Set("IpAddress", *params.IpAddress) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -198,11 +197,10 @@ func (c *ApiService) PageSipIpAddress(IpAccessControlListSid string, params *Lis path = strings.Replace(path, "{"+"IpAccessControlListSid"+"}", IpAccessControlListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -350,8 +348,6 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CidrPrefixLength != nil { data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } @@ -361,6 +357,7 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin if params != nil && params.IpAddress != nil { data.Set("IpAddress", *params.IpAddress) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sms_short_codes.go b/rest/api/v2010/accounts_sms_short_codes.go index 4cc91d73c..bc00d6e3d 100644 --- a/rest/api/v2010/accounts_sms_short_codes.go +++ b/rest/api/v2010/accounts_sms_short_codes.go @@ -106,8 +106,6 @@ func (c *ApiService) PageShortCode(params *ListShortCodeParams, pageToken string } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -117,6 +115,7 @@ func (c *ApiService) PageShortCode(params *ListShortCodeParams, pageToken string if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -281,8 +280,6 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiVersion != nil { data.Set("ApiVersion", *params.ApiVersion) } @@ -301,6 +298,7 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) if params != nil && params.SmsUrl != nil { data.Set("SmsUrl", *params.SmsUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_tokens.go b/rest/api/v2010/accounts_tokens.go index 9d36b114d..4f2e27402 100644 --- a/rest/api/v2010/accounts_tokens.go +++ b/rest/api/v2010/accounts_tokens.go @@ -45,11 +45,10 @@ func (c *ApiService) CreateToken(params *CreateTokenParams) (*ApiV2010Token, err } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_transcriptions.go b/rest/api/v2010/accounts_transcriptions.go index 3ed32584b..beb37f68a 100644 --- a/rest/api/v2010/accounts_transcriptions.go +++ b/rest/api/v2010/accounts_transcriptions.go @@ -128,11 +128,10 @@ func (c *ApiService) PageTranscription(params *ListTranscriptionParams, pageToke } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records.go b/rest/api/v2010/accounts_usage_records.go index 75e6cfa38..0946da31c 100644 --- a/rest/api/v2010/accounts_usage_records.go +++ b/rest/api/v2010/accounts_usage_records.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken st } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken st if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_all_time.go b/rest/api/v2010/accounts_usage_records_all_time.go index 3bc28c6d7..9b70ef4e7 100644 --- a/rest/api/v2010/accounts_usage_records_all_time.go +++ b/rest/api/v2010/accounts_usage_records_all_time.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordAllTime(params *ListUsageRecordAllTimeParams } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordAllTime(params *ListUsageRecordAllTimeParams if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_daily.go b/rest/api/v2010/accounts_usage_records_daily.go index 9c494c053..31e9c4a1f 100644 --- a/rest/api/v2010/accounts_usage_records_daily.go +++ b/rest/api/v2010/accounts_usage_records_daily.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordDaily(params *ListUsageRecordDailyParams, pa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordDaily(params *ListUsageRecordDailyParams, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_last_month.go b/rest/api/v2010/accounts_usage_records_last_month.go index 8bc7346d2..4c11005de 100644 --- a/rest/api/v2010/accounts_usage_records_last_month.go +++ b/rest/api/v2010/accounts_usage_records_last_month.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordLastMonth(params *ListUsageRecordLastMonthPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordLastMonth(params *ListUsageRecordLastMonthPa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_monthly.go b/rest/api/v2010/accounts_usage_records_monthly.go index 6ea789876..56a617ccc 100644 --- a/rest/api/v2010/accounts_usage_records_monthly.go +++ b/rest/api/v2010/accounts_usage_records_monthly.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordMonthly(params *ListUsageRecordMonthlyParams } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordMonthly(params *ListUsageRecordMonthlyParams if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_this_month.go b/rest/api/v2010/accounts_usage_records_this_month.go index 71ddd0dbd..b978f91e8 100644 --- a/rest/api/v2010/accounts_usage_records_this_month.go +++ b/rest/api/v2010/accounts_usage_records_this_month.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordThisMonth(params *ListUsageRecordThisMonthPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordThisMonth(params *ListUsageRecordThisMonthPa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_today.go b/rest/api/v2010/accounts_usage_records_today.go index ca9d38bde..cd3f0adf0 100644 --- a/rest/api/v2010/accounts_usage_records_today.go +++ b/rest/api/v2010/accounts_usage_records_today.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordToday(params *ListUsageRecordTodayParams, pa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordToday(params *ListUsageRecordTodayParams, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_yearly.go b/rest/api/v2010/accounts_usage_records_yearly.go index e68571001..9e204cfb5 100644 --- a/rest/api/v2010/accounts_usage_records_yearly.go +++ b/rest/api/v2010/accounts_usage_records_yearly.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordYearly(params *ListUsageRecordYearlyParams, } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordYearly(params *ListUsageRecordYearlyParams, if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_yesterday.go b/rest/api/v2010/accounts_usage_records_yesterday.go index 651a41b72..63dc2f36d 100644 --- a/rest/api/v2010/accounts_usage_records_yesterday.go +++ b/rest/api/v2010/accounts_usage_records_yesterday.go @@ -78,8 +78,6 @@ func (c *ApiService) PageUsageRecordYesterday(params *ListUsageRecordYesterdayPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -95,6 +93,7 @@ func (c *ApiService) PageUsageRecordYesterday(params *ListUsageRecordYesterdayPa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_triggers.go b/rest/api/v2010/accounts_usage_triggers.go index 2b2c95a78..46138b247 100644 --- a/rest/api/v2010/accounts_usage_triggers.go +++ b/rest/api/v2010/accounts_usage_triggers.go @@ -84,8 +84,6 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -107,6 +105,7 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV if params != nil && params.UsageCategory != nil { data.Set("UsageCategory", *params.UsageCategory) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -247,8 +246,6 @@ func (c *ApiService) PageUsageTrigger(params *ListUsageTriggerParams, pageToken } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Recurring != nil { data.Set("Recurring", *params.Recurring) } @@ -261,6 +258,7 @@ func (c *ApiService) PageUsageTrigger(params *ListUsageTriggerParams, pageToken if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -407,8 +405,6 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -418,6 +414,7 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants.go b/rest/autopilot/v1/assistants.go index 8b73de9cb..d7cc6bb99 100644 --- a/rest/autopilot/v1/assistants.go +++ b/rest/autopilot/v1/assistants.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateAssistant(params *CreateAssistantParams) (*AutopilotV path := "/v1/Assistants" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackEvents != nil { data.Set("CallbackEvents", *params.CallbackEvents) } @@ -107,6 +105,7 @@ func (c *ApiService) CreateAssistant(params *CreateAssistantParams) (*AutopilotV if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -184,11 +183,10 @@ func (c *ApiService) PageAssistant(params *ListAssistantParams, pageToken string path := "/v1/Assistants" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -353,8 +351,6 @@ func (c *ApiService) UpdateAssistant(Sid string, params *UpdateAssistantParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackEvents != nil { data.Set("CallbackEvents", *params.CallbackEvents) } @@ -391,6 +387,7 @@ func (c *ApiService) UpdateAssistant(Sid string, params *UpdateAssistantParams) if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_defaults.go b/rest/autopilot/v1/assistants_defaults.go index 549a141ed..bb2e6176d 100644 --- a/rest/autopilot/v1/assistants_defaults.go +++ b/rest/autopilot/v1/assistants_defaults.go @@ -56,8 +56,6 @@ func (c *ApiService) UpdateDefaults(AssistantSid string, params *UpdateDefaultsP path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Defaults != nil { v, err := json.Marshal(params.Defaults) @@ -67,6 +65,7 @@ func (c *ApiService) UpdateDefaults(AssistantSid string, params *UpdateDefaultsP data.Set("Defaults", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_field_types.go b/rest/autopilot/v1/assistants_field_types.go index be9740467..75853e6d8 100644 --- a/rest/autopilot/v1/assistants_field_types.go +++ b/rest/autopilot/v1/assistants_field_types.go @@ -43,14 +43,13 @@ func (c *ApiService) CreateFieldType(AssistantSid string, params *CreateFieldTyp path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,11 +131,10 @@ func (c *ApiService) PageFieldType(AssistantSid string, params *ListFieldTypePar path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -266,14 +264,13 @@ func (c *ApiService) UpdateFieldType(AssistantSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_field_types_field_values.go b/rest/autopilot/v1/assistants_field_types_field_values.go index a8dfe7178..30b80fa2c 100644 --- a/rest/autopilot/v1/assistants_field_types_field_values.go +++ b/rest/autopilot/v1/assistants_field_types_field_values.go @@ -50,8 +50,6 @@ func (c *ApiService) CreateFieldValue(AssistantSid string, FieldTypeSid string, path = strings.Replace(path, "{"+"FieldTypeSid"+"}", FieldTypeSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -61,6 +59,7 @@ func (c *ApiService) CreateFieldValue(AssistantSid string, FieldTypeSid string, if params != nil && params.Value != nil { data.Set("Value", *params.Value) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -151,14 +150,13 @@ func (c *ApiService) PageFieldValue(AssistantSid string, FieldTypeSid string, pa path = strings.Replace(path, "{"+"FieldTypeSid"+"}", FieldTypeSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/autopilot/v1/assistants_model_builds.go b/rest/autopilot/v1/assistants_model_builds.go index 668a547dd..f1d5c33b3 100644 --- a/rest/autopilot/v1/assistants_model_builds.go +++ b/rest/autopilot/v1/assistants_model_builds.go @@ -43,14 +43,13 @@ func (c *ApiService) CreateModelBuild(AssistantSid string, params *CreateModelBu path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,11 +131,10 @@ func (c *ApiService) PageModelBuild(AssistantSid string, params *ListModelBuildP path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -260,11 +258,10 @@ func (c *ApiService) UpdateModelBuild(AssistantSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_queries.go b/rest/autopilot/v1/assistants_queries.go index 95027d1f1..4e2c08cfe 100644 --- a/rest/autopilot/v1/assistants_queries.go +++ b/rest/autopilot/v1/assistants_queries.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateQuery(AssistantSid string, params *CreateQueryParams) path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateQuery(AssistantSid string, params *CreateQueryParams) if params != nil && params.Tasks != nil { data.Set("Tasks", *params.Tasks) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -174,8 +173,6 @@ func (c *ApiService) PageQuery(AssistantSid string, params *ListQueryParams, pag path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -191,6 +188,7 @@ func (c *ApiService) PageQuery(AssistantSid string, params *ListQueryParams, pag if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -320,14 +318,13 @@ func (c *ApiService) UpdateQuery(AssistantSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SampleSid != nil { data.Set("SampleSid", *params.SampleSid) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_restore.go b/rest/autopilot/v1/assistants_restore.go index ec81e99ec..6a8984648 100644 --- a/rest/autopilot/v1/assistants_restore.go +++ b/rest/autopilot/v1/assistants_restore.go @@ -31,11 +31,10 @@ func (c *ApiService) UpdateRestoreAssistant(params *UpdateRestoreAssistantParams path := "/v1/Assistants/Restore" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Assistant != nil { data.Set("Assistant", *params.Assistant) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_style_sheet.go b/rest/autopilot/v1/assistants_style_sheet.go index 06865c411..333902e0d 100644 --- a/rest/autopilot/v1/assistants_style_sheet.go +++ b/rest/autopilot/v1/assistants_style_sheet.go @@ -58,8 +58,6 @@ func (c *ApiService) UpdateStyleSheet(AssistantSid string, params *UpdateStyleSh path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.StyleSheet != nil { v, err := json.Marshal(params.StyleSheet) @@ -69,6 +67,7 @@ func (c *ApiService) UpdateStyleSheet(AssistantSid string, params *UpdateStyleSh data.Set("StyleSheet", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks.go b/rest/autopilot/v1/assistants_tasks.go index 4141f28eb..63213c1b0 100644 --- a/rest/autopilot/v1/assistants_tasks.go +++ b/rest/autopilot/v1/assistants_tasks.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateTask(AssistantSid string, params *CreateTaskParams) ( path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Actions != nil { v, err := json.Marshal(params.Actions) @@ -75,6 +73,7 @@ func (c *ApiService) CreateTask(AssistantSid string, params *CreateTaskParams) ( if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -156,11 +155,10 @@ func (c *ApiService) PageTask(AssistantSid string, params *ListTaskParams, pageT path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -302,8 +300,6 @@ func (c *ApiService) UpdateTask(AssistantSid string, Sid string, params *UpdateT path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Actions != nil { v, err := json.Marshal(params.Actions) @@ -322,6 +318,7 @@ func (c *ApiService) UpdateTask(AssistantSid string, Sid string, params *UpdateT if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks_actions.go b/rest/autopilot/v1/assistants_tasks_actions.go index 32d9caf63..a67ebe64c 100644 --- a/rest/autopilot/v1/assistants_tasks_actions.go +++ b/rest/autopilot/v1/assistants_tasks_actions.go @@ -60,8 +60,6 @@ func (c *ApiService) UpdateTaskActions(AssistantSid string, TaskSid string, para path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Actions != nil { v, err := json.Marshal(params.Actions) @@ -71,6 +69,7 @@ func (c *ApiService) UpdateTaskActions(AssistantSid string, TaskSid string, para data.Set("Actions", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks_fields.go b/rest/autopilot/v1/assistants_tasks_fields.go index cd3ae09e2..8016a1e7f 100644 --- a/rest/autopilot/v1/assistants_tasks_fields.go +++ b/rest/autopilot/v1/assistants_tasks_fields.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateField(AssistantSid string, TaskSid string, params *Cr path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FieldType != nil { data.Set("FieldType", *params.FieldType) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -136,11 +135,10 @@ func (c *ApiService) PageField(AssistantSid string, TaskSid string, params *List path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/autopilot/v1/assistants_tasks_samples.go b/rest/autopilot/v1/assistants_tasks_samples.go index 64bacbcf3..9a22b3788 100644 --- a/rest/autopilot/v1/assistants_tasks_samples.go +++ b/rest/autopilot/v1/assistants_tasks_samples.go @@ -50,8 +50,6 @@ func (c *ApiService) CreateSample(AssistantSid string, TaskSid string, params *C path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -61,6 +59,7 @@ func (c *ApiService) CreateSample(AssistantSid string, TaskSid string, params *C if params != nil && params.TaggedText != nil { data.Set("TaggedText", *params.TaggedText) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -151,14 +150,13 @@ func (c *ApiService) PageSample(AssistantSid string, TaskSid string, params *Lis path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -295,8 +293,6 @@ func (c *ApiService) UpdateSample(AssistantSid string, TaskSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -306,6 +302,7 @@ func (c *ApiService) UpdateSample(AssistantSid string, TaskSid string, Sid strin if params != nil && params.TaggedText != nil { data.Set("TaggedText", *params.TaggedText) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_webhooks.go b/rest/autopilot/v1/assistants_webhooks.go index d0d1a11a1..50f028dea 100644 --- a/rest/autopilot/v1/assistants_webhooks.go +++ b/rest/autopilot/v1/assistants_webhooks.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateWebhook(AssistantSid string, params *CreateWebhookPar path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Events != nil { data.Set("Events", *params.Events) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateWebhook(AssistantSid string, params *CreateWebhookPar if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -150,11 +149,10 @@ func (c *ApiService) PageWebhook(AssistantSid string, params *ListWebhookParams, path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -296,8 +294,6 @@ func (c *ApiService) UpdateWebhook(AssistantSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Events != nil { data.Set("Events", *params.Events) } @@ -310,6 +306,7 @@ func (c *ApiService) UpdateWebhook(AssistantSid string, Sid string, params *Upda if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/bulkexports/v1/exports_configuration.go b/rest/bulkexports/v1/exports_configuration.go index 7d81257e6..79ab0465b 100644 --- a/rest/bulkexports/v1/exports_configuration.go +++ b/rest/bulkexports/v1/exports_configuration.go @@ -71,8 +71,6 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -82,6 +80,7 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/bulkexports/v1/exports_days.go b/rest/bulkexports/v1/exports_days.go index 257465feb..3f0f6e8c2 100644 --- a/rest/bulkexports/v1/exports_days.go +++ b/rest/bulkexports/v1/exports_days.go @@ -64,11 +64,10 @@ func (c *ApiService) PageDay(ResourceType string, params *ListDayParams, pageTok path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/bulkexports/v1/exports_jobs.go b/rest/bulkexports/v1/exports_jobs.go index 39e5233e3..9d4a65a54 100644 --- a/rest/bulkexports/v1/exports_jobs.go +++ b/rest/bulkexports/v1/exports_jobs.go @@ -67,8 +67,6 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -87,6 +85,7 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -166,11 +165,10 @@ func (c *ApiService) PageExportCustomJob(ResourceType string, params *ListExport path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v1/credentials.go b/rest/chat/v1/credentials.go index 0dbe71031..d3630c167 100644 --- a/rest/chat/v1/credentials.go +++ b/rest/chat/v1/credentials.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken stri path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,8 +327,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -349,6 +345,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services.go b/rest/chat/v1/services.go index 093383d1a..a4bec5dcb 100644 --- a/rest/chat/v1/services.go +++ b/rest/chat/v1/services.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV1Service, path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,11 +117,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -563,8 +561,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -729,6 +725,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels.go b/rest/chat/v1/services_channels.go index cbaf7d411..5590ce3c7 100644 --- a/rest/chat/v1/services_channels.go +++ b/rest/chat/v1/services_channels.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -156,8 +155,6 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -166,6 +163,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -301,8 +299,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -312,6 +308,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels_invites.go b/rest/chat/v1/services_channels_invites.go index 21830e993..0cfcd8004 100644 --- a/rest/chat/v1/services_channels_invites.go +++ b/rest/chat/v1/services_channels_invites.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -142,8 +141,6 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -152,6 +149,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v1/services_channels_members.go b/rest/chat/v1/services_channels_members.go index 28afe32e1..b395abe77 100644 --- a/rest/chat/v1/services_channels_members.go +++ b/rest/chat/v1/services_channels_members.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -142,8 +141,6 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -152,6 +149,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -282,14 +280,13 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels_messages.go b/rest/chat/v1/services_channels_messages.go index 5c4ea3902..7f3805568 100644 --- a/rest/chat/v1/services_channels_messages.go +++ b/rest/chat/v1/services_channels_messages.go @@ -50,8 +50,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -61,6 +59,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.From != nil { data.Set("From", *params.From) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -151,14 +150,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -289,14 +287,13 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } if params != nil && params.Body != nil { data.Set("Body", *params.Body) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_roles.go b/rest/chat/v1/services_roles.go index 11de5781f..7b7e4ef3c 100644 --- a/rest/chat/v1/services_roles.go +++ b/rest/chat/v1/services_roles.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -62,6 +60,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -143,11 +142,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,13 +269,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_users.go b/rest/chat/v1/services_users.go index df4ec12b4..032945f75 100644 --- a/rest/chat/v1/services_users.go +++ b/rest/chat/v1/services_users.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -150,11 +149,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -290,8 +288,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -301,6 +297,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_users_channels.go b/rest/chat/v1/services_users_channels.go index ef92029e1..1201f1ed3 100644 --- a/rest/chat/v1/services_users_channels.go +++ b/rest/chat/v1/services_users_channels.go @@ -46,11 +46,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/credentials.go b/rest/chat/v2/credentials.go index aaf7dc7a0..58bb27adb 100644 --- a/rest/chat/v2/credentials.go +++ b/rest/chat/v2/credentials.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken stri path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,8 +327,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -349,6 +345,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services.go b/rest/chat/v2/services.go index 55aeb0caf..74a242401 100644 --- a/rest/chat/v2/services.go +++ b/rest/chat/v2/services.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV2Service, path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,11 +117,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -425,8 +423,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -522,6 +518,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch if params != nil && params.WebhookMethod != nil { data.Set("WebhookMethod", *params.WebhookMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_bindings.go b/rest/chat/v2/services_bindings.go index 81e339923..4025cd0cb 100644 --- a/rest/chat/v2/services_bindings.go +++ b/rest/chat/v2/services_bindings.go @@ -98,8 +98,6 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -113,6 +111,7 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/services_channels.go b/rest/chat/v2/services_channels.go index 2021bb076..faf76495e 100644 --- a/rest/chat/v2/services_channels.go +++ b/rest/chat/v2/services_channels.go @@ -80,8 +80,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -103,7 +101,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,7 +139,6 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -209,8 +206,6 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -219,6 +214,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -378,8 +374,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -398,7 +392,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_channels_invites.go b/rest/chat/v2/services_channels_invites.go index bf17de8ab..21b94bdf1 100644 --- a/rest/chat/v2/services_channels_invites.go +++ b/rest/chat/v2/services_channels_invites.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -142,8 +141,6 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -152,6 +149,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/services_channels_members.go b/rest/chat/v2/services_channels_members.go index 80446f5da..b4e3166d8 100644 --- a/rest/chat/v2/services_channels_members.go +++ b/rest/chat/v2/services_channels_members.go @@ -81,8 +81,6 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -104,7 +102,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -143,7 +141,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -213,8 +210,6 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -223,6 +218,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -383,8 +379,6 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -403,7 +397,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_channels_messages.go b/rest/chat/v2/services_channels_messages.go index adfde57db..50497e361 100644 --- a/rest/chat/v2/services_channels_messages.go +++ b/rest/chat/v2/services_channels_messages.go @@ -81,8 +81,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -104,7 +102,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -143,7 +141,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -213,14 +210,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -381,8 +377,6 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -401,7 +395,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str if params != nil && params.LastUpdatedBy != nil { data.Set("LastUpdatedBy", *params.LastUpdatedBy) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_channels_webhooks.go b/rest/chat/v2/services_channels_webhooks.go index 7eccac780..ce7697cf4 100644 --- a/rest/chat/v2/services_channels_webhooks.go +++ b/rest/chat/v2/services_channels_webhooks.go @@ -74,8 +74,6 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -101,6 +99,7 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -185,11 +184,10 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -344,8 +342,6 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -368,6 +364,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_roles.go b/rest/chat/v2/services_roles.go index dab5b24f5..370d102fc 100644 --- a/rest/chat/v2/services_roles.go +++ b/rest/chat/v2/services_roles.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -62,6 +60,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -143,11 +142,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,13 +269,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_users.go b/rest/chat/v2/services_users.go index 766dc4783..1d1b9fb4c 100644 --- a/rest/chat/v2/services_users.go +++ b/rest/chat/v2/services_users.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -75,7 +73,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -160,11 +158,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -306,8 +303,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -317,7 +312,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_users_bindings.go b/rest/chat/v2/services_users_bindings.go index 85212e3d9..9181213a5 100644 --- a/rest/chat/v2/services_users_bindings.go +++ b/rest/chat/v2/services_users_bindings.go @@ -95,8 +95,6 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -105,6 +103,7 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/services_users_channels.go b/rest/chat/v2/services_users_channels.go index fbf662552..323673efc 100644 --- a/rest/chat/v2/services_users_channels.go +++ b/rest/chat/v2/services_users_channels.go @@ -91,11 +91,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -232,8 +231,6 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } @@ -243,6 +240,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe if params != nil && params.NotificationLevel != nil { data.Set("NotificationLevel", *params.NotificationLevel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/configuration.go b/rest/conversations/v1/configuration.go index 0cd09988c..5c4c131ae 100644 --- a/rest/conversations/v1/configuration.go +++ b/rest/conversations/v1/configuration.go @@ -72,8 +72,6 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co path := "/v1/Configuration" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DefaultChatServiceSid != nil { data.Set("DefaultChatServiceSid", *params.DefaultChatServiceSid) } @@ -86,6 +84,7 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co if params != nil && params.DefaultMessagingServiceSid != nil { data.Set("DefaultMessagingServiceSid", *params.DefaultMessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/configuration_webhooks.go b/rest/conversations/v1/configuration_webhooks.go index 376340477..e9bd6f05f 100644 --- a/rest/conversations/v1/configuration_webhooks.go +++ b/rest/conversations/v1/configuration_webhooks.go @@ -76,8 +76,6 @@ func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebho path := "/v1/Configuration/Webhooks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Filters != nil { for _, item := range *params.Filters { data.Add("Filters", item) @@ -95,6 +93,7 @@ func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebho if params != nil && params.Target != nil { data.Set("Target", *params.Target) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/conversations.go b/rest/conversations/v1/conversations.go index 5d20c86a5..ebdbe7f99 100644 --- a/rest/conversations/v1/conversations.go +++ b/rest/conversations/v1/conversations.go @@ -92,8 +92,6 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv path := "/v1/Conversations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -121,7 +119,7 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -159,7 +157,6 @@ func (c *ApiService) DeleteConversation(Sid string, params *DeleteConversationPa data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -219,11 +216,10 @@ func (c *ApiService) PageConversation(params *ListConversationParams, pageToken path := "/v1/Conversations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -401,8 +397,6 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -430,7 +424,7 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/conversations_messages.go b/rest/conversations/v1/conversations_messages.go index bb626346b..2cfdda1fa 100644 --- a/rest/conversations/v1/conversations_messages.go +++ b/rest/conversations/v1/conversations_messages.go @@ -75,8 +75,6 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -95,7 +93,7 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -134,7 +132,6 @@ func (c *ApiService) DeleteConversationMessage(ConversationSid string, Sid strin data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -197,11 +194,10 @@ func (c *ApiService) PageConversationMessage(ConversationSid string, params *Lis path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -356,8 +352,6 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -373,7 +367,7 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin if params != nil && params.DateUpdated != nil { data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/conversations_messages_receipts.go b/rest/conversations/v1/conversations_messages_receipts.go index b5bfcc734..3b8f9f0eb 100644 --- a/rest/conversations/v1/conversations_messages_receipts.go +++ b/rest/conversations/v1/conversations_messages_receipts.go @@ -71,11 +71,10 @@ func (c *ApiService) PageConversationMessageReceipt(ConversationSid string, Mess path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/conversations_participants.go b/rest/conversations/v1/conversations_participants.go index 147226fc3..c208dce69 100644 --- a/rest/conversations/v1/conversations_participants.go +++ b/rest/conversations/v1/conversations_participants.go @@ -87,8 +87,6 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -113,7 +111,7 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -152,7 +150,6 @@ func (c *ApiService) DeleteConversationParticipant(ConversationSid string, Sid s data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -215,11 +212,10 @@ func (c *ApiService) PageConversationParticipant(ConversationSid string, params path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -398,8 +394,6 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -427,7 +421,7 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/conversations_webhooks.go b/rest/conversations/v1/conversations_webhooks.go index 378ba56c0..ed3410206 100644 --- a/rest/conversations/v1/conversations_webhooks.go +++ b/rest/conversations/v1/conversations_webhooks.go @@ -74,8 +74,6 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -101,6 +99,7 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par if params != nil && params.Target != nil { data.Set("Target", *params.Target) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -184,11 +183,10 @@ func (c *ApiService) PageConversationScopedWebhook(ConversationSid string, param path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -337,8 +335,6 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -358,6 +354,7 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/credentials.go b/rest/conversations/v1/credentials.go index 8f5599d8e..37c23b781 100644 --- a/rest/conversations/v1/credentials.go +++ b/rest/conversations/v1/credentials.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -96,6 +94,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -175,11 +174,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken stri path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -339,8 +337,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -362,6 +358,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/roles.go b/rest/conversations/v1/roles.go index 69053d7c9..25b8839c1 100644 --- a/rest/conversations/v1/roles.go +++ b/rest/conversations/v1/roles.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, path := "/v1/Roles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -62,6 +60,7 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,11 +140,10 @@ func (c *ApiService) PageRole(params *ListRoleParams, pageToken string, pageNumb path := "/v1/Roles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -269,13 +267,12 @@ func (c *ApiService) UpdateRole(Sid string, params *UpdateRoleParams) (*Conversa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services.go b/rest/conversations/v1/services.go index 1f5279b3b..143fc9acf 100644 --- a/rest/conversations/v1/services.go +++ b/rest/conversations/v1/services.go @@ -37,11 +37,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ConversationsV path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -121,11 +120,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_bindings.go b/rest/conversations/v1/services_bindings.go index 09c0ad5f8..a4543430e 100644 --- a/rest/conversations/v1/services_bindings.go +++ b/rest/conversations/v1/services_bindings.go @@ -100,8 +100,6 @@ func (c *ApiService) PageServiceBinding(ChatServiceSid string, params *ListServi path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -115,6 +113,7 @@ func (c *ApiService) PageServiceBinding(ChatServiceSid string, params *ListServi if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_configuration.go b/rest/conversations/v1/services_configuration.go index febebe2ce..4c8dffcf2 100644 --- a/rest/conversations/v1/services_configuration.go +++ b/rest/conversations/v1/services_configuration.go @@ -77,8 +77,6 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DefaultChatServiceRoleSid != nil { data.Set("DefaultChatServiceRoleSid", *params.DefaultChatServiceRoleSid) } @@ -91,6 +89,7 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U if params != nil && params.ReachabilityEnabled != nil { data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_configuration_notifications.go b/rest/conversations/v1/services_configuration_notifications.go index 3d0f08798..ac87ca518 100644 --- a/rest/conversations/v1/services_configuration_notifications.go +++ b/rest/conversations/v1/services_configuration_notifications.go @@ -119,8 +119,6 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddedToConversationEnabled != nil { data.Set("AddedToConversation.Enabled", fmt.Sprint(*params.AddedToConversationEnabled)) } @@ -154,6 +152,7 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up if params != nil && params.RemovedFromConversationTemplate != nil { data.Set("RemovedFromConversation.Template", *params.RemovedFromConversationTemplate) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_conversations.go b/rest/conversations/v1/services_conversations.go index 26cd99c09..e0e651c87 100644 --- a/rest/conversations/v1/services_conversations.go +++ b/rest/conversations/v1/services_conversations.go @@ -93,8 +93,6 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -122,7 +120,7 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -161,7 +159,6 @@ func (c *ApiService) DeleteServiceConversation(ChatServiceSid string, Sid string data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -224,11 +221,10 @@ func (c *ApiService) PageServiceConversation(ChatServiceSid string, params *List path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -407,8 +403,6 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -436,7 +430,7 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/services_conversations_messages.go b/rest/conversations/v1/services_conversations_messages.go index 5a2563f83..cd12d7fa1 100644 --- a/rest/conversations/v1/services_conversations_messages.go +++ b/rest/conversations/v1/services_conversations_messages.go @@ -76,8 +76,6 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -96,7 +94,7 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -136,7 +134,6 @@ func (c *ApiService) DeleteServiceConversationMessage(ChatServiceSid string, Con data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -201,11 +198,10 @@ func (c *ApiService) PageServiceConversationMessage(ChatServiceSid string, Conve path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -361,8 +357,6 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -378,7 +372,7 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con if params != nil && params.DateUpdated != nil { data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/services_conversations_messages_receipts.go b/rest/conversations/v1/services_conversations_messages_receipts.go index 6823890e7..b04ebd5da 100644 --- a/rest/conversations/v1/services_conversations_messages_receipts.go +++ b/rest/conversations/v1/services_conversations_messages_receipts.go @@ -73,11 +73,10 @@ func (c *ApiService) PageServiceConversationMessageReceipt(ChatServiceSid string path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_conversations_participants.go b/rest/conversations/v1/services_conversations_participants.go index e941d4355..a198da1b8 100644 --- a/rest/conversations/v1/services_conversations_participants.go +++ b/rest/conversations/v1/services_conversations_participants.go @@ -88,8 +88,6 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -114,7 +112,7 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -154,7 +152,6 @@ func (c *ApiService) DeleteServiceConversationParticipant(ChatServiceSid string, data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -219,11 +216,10 @@ func (c *ApiService) PageServiceConversationParticipant(ChatServiceSid string, C path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -403,8 +399,6 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -432,7 +426,7 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/services_conversations_webhooks.go b/rest/conversations/v1/services_conversations_webhooks.go index debd31dab..e1c3c9133 100644 --- a/rest/conversations/v1/services_conversations_webhooks.go +++ b/rest/conversations/v1/services_conversations_webhooks.go @@ -75,8 +75,6 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -102,6 +100,7 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin if params != nil && params.Target != nil { data.Set("Target", *params.Target) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -188,11 +187,10 @@ func (c *ApiService) PageServiceConversationScopedWebhook(ChatServiceSid string, path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -342,8 +340,6 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -363,6 +359,7 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_roles.go b/rest/conversations/v1/services_roles.go index 258df233a..dc60ad033 100644 --- a/rest/conversations/v1/services_roles.go +++ b/rest/conversations/v1/services_roles.go @@ -50,8 +50,6 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -63,6 +61,7 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -146,11 +145,10 @@ func (c *ApiService) PageServiceRole(ChatServiceSid string, params *ListServiceR path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -275,13 +273,12 @@ func (c *ApiService) UpdateServiceRole(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_users.go b/rest/conversations/v1/services_users.go index 9856f5dac..049438985 100644 --- a/rest/conversations/v1/services_users.go +++ b/rest/conversations/v1/services_users.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -76,7 +74,7 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -115,7 +113,6 @@ func (c *ApiService) DeleteServiceUser(ChatServiceSid string, Sid string, params data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -178,11 +175,10 @@ func (c *ApiService) PageServiceUser(ChatServiceSid string, params *ListServiceU path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -325,8 +321,6 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -336,7 +330,7 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/users.go b/rest/conversations/v1/users.go index 2c7edd4aa..7183997a4 100644 --- a/rest/conversations/v1/users.go +++ b/rest/conversations/v1/users.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, path := "/v1/Users" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -75,7 +73,7 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -113,7 +111,6 @@ func (c *ApiService) DeleteUser(Sid string, params *DeleteUserParams) error { data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -173,11 +170,10 @@ func (c *ApiService) PageUser(params *ListUserParams, pageToken string, pageNumb path := "/v1/Users" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -319,8 +315,6 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -330,7 +324,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/events/v1/schemas_versions.go b/rest/events/v1/schemas_versions.go index a49e2e459..66809b559 100644 --- a/rest/events/v1/schemas_versions.go +++ b/rest/events/v1/schemas_versions.go @@ -69,11 +69,10 @@ func (c *ApiService) PageSchemaVersion(Id string, params *ListSchemaVersionParam path = strings.Replace(path, "{"+"Id"+"}", Id, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/events/v1/sinks.go b/rest/events/v1/sinks.go index d40e78292..2b7471b3c 100644 --- a/rest/events/v1/sinks.go +++ b/rest/events/v1/sinks.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) path := "/v1/Sinks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } @@ -66,6 +64,7 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) if params != nil && params.SinkType != nil { data.Set("SinkType", *params.SinkType) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -157,8 +156,6 @@ func (c *ApiService) PageSink(params *ListSinkParams, pageToken string, pageNumb path := "/v1/Sinks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.InUse != nil { data.Set("InUse", fmt.Sprint(*params.InUse)) } @@ -168,6 +165,7 @@ func (c *ApiService) PageSink(params *ListSinkParams, pageToken string, pageNumb if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -291,11 +289,10 @@ func (c *ApiService) UpdateSink(Sid string, params *UpdateSinkParams) (*EventsV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/sinks_validate.go b/rest/events/v1/sinks_validate.go index 6110b2278..9b07e93ea 100644 --- a/rest/events/v1/sinks_validate.go +++ b/rest/events/v1/sinks_validate.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateSinkValidate(Sid string, params *CreateSinkValidatePa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TestId != nil { data.Set("TestId", *params.TestId) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/subscriptions.go b/rest/events/v1/subscriptions.go index d9dc9305d..a159d3f01 100644 --- a/rest/events/v1/subscriptions.go +++ b/rest/events/v1/subscriptions.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even path := "/v1/Subscriptions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } @@ -68,6 +66,7 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even data.Add("Types", string(v)) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -153,14 +152,13 @@ func (c *ApiService) PageSubscription(params *ListSubscriptionParams, pageToken path := "/v1/Subscriptions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SinkSid != nil { data.Set("SinkSid", *params.SinkSid) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -290,14 +288,13 @@ func (c *ApiService) UpdateSubscription(Sid string, params *UpdateSubscriptionPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } if params != nil && params.SinkSid != nil { data.Set("SinkSid", *params.SinkSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/subscriptions_subscribed_events.go b/rest/events/v1/subscriptions_subscribed_events.go index d65d77e98..cea45b214 100644 --- a/rest/events/v1/subscriptions_subscribed_events.go +++ b/rest/events/v1/subscriptions_subscribed_events.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateSubscribedEvent(SubscriptionSid string, params *Creat path = strings.Replace(path, "{"+"SubscriptionSid"+"}", SubscriptionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SchemaVersion != nil { data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) } if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -135,11 +134,10 @@ func (c *ApiService) PageSubscribedEvent(SubscriptionSid string, params *ListSub path = strings.Replace(path, "{"+"SubscriptionSid"+"}", SubscriptionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -264,11 +262,10 @@ func (c *ApiService) UpdateSubscribedEvent(SubscriptionSid string, Type string, path = strings.Replace(path, "{"+"Type"+"}", Type, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SchemaVersion != nil { data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/types.go b/rest/events/v1/types.go index 498bc6746..cedea9091 100644 --- a/rest/events/v1/types.go +++ b/rest/events/v1/types.go @@ -72,14 +72,13 @@ func (c *ApiService) PageEventType(params *ListEventTypeParams, pageToken string path := "/v1/Types" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SchemaId != nil { data.Set("SchemaId", *params.SchemaId) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/fax/v1/faxes.go b/rest/fax/v1/faxes.go index d1f8c1fe7..8b33fea27 100644 --- a/rest/fax/v1/faxes.go +++ b/rest/fax/v1/faxes.go @@ -86,8 +86,6 @@ func (c *ApiService) CreateFax(params *CreateFaxParams) (*FaxV1Fax, error) { path := "/v1/Faxes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -115,6 +113,7 @@ func (c *ApiService) CreateFax(params *CreateFaxParams) (*FaxV1Fax, error) { if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -218,8 +217,6 @@ func (c *ApiService) PageFax(params *ListFaxParams, pageToken string, pageNumber path := "/v1/Faxes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -235,6 +232,7 @@ func (c *ApiService) PageFax(params *ListFaxParams, pageToken string, pageNumber if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -358,11 +356,10 @@ func (c *ApiService) UpdateFax(Sid string, params *UpdateFaxParams) (*FaxV1Fax, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/fax/v1/faxes_media.go b/rest/fax/v1/faxes_media.go index 3a8a99c69..a411ad341 100644 --- a/rest/fax/v1/faxes_media.go +++ b/rest/fax/v1/faxes_media.go @@ -88,11 +88,10 @@ func (c *ApiService) PageFaxMedia(FaxSid string, params *ListFaxMediaParams, pag path = strings.Replace(path, "{"+"FaxSid"+"}", FaxSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/channels.go b/rest/flex/v1/channels.go index b73c0f2e4..e79ace9b5 100644 --- a/rest/flex/v1/channels.go +++ b/rest/flex/v1/channels.go @@ -90,8 +90,6 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, path := "/v1/Channels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChatFriendlyName != nil { data.Set("ChatFriendlyName", *params.ChatFriendlyName) } @@ -122,6 +120,7 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, if params != nil && params.TaskSid != nil { data.Set("TaskSid", *params.TaskSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -199,11 +198,10 @@ func (c *ApiService) PageChannel(params *ListChannelParams, pageToken string, pa path := "/v1/Channels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/configuration.go b/rest/flex/v1/configuration.go index e9398e8ae..588c1f6b9 100644 --- a/rest/flex/v1/configuration.go +++ b/rest/flex/v1/configuration.go @@ -31,11 +31,10 @@ func (c *ApiService) FetchConfiguration(params *FetchConfigurationParams) (*Flex path := "/v1/Configuration" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UiVersion != nil { data.Set("UiVersion", *params.UiVersion) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/flex/v1/flex_flows.go b/rest/flex/v1/flex_flows.go index 0d3d5b9b1..bb245a2c1 100644 --- a/rest/flex/v1/flex_flows.go +++ b/rest/flex/v1/flex_flows.go @@ -132,8 +132,6 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl path := "/v1/FlexFlows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelType != nil { data.Set("ChannelType", *params.ChannelType) } @@ -185,6 +183,7 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl if params != nil && params.LongLived != nil { data.Set("LongLived", fmt.Sprint(*params.LongLived)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -268,14 +267,13 @@ func (c *ApiService) PageFlexFlow(params *ListFlexFlowParams, pageToken string, path := "/v1/FlexFlows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -494,8 +492,6 @@ func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelType != nil { data.Set("ChannelType", *params.ChannelType) } @@ -547,6 +543,7 @@ func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (* if params != nil && params.LongLived != nil { data.Set("LongLived", fmt.Sprint(*params.LongLived)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/flex/v1/web_channels.go b/rest/flex/v1/web_channels.go index 0ca154738..effca54d5 100644 --- a/rest/flex/v1/web_channels.go +++ b/rest/flex/v1/web_channels.go @@ -66,8 +66,6 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We path := "/v1/WebChannels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChatFriendlyName != nil { data.Set("ChatFriendlyName", *params.ChatFriendlyName) } @@ -86,6 +84,7 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We if params != nil && params.PreEngagementData != nil { data.Set("PreEngagementData", *params.PreEngagementData) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) PageWebChannel(params *ListWebChannelParams, pageToken stri path := "/v1/WebChannels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -296,14 +294,13 @@ func (c *ApiService) UpdateWebChannel(Sid string, params *UpdateWebChannelParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChatStatus != nil { data.Set("ChatStatus", *params.ChatStatus) } if params != nil && params.PostEngagementData != nil { data.Set("PostEngagementData", *params.PostEngagementData) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/frontline/v1/users.go b/rest/frontline/v1/users.go index 71ec42fbc..21023d7cd 100644 --- a/rest/frontline/v1/users.go +++ b/rest/frontline/v1/users.go @@ -70,8 +70,6 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Avatar != nil { data.Set("Avatar", *params.Avatar) } @@ -81,6 +79,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin if params != nil && params.State != nil { data.Set("State", *params.State) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/insights/v1/video_rooms.go b/rest/insights/v1/video_rooms.go index 99e3902a8..acf37f320 100644 --- a/rest/insights/v1/video_rooms.go +++ b/rest/insights/v1/video_rooms.go @@ -97,8 +97,6 @@ func (c *ApiService) PageVideoRoomSummary(params *ListVideoRoomSummaryParams, pa path := "/v1/Video/Rooms" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.RoomType != nil { for _, item := range *params.RoomType { data.Add("RoomType", item) @@ -121,6 +119,7 @@ func (c *ApiService) PageVideoRoomSummary(params *ListVideoRoomSummaryParams, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/video_rooms_participants.go b/rest/insights/v1/video_rooms_participants.go index 9b008290e..081cc67cf 100644 --- a/rest/insights/v1/video_rooms_participants.go +++ b/rest/insights/v1/video_rooms_participants.go @@ -69,11 +69,10 @@ func (c *ApiService) PageVideoParticipantSummary(RoomSid string, params *ListVid path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice_events.go b/rest/insights/v1/voice_events.go index a1c82add6..0ff2cb192 100644 --- a/rest/insights/v1/voice_events.go +++ b/rest/insights/v1/voice_events.go @@ -51,14 +51,13 @@ func (c *ApiService) PageEvent(CallSid string, params *ListEventParams, pageToke path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Edge != nil { data.Set("Edge", *params.Edge) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice_metrics.go b/rest/insights/v1/voice_metrics.go index 36b0c545f..471355c47 100644 --- a/rest/insights/v1/voice_metrics.go +++ b/rest/insights/v1/voice_metrics.go @@ -57,8 +57,6 @@ func (c *ApiService) PageMetric(CallSid string, params *ListMetricParams, pageTo path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Edge != nil { data.Set("Edge", *params.Edge) } @@ -68,6 +66,7 @@ func (c *ApiService) PageMetric(CallSid string, params *ListMetricParams, pageTo if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice_summary.go b/rest/insights/v1/voice_summary.go index 5ae0fcad2..cb2d7f198 100644 --- a/rest/insights/v1/voice_summary.go +++ b/rest/insights/v1/voice_summary.go @@ -34,11 +34,10 @@ func (c *ApiService) FetchSummary(CallSid string, params *FetchSummaryParams) (* path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ProcessingState != nil { data.Set("ProcessingState", *params.ProcessingState) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/credentials.go b/rest/ip_messaging/v1/credentials.go index cdaecafab..2de87406d 100644 --- a/rest/ip_messaging/v1/credentials.go +++ b/rest/ip_messaging/v1/credentials.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken stri path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,8 +327,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -349,6 +345,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services.go b/rest/ip_messaging/v1/services.go index 4cb9217c5..634c5234f 100644 --- a/rest/ip_messaging/v1/services.go +++ b/rest/ip_messaging/v1/services.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV1S path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,11 +117,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -563,8 +561,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -729,6 +725,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels.go b/rest/ip_messaging/v1/services_channels.go index 8b6602ba9..0389b4ccd 100644 --- a/rest/ip_messaging/v1/services_channels.go +++ b/rest/ip_messaging/v1/services_channels.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -156,8 +155,6 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -166,6 +163,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -301,8 +299,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -312,6 +308,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels_invites.go b/rest/ip_messaging/v1/services_channels_invites.go index 2cc4b7cd7..85ec7ecf6 100644 --- a/rest/ip_messaging/v1/services_channels_invites.go +++ b/rest/ip_messaging/v1/services_channels_invites.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -142,8 +141,6 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -152,6 +149,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v1/services_channels_members.go b/rest/ip_messaging/v1/services_channels_members.go index 6da1f7aee..99b0f6dbf 100644 --- a/rest/ip_messaging/v1/services_channels_members.go +++ b/rest/ip_messaging/v1/services_channels_members.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -142,8 +141,6 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -152,6 +149,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -282,14 +280,13 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels_messages.go b/rest/ip_messaging/v1/services_channels_messages.go index f860fb4f3..e9a96b96b 100644 --- a/rest/ip_messaging/v1/services_channels_messages.go +++ b/rest/ip_messaging/v1/services_channels_messages.go @@ -50,8 +50,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -61,6 +59,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.From != nil { data.Set("From", *params.From) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -151,14 +150,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -289,14 +287,13 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } if params != nil && params.Body != nil { data.Set("Body", *params.Body) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_roles.go b/rest/ip_messaging/v1/services_roles.go index b2228ba7f..1b5d5ff9f 100644 --- a/rest/ip_messaging/v1/services_roles.go +++ b/rest/ip_messaging/v1/services_roles.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -62,6 +60,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -143,11 +142,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,13 +269,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_users.go b/rest/ip_messaging/v1/services_users.go index 1ff6539fd..f63ab1eff 100644 --- a/rest/ip_messaging/v1/services_users.go +++ b/rest/ip_messaging/v1/services_users.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -150,11 +149,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -290,8 +288,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -301,6 +297,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_users_channels.go b/rest/ip_messaging/v1/services_users_channels.go index a1ad4d496..eac7c8d13 100644 --- a/rest/ip_messaging/v1/services_users_channels.go +++ b/rest/ip_messaging/v1/services_users_channels.go @@ -46,11 +46,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/credentials.go b/rest/ip_messaging/v2/credentials.go index 425eebda1..fb64956d1 100644 --- a/rest/ip_messaging/v2/credentials.go +++ b/rest/ip_messaging/v2/credentials.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken stri path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,8 +327,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -349,6 +345,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services.go b/rest/ip_messaging/v2/services.go index e55a96720..98d050c16 100644 --- a/rest/ip_messaging/v2/services.go +++ b/rest/ip_messaging/v2/services.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV2S path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,11 +117,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -425,8 +423,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -522,6 +518,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip if params != nil && params.WebhookMethod != nil { data.Set("WebhookMethod", *params.WebhookMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_bindings.go b/rest/ip_messaging/v2/services_bindings.go index 06592b7e6..0429db2a5 100644 --- a/rest/ip_messaging/v2/services_bindings.go +++ b/rest/ip_messaging/v2/services_bindings.go @@ -98,8 +98,6 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -113,6 +111,7 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/services_channels.go b/rest/ip_messaging/v2/services_channels.go index 92b354619..4d8c7f0ed 100644 --- a/rest/ip_messaging/v2/services_channels.go +++ b/rest/ip_messaging/v2/services_channels.go @@ -80,8 +80,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -103,7 +101,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,7 +139,6 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -209,8 +206,6 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -219,6 +214,7 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -378,8 +374,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -398,7 +392,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_channels_invites.go b/rest/ip_messaging/v2/services_channels_invites.go index 1fe40ec59..ab85b9257 100644 --- a/rest/ip_messaging/v2/services_channels_invites.go +++ b/rest/ip_messaging/v2/services_channels_invites.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -142,8 +141,6 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -152,6 +149,7 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/services_channels_members.go b/rest/ip_messaging/v2/services_channels_members.go index b0107902f..568c67678 100644 --- a/rest/ip_messaging/v2/services_channels_members.go +++ b/rest/ip_messaging/v2/services_channels_members.go @@ -81,8 +81,6 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -104,7 +102,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -143,7 +141,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -213,8 +210,6 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -223,6 +218,7 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -383,8 +379,6 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -403,7 +397,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_channels_messages.go b/rest/ip_messaging/v2/services_channels_messages.go index b7fe09c9e..9b5a02437 100644 --- a/rest/ip_messaging/v2/services_channels_messages.go +++ b/rest/ip_messaging/v2/services_channels_messages.go @@ -81,8 +81,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -104,7 +102,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -143,7 +141,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -213,14 +210,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -381,8 +377,6 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -401,7 +395,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str if params != nil && params.LastUpdatedBy != nil { data.Set("LastUpdatedBy", *params.LastUpdatedBy) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_channels_webhooks.go b/rest/ip_messaging/v2/services_channels_webhooks.go index 047e9ccde..889cffd6c 100644 --- a/rest/ip_messaging/v2/services_channels_webhooks.go +++ b/rest/ip_messaging/v2/services_channels_webhooks.go @@ -74,8 +74,6 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -101,6 +99,7 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -185,11 +184,10 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -344,8 +342,6 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -368,6 +364,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_roles.go b/rest/ip_messaging/v2/services_roles.go index ebd4d4a11..7f1de4704 100644 --- a/rest/ip_messaging/v2/services_roles.go +++ b/rest/ip_messaging/v2/services_roles.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -62,6 +60,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -143,11 +142,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,13 +269,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_users.go b/rest/ip_messaging/v2/services_users.go index 5b013bded..19c08ea84 100644 --- a/rest/ip_messaging/v2/services_users.go +++ b/rest/ip_messaging/v2/services_users.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -75,7 +73,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -160,11 +158,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -306,8 +303,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -317,7 +312,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_users_bindings.go b/rest/ip_messaging/v2/services_users_bindings.go index 57b3bff39..2c44e983c 100644 --- a/rest/ip_messaging/v2/services_users_bindings.go +++ b/rest/ip_messaging/v2/services_users_bindings.go @@ -95,8 +95,6 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -105,6 +103,7 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/services_users_channels.go b/rest/ip_messaging/v2/services_users_channels.go index d4aa7ed0e..25cbedc24 100644 --- a/rest/ip_messaging/v2/services_users_channels.go +++ b/rest/ip_messaging/v2/services_users_channels.go @@ -90,11 +90,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -231,8 +230,6 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } @@ -242,6 +239,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe if params != nil && params.NotificationLevel != nil { data.Set("NotificationLevel", *params.NotificationLevel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/lookups/v1/phone_numbers.go b/rest/lookups/v1/phone_numbers.go index 1013d5822..bfa60947a 100644 --- a/rest/lookups/v1/phone_numbers.go +++ b/rest/lookups/v1/phone_numbers.go @@ -52,8 +52,6 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CountryCode != nil { data.Set("CountryCode", *params.CountryCode) } @@ -76,6 +74,7 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb data.Set("AddOnsData", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/a2p_brand_registrations.go b/rest/messaging/v1/a2p_brand_registrations.go index 685044592..6ac4a6c0a 100644 --- a/rest/messaging/v1/a2p_brand_registrations.go +++ b/rest/messaging/v1/a2p_brand_registrations.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsPa path := "/v1/a2p/BrandRegistrations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.A2pProfileBundleSid != nil { data.Set("A2pProfileBundleSid", *params.A2pProfileBundleSid) } @@ -59,6 +57,7 @@ func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsPa if params != nil && params.CustomerProfileBundleSid != nil { data.Set("CustomerProfileBundleSid", *params.CustomerProfileBundleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -119,11 +118,10 @@ func (c *ApiService) PageBrandRegistrations(params *ListBrandRegistrationsParams path := "/v1/a2p/BrandRegistrations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/deactivations.go b/rest/messaging/v1/deactivations.go index aa196a830..8585ab025 100644 --- a/rest/messaging/v1/deactivations.go +++ b/rest/messaging/v1/deactivations.go @@ -32,11 +32,10 @@ func (c *ApiService) FetchDeactivation(params *FetchDeactivationParams) error { path := "/v1/Deactivations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Date != nil { data.Set("Date", fmt.Sprint(*params.Date)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services.go b/rest/messaging/v1/services.go index 858ef4448..eab2ab732 100644 --- a/rest/messaging/v1/services.go +++ b/rest/messaging/v1/services.go @@ -120,8 +120,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCodeGeomatch != nil { data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) } @@ -167,6 +165,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser if params != nil && params.ValidityPeriod != nil { data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -244,11 +243,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -455,8 +453,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Me path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCodeGeomatch != nil { data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) } @@ -502,6 +498,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Me if params != nil && params.ValidityPeriod != nil { data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_alpha_senders.go b/rest/messaging/v1/services_alpha_senders.go index ddc999c71..edee09410 100644 --- a/rest/messaging/v1/services_alpha_senders.go +++ b/rest/messaging/v1/services_alpha_senders.go @@ -37,11 +37,10 @@ func (c *ApiService) CreateAlphaSender(ServiceSid string, params *CreateAlphaSen path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AlphaSender != nil { data.Set("AlphaSender", *params.AlphaSender) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -123,11 +122,10 @@ func (c *ApiService) PageAlphaSender(ServiceSid string, params *ListAlphaSenderP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_compliance_usa2p.go b/rest/messaging/v1/services_compliance_usa2p.go index 6a71c479f..d724b5fc0 100644 --- a/rest/messaging/v1/services_compliance_usa2p.go +++ b/rest/messaging/v1/services_compliance_usa2p.go @@ -67,8 +67,6 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BrandRegistrationSid != nil { data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) } @@ -89,6 +87,7 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre if params != nil && params.UsAppToPersonUsecase != nil { data.Set("UsAppToPersonUsecase", *params.UsAppToPersonUsecase) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -170,11 +169,10 @@ func (c *ApiService) PageUsAppToPerson(MessagingServiceSid string, params *ListU path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_phone_numbers.go b/rest/messaging/v1/services_phone_numbers.go index 724278b2a..4a66de747 100644 --- a/rest/messaging/v1/services_phone_numbers.go +++ b/rest/messaging/v1/services_phone_numbers.go @@ -37,11 +37,10 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PhoneNumberSid != nil { data.Set("PhoneNumberSid", *params.PhoneNumberSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -123,11 +122,10 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_preregistered_usa2p.go b/rest/messaging/v1/services_preregistered_usa2p.go index 03267276c..7c7eb2faf 100644 --- a/rest/messaging/v1/services_preregistered_usa2p.go +++ b/rest/messaging/v1/services_preregistered_usa2p.go @@ -37,14 +37,13 @@ func (c *ApiService) CreateExternalCampaign(params *CreateExternalCampaignParams path := "/v1/Services/PreregisteredUsa2p" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CampaignId != nil { data.Set("CampaignId", *params.CampaignId) } if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_short_codes.go b/rest/messaging/v1/services_short_codes.go index 715643173..3b5e64819 100644 --- a/rest/messaging/v1/services_short_codes.go +++ b/rest/messaging/v1/services_short_codes.go @@ -37,11 +37,10 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ShortCodeSid != nil { data.Set("ShortCodeSid", *params.ShortCodeSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -123,11 +122,10 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/monitor/v1/alerts.go b/rest/monitor/v1/alerts.go index e15377e6e..33c077678 100644 --- a/rest/monitor/v1/alerts.go +++ b/rest/monitor/v1/alerts.go @@ -84,8 +84,6 @@ func (c *ApiService) PageAlert(params *ListAlertParams, pageToken string, pageNu path := "/v1/Alerts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LogLevel != nil { data.Set("LogLevel", *params.LogLevel) } @@ -98,6 +96,7 @@ func (c *ApiService) PageAlert(params *ListAlertParams, pageToken string, pageNu if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/monitor/v1/events.go b/rest/monitor/v1/events.go index 187868fa0..9db3f2b40 100644 --- a/rest/monitor/v1/events.go +++ b/rest/monitor/v1/events.go @@ -102,8 +102,6 @@ func (c *ApiService) PageEvent(params *ListEventParams, pageToken string, pageNu path := "/v1/Events" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActorSid != nil { data.Set("ActorSid", *params.ActorSid) } @@ -125,6 +123,7 @@ func (c *ApiService) PageEvent(params *ListEventParams, pageToken string, pageNu if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/notify/v1/credentials.go b/rest/notify/v1/credentials.go index 1bb157e37..0b69ad505 100644 --- a/rest/notify/v1/credentials.go +++ b/rest/notify/v1/credentials.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken stri path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,8 +327,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -349,6 +345,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/notify/v1/services.go b/rest/notify/v1/services.go index 0ca6caa77..bcce0c338 100644 --- a/rest/notify/v1/services.go +++ b/rest/notify/v1/services.go @@ -114,8 +114,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AlexaSkillId != nil { data.Set("AlexaSkillId", *params.AlexaSkillId) } @@ -158,6 +156,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -241,14 +240,13 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -449,8 +447,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*No path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AlexaSkillId != nil { data.Set("AlexaSkillId", *params.AlexaSkillId) } @@ -493,6 +489,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*No if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/notify/v1/services_bindings.go b/rest/notify/v1/services_bindings.go index 54add6432..52c75f428 100644 --- a/rest/notify/v1/services_bindings.go +++ b/rest/notify/v1/services_bindings.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Address != nil { data.Set("Address", *params.Address) } @@ -98,6 +96,7 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam data.Add("Tag", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -203,8 +202,6 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.StartDate != nil { data.Set("StartDate", fmt.Sprint(*params.StartDate)) } @@ -224,6 +221,7 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/notify/v1/services_notifications.go b/rest/notify/v1/services_notifications.go index ec069d54d..c97a94185 100644 --- a/rest/notify/v1/services_notifications.go +++ b/rest/notify/v1/services_notifications.go @@ -137,8 +137,6 @@ func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotific path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Action != nil { data.Set("Action", *params.Action) } @@ -243,6 +241,7 @@ func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotific if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_bundles.go b/rest/numbers/v2/regulatory_compliance_bundles.go index 5fae6493f..d6c415189 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles.go +++ b/rest/numbers/v2/regulatory_compliance_bundles.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Bundle, path := "/v2/RegulatoryCompliance/Bundles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -96,6 +94,7 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Bundle, if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -205,8 +204,6 @@ func (c *ApiService) PageBundle(params *ListBundleParams, pageToken string, page path := "/v2/RegulatoryCompliance/Bundles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -225,6 +222,7 @@ func (c *ApiService) PageBundle(params *ListBundleParams, pageToken string, page if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -366,8 +364,6 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -380,6 +376,7 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go index b37b85b20..76ec95fe7 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go @@ -92,11 +92,10 @@ func (c *ApiService) PageEvaluation(BundleSid string, params *ListEvaluationPara path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go index d343d69f5..e4d25bb88 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateItemAssignment(BundleSid string, params *CreateItemAs path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageItemAssignment(BundleSid string, params *ListItemAssign path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_end_user_types.go b/rest/numbers/v2/regulatory_compliance_end_user_types.go index d513895d3..841f8bb7e 100644 --- a/rest/numbers/v2/regulatory_compliance_end_user_types.go +++ b/rest/numbers/v2/regulatory_compliance_end_user_types.go @@ -66,11 +66,10 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken st path := "/v2/RegulatoryCompliance/EndUserTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_end_users.go b/rest/numbers/v2/regulatory_compliance_end_users.go index 70ac3e5cb..89731c696 100644 --- a/rest/numbers/v2/regulatory_compliance_end_users.go +++ b/rest/numbers/v2/regulatory_compliance_end_users.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2EndUs path := "/v2/RegulatoryCompliance/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -66,6 +64,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2EndUs if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -145,11 +144,10 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken string, pa path := "/v2/RegulatoryCompliance/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -279,8 +277,6 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -293,6 +289,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_regulations.go b/rest/numbers/v2/regulatory_compliance_regulations.go index ad390b2f9..42297fffb 100644 --- a/rest/numbers/v2/regulatory_compliance_regulations.go +++ b/rest/numbers/v2/regulatory_compliance_regulations.go @@ -84,8 +84,6 @@ func (c *ApiService) PageRegulation(params *ListRegulationParams, pageToken stri path := "/v2/RegulatoryCompliance/Regulations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndUserType != nil { data.Set("EndUserType", *params.EndUserType) } @@ -98,6 +96,7 @@ func (c *ApiService) PageRegulation(params *ListRegulationParams, pageToken stri if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go index 5b79f46bf..1e3b4dcfe 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go @@ -66,11 +66,10 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy path := "/v2/RegulatoryCompliance/SupportingDocumentTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_supporting_documents.go b/rest/numbers/v2/regulatory_compliance_supporting_documents.go index 63a0607ee..1886b5069 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_documents.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_documents.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa path := "/v2/RegulatoryCompliance/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -66,6 +64,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -145,11 +144,10 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams path := "/v2/RegulatoryCompliance/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -279,8 +277,6 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -293,6 +289,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/pricing/v1/messaging_countries.go b/rest/pricing/v1/messaging_countries.go index 4dd375170..05abfc421 100644 --- a/rest/pricing/v1/messaging_countries.go +++ b/rest/pricing/v1/messaging_countries.go @@ -65,11 +65,10 @@ func (c *ApiService) PageMessagingCountry(params *ListMessagingCountryParams, pa path := "/v1/Messaging/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v1/phone_numbers_countries.go b/rest/pricing/v1/phone_numbers_countries.go index 80f582989..fda190c47 100644 --- a/rest/pricing/v1/phone_numbers_countries.go +++ b/rest/pricing/v1/phone_numbers_countries.go @@ -65,11 +65,10 @@ func (c *ApiService) PagePhoneNumberCountry(params *ListPhoneNumberCountryParams path := "/v1/PhoneNumbers/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v1/voice_countries.go b/rest/pricing/v1/voice_countries.go index 1323dab16..3aa8fa3d3 100644 --- a/rest/pricing/v1/voice_countries.go +++ b/rest/pricing/v1/voice_countries.go @@ -65,11 +65,10 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken path := "/v1/Voice/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v2/voice_countries.go b/rest/pricing/v2/voice_countries.go index d6fa7ed18..deff31edd 100644 --- a/rest/pricing/v2/voice_countries.go +++ b/rest/pricing/v2/voice_countries.go @@ -66,11 +66,10 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken path := "/v2/Voice/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v2/voice_numbers.go b/rest/pricing/v2/voice_numbers.go index 79489bb80..3ccb03f29 100644 --- a/rest/pricing/v2/voice_numbers.go +++ b/rest/pricing/v2/voice_numbers.go @@ -35,11 +35,10 @@ func (c *ApiService) FetchVoiceNumber(DestinationNumber string, params *FetchVoi path = strings.Replace(path, "{"+"DestinationNumber"+"}", DestinationNumber, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.OriginationNumber != nil { data.Set("OriginationNumber", *params.OriginationNumber) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services.go b/rest/proxy/v1/services.go index 82af491d2..7cae8ad05 100644 --- a/rest/proxy/v1/services.go +++ b/rest/proxy/v1/services.go @@ -79,8 +79,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackUrl != nil { data.Set("CallbackUrl", *params.CallbackUrl) } @@ -105,6 +103,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -184,11 +183,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -354,8 +352,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackUrl != nil { data.Set("CallbackUrl", *params.CallbackUrl) } @@ -380,6 +376,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_phone_numbers.go b/rest/proxy/v1/services_phone_numbers.go index 959167cac..f6b09908c 100644 --- a/rest/proxy/v1/services_phone_numbers.go +++ b/rest/proxy/v1/services_phone_numbers.go @@ -50,8 +50,6 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } @@ -61,6 +59,7 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum if params != nil && params.Sid != nil { data.Set("Sid", *params.Sid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -144,11 +143,10 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -273,11 +271,10 @@ func (c *ApiService) UpdatePhoneNumber(ServiceSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_sessions.go b/rest/proxy/v1/services_sessions.go index 3bd4fdd26..246fb84ca 100644 --- a/rest/proxy/v1/services_sessions.go +++ b/rest/proxy/v1/services_sessions.go @@ -75,8 +75,6 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateExpiry != nil { data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) } @@ -106,6 +104,7 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -189,11 +188,10 @@ func (c *ApiService) PageSession(ServiceSid string, params *ListSessionParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -336,8 +334,6 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateExpiry != nil { data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) } @@ -350,6 +346,7 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_sessions_interactions.go b/rest/proxy/v1/services_sessions_interactions.go index 13a677607..e8a5e8b6f 100644 --- a/rest/proxy/v1/services_sessions_interactions.go +++ b/rest/proxy/v1/services_sessions_interactions.go @@ -91,11 +91,10 @@ func (c *ApiService) PageInteraction(ServiceSid string, SessionSid string, param path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/proxy/v1/services_sessions_participants.go b/rest/proxy/v1/services_sessions_participants.go index bfe3130b1..d7cb71f53 100644 --- a/rest/proxy/v1/services_sessions_participants.go +++ b/rest/proxy/v1/services_sessions_participants.go @@ -63,8 +63,6 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FailOnParticipantConflict != nil { data.Set("FailOnParticipantConflict", fmt.Sprint(*params.FailOnParticipantConflict)) } @@ -80,6 +78,7 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par if params != nil && params.ProxyIdentifierSid != nil { data.Set("ProxyIdentifierSid", *params.ProxyIdentifierSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -166,11 +165,10 @@ func (c *ApiService) PageParticipant(ServiceSid string, SessionSid string, param path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/proxy/v1/services_sessions_participants_message_interactions.go b/rest/proxy/v1/services_sessions_participants_message_interactions.go index c40e81698..3b6fd8baa 100644 --- a/rest/proxy/v1/services_sessions_participants_message_interactions.go +++ b/rest/proxy/v1/services_sessions_participants_message_interactions.go @@ -46,8 +46,6 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Body != nil { data.Set("Body", *params.Body) } @@ -56,6 +54,7 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri data.Add("MediaUrl", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -123,11 +122,10 @@ func (c *ApiService) PageMessageInteraction(ServiceSid string, SessionSid string path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/proxy/v1/services_short_codes.go b/rest/proxy/v1/services_short_codes.go index 9c3d88461..038ed70a5 100644 --- a/rest/proxy/v1/services_short_codes.go +++ b/rest/proxy/v1/services_short_codes.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sid != nil { data.Set("Sid", *params.Sid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -255,11 +253,10 @@ func (c *ApiService) UpdateShortCode(ServiceSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services.go b/rest/serverless/v1/services.go index ccd59876f..4c3402c88 100644 --- a/rest/serverless/v1/services.go +++ b/rest/serverless/v1/services.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -148,11 +147,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -288,8 +286,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -299,6 +295,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se if params != nil && params.UiEditable != nil { data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_assets.go b/rest/serverless/v1/services_assets.go index 19d59ba37..3c9cf8e45 100644 --- a/rest/serverless/v1/services_assets.go +++ b/rest/serverless/v1/services_assets.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateAsset(ServiceSid string, params *CreateAssetParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageAsset(ServiceSid string, params *ListAssetParams, pageT path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -255,11 +253,10 @@ func (c *ApiService) UpdateAsset(ServiceSid string, Sid string, params *UpdateAs path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_assets_versions.go b/rest/serverless/v1/services_assets_versions.go index 15f5d512d..1fe8cf2fa 100644 --- a/rest/serverless/v1/services_assets_versions.go +++ b/rest/serverless/v1/services_assets_versions.go @@ -71,11 +71,10 @@ func (c *ApiService) PageAssetVersion(ServiceSid string, AssetSid string, params path = strings.Replace(path, "{"+"AssetSid"+"}", AssetSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_builds.go b/rest/serverless/v1/services_builds.go index 6215accb2..63f76b044 100644 --- a/rest/serverless/v1/services_builds.go +++ b/rest/serverless/v1/services_builds.go @@ -56,8 +56,6 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssetVersions != nil { for _, item := range *params.AssetVersions { data.Add("AssetVersions", item) @@ -74,6 +72,7 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( if params != nil && params.Runtime != nil { data.Set("Runtime", *params.Runtime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -157,11 +156,10 @@ func (c *ApiService) PageBuild(ServiceSid string, params *ListBuildParams, pageT path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments.go b/rest/serverless/v1/services_environments.go index bfdaf4080..3ef452249 100644 --- a/rest/serverless/v1/services_environments.go +++ b/rest/serverless/v1/services_environments.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateEnvironment(ServiceSid string, params *CreateEnvironm path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DomainSuffix != nil { data.Set("DomainSuffix", *params.DomainSuffix) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -135,11 +134,10 @@ func (c *ApiService) PageEnvironment(ServiceSid string, params *ListEnvironmentP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments_deployments.go b/rest/serverless/v1/services_environments_deployments.go index d74fb7ec9..17f6abe4e 100644 --- a/rest/serverless/v1/services_environments_deployments.go +++ b/rest/serverless/v1/services_environments_deployments.go @@ -39,11 +39,10 @@ func (c *ApiService) CreateDeployment(ServiceSid string, EnvironmentSid string, path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BuildSid != nil { data.Set("BuildSid", *params.BuildSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -110,11 +109,10 @@ func (c *ApiService) PageDeployment(ServiceSid string, EnvironmentSid string, pa path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments_logs.go b/rest/serverless/v1/services_environments_logs.go index 2d7490e93..bcfafb412 100644 --- a/rest/serverless/v1/services_environments_logs.go +++ b/rest/serverless/v1/services_environments_logs.go @@ -90,8 +90,6 @@ func (c *ApiService) PageLog(ServiceSid string, EnvironmentSid string, params *L path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FunctionSid != nil { data.Set("FunctionSid", *params.FunctionSid) } @@ -104,6 +102,7 @@ func (c *ApiService) PageLog(ServiceSid string, EnvironmentSid string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments_variables.go b/rest/serverless/v1/services_environments_variables.go index 6dd2a0622..dab9ed9eb 100644 --- a/rest/serverless/v1/services_environments_variables.go +++ b/rest/serverless/v1/services_environments_variables.go @@ -45,14 +45,13 @@ func (c *ApiService) CreateVariable(ServiceSid string, EnvironmentSid string, pa path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Key != nil { data.Set("Key", *params.Key) } if params != nil && params.Value != nil { data.Set("Value", *params.Value) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -139,11 +138,10 @@ func (c *ApiService) PageVariable(ServiceSid string, EnvironmentSid string, para path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -275,14 +273,13 @@ func (c *ApiService) UpdateVariable(ServiceSid string, EnvironmentSid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Key != nil { data.Set("Key", *params.Key) } if params != nil && params.Value != nil { data.Set("Value", *params.Value) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_functions.go b/rest/serverless/v1/services_functions.go index 3d81a4da5..b61c2673c 100644 --- a/rest/serverless/v1/services_functions.go +++ b/rest/serverless/v1/services_functions.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateFunction(ServiceSid string, params *CreateFunctionPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageFunction(ServiceSid string, params *ListFunctionParams, path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -255,11 +253,10 @@ func (c *ApiService) UpdateFunction(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_functions_versions.go b/rest/serverless/v1/services_functions_versions.go index 57ad840e0..0a95db0e3 100644 --- a/rest/serverless/v1/services_functions_versions.go +++ b/rest/serverless/v1/services_functions_versions.go @@ -71,11 +71,10 @@ func (c *ApiService) PageFunctionVersion(ServiceSid string, FunctionSid string, path = strings.Replace(path, "{"+"FunctionSid"+"}", FunctionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows.go b/rest/studio/v1/flows.go index 26dccb18e..a1c7a1366 100644 --- a/rest/studio/v1/flows.go +++ b/rest/studio/v1/flows.go @@ -84,11 +84,10 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken string, pageNumb path := "/v1/Flows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_engagements.go b/rest/studio/v1/flows_engagements.go index dd4e48046..f90c0077e 100644 --- a/rest/studio/v1/flows_engagements.go +++ b/rest/studio/v1/flows_engagements.go @@ -50,8 +50,6 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -150,11 +149,10 @@ func (c *ApiService) PageEngagement(FlowSid string, params *ListEngagementParams path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_engagements_steps.go b/rest/studio/v1/flows_engagements_steps.go index d5877398f..514aadba2 100644 --- a/rest/studio/v1/flows_engagements_steps.go +++ b/rest/studio/v1/flows_engagements_steps.go @@ -71,11 +71,10 @@ func (c *ApiService) PageStep(FlowSid string, EngagementSid string, params *List path = strings.Replace(path, "{"+"EngagementSid"+"}", EngagementSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_executions.go b/rest/studio/v1/flows_executions.go index 7242ebeb5..02c6a5b4b 100644 --- a/rest/studio/v1/flows_executions.go +++ b/rest/studio/v1/flows_executions.go @@ -51,8 +51,6 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -68,6 +66,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,8 +162,6 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreatedFrom != nil { data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) } @@ -174,6 +171,7 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -298,11 +296,10 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v1/flows_executions_steps.go b/rest/studio/v1/flows_executions_steps.go index ac551b396..fc0958260 100644 --- a/rest/studio/v1/flows_executions_steps.go +++ b/rest/studio/v1/flows_executions_steps.go @@ -71,11 +71,10 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v2/flows.go b/rest/studio/v2/flows.go index 9e9817960..01ff12a2c 100644 --- a/rest/studio/v2/flows.go +++ b/rest/studio/v2/flows.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) path := "/v2/Flows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommitMessage != nil { data.Set("CommitMessage", *params.CommitMessage) } @@ -75,6 +73,7 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -154,11 +153,10 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken string, pageNumb path := "/v2/Flows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -300,8 +298,6 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommitMessage != nil { data.Set("CommitMessage", *params.CommitMessage) } @@ -320,6 +316,7 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_executions.go b/rest/studio/v2/flows_executions.go index d6234f816..92cc5764b 100644 --- a/rest/studio/v2/flows_executions.go +++ b/rest/studio/v2/flows_executions.go @@ -51,8 +51,6 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -68,6 +66,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,8 +162,6 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreatedFrom != nil { data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) } @@ -174,6 +171,7 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -298,11 +296,10 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_executions_steps.go b/rest/studio/v2/flows_executions_steps.go index 6a033f952..c24ebb66c 100644 --- a/rest/studio/v2/flows_executions_steps.go +++ b/rest/studio/v2/flows_executions_steps.go @@ -71,11 +71,10 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v2/flows_revisions.go b/rest/studio/v2/flows_revisions.go index 0e4dee9f1..9e4529cd9 100644 --- a/rest/studio/v2/flows_revisions.go +++ b/rest/studio/v2/flows_revisions.go @@ -69,11 +69,10 @@ func (c *ApiService) PageFlowRevision(Sid string, params *ListFlowRevisionParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v2/flows_test_users.go b/rest/studio/v2/flows_test_users.go index 07e4e176b..6dc4e7ed4 100644 --- a/rest/studio/v2/flows_test_users.go +++ b/rest/studio/v2/flows_test_users.go @@ -58,13 +58,12 @@ func (c *ApiService) UpdateTestUser(Sid string, params *UpdateTestUserParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TestUsers != nil { for _, item := range *params.TestUsers { data.Add("TestUsers", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_validate.go b/rest/studio/v2/flows_validate.go index 12d4459b8..5631db79d 100644 --- a/rest/studio/v2/flows_validate.go +++ b/rest/studio/v2/flows_validate.go @@ -50,8 +50,6 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud path := "/v2/Flows/Validate" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommitMessage != nil { data.Set("CommitMessage", *params.CommitMessage) } @@ -70,6 +68,7 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/commands.go b/rest/supersim/v1/commands.go index c74e2f415..68bf7dd0b 100644 --- a/rest/supersim/v1/commands.go +++ b/rest/supersim/v1/commands.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*SupersimV1Comm path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*SupersimV1Comm if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -148,8 +147,6 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken string, pa path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -162,6 +159,7 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken string, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/fleets.go b/rest/supersim/v1/fleets.go index d1c2b78f9..73997ede4 100644 --- a/rest/supersim/v1/fleets.go +++ b/rest/supersim/v1/fleets.go @@ -91,8 +91,6 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e path := "/v1/Fleets" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommandsEnabled != nil { data.Set("CommandsEnabled", fmt.Sprint(*params.CommandsEnabled)) } @@ -123,6 +121,7 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -190,14 +189,13 @@ func (c *ApiService) PageFleet(params *ListFleetParams, pageToken string, pageNu path := "/v1/Fleets" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.NetworkAccessProfile != nil { data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -351,8 +349,6 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommandsMethod != nil { data.Set("CommandsMethod", *params.CommandsMethod) } @@ -371,6 +367,7 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/network_access_profiles.go b/rest/supersim/v1/network_access_profiles.go index 57ecf9c39..e10fe1842 100644 --- a/rest/supersim/v1/network_access_profiles.go +++ b/rest/supersim/v1/network_access_profiles.go @@ -43,8 +43,6 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi path := "/v1/NetworkAccessProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Networks != nil { for _, item := range *params.Networks { data.Add("Networks", item) @@ -53,6 +51,7 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -114,11 +113,10 @@ func (c *ApiService) PageNetworkAccessProfile(params *ListNetworkAccessProfilePa path := "/v1/NetworkAccessProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -242,11 +240,10 @@ func (c *ApiService) UpdateNetworkAccessProfile(Sid string, params *UpdateNetwor path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/network_access_profiles_networks.go b/rest/supersim/v1/network_access_profiles_networks.go index 98dac05a8..7d2a8160f 100644 --- a/rest/supersim/v1/network_access_profiles_networks.go +++ b/rest/supersim/v1/network_access_profiles_networks.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateNetworkAccessProfileNetwork(NetworkAccessProfileSid s path = strings.Replace(path, "{"+"NetworkAccessProfileSid"+"}", NetworkAccessProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Network != nil { data.Set("Network", *params.Network) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageNetworkAccessProfileNetwork(NetworkAccessProfileSid str path = strings.Replace(path, "{"+"NetworkAccessProfileSid"+"}", NetworkAccessProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/networks.go b/rest/supersim/v1/networks.go index f6a8752e5..2f1a09cbd 100644 --- a/rest/supersim/v1/networks.go +++ b/rest/supersim/v1/networks.go @@ -84,8 +84,6 @@ func (c *ApiService) PageNetwork(params *ListNetworkParams, pageToken string, pa path := "/v1/Networks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsoCountry != nil { data.Set("IsoCountry", *params.IsoCountry) } @@ -98,6 +96,7 @@ func (c *ApiService) PageNetwork(params *ListNetworkParams, pageToken string, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/sims.go b/rest/supersim/v1/sims.go index d82be7739..a55250a23 100644 --- a/rest/supersim/v1/sims.go +++ b/rest/supersim/v1/sims.go @@ -43,14 +43,13 @@ func (c *ApiService) CreateSim(params *CreateSimParams) (*SupersimV1Sim, error) path := "/v1/Sims" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Iccid != nil { data.Set("Iccid", *params.Iccid) } if params != nil && params.RegistrationCode != nil { data.Set("RegistrationCode", *params.RegistrationCode) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -130,8 +129,6 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken string, pageNumber path := "/v1/Sims" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -144,6 +141,7 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken string, pageNumber if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -297,8 +295,6 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -317,6 +313,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/sims_billing_periods.go b/rest/supersim/v1/sims_billing_periods.go index d0d79d7d5..e80ff01b2 100644 --- a/rest/supersim/v1/sims_billing_periods.go +++ b/rest/supersim/v1/sims_billing_periods.go @@ -45,11 +45,10 @@ func (c *ApiService) PageBillingPeriod(SimSid string, params *ListBillingPeriodP path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/sms_commands.go b/rest/supersim/v1/sms_commands.go index 75f099e22..1846621d4 100644 --- a/rest/supersim/v1/sms_commands.go +++ b/rest/supersim/v1/sms_commands.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim path := "/v1/SmsCommands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -148,8 +147,6 @@ func (c *ApiService) PageSmsCommand(params *ListSmsCommandParams, pageToken stri path := "/v1/SmsCommands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -162,6 +159,7 @@ func (c *ApiService) PageSmsCommand(params *ListSmsCommandParams, pageToken stri if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/usage_records.go b/rest/supersim/v1/usage_records.go index 58ab12296..72f336214 100644 --- a/rest/supersim/v1/usage_records.go +++ b/rest/supersim/v1/usage_records.go @@ -91,8 +91,6 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken st path := "/v1/UsageRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -120,6 +118,7 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken st if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/sync/v1/services.go b/rest/sync/v1/services.go index 2404f35a2..74c6cb240 100644 --- a/rest/sync/v1/services.go +++ b/rest/sync/v1/services.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AclEnabled != nil { data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, if params != nil && params.WebhooksFromRestEnabled != nil { data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -335,8 +333,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Sy path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AclEnabled != nil { data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) } @@ -358,6 +354,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Sy if params != nil && params.WebhooksFromRestEnabled != nil { data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_documents.go b/rest/sync/v1/services_documents.go index c737fce46..8cd2ac651 100644 --- a/rest/sync/v1/services_documents.go +++ b/rest/sync/v1/services_documents.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Data != nil { v, err := json.Marshal(params.Data) @@ -66,6 +64,7 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -147,11 +146,10 @@ func (c *ApiService) PageDocument(ServiceSid string, params *ListDocumentParams, path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,8 +285,6 @@ func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Data != nil { v, err := json.Marshal(params.Data) @@ -301,7 +297,7 @@ func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *Updat if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/sync/v1/services_documents_permissions.go b/rest/sync/v1/services_documents_permissions.go index 36c38e770..f348909b3 100644 --- a/rest/sync/v1/services_documents_permissions.go +++ b/rest/sync/v1/services_documents_permissions.go @@ -91,11 +91,10 @@ func (c *ApiService) PageDocumentPermission(ServiceSid string, DocumentSid strin path = strings.Replace(path, "{"+"DocumentSid"+"}", DocumentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -233,8 +232,6 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Manage != nil { data.Set("Manage", fmt.Sprint(*params.Manage)) } @@ -244,6 +241,7 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str if params != nil && params.Write != nil { data.Set("Write", fmt.Sprint(*params.Write)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_lists.go b/rest/sync/v1/services_lists.go index 48c7255b7..886cdf4e2 100644 --- a/rest/sync/v1/services_lists.go +++ b/rest/sync/v1/services_lists.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,11 +140,10 @@ func (c *ApiService) PageSyncList(ServiceSid string, params *ListSyncListParams, path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -275,14 +273,13 @@ func (c *ApiService) UpdateSyncList(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_lists_items.go b/rest/sync/v1/services_lists_items.go index b2c0249e6..f8614b975 100644 --- a/rest/sync/v1/services_lists_items.go +++ b/rest/sync/v1/services_lists_items.go @@ -56,8 +56,6 @@ func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, param path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, param if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -111,7 +110,6 @@ func (c *ApiService) DeleteSyncListItem(ServiceSid string, ListSid string, Index data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -193,8 +191,6 @@ func (c *ApiService) PageSyncListItem(ServiceSid string, ListSid string, params path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } @@ -207,6 +203,7 @@ func (c *ApiService) PageSyncListItem(ServiceSid string, ListSid string, params if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -355,8 +352,6 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index path = strings.Replace(path, "{"+"Index"+"}", fmt.Sprint(Index), -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -375,7 +370,7 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/sync/v1/services_lists_permissions.go b/rest/sync/v1/services_lists_permissions.go index 49ad16ecd..111eb254b 100644 --- a/rest/sync/v1/services_lists_permissions.go +++ b/rest/sync/v1/services_lists_permissions.go @@ -91,11 +91,10 @@ func (c *ApiService) PageSyncListPermission(ServiceSid string, ListSid string, p path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -233,8 +232,6 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Manage != nil { data.Set("Manage", fmt.Sprint(*params.Manage)) } @@ -244,6 +241,7 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, if params != nil && params.Write != nil { data.Set("Write", fmt.Sprint(*params.Write)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_maps.go b/rest/sync/v1/services_maps.go index 1dc22d3e8..894918ff4 100644 --- a/rest/sync/v1/services_maps.go +++ b/rest/sync/v1/services_maps.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,11 +140,10 @@ func (c *ApiService) PageSyncMap(ServiceSid string, params *ListSyncMapParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -275,14 +273,13 @@ func (c *ApiService) UpdateSyncMap(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_maps_items.go b/rest/sync/v1/services_maps_items.go index 9cd0abf4b..81c098186 100644 --- a/rest/sync/v1/services_maps_items.go +++ b/rest/sync/v1/services_maps_items.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -85,6 +83,7 @@ func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -120,7 +119,6 @@ func (c *ApiService) DeleteSyncMapItem(ServiceSid string, MapSid string, Key str data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -202,8 +200,6 @@ func (c *ApiService) PageSyncMapItem(ServiceSid string, MapSid string, params *L path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } @@ -216,6 +212,7 @@ func (c *ApiService) PageSyncMapItem(ServiceSid string, MapSid string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -364,8 +361,6 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -384,7 +379,7 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/sync/v1/services_maps_permissions.go b/rest/sync/v1/services_maps_permissions.go index 13dcb57b6..b889aa634 100644 --- a/rest/sync/v1/services_maps_permissions.go +++ b/rest/sync/v1/services_maps_permissions.go @@ -91,11 +91,10 @@ func (c *ApiService) PageSyncMapPermission(ServiceSid string, MapSid string, par path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -233,8 +232,6 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Manage != nil { data.Set("Manage", fmt.Sprint(*params.Manage)) } @@ -244,6 +241,7 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I if params != nil && params.Write != nil { data.Set("Write", fmt.Sprint(*params.Write)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_streams.go b/rest/sync/v1/services_streams.go index f09bf8ca3..67caca3c0 100644 --- a/rest/sync/v1/services_streams.go +++ b/rest/sync/v1/services_streams.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateSyncStream(ServiceSid string, params *CreateSyncStrea path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -135,11 +134,10 @@ func (c *ApiService) PageSyncStream(ServiceSid string, params *ListSyncStreamPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -264,11 +262,10 @@ func (c *ApiService) UpdateSyncStream(ServiceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_streams_messages.go b/rest/sync/v1/services_streams_messages.go index fa57105ac..978826a64 100644 --- a/rest/sync/v1/services_streams_messages.go +++ b/rest/sync/v1/services_streams_messages.go @@ -36,8 +36,6 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa path = strings.Replace(path, "{"+"StreamSid"+"}", StreamSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Data != nil { v, err := json.Marshal(params.Data) @@ -47,6 +45,7 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa data.Set("Data", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces.go b/rest/taskrouter/v1/workspaces.go index ca1324ba1..ebd2c05ac 100644 --- a/rest/taskrouter/v1/workspaces.go +++ b/rest/taskrouter/v1/workspaces.go @@ -66,8 +66,6 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter path := "/v1/Workspaces" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EventCallbackUrl != nil { data.Set("EventCallbackUrl", *params.EventCallbackUrl) } @@ -86,6 +84,7 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter if params != nil && params.Template != nil { data.Set("Template", *params.Template) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -169,14 +168,13 @@ func (c *ApiService) PageWorkspace(params *ListWorkspaceParams, pageToken string path := "/v1/Workspaces" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -335,8 +333,6 @@ func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DefaultActivitySid != nil { data.Set("DefaultActivitySid", *params.DefaultActivitySid) } @@ -358,6 +354,7 @@ func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) if params != nil && params.TimeoutActivitySid != nil { data.Set("TimeoutActivitySid", *params.TimeoutActivitySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_activities.go b/rest/taskrouter/v1/workspaces_activities.go index ecd4dbc32..fa4a81bf5 100644 --- a/rest/taskrouter/v1/workspaces_activities.go +++ b/rest/taskrouter/v1/workspaces_activities.go @@ -43,14 +43,13 @@ func (c *ApiService) CreateActivity(WorkspaceSid string, params *CreateActivityP path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Available != nil { data.Set("Available", fmt.Sprint(*params.Available)) } if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -144,8 +143,6 @@ func (c *ApiService) PageActivity(WorkspaceSid string, params *ListActivityParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -155,6 +152,7 @@ func (c *ApiService) PageActivity(WorkspaceSid string, params *ListActivityParam if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -278,11 +276,10 @@ func (c *ApiService) UpdateActivity(WorkspaceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_cumulative_statistics.go index 96b175d36..93b914434 100644 --- a/rest/taskrouter/v1/workspaces_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_cumulative_statistics.go @@ -60,8 +60,6 @@ func (c *ApiService) FetchWorkspaceCumulativeStatistics(WorkspaceSid string, par path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -77,6 +75,7 @@ func (c *ApiService) FetchWorkspaceCumulativeStatistics(WorkspaceSid string, par if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_events.go b/rest/taskrouter/v1/workspaces_events.go index 37a128b8b..5e138dd43 100644 --- a/rest/taskrouter/v1/workspaces_events.go +++ b/rest/taskrouter/v1/workspaces_events.go @@ -135,8 +135,6 @@ func (c *ApiService) PageEvent(WorkspaceSid string, params *ListEventParams, pag path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -173,6 +171,7 @@ func (c *ApiService) PageEvent(WorkspaceSid string, params *ListEventParams, pag if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/taskrouter/v1/workspaces_real_time_statistics.go b/rest/taskrouter/v1/workspaces_real_time_statistics.go index ebcc1392f..43d2c9ec7 100644 --- a/rest/taskrouter/v1/workspaces_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_real_time_statistics.go @@ -34,11 +34,10 @@ func (c *ApiService) FetchWorkspaceRealTimeStatistics(WorkspaceSid string, param path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_statistics.go b/rest/taskrouter/v1/workspaces_statistics.go index 397348f9e..dd5a2a342 100644 --- a/rest/taskrouter/v1/workspaces_statistics.go +++ b/rest/taskrouter/v1/workspaces_statistics.go @@ -60,8 +60,6 @@ func (c *ApiService) FetchWorkspaceStatistics(WorkspaceSid string, params *Fetch path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -77,6 +75,7 @@ func (c *ApiService) FetchWorkspaceStatistics(WorkspaceSid string, params *Fetch if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_channels.go b/rest/taskrouter/v1/workspaces_task_channels.go index 4a9432a75..c9de6cc5b 100644 --- a/rest/taskrouter/v1/workspaces_task_channels.go +++ b/rest/taskrouter/v1/workspaces_task_channels.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelOptimizedRouting != nil { data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,11 +140,10 @@ func (c *ApiService) PageTaskChannel(WorkspaceSid string, params *ListTaskChanne path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -275,14 +273,13 @@ func (c *ApiService) UpdateTaskChannel(WorkspaceSid string, Sid string, params * path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelOptimizedRouting != nil { data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) } if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues.go b/rest/taskrouter/v1/workspaces_task_queues.go index fa4c6078f..2bc3861bf 100644 --- a/rest/taskrouter/v1/workspaces_task_queues.go +++ b/rest/taskrouter/v1/workspaces_task_queues.go @@ -67,8 +67,6 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentActivitySid != nil { data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) } @@ -87,6 +85,7 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu if params != nil && params.TaskOrder != nil { data.Set("TaskOrder", *params.TaskOrder) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -186,8 +185,6 @@ func (c *ApiService) PageTaskQueue(WorkspaceSid string, params *ListTaskQueuePar path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -200,6 +197,7 @@ func (c *ApiService) PageTaskQueue(WorkspaceSid string, params *ListTaskQueuePar if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -353,8 +351,6 @@ func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentActivitySid != nil { data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) } @@ -373,6 +369,7 @@ func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *Up if params != nil && params.TaskOrder != nil { data.Set("TaskOrder", *params.TaskOrder) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go index 43a72efa7..59e5ae28c 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchTaskQueueCumulativeStatistics(WorkspaceSid string, Tas path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchTaskQueueCumulativeStatistics(WorkspaceSid string, Tas if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { 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 1b8a1823b..608831b35 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go @@ -35,11 +35,10 @@ func (c *ApiService) FetchTaskQueueRealTimeStatistics(WorkspaceSid string, TaskQ path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_statistics.go index 4308e6d0d..bf2fcdd1e 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_statistics.go @@ -63,8 +63,6 @@ func (c *ApiService) FetchTaskQueueStatistics(WorkspaceSid string, TaskQueueSid path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -80,6 +78,7 @@ func (c *ApiService) FetchTaskQueueStatistics(WorkspaceSid string, TaskQueueSid if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -156,8 +155,6 @@ func (c *ApiService) PageTaskQueuesStatistics(WorkspaceSid string, params *ListT path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -179,6 +176,7 @@ func (c *ApiService) PageTaskQueuesStatistics(WorkspaceSid string, params *ListT if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/taskrouter/v1/workspaces_tasks.go b/rest/taskrouter/v1/workspaces_tasks.go index e3c37d018..7021fb3de 100644 --- a/rest/taskrouter/v1/workspaces_tasks.go +++ b/rest/taskrouter/v1/workspaces_tasks.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) ( path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -78,6 +76,7 @@ func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) ( if params != nil && params.WorkflowSid != nil { data.Set("WorkflowSid", *params.WorkflowSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -112,7 +111,6 @@ func (c *ApiService) DeleteTask(WorkspaceSid string, Sid string, params *DeleteT data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -228,8 +226,6 @@ func (c *ApiService) PageTask(WorkspaceSid string, params *ListTaskParams, pageT path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Priority != nil { data.Set("Priority", fmt.Sprint(*params.Priority)) } @@ -262,6 +258,7 @@ func (c *ApiService) PageTask(WorkspaceSid string, params *ListTaskParams, pageT if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -415,8 +412,6 @@ func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateT path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentStatus != nil { data.Set("AssignmentStatus", *params.AssignmentStatus) } @@ -432,7 +427,7 @@ func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateT if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/taskrouter/v1/workspaces_tasks_reservations.go b/rest/taskrouter/v1/workspaces_tasks_reservations.go index 6cae9a7ff..2943a520a 100644 --- a/rest/taskrouter/v1/workspaces_tasks_reservations.go +++ b/rest/taskrouter/v1/workspaces_tasks_reservations.go @@ -76,14 +76,13 @@ func (c *ApiService) PageTaskReservation(WorkspaceSid string, TaskSid string, pa path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ReservationStatus != nil { data.Set("ReservationStatus", *params.ReservationStatus) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -520,8 +519,6 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beep != nil { data.Set("Beep", *params.Beep) } @@ -687,6 +684,7 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, if params != nil && params.WorkerActivitySid != nil { data.Set("WorkerActivitySid", *params.WorkerActivitySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers.go b/rest/taskrouter/v1/workspaces_workers.go index 5890a3b47..70fbd1cff 100644 --- a/rest/taskrouter/v1/workspaces_workers.go +++ b/rest/taskrouter/v1/workspaces_workers.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActivitySid != nil { data.Set("ActivitySid", *params.ActivitySid) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParam if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -183,8 +182,6 @@ func (c *ApiService) PageWorker(WorkspaceSid string, params *ListWorkerParams, p path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActivityName != nil { data.Set("ActivityName", *params.ActivityName) } @@ -209,6 +206,7 @@ func (c *ApiService) PageWorker(WorkspaceSid string, params *ListWorkerParams, p if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -350,8 +348,6 @@ func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActivitySid != nil { data.Set("ActivitySid", *params.ActivitySid) } @@ -364,6 +360,7 @@ func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *Updat if params != nil && params.RejectPendingReservations != nil { data.Set("RejectPendingReservations", fmt.Sprint(*params.RejectPendingReservations)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_channels.go b/rest/taskrouter/v1/workspaces_workers_channels.go index ce9d8efc5..c3cb35496 100644 --- a/rest/taskrouter/v1/workspaces_workers_channels.go +++ b/rest/taskrouter/v1/workspaces_workers_channels.go @@ -70,11 +70,10 @@ func (c *ApiService) PageWorkerChannel(WorkspaceSid string, WorkerSid string, pa path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -205,14 +204,13 @@ func (c *ApiService) UpdateWorkerChannel(WorkspaceSid string, WorkerSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Available != nil { data.Set("Available", fmt.Sprint(*params.Available)) } if params != nil && params.Capacity != nil { data.Set("Capacity", fmt.Sprint(*params.Capacity)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go index 4f10d339a..9fa262b9d 100644 --- a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go @@ -54,8 +54,6 @@ func (c *ApiService) FetchWorkersCumulativeStatistics(WorkspaceSid string, param path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -68,6 +66,7 @@ func (c *ApiService) FetchWorkersCumulativeStatistics(WorkspaceSid string, param if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go index 1f2033eca..a1fe399d1 100644 --- a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go @@ -34,11 +34,10 @@ func (c *ApiService) FetchWorkersRealTimeStatistics(WorkspaceSid string, params path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_reservations.go b/rest/taskrouter/v1/workspaces_workers_reservations.go index 68db9831c..1c87702de 100644 --- a/rest/taskrouter/v1/workspaces_workers_reservations.go +++ b/rest/taskrouter/v1/workspaces_workers_reservations.go @@ -76,14 +76,13 @@ func (c *ApiService) PageWorkerReservation(WorkspaceSid string, WorkerSid string path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ReservationStatus != nil { data.Set("ReservationStatus", *params.ReservationStatus) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -508,8 +507,6 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beep != nil { data.Set("Beep", *params.Beep) } @@ -669,6 +666,7 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri if params != nil && params.WorkerActivitySid != nil { data.Set("WorkerActivitySid", *params.WorkerActivitySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_statistics.go b/rest/taskrouter/v1/workspaces_workers_statistics.go index 2f7b60e4d..a4bccb4ee 100644 --- a/rest/taskrouter/v1/workspaces_workers_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_statistics.go @@ -55,8 +55,6 @@ func (c *ApiService) FetchWorkerInstanceStatistics(WorkspaceSid string, WorkerSi path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -69,6 +67,7 @@ func (c *ApiService) FetchWorkerInstanceStatistics(WorkspaceSid string, WorkerSi if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -137,8 +136,6 @@ func (c *ApiService) FetchWorkerStatistics(WorkspaceSid string, params *FetchWor path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -160,6 +157,7 @@ func (c *ApiService) FetchWorkerStatistics(WorkspaceSid string, params *FetchWor if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows.go b/rest/taskrouter/v1/workspaces_workflows.go index 87377e286..fa6f7b6e6 100644 --- a/rest/taskrouter/v1/workspaces_workflows.go +++ b/rest/taskrouter/v1/workspaces_workflows.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentCallbackUrl != nil { data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) } @@ -78,6 +76,7 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP if params != nil && params.TaskReservationTimeout != nil { data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -165,14 +164,13 @@ func (c *ApiService) PageWorkflow(WorkspaceSid string, params *ListWorkflowParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -326,8 +324,6 @@ func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentCallbackUrl != nil { data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) } @@ -346,6 +342,7 @@ func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *Upd if params != nil && params.TaskReservationTimeout != nil { data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go index cd030abc7..52d8381b9 100644 --- a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchWorkflowCumulativeStatistics(WorkspaceSid string, Work path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchWorkflowCumulativeStatistics(WorkspaceSid string, Work if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go index 50394aadd..637d564ba 100644 --- a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go @@ -35,11 +35,10 @@ func (c *ApiService) FetchWorkflowRealTimeStatistics(WorkspaceSid string, Workfl path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows_statistics.go b/rest/taskrouter/v1/workspaces_workflows_statistics.go index abc65ee66..d1ff269dd 100644 --- a/rest/taskrouter/v1/workspaces_workflows_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchWorkflowStatistics(WorkspaceSid string, WorkflowSid st path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchWorkflowStatistics(WorkspaceSid string, WorkflowSid st if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks.go b/rest/trunking/v1/trunks.go index 7cacd2e28..565dd91bd 100644 --- a/rest/trunking/v1/trunks.go +++ b/rest/trunking/v1/trunks.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e path := "/v1/Trunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e if params != nil && params.TransferMode != nil { data.Set("TransferMode", *params.TransferMode) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -172,11 +171,10 @@ func (c *ApiService) PageTrunk(params *ListTrunkParams, pageToken string, pageNu path := "/v1/Trunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -335,8 +333,6 @@ func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*Trunki path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -358,6 +354,7 @@ func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*Trunki if params != nil && params.TransferMode != nil { data.Set("TransferMode", *params.TransferMode) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_credential_lists.go b/rest/trunking/v1/trunks_credential_lists.go index 0079a9b23..df745b879 100644 --- a/rest/trunking/v1/trunks_credential_lists.go +++ b/rest/trunking/v1/trunks_credential_lists.go @@ -37,11 +37,10 @@ func (c *ApiService) CreateCredentialList(TrunkSid string, params *CreateCredent path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -123,11 +122,10 @@ func (c *ApiService) PageCredentialList(TrunkSid string, params *ListCredentialL path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trunking/v1/trunks_ip_access_control_lists.go b/rest/trunking/v1/trunks_ip_access_control_lists.go index 050c3e4f3..d77220138 100644 --- a/rest/trunking/v1/trunks_ip_access_control_lists.go +++ b/rest/trunking/v1/trunks_ip_access_control_lists.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateIpAccessControlList(TrunkSid string, params *CreateIp path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -125,11 +124,10 @@ func (c *ApiService) PageIpAccessControlList(TrunkSid string, params *ListIpAcce path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trunking/v1/trunks_origination_urls.go b/rest/trunking/v1/trunks_origination_urls.go index 1a486f924..0a55118f5 100644 --- a/rest/trunking/v1/trunks_origination_urls.go +++ b/rest/trunking/v1/trunks_origination_urls.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -78,6 +76,7 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -159,11 +158,10 @@ func (c *ApiService) PageOriginationUrl(TrunkSid string, params *ListOrigination path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -311,8 +309,6 @@ func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -328,6 +324,7 @@ func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *U if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_phone_numbers.go b/rest/trunking/v1/trunks_phone_numbers.go index 00d1072fc..208e54f24 100644 --- a/rest/trunking/v1/trunks_phone_numbers.go +++ b/rest/trunking/v1/trunks_phone_numbers.go @@ -37,11 +37,10 @@ func (c *ApiService) CreatePhoneNumber(TrunkSid string, params *CreatePhoneNumbe path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PhoneNumberSid != nil { data.Set("PhoneNumberSid", *params.PhoneNumberSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -123,11 +122,10 @@ func (c *ApiService) PagePhoneNumber(TrunkSid string, params *ListPhoneNumberPar path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trunking/v1/trunks_recording.go b/rest/trunking/v1/trunks_recording.go index 475e748ce..89d2a736e 100644 --- a/rest/trunking/v1/trunks_recording.go +++ b/rest/trunking/v1/trunks_recording.go @@ -62,14 +62,13 @@ func (c *ApiService) UpdateRecording(TrunkSid string, params *UpdateRecordingPar path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Mode != nil { data.Set("Mode", *params.Mode) } if params != nil && params.Trim != nil { data.Set("Trim", *params.Trim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/customer_profiles.go b/rest/trusthub/v1/customer_profiles.go index 3c3d1833a..869afc572 100644 --- a/rest/trusthub/v1/customer_profiles.go +++ b/rest/trusthub/v1/customer_profiles.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) path := "/v1/CustomerProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -166,8 +165,6 @@ func (c *ApiService) PageCustomerProfile(params *ListCustomerProfileParams, page path := "/v1/CustomerProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -180,6 +177,7 @@ func (c *ApiService) PageCustomerProfile(params *ListCustomerProfileParams, page if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -321,8 +319,6 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -335,6 +331,7 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go index 70c7b936b..63cb37329 100644 --- a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateCustomerProfileChannelEndpointAssignment(CustomerProf path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } if params != nil && params.ChannelEndpointType != nil { data.Set("ChannelEndpointType", *params.ChannelEndpointType) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -147,8 +146,6 @@ func (c *ApiService) PageCustomerProfileChannelEndpointAssignment(CustomerProfil path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } @@ -158,6 +155,7 @@ func (c *ApiService) PageCustomerProfileChannelEndpointAssignment(CustomerProfil if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/customer_profiles_entity_assignments.go b/rest/trusthub/v1/customer_profiles_entity_assignments.go index c7b4a08c6..f663589b9 100644 --- a/rest/trusthub/v1/customer_profiles_entity_assignments.go +++ b/rest/trusthub/v1/customer_profiles_entity_assignments.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateCustomerProfileEntityAssignment(CustomerProfileSid st path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageCustomerProfileEntityAssignment(CustomerProfileSid stri path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/customer_profiles_evaluations.go b/rest/trusthub/v1/customer_profiles_evaluations.go index e06ece8b9..8a9cf17ed 100644 --- a/rest/trusthub/v1/customer_profiles_evaluations.go +++ b/rest/trusthub/v1/customer_profiles_evaluations.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateCustomerProfileEvaluation(CustomerProfileSid string, path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PolicySid != nil { data.Set("PolicySid", *params.PolicySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -107,11 +106,10 @@ func (c *ApiService) PageCustomerProfileEvaluation(CustomerProfileSid string, pa path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/end_user_types.go b/rest/trusthub/v1/end_user_types.go index a9f39ee83..10b3f6e4b 100644 --- a/rest/trusthub/v1/end_user_types.go +++ b/rest/trusthub/v1/end_user_types.go @@ -66,11 +66,10 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken st path := "/v1/EndUserTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/end_users.go b/rest/trusthub/v1/end_users.go index 928470b19..c389c5094 100644 --- a/rest/trusthub/v1/end_users.go +++ b/rest/trusthub/v1/end_users.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU path := "/v1/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -66,6 +64,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -145,11 +144,10 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken string, pa path := "/v1/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -279,8 +277,6 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -293,6 +289,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/policies.go b/rest/trusthub/v1/policies.go index 40bda9c60..ed9d4717c 100644 --- a/rest/trusthub/v1/policies.go +++ b/rest/trusthub/v1/policies.go @@ -66,11 +66,10 @@ func (c *ApiService) PagePolicies(params *ListPoliciesParams, pageToken string, path := "/v1/Policies" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/supporting_document_types.go b/rest/trusthub/v1/supporting_document_types.go index d219a78d2..953db2655 100644 --- a/rest/trusthub/v1/supporting_document_types.go +++ b/rest/trusthub/v1/supporting_document_types.go @@ -66,11 +66,10 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy path := "/v1/SupportingDocumentTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/supporting_documents.go b/rest/trusthub/v1/supporting_documents.go index 871ac08df..1638f0843 100644 --- a/rest/trusthub/v1/supporting_documents.go +++ b/rest/trusthub/v1/supporting_documents.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa path := "/v1/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -66,6 +64,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -145,11 +144,10 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams path := "/v1/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -279,8 +277,6 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -293,6 +289,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/trust_products.go b/rest/trusthub/v1/trust_products.go index b3e165c6e..85d4cbc07 100644 --- a/rest/trusthub/v1/trust_products.go +++ b/rest/trusthub/v1/trust_products.go @@ -55,8 +55,6 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus path := "/v1/TrustProducts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -69,6 +67,7 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -166,8 +165,6 @@ func (c *ApiService) PageTrustProduct(params *ListTrustProductParams, pageToken path := "/v1/TrustProducts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -180,6 +177,7 @@ func (c *ApiService) PageTrustProduct(params *ListTrustProductParams, pageToken if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -321,8 +319,6 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -335,6 +331,7 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go index 113a00d54..aea638aff 100644 --- a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateTrustProductChannelEndpointAssignment(TrustProductSid path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } if params != nil && params.ChannelEndpointType != nil { data.Set("ChannelEndpointType", *params.ChannelEndpointType) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -147,8 +146,6 @@ func (c *ApiService) PageTrustProductChannelEndpointAssignment(TrustProductSid s path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } @@ -158,6 +155,7 @@ func (c *ApiService) PageTrustProductChannelEndpointAssignment(TrustProductSid s if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/trust_products_entity_assignments.go b/rest/trusthub/v1/trust_products_entity_assignments.go index 4b73a752d..95440b7e2 100644 --- a/rest/trusthub/v1/trust_products_entity_assignments.go +++ b/rest/trusthub/v1/trust_products_entity_assignments.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateTrustProductEntityAssignment(TrustProductSid string, path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageTrustProductEntityAssignment(TrustProductSid string, pa path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/trust_products_evaluations.go b/rest/trusthub/v1/trust_products_evaluations.go index a5bf3d622..e77a196c3 100644 --- a/rest/trusthub/v1/trust_products_evaluations.go +++ b/rest/trusthub/v1/trust_products_evaluations.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateTrustProductEvaluation(TrustProductSid string, params path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PolicySid != nil { data.Set("PolicySid", *params.PolicySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -107,11 +106,10 @@ func (c *ApiService) PageTrustProductEvaluation(TrustProductSid string, params * path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/verify/v2/attempts.go b/rest/verify/v2/attempts.go index 93d761508..742db160b 100644 --- a/rest/verify/v2/attempts.go +++ b/rest/verify/v2/attempts.go @@ -85,8 +85,6 @@ func (c *ApiService) PageVerificationAttempt(params *ListVerificationAttemptPara path := "/v2/Attempts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreatedAfter != nil { data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } @@ -99,6 +97,7 @@ func (c *ApiService) PageVerificationAttempt(params *ListVerificationAttemptPara if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/verify/v2/services.go b/rest/verify/v2/services.go index 31374b206..9fc77b0a1 100644 --- a/rest/verify/v2/services.go +++ b/rest/verify/v2/services.go @@ -127,8 +127,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CodeLength != nil { data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) } @@ -177,6 +175,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic if params != nil && params.TtsName != nil { data.Set("TtsName", *params.TtsName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -256,11 +255,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken string, pa path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -474,8 +472,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CodeLength != nil { data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) } @@ -524,6 +520,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve if params != nil && params.TtsName != nil { data.Set("TtsName", *params.TtsName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_access_tokens.go b/rest/verify/v2/services_access_tokens.go index 41a67ca91..cacbe95c4 100644 --- a/rest/verify/v2/services_access_tokens.go +++ b/rest/verify/v2/services_access_tokens.go @@ -41,14 +41,13 @@ func (c *ApiService) CreateAccessToken(ServiceSid string, params *CreateAccessTo path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FactorType != nil { data.Set("FactorType", *params.FactorType) } if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities.go b/rest/verify/v2/services_entities.go index fe41a5125..4c54ce985 100644 --- a/rest/verify/v2/services_entities.go +++ b/rest/verify/v2/services_entities.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateEntity(ServiceSid string, params *CreateEntityParams) path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) PageEntity(ServiceSid string, params *ListEntityParams, pag path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/verify/v2/services_entities_challenges.go b/rest/verify/v2/services_entities_challenges.go index c0a9c2b65..16042c9ef 100644 --- a/rest/verify/v2/services_entities_challenges.go +++ b/rest/verify/v2/services_entities_challenges.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthPayload != nil { data.Set("AuthPayload", *params.AuthPayload) } @@ -104,6 +102,7 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params data.Set("HiddenDetails", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -182,8 +181,6 @@ func (c *ApiService) PageChallenge(ServiceSid string, Identity string, params *L path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FactorSid != nil { data.Set("FactorSid", *params.FactorSid) } @@ -193,6 +190,7 @@ func (c *ApiService) PageChallenge(ServiceSid string, Identity string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -318,11 +316,10 @@ func (c *ApiService) UpdateChallenge(ServiceSid string, Identity string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthPayload != nil { data.Set("AuthPayload", *params.AuthPayload) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities_challenges_notifications.go b/rest/verify/v2/services_entities_challenges_notifications.go index 90dc0d3f2..1e27aff96 100644 --- a/rest/verify/v2/services_entities_challenges_notifications.go +++ b/rest/verify/v2/services_entities_challenges_notifications.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateNotification(ServiceSid string, Identity string, Chal path = strings.Replace(path, "{"+"ChallengeSid"+"}", ChallengeSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities_factors.go b/rest/verify/v2/services_entities_factors.go index 853afc03e..e0767424a 100644 --- a/rest/verify/v2/services_entities_factors.go +++ b/rest/verify/v2/services_entities_factors.go @@ -111,8 +111,6 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingAlg != nil { data.Set("Binding.Alg", *params.BindingAlg) } @@ -152,6 +150,7 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -238,11 +237,10 @@ func (c *ApiService) PageFactor(ServiceSid string, Identity string, params *List path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -410,8 +408,6 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthPayload != nil { data.Set("AuthPayload", *params.AuthPayload) } @@ -436,6 +432,7 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_messaging_configurations.go b/rest/verify/v2/services_messaging_configurations.go index 67ed0de72..4d7ebc953 100644 --- a/rest/verify/v2/services_messaging_configurations.go +++ b/rest/verify/v2/services_messaging_configurations.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateMessagingConfiguration(ServiceSid string, params *Cre path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Country != nil { data.Set("Country", *params.Country) } if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -135,11 +134,10 @@ func (c *ApiService) PageMessagingConfiguration(ServiceSid string, params *ListM path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -264,11 +262,10 @@ func (c *ApiService) UpdateMessagingConfiguration(ServiceSid string, Country str path = strings.Replace(path, "{"+"Country"+"}", Country, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_rate_limits.go b/rest/verify/v2/services_rate_limits.go index fa25b0d74..2221331e3 100644 --- a/rest/verify/v2/services_rate_limits.go +++ b/rest/verify/v2/services_rate_limits.go @@ -44,14 +44,13 @@ func (c *ApiService) CreateRateLimit(ServiceSid string, params *CreateRateLimitP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -135,11 +134,10 @@ func (c *ApiService) PageRateLimit(ServiceSid string, params *ListRateLimitParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -264,11 +262,10 @@ func (c *ApiService) UpdateRateLimit(ServiceSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_rate_limits_buckets.go b/rest/verify/v2/services_rate_limits_buckets.go index c8003de5a..b220ca405 100644 --- a/rest/verify/v2/services_rate_limits_buckets.go +++ b/rest/verify/v2/services_rate_limits_buckets.go @@ -45,14 +45,13 @@ func (c *ApiService) CreateBucket(ServiceSid string, RateLimitSid string, params path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Interval != nil { data.Set("Interval", fmt.Sprint(*params.Interval)) } if params != nil && params.Max != nil { data.Set("Max", fmt.Sprint(*params.Max)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -139,11 +138,10 @@ func (c *ApiService) PageBucket(ServiceSid string, RateLimitSid string, params * path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -275,14 +273,13 @@ func (c *ApiService) UpdateBucket(ServiceSid string, RateLimitSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Interval != nil { data.Set("Interval", fmt.Sprint(*params.Interval)) } if params != nil && params.Max != nil { data.Set("Max", fmt.Sprint(*params.Max)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_verification_check.go b/rest/verify/v2/services_verification_check.go index b4edbf188..f8483e150 100644 --- a/rest/verify/v2/services_verification_check.go +++ b/rest/verify/v2/services_verification_check.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Amount != nil { data.Set("Amount", *params.Amount) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe if params != nil && params.VerificationSid != nil { data.Set("VerificationSid", *params.VerificationSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_verifications.go b/rest/verify/v2/services_verifications.go index e956231a3..abfbae3ec 100644 --- a/rest/verify/v2/services_verifications.go +++ b/rest/verify/v2/services_verifications.go @@ -107,8 +107,6 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Amount != nil { data.Set("Amount", *params.Amount) } @@ -160,6 +158,7 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -218,11 +217,10 @@ func (c *ApiService) UpdateVerification(ServiceSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_webhooks.go b/rest/verify/v2/services_webhooks.go index c5a291def..d92ce0f18 100644 --- a/rest/verify/v2/services_webhooks.go +++ b/rest/verify/v2/services_webhooks.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EventTypes != nil { for _, item := range *params.EventTypes { data.Add("EventTypes", item) @@ -81,6 +79,7 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -164,11 +163,10 @@ func (c *ApiService) PageWebhook(ServiceSid string, params *ListWebhookParams, p path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -316,8 +314,6 @@ func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EventTypes != nil { for _, item := range *params.EventTypes { data.Add("EventTypes", item) @@ -335,6 +331,7 @@ func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *Update if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/composition_hooks.go b/rest/video/v1/composition_hooks.go index ea59b4235..d097dab3d 100644 --- a/rest/video/v1/composition_hooks.go +++ b/rest/video/v1/composition_hooks.go @@ -91,8 +91,6 @@ func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) path := "/v1/CompositionHooks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AudioSources != nil { for _, item := range *params.AudioSources { data.Add("AudioSources", item) @@ -133,6 +131,7 @@ func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) data.Set("VideoLayout", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -236,8 +235,6 @@ func (c *ApiService) PageCompositionHook(params *ListCompositionHookParams, page path := "/v1/CompositionHooks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -253,6 +250,7 @@ func (c *ApiService) PageCompositionHook(params *ListCompositionHookParams, page if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -429,8 +427,6 @@ func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateComposition path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AudioSources != nil { for _, item := range *params.AudioSources { data.Add("AudioSources", item) @@ -471,6 +467,7 @@ func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateComposition data.Set("VideoLayout", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/composition_settings_default.go b/rest/video/v1/composition_settings_default.go index c6ad2d50d..2637692dd 100644 --- a/rest/video/v1/composition_settings_default.go +++ b/rest/video/v1/composition_settings_default.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings path := "/v1/CompositionSettings/Default" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AwsCredentialsSid != nil { data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) } @@ -82,6 +80,7 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/compositions.go b/rest/video/v1/compositions.go index b254e94c8..afb9b401e 100644 --- a/rest/video/v1/compositions.go +++ b/rest/video/v1/compositions.go @@ -85,8 +85,6 @@ func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV path := "/v1/Compositions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AudioSources != nil { for _, item := range *params.AudioSources { data.Add("AudioSources", item) @@ -124,6 +122,7 @@ func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV data.Set("VideoLayout", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -227,8 +226,6 @@ func (c *ApiService) PageComposition(params *ListCompositionParams, pageToken st path := "/v1/Compositions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -244,6 +241,7 @@ func (c *ApiService) PageComposition(params *ListCompositionParams, pageToken st if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/recording_settings_default.go b/rest/video/v1/recording_settings_default.go index d4e458b7f..e91e9b7b0 100644 --- a/rest/video/v1/recording_settings_default.go +++ b/rest/video/v1/recording_settings_default.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara path := "/v1/RecordingSettings/Default" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AwsCredentialsSid != nil { data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) } @@ -82,6 +80,7 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/recordings.go b/rest/video/v1/recordings.go index 68d36dbb1..30c380618 100644 --- a/rest/video/v1/recordings.go +++ b/rest/video/v1/recordings.go @@ -121,8 +121,6 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken string path := "/v1/Recordings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -146,6 +144,7 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken string if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/rooms.go b/rest/video/v1/rooms.go index 4fff3e0b5..1d8c50025 100644 --- a/rest/video/v1/rooms.go +++ b/rest/video/v1/rooms.go @@ -91,8 +91,6 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) path := "/v1/Rooms" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EnableTurn != nil { data.Set("EnableTurn", fmt.Sprint(*params.EnableTurn)) } @@ -131,6 +129,7 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) data.Add("VideoCodecs", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -215,8 +214,6 @@ func (c *ApiService) PageRoom(params *ListRoomParams, pageToken string, pageNumb path := "/v1/Rooms" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -232,6 +229,7 @@ func (c *ApiService) PageRoom(params *ListRoomParams, pageToken string, pageNumb if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -354,11 +352,10 @@ func (c *ApiService) UpdateRoom(Sid string, params *UpdateRoomParams) (*VideoV1R path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants.go b/rest/video/v1/rooms_participants.go index 254208ba1..a17329741 100644 --- a/rest/video/v1/rooms_participants.go +++ b/rest/video/v1/rooms_participants.go @@ -93,8 +93,6 @@ func (c *ApiService) PageRoomParticipant(RoomSid string, params *ListRoomPartici path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -110,6 +108,7 @@ func (c *ApiService) PageRoomParticipant(RoomSid string, params *ListRoomPartici if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -233,11 +232,10 @@ func (c *ApiService) UpdateRoomParticipant(RoomSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants_published_tracks.go b/rest/video/v1/rooms_participants_published_tracks.go index 06a63333c..0c08a7293 100644 --- a/rest/video/v1/rooms_participants_published_tracks.go +++ b/rest/video/v1/rooms_participants_published_tracks.go @@ -71,11 +71,10 @@ func (c *ApiService) PageRoomParticipantPublishedTrack(RoomSid string, Participa path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/rooms_participants_subscribe_rules.go b/rest/video/v1/rooms_participants_subscribe_rules.go index 76fe09127..0f5f0e8bd 100644 --- a/rest/video/v1/rooms_participants_subscribe_rules.go +++ b/rest/video/v1/rooms_participants_subscribe_rules.go @@ -60,8 +60,6 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Rules != nil { v, err := json.Marshal(params.Rules) @@ -71,6 +69,7 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip data.Set("Rules", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants_subscribed_tracks.go b/rest/video/v1/rooms_participants_subscribed_tracks.go index 960483a9a..1b5ac1099 100644 --- a/rest/video/v1/rooms_participants_subscribed_tracks.go +++ b/rest/video/v1/rooms_participants_subscribed_tracks.go @@ -71,11 +71,10 @@ func (c *ApiService) PageRoomParticipantSubscribedTrack(RoomSid string, Particip path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/rooms_recording_rules.go b/rest/video/v1/rooms_recording_rules.go index c685d3fce..d232d3b3d 100644 --- a/rest/video/v1/rooms_recording_rules.go +++ b/rest/video/v1/rooms_recording_rules.go @@ -58,8 +58,6 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Rules != nil { v, err := json.Marshal(params.Rules) @@ -69,6 +67,7 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR data.Set("Rules", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_recordings.go b/rest/video/v1/rooms_recordings.go index d7f496ef4..be0c78b7a 100644 --- a/rest/video/v1/rooms_recordings.go +++ b/rest/video/v1/rooms_recordings.go @@ -111,8 +111,6 @@ func (c *ApiService) PageRoomRecording(RoomSid string, params *ListRoomRecording path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -128,6 +126,7 @@ func (c *ApiService) PageRoomRecording(RoomSid string, params *ListRoomRecording if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/voice/v1/byoc_trunks.go b/rest/voice/v1/byoc_trunks.go index 0f0fbdbc9..cc6d709e7 100644 --- a/rest/voice/v1/byoc_trunks.go +++ b/rest/voice/v1/byoc_trunks.go @@ -90,8 +90,6 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo path := "/v1/ByocTrunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -122,6 +120,7 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -199,11 +198,10 @@ func (c *ApiService) PageByocTrunk(params *ListByocTrunkParams, pageToken string path := "/v1/ByocTrunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -380,8 +378,6 @@ func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -412,6 +408,7 @@ func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/connection_policies.go b/rest/voice/v1/connection_policies.go index 093155412..1fe11dc07 100644 --- a/rest/voice/v1/connection_policies.go +++ b/rest/voice/v1/connection_policies.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateConnectionPolicy(params *CreateConnectionPolicyParams path := "/v1/ConnectionPolicies" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,11 +117,10 @@ func (c *ApiService) PageConnectionPolicy(params *ListConnectionPolicyParams, pa path := "/v1/ConnectionPolicies" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -245,11 +243,10 @@ func (c *ApiService) UpdateConnectionPolicy(Sid string, params *UpdateConnection path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/connection_policies_targets.go b/rest/voice/v1/connection_policies_targets.go index d9cc389da..06688db5e 100644 --- a/rest/voice/v1/connection_policies_targets.go +++ b/rest/voice/v1/connection_policies_targets.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -78,6 +76,7 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -159,11 +158,10 @@ func (c *ApiService) PageConnectionPolicyTarget(ConnectionPolicySid string, para path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -311,8 +309,6 @@ func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -328,6 +324,7 @@ func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Si if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/dialing_permissions_bulk_country_updates.go b/rest/voice/v1/dialing_permissions_bulk_country_updates.go index eee6fdccc..e10f9ba33 100644 --- a/rest/voice/v1/dialing_permissions_bulk_country_updates.go +++ b/rest/voice/v1/dialing_permissions_bulk_country_updates.go @@ -32,11 +32,10 @@ func (c *ApiService) CreateDialingPermissionsCountryBulkUpdate(params *CreateDia path := "/v1/DialingPermissions/BulkCountryUpdates" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UpdateRequest != nil { data.Set("UpdateRequest", *params.UpdateRequest) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/dialing_permissions_countries.go b/rest/voice/v1/dialing_permissions_countries.go index a1bc361a9..3d3a0d646 100644 --- a/rest/voice/v1/dialing_permissions_countries.go +++ b/rest/voice/v1/dialing_permissions_countries.go @@ -102,8 +102,6 @@ func (c *ApiService) PageDialingPermissionsCountry(params *ListDialingPermission path := "/v1/DialingPermissions/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsoCode != nil { data.Set("IsoCode", *params.IsoCode) } @@ -125,6 +123,7 @@ func (c *ApiService) PageDialingPermissionsCountry(params *ListDialingPermission if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) 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 9b6765b6a..f32a0e4ba 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 @@ -45,11 +45,10 @@ func (c *ApiService) PageDialingPermissionsHrsPrefixes(IsoCode string, params *L path = strings.Replace(path, "{"+"IsoCode"+"}", IsoCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/voice/v1/ip_records.go b/rest/voice/v1/ip_records.go index c32fea33a..3b7cb9bfd 100644 --- a/rest/voice/v1/ip_records.go +++ b/rest/voice/v1/ip_records.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec path := "/v1/IpRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CidrPrefixLength != nil { data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } @@ -59,6 +57,7 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec if params != nil && params.IpAddress != nil { data.Set("IpAddress", *params.IpAddress) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -136,11 +135,10 @@ func (c *ApiService) PageIpRecord(params *ListIpRecordParams, pageToken string, path := "/v1/IpRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -263,11 +261,10 @@ func (c *ApiService) UpdateIpRecord(Sid string, params *UpdateIpRecordParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/settings.go b/rest/voice/v1/settings.go index 5b6e7ea82..3eb13769e 100644 --- a/rest/voice/v1/settings.go +++ b/rest/voice/v1/settings.go @@ -55,11 +55,10 @@ func (c *ApiService) UpdateDialingPermissionsSettings(params *UpdateDialingPermi path := "/v1/Settings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DialingPermissionsInheritance != nil { data.Set("DialingPermissionsInheritance", fmt.Sprint(*params.DialingPermissionsInheritance)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/source_ip_mappings.go b/rest/voice/v1/source_ip_mappings.go index a8027a08d..714c98137 100644 --- a/rest/voice/v1/source_ip_mappings.go +++ b/rest/voice/v1/source_ip_mappings.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateSourceIpMapping(params *CreateSourceIpMappingParams) path := "/v1/SourceIpMappings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpRecordSid != nil { data.Set("IpRecordSid", *params.IpRecordSid) } if params != nil && params.SipDomainSid != nil { data.Set("SipDomainSid", *params.SipDomainSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -127,11 +126,10 @@ func (c *ApiService) PageSourceIpMapping(params *ListSourceIpMappingParams, page path := "/v1/SourceIpMappings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -254,11 +252,10 @@ func (c *ApiService) UpdateSourceIpMapping(Sid string, params *UpdateSourceIpMap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SipDomainSid != nil { data.Set("SipDomainSid", *params.SipDomainSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/commands.go b/rest/wireless/v1/commands.go index 5ab7253c0..73b6641be 100644 --- a/rest/wireless/v1/commands.go +++ b/rest/wireless/v1/commands.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -96,6 +94,7 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -199,8 +198,6 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken string, pa path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -216,6 +213,7 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken string, pa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/wireless/v1/rate_plans.go b/rest/wireless/v1/rate_plans.go index a28e3a2ca..db91aba85 100644 --- a/rest/wireless/v1/rate_plans.go +++ b/rest/wireless/v1/rate_plans.go @@ -96,8 +96,6 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra path := "/v1/RatePlans" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DataEnabled != nil { data.Set("DataEnabled", fmt.Sprint(*params.DataEnabled)) } @@ -133,6 +131,7 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra if params != nil && params.VoiceEnabled != nil { data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -210,11 +209,10 @@ func (c *ApiService) PageRatePlan(params *ListRatePlanParams, pageToken string, path := "/v1/RatePlans" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -343,14 +341,13 @@ func (c *ApiService) UpdateRatePlan(Sid string, params *UpdateRatePlanParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/sims.go b/rest/wireless/v1/sims.go index 9c1013d38..e4623d35e 100644 --- a/rest/wireless/v1/sims.go +++ b/rest/wireless/v1/sims.go @@ -114,8 +114,6 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken string, pageNumber path := "/v1/Sims" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -134,6 +132,7 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken string, pageNumber if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) @@ -359,8 +358,6 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -415,6 +412,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/sims_data_sessions.go b/rest/wireless/v1/sims_data_sessions.go index e036835a3..9d1bcaa9b 100644 --- a/rest/wireless/v1/sims_data_sessions.go +++ b/rest/wireless/v1/sims_data_sessions.go @@ -45,11 +45,10 @@ func (c *ApiService) PageDataSession(SimSid string, params *ListDataSessionParam path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/wireless/v1/sims_usage_records.go b/rest/wireless/v1/sims_usage_records.go index cc3a6a114..2b4a37c0e 100644 --- a/rest/wireless/v1/sims_usage_records.go +++ b/rest/wireless/v1/sims_usage_records.go @@ -64,8 +64,6 @@ func (c *ApiService) PageUsageRecord(SimSid string, params *ListUsageRecordParam path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.End != nil { data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) } @@ -78,6 +76,7 @@ func (c *ApiService) PageUsageRecord(SimSid string, params *ListUsageRecordParam if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/wireless/v1/usage_records.go b/rest/wireless/v1/usage_records.go index dbb01194c..ffb432e73 100644 --- a/rest/wireless/v1/usage_records.go +++ b/rest/wireless/v1/usage_records.go @@ -61,8 +61,6 @@ func (c *ApiService) PageAccountUsageRecord(params *ListAccountUsageRecordParams path := "/v1/UsageRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.End != nil { data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) } @@ -75,6 +73,7 @@ func (c *ApiService) PageAccountUsageRecord(params *ListAccountUsageRecordParams if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) if pageToken != "" { data.Set("PageToken", pageToken)