Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions client/page_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// Takes a limit on the max number of records to read and a max pageSize and calculates the max number of pages to read.
func ReadLimits(pageSize *int, limit *int) int {
func ReadLimits(pageSize *int64, limit *int64) int64 {
//don't care about pageSize
if pageSize == nil {
if limit == nil {
Expand Down Expand Up @@ -67,7 +67,7 @@ func getNextPageUrl(baseUrl string, response interface{}) (string, error) {
return "", nil
}

func min(a int, b int) int {
func min(a int64, b int64) int64 {
if a > b {
return b
}
Expand Down
14 changes: 7 additions & 7 deletions client/page_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import (
)

func TestPageUtil_ReadLimits(t *testing.T) {
assert.Equal(t, 5, ReadLimits(nil, setLimit(5)))
assert.Equal(t, 5, ReadLimits(setPageSize(10), setLimit(5)))
assert.Equal(t, 1000, ReadLimits(nil, setLimit(5000)))
assert.Equal(t, 10, ReadLimits(setPageSize(10), nil))
assert.Equal(t, 50, ReadLimits(nil, nil))
assert.Equal(t, int64(5), ReadLimits(nil, setLimit(5)))
assert.Equal(t, int64(5), ReadLimits(setPageSize(10), setLimit(5)))
assert.Equal(t, int64(1000), ReadLimits(nil, setLimit(5000)))
assert.Equal(t, int64(10), ReadLimits(setPageSize(10), nil))
assert.Equal(t, int64(50), ReadLimits(nil, nil))
}

func setLimit(limit int) *int {
func setLimit(limit int64) *int64 {
return &limit
}

func setPageSize(pageSize int) *int {
func setPageSize(pageSize int64) *int64 {
return &pageSize
}

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ require (
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
)

retract (
v1.22.0 // Contains known bug
)
retract v1.22.0 // Contains known bug
1 change: 0 additions & 1 deletion rest/accounts/v1/consents_bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func (params *CreateBulkConsentsParams) SetItems(Items []interface{}) *CreateBul
return params
}

//
func (c *ApiService) CreateBulkConsents(params *CreateBulkConsentsParams) (*AccountsV1BulkConsents, error) {
path := "/v1/Consents/Bulk"

Expand Down
1 change: 0 additions & 1 deletion rest/accounts/v1/contacts_bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func (params *CreateBulkContactsParams) SetItems(Items []interface{}) *CreateBul
return params
}

//
func (c *ApiService) CreateBulkContacts(params *CreateBulkContactsParams) (*AccountsV1BulkContacts, error) {
path := "/v1/Contacts/Bulk"

Expand Down
10 changes: 5 additions & 5 deletions rest/accounts/v1/credentials_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ func (c *ApiService) FetchCredentialAws(Sid string) (*AccountsV1CredentialAws, e
// Optional parameters for the method 'ListCredentialAws'
type ListCredentialAwsParams struct {
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListCredentialAwsParams) SetPageSize(PageSize int) *ListCredentialAwsParams {
func (params *ListCredentialAwsParams) SetPageSize(PageSize int64) *ListCredentialAwsParams {
params.PageSize = &PageSize
return params
}
func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsParams {
func (params *ListCredentialAwsParams) SetLimit(Limit int64) *ListCredentialAwsParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func (c *ApiService) StreamCredentialAws(params *ListCredentialAwsParams) (chan
}

func (c *ApiService) streamCredentialAws(response *ListCredentialAwsResponse, params *ListCredentialAwsParams, recordChannel chan AccountsV1CredentialAws, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.Credentials
Expand Down
10 changes: 5 additions & 5 deletions rest/accounts/v1/credentials_public_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ func (c *ApiService) FetchCredentialPublicKey(Sid string) (*AccountsV1Credential
// Optional parameters for the method 'ListCredentialPublicKey'
type ListCredentialPublicKeyParams struct {
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListCredentialPublicKeyParams) SetPageSize(PageSize int) *ListCredentialPublicKeyParams {
func (params *ListCredentialPublicKeyParams) SetPageSize(PageSize int64) *ListCredentialPublicKeyParams {
params.PageSize = &PageSize
return params
}
func (params *ListCredentialPublicKeyParams) SetLimit(Limit int) *ListCredentialPublicKeyParams {
func (params *ListCredentialPublicKeyParams) SetLimit(Limit int64) *ListCredentialPublicKeyParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func (c *ApiService) StreamCredentialPublicKey(params *ListCredentialPublicKeyPa
}

func (c *ApiService) streamCredentialPublicKey(response *ListCredentialPublicKeyResponse, params *ListCredentialPublicKeyParams, recordChannel chan AccountsV1CredentialPublicKey, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.Credentials
Expand Down
4 changes: 2 additions & 2 deletions rest/accounts/v1/docs/CredentialsAWSApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ Other parameters are passed through a pointer to a ListCredentialAwsParams struc

Name | Type | Description
------------- | ------------- | -------------
**PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000.
**Limit** | **int** | Max number of records to return.
**PageSize** | **int64** | How many resources to return in each list page. The default is 50, and the maximum is 1000.
**Limit** | **int64** | Max number of records to return.

### Return type

Expand Down
4 changes: 2 additions & 2 deletions rest/accounts/v1/docs/CredentialsPublicKeysApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ Other parameters are passed through a pointer to a ListCredentialPublicKeyParams

Name | Type | Description
------------- | ------------- | -------------
**PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000.
**Limit** | **int** | Max number of records to return.
**PageSize** | **int64** | How many resources to return in each list page. The default is 50, and the maximum is 1000.
**Limit** | **int64** | Max number of records to return.

### Return type

Expand Down
2 changes: 1 addition & 1 deletion rest/accounts/v1/docs/ListCredentialAwsResponseMeta.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**FirstPageUrl** | **string** | |[optional]
**Key** | **string** | |[optional]
**NextPageUrl** | Pointer to **string** | |
**Page** | **int** | |[optional]
**PageSize** | **int** | |[optional]
**PreviousPageUrl** | Pointer to **string** | |
**Url** | **string** | |[optional]
**Key** | **string** | |[optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package openapi
// ListCredentialAwsResponseMeta struct for ListCredentialAwsResponseMeta
type ListCredentialAwsResponseMeta struct {
FirstPageUrl string `json:"first_page_url,omitempty"`
Key string `json:"key,omitempty"`
NextPageUrl *string `json:"next_page_url,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"page_size,omitempty"`
PreviousPageUrl *string `json:"previous_page_url,omitempty"`
Url string `json:"url,omitempty"`
Key string `json:"key,omitempty"`
}
1 change: 1 addition & 0 deletions rest/api/v2010/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ Class | Method | HTTP request | Description
- [ListMemberResponse](docs/ListMemberResponse.md)
- [ApiV2010IncomingPhoneNumber](docs/ApiV2010IncomingPhoneNumber.md)
- [ApiV2010ConnectApp](docs/ApiV2010ConnectApp.md)
- [FetchHealthCheckResponse](docs/FetchHealthCheckResponse.md)
- [ApiV2010SipAuthCallsIpAccessControlListMapping](docs/ApiV2010SipAuthCallsIpAccessControlListMapping.md)
- [ApiV2010UsageRecordToday](docs/ApiV2010UsageRecordToday.md)
- [ApiV2010ConferenceRecording](docs/ApiV2010ConferenceRecording.md)
Expand Down
10 changes: 5 additions & 5 deletions rest/api/v2010/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ type ListAccountParams struct {
// Only return Account resources with the given status. Can be `closed`, `suspended` or `active`.
Status *string `json:"Status,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListAccountParams) SetFriendlyName(FriendlyName string) *ListAccountParams {
Expand All @@ -107,11 +107,11 @@ func (params *ListAccountParams) SetStatus(Status string) *ListAccountParams {
params.Status = &Status
return params
}
func (params *ListAccountParams) SetPageSize(PageSize int) *ListAccountParams {
func (params *ListAccountParams) SetPageSize(PageSize int64) *ListAccountParams {
params.PageSize = &PageSize
return params
}
func (params *ListAccountParams) SetLimit(Limit int) *ListAccountParams {
func (params *ListAccountParams) SetLimit(Limit int64) *ListAccountParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -196,7 +196,7 @@ func (c *ApiService) StreamAccount(params *ListAccountParams) (chan ApiV2010Acco
}

func (c *ApiService) streamAccount(response *ListAccountResponse, params *ListAccountParams, recordChannel chan ApiV2010Account, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.Accounts
Expand Down
14 changes: 5 additions & 9 deletions rest/api/v2010/accounts_addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func (params *CreateAddressParams) SetStreetSecondary(StreetSecondary string) *C
return params
}

//
func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Address, error) {
path := "/2010-04-01/Accounts/{AccountSid}/Addresses.json"
if params != nil && params.PathAccountSid != nil {
Expand Down Expand Up @@ -165,7 +164,6 @@ func (params *DeleteAddressParams) SetPathAccountSid(PathAccountSid string) *Del
return params
}

//
func (c *ApiService) DeleteAddress(Sid string, params *DeleteAddressParams) error {
path := "/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json"
if params != nil && params.PathAccountSid != nil {
Expand Down Expand Up @@ -201,7 +199,6 @@ func (params *FetchAddressParams) SetPathAccountSid(PathAccountSid string) *Fetc
return params
}

//
func (c *ApiService) FetchAddress(Sid string, params *FetchAddressParams) (*ApiV2010Address, error) {
path := "/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json"
if params != nil && params.PathAccountSid != nil {
Expand Down Expand Up @@ -242,9 +239,9 @@ type ListAddressParams struct {
// The ISO country code of the Address resources to read.
IsoCountry *string `json:"IsoCountry,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListAddressParams) SetPathAccountSid(PathAccountSid string) *ListAddressParams {
Expand All @@ -263,11 +260,11 @@ func (params *ListAddressParams) SetIsoCountry(IsoCountry string) *ListAddressPa
params.IsoCountry = &IsoCountry
return params
}
func (params *ListAddressParams) SetPageSize(PageSize int) *ListAddressParams {
func (params *ListAddressParams) SetPageSize(PageSize int64) *ListAddressParams {
params.PageSize = &PageSize
return params
}
func (params *ListAddressParams) SetLimit(Limit int) *ListAddressParams {
func (params *ListAddressParams) SetLimit(Limit int64) *ListAddressParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -361,7 +358,7 @@ func (c *ApiService) StreamAddress(params *ListAddressParams) (chan ApiV2010Addr
}

func (c *ApiService) streamAddress(response *ListAddressResponse, params *ListAddressParams, recordChannel chan ApiV2010Address, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.Addresses
Expand Down Expand Up @@ -473,7 +470,6 @@ func (params *UpdateAddressParams) SetStreetSecondary(StreetSecondary string) *U
return params
}

//
func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*ApiV2010Address, error) {
path := "/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json"
if params != nil && params.PathAccountSid != nil {
Expand Down
10 changes: 5 additions & 5 deletions rest/api/v2010/accounts_addresses_dependent_phone_numbers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ type ListDependentPhoneNumberParams struct {
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DependentPhoneNumber resources to read.
PathAccountSid *string `json:"PathAccountSid,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListDependentPhoneNumberParams) SetPathAccountSid(PathAccountSid string) *ListDependentPhoneNumberParams {
params.PathAccountSid = &PathAccountSid
return params
}
func (params *ListDependentPhoneNumberParams) SetPageSize(PageSize int) *ListDependentPhoneNumberParams {
func (params *ListDependentPhoneNumberParams) SetPageSize(PageSize int64) *ListDependentPhoneNumberParams {
params.PageSize = &PageSize
return params
}
func (params *ListDependentPhoneNumberParams) SetLimit(Limit int) *ListDependentPhoneNumberParams {
func (params *ListDependentPhoneNumberParams) SetLimit(Limit int64) *ListDependentPhoneNumberParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -127,7 +127,7 @@ func (c *ApiService) StreamDependentPhoneNumber(AddressSid string, params *ListD
}

func (c *ApiService) streamDependentPhoneNumber(response *ListDependentPhoneNumberResponse, params *ListDependentPhoneNumberParams, recordChannel chan ApiV2010DependentPhoneNumber, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.DependentPhoneNumbers
Expand Down
10 changes: 5 additions & 5 deletions rest/api/v2010/accounts_applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ type ListApplicationParams struct {
// The string that identifies the Application resources to read.
FriendlyName *string `json:"FriendlyName,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListApplicationParams) SetPathAccountSid(PathAccountSid string) *ListApplicationParams {
Expand All @@ -305,11 +305,11 @@ func (params *ListApplicationParams) SetFriendlyName(FriendlyName string) *ListA
params.FriendlyName = &FriendlyName
return params
}
func (params *ListApplicationParams) SetPageSize(PageSize int) *ListApplicationParams {
func (params *ListApplicationParams) SetPageSize(PageSize int64) *ListApplicationParams {
params.PageSize = &PageSize
return params
}
func (params *ListApplicationParams) SetLimit(Limit int) *ListApplicationParams {
func (params *ListApplicationParams) SetLimit(Limit int64) *ListApplicationParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -397,7 +397,7 @@ func (c *ApiService) StreamApplication(params *ListApplicationParams) (chan ApiV
}

func (c *ApiService) streamApplication(response *ListApplicationResponse, params *ListApplicationParams, recordChannel chan ApiV2010Application, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.Applications
Expand Down
10 changes: 5 additions & 5 deletions rest/api/v2010/accounts_authorized_connect_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ type ListAuthorizedConnectAppParams struct {
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resources to read.
PathAccountSid *string `json:"PathAccountSid,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
PageSize *int64 `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
Limit *int64 `json:"limit,omitempty"`
}

func (params *ListAuthorizedConnectAppParams) SetPathAccountSid(PathAccountSid string) *ListAuthorizedConnectAppParams {
params.PathAccountSid = &PathAccountSid
return params
}
func (params *ListAuthorizedConnectAppParams) SetPageSize(PageSize int) *ListAuthorizedConnectAppParams {
func (params *ListAuthorizedConnectAppParams) SetPageSize(PageSize int64) *ListAuthorizedConnectAppParams {
params.PageSize = &PageSize
return params
}
func (params *ListAuthorizedConnectAppParams) SetLimit(Limit int) *ListAuthorizedConnectAppParams {
func (params *ListAuthorizedConnectAppParams) SetLimit(Limit int64) *ListAuthorizedConnectAppParams {
params.Limit = &Limit
return params
}
Expand Down Expand Up @@ -167,7 +167,7 @@ func (c *ApiService) StreamAuthorizedConnectApp(params *ListAuthorizedConnectApp
}

func (c *ApiService) streamAuthorizedConnectApp(response *ListAuthorizedConnectAppResponse, params *ListAuthorizedConnectAppParams, recordChannel chan ApiV2010AuthorizedConnectApp, errorChannel chan error) {
curRecord := 1
var curRecord int64 = 1

for response != nil {
responseRecords := response.AuthorizedConnectApps
Expand Down
Loading
Loading