Skip to content

Commit

Permalink
Modified generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Oct 17, 2023
1 parent 9f00bdc commit f1c25ea
Show file tree
Hide file tree
Showing 433 changed files with 12,514 additions and 11,188 deletions.
1 change: 1 addition & 0 deletions rest/accounts/v1/auth_tokens_promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func (c *ApiService) UpdateAuthTokenPromotion() (*AccountsV1AuthTokenPromotion,




resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions rest/accounts/v1/auth_tokens_secondary.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func (c *ApiService) CreateSecondaryAuthToken() (*AccountsV1SecondaryAuthToken,




resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
Expand All @@ -56,6 +57,7 @@ func (c *ApiService) DeleteSecondaryAuthToken() (error) {




resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
if err != nil {
return err
Expand Down
154 changes: 85 additions & 69 deletions rest/accounts/v1/credentials_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
package openapi

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

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


// Optional parameters for the method 'CreateCredentialAws'
type CreateCredentialAwsParams struct {
// A string that contains the AWS access credentials in the format `<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
Expand All @@ -33,25 +33,26 @@ type CreateCredentialAwsParams struct {
AccountSid *string `json:"AccountSid,omitempty"`
}

func (params *CreateCredentialAwsParams) SetCredentials(Credentials string) *CreateCredentialAwsParams {
func (params *CreateCredentialAwsParams) SetCredentials(Credentials string) (*CreateCredentialAwsParams){
params.Credentials = &Credentials
return params
}
func (params *CreateCredentialAwsParams) SetFriendlyName(FriendlyName string) *CreateCredentialAwsParams {
func (params *CreateCredentialAwsParams) SetFriendlyName(FriendlyName string) (*CreateCredentialAwsParams){
params.FriendlyName = &FriendlyName
return params
}
func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) *CreateCredentialAwsParams {
func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) (*CreateCredentialAwsParams){
params.AccountSid = &AccountSid
return params
}

// Create a new AWS Credential
func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*AccountsV1CredentialAws, error) {
path := "/v1/Credentials/AWS"

data := url.Values{}
headers := make(map[string]interface{})

if params != nil && params.Credentials != nil {
data.Set("Credentials", *params.Credentials)
}
Expand All @@ -62,6 +63,8 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac
data.Set("AccountSid", *params.AccountSid)
}



resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
Expand All @@ -78,13 +81,16 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac
}

// Delete a Credential from your account
func (c *ApiService) DeleteCredentialAws(Sid string, ) error {
func (c *ApiService) DeleteCredentialAws(Sid string, ) (error) {
path := "/v1/Credentials/AWS/{Sid}"
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)

data := url.Values{}
headers := make(map[string]interface{})




resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
if err != nil {
return err
Expand All @@ -98,11 +104,14 @@ func (c *ApiService) DeleteCredentialAws(Sid string, ) error {
// Fetch the AWS credentials specified by the provided Credential Sid
func (c *ApiService) FetchCredentialAws(Sid string, ) (*AccountsV1CredentialAws, error) {
path := "/v1/Credentials/AWS/{Sid}"
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)

data := url.Values{}
headers := make(map[string]interface{})




resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
if err != nil {
return nil, err
Expand All @@ -126,11 +135,11 @@ type ListCredentialAwsParams struct {
Limit *int `json:"limit,omitempty"`
}

func (params *ListCredentialAwsParams) SetPageSize(PageSize int) *ListCredentialAwsParams {
func (params *ListCredentialAwsParams) SetPageSize(PageSize int) (*ListCredentialAwsParams){
params.PageSize = &PageSize
return params
}
func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsParams {
func (params *ListCredentialAwsParams) SetLimit(Limit int) (*ListCredentialAwsParams){
params.Limit = &Limit
return params
}
Expand All @@ -139,8 +148,10 @@ func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsPar
func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToken, pageNumber string) (*ListCredentialAwsResponse, error) {
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))
}
Expand Down Expand Up @@ -169,70 +180,71 @@ func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToke

// Lists CredentialAws records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
func (c *ApiService) ListCredentialAws(params *ListCredentialAwsParams) ([]AccountsV1CredentialAws, error) {
response, errors := c.StreamCredentialAws(params)
response, errors := c.StreamCredentialAws(params)

records := make([]AccountsV1CredentialAws, 0)
for record := range response {
records = append(records, record)
}
records := make([]AccountsV1CredentialAws, 0)
for record := range response {
records = append(records, record)
}

if err := <-errors; err != nil {
return nil, err
}
if err := <-errors; err != nil {
return nil, err
}

return records, nil
return records, nil
}

// Streams CredentialAws records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.
func (c *ApiService) StreamCredentialAws(params *ListCredentialAwsParams) (chan AccountsV1CredentialAws, chan error) {
if params == nil {
params = &ListCredentialAwsParams{}
}
params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))

recordChannel := make(chan AccountsV1CredentialAws, 1)
errorChannel := make(chan error, 1)

response, err := c.PageCredentialAws(params, "", "")
if err != nil {
errorChannel <- err
close(recordChannel)
close(errorChannel)
} else {
go c.streamCredentialAws(response, params, recordChannel, errorChannel)
}

return recordChannel, errorChannel
if params == nil {
params = &ListCredentialAwsParams{}
}
params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))

recordChannel := make(chan AccountsV1CredentialAws, 1)
errorChannel := make(chan error, 1)

response, err := c.PageCredentialAws(params, "", "")
if err != nil {
errorChannel <- err
close(recordChannel)
close(errorChannel)
} else {
go c.streamCredentialAws(response, params, recordChannel, errorChannel)
}

return recordChannel, errorChannel
}

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

for response != nil {
responseRecords := response.Credentials
for item := range responseRecords {
recordChannel <- responseRecords[item]
curRecord += 1
if params.Limit != nil && *params.Limit < curRecord {
close(recordChannel)
close(errorChannel)
return
}
}

record, err := client.GetNext(c.baseURL, response, c.getNextListCredentialAwsResponse)
if err != nil {
errorChannel <- err
break
} else if record == nil {
break
}

response = record.(*ListCredentialAwsResponse)
}

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

for response != nil {
responseRecords := response.Credentials
for item := range responseRecords {
recordChannel <- responseRecords[item]
curRecord += 1
if params.Limit != nil && *params.Limit < curRecord {
close(recordChannel)
close(errorChannel)
return
}
}

record, err := client.GetNext(c.baseURL, response, c.getNextListCredentialAwsResponse)
if err != nil {
errorChannel <- err
break
} else if record == nil {
break
}

response = record.(*ListCredentialAwsResponse)
}

close(recordChannel)
close(errorChannel)
}

func (c *ApiService) getNextListCredentialAwsResponse(nextPageUrl string) (interface{}, error) {
Expand All @@ -253,28 +265,32 @@ func (c *ApiService) getNextListCredentialAwsResponse(nextPageUrl string) (inter
return ps, nil
}


// Optional parameters for the method 'UpdateCredentialAws'
type UpdateCredentialAwsParams struct {
// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
FriendlyName *string `json:"FriendlyName,omitempty"`
}

func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) *UpdateCredentialAwsParams {
func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) (*UpdateCredentialAwsParams){
params.FriendlyName = &FriendlyName
return params
}

// Modify the properties of a given Account
func (c *ApiService) UpdateCredentialAws(Sid string, params *UpdateCredentialAwsParams) (*AccountsV1CredentialAws, error) {
path := "/v1/Credentials/AWS/{Sid}"
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
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)
}



resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
Expand Down
35 changes: 20 additions & 15 deletions rest/accounts/v1/credentials_public_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey

data := url.Values{}
headers := make(map[string]interface{})
if params != nil && params.PublicKey != nil {
data.Set("PublicKey", *params.PublicKey)
}
if params != nil && params.FriendlyName != nil {
data.Set("FriendlyName", *params.FriendlyName)
}
if params != nil && params.AccountSid != nil {
data.Set("AccountSid", *params.AccountSid)
}

if params != nil && params.PublicKey != nil {
data.Set("PublicKey", *params.PublicKey)
}
if params != nil && params.FriendlyName != nil {
data.Set("FriendlyName", *params.FriendlyName)
}
if params != nil && params.AccountSid != nil {
data.Set("AccountSid", *params.AccountSid)
}



Expand Down Expand Up @@ -89,6 +90,7 @@ func (c *ApiService) DeleteCredentialPublicKey(Sid string, ) (error) {




resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
if err != nil {
return err
Expand All @@ -109,6 +111,7 @@ func (c *ApiService) FetchCredentialPublicKey(Sid string, ) (*AccountsV1Credenti




resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
if err != nil {
return nil, err
Expand Down Expand Up @@ -148,9 +151,10 @@ func (c *ApiService) PageCredentialPublicKey(params *ListCredentialPublicKeyPara

data := url.Values{}
headers := make(map[string]interface{})
if params != nil && params.PageSize != nil {
data.Set("PageSize", fmt.Sprint(*params.PageSize))
}

if params != nil && params.PageSize != nil {
data.Set("PageSize", fmt.Sprint(*params.PageSize))
}

if pageToken != "" {
data.Set("PageToken", pageToken)
Expand Down Expand Up @@ -280,9 +284,10 @@ func (c *ApiService) UpdateCredentialPublicKey(Sid string, params *UpdateCredent

data := url.Values{}
headers := make(map[string]interface{})
if params != nil && params.FriendlyName != nil {
data.Set("FriendlyName", *params.FriendlyName)
}

if params != nil && params.FriendlyName != nil {
data.Set("FriendlyName", *params.FriendlyName)
}



Expand Down
Loading

0 comments on commit f1c25ea

Please sign in to comment.