1515package openapi
1616
1717import (
18- "context"
1918 "encoding/json"
2019 "fmt"
2120 "net/url"
@@ -49,11 +48,6 @@ func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) *Creat
4948
5049// Create a new AWS Credential
5150func (c * ApiService ) CreateCredentialAws (params * CreateCredentialAwsParams ) (* AccountsV1CredentialAws , error ) {
52- return c .CreateCredentialAwsWithCtx (context .TODO (), params )
53- }
54-
55- // Create a new AWS Credential
56- func (c * ApiService ) CreateCredentialAwsWithCtx (ctx context.Context , params * CreateCredentialAwsParams ) (* AccountsV1CredentialAws , error ) {
5751 path := "/v1/Credentials/AWS"
5852
5953 data := url.Values {}
@@ -69,7 +63,7 @@ func (c *ApiService) CreateCredentialAwsWithCtx(ctx context.Context, params *Cre
6963 data .Set ("AccountSid" , * params .AccountSid )
7064 }
7165
72- resp , err := c .requestHandler .Post (ctx , c .baseURL + path , data , headers )
66+ resp , err := c .requestHandler .Post (c .baseURL + path , data , headers )
7367 if err != nil {
7468 return nil , err
7569 }
@@ -86,18 +80,13 @@ func (c *ApiService) CreateCredentialAwsWithCtx(ctx context.Context, params *Cre
8680
8781// Delete a Credential from your account
8882func (c * ApiService ) DeleteCredentialAws (Sid string ) error {
89- return c .DeleteCredentialAwsWithCtx (context .TODO (), Sid )
90- }
91-
92- // Delete a Credential from your account
93- func (c * ApiService ) DeleteCredentialAwsWithCtx (ctx context.Context , Sid string ) error {
9483 path := "/v1/Credentials/AWS/{Sid}"
9584 path = strings .Replace (path , "{" + "Sid" + "}" , Sid , - 1 )
9685
9786 data := url.Values {}
9887 headers := make (map [string ]interface {})
9988
100- resp , err := c .requestHandler .Delete (ctx , c .baseURL + path , data , headers )
89+ resp , err := c .requestHandler .Delete (c .baseURL + path , data , headers )
10190 if err != nil {
10291 return err
10392 }
@@ -109,18 +98,13 @@ func (c *ApiService) DeleteCredentialAwsWithCtx(ctx context.Context, Sid string)
10998
11099// Fetch the AWS credentials specified by the provided Credential Sid
111100func (c * ApiService ) FetchCredentialAws (Sid string ) (* AccountsV1CredentialAws , error ) {
112- return c .FetchCredentialAwsWithCtx (context .TODO (), Sid )
113- }
114-
115- // Fetch the AWS credentials specified by the provided Credential Sid
116- func (c * ApiService ) FetchCredentialAwsWithCtx (ctx context.Context , Sid string ) (* AccountsV1CredentialAws , error ) {
117101 path := "/v1/Credentials/AWS/{Sid}"
118102 path = strings .Replace (path , "{" + "Sid" + "}" , Sid , - 1 )
119103
120104 data := url.Values {}
121105 headers := make (map [string ]interface {})
122106
123- resp , err := c .requestHandler .Get (ctx , c .baseURL + path , data , headers )
107+ resp , err := c .requestHandler .Get (c .baseURL + path , data , headers )
124108 if err != nil {
125109 return nil , err
126110 }
@@ -154,11 +138,6 @@ func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsPar
154138
155139// Retrieve a single page of CredentialAws records from the API. Request is executed immediately.
156140func (c * ApiService ) PageCredentialAws (params * ListCredentialAwsParams , pageToken , pageNumber string ) (* ListCredentialAwsResponse , error ) {
157- return c .PageCredentialAwsWithCtx (context .TODO (), params , pageToken , pageNumber )
158- }
159-
160- // Retrieve a single page of CredentialAws records from the API. Request is executed immediately.
161- func (c * ApiService ) PageCredentialAwsWithCtx (ctx context.Context , params * ListCredentialAwsParams , pageToken , pageNumber string ) (* ListCredentialAwsResponse , error ) {
162141 path := "/v1/Credentials/AWS"
163142
164143 data := url.Values {}
@@ -175,7 +154,7 @@ func (c *ApiService) PageCredentialAwsWithCtx(ctx context.Context, params *ListC
175154 data .Set ("Page" , pageNumber )
176155 }
177156
178- resp , err := c .requestHandler .Get (ctx , c .baseURL + path , data , headers )
157+ resp , err := c .requestHandler .Get (c .baseURL + path , data , headers )
179158 if err != nil {
180159 return nil , err
181160 }
@@ -192,12 +171,7 @@ func (c *ApiService) PageCredentialAwsWithCtx(ctx context.Context, params *ListC
192171
193172// Lists CredentialAws records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
194173func (c * ApiService ) ListCredentialAws (params * ListCredentialAwsParams ) ([]AccountsV1CredentialAws , error ) {
195- return c .ListCredentialAwsWithCtx (context .TODO (), params )
196- }
197-
198- // Lists CredentialAws records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
199- func (c * ApiService ) ListCredentialAwsWithCtx (ctx context.Context , params * ListCredentialAwsParams ) ([]AccountsV1CredentialAws , error ) {
200- response , errors := c .StreamCredentialAwsWithCtx (ctx , params )
174+ response , errors := c .StreamCredentialAws (params )
201175
202176 records := make ([]AccountsV1CredentialAws , 0 )
203177 for record := range response {
@@ -213,11 +187,6 @@ func (c *ApiService) ListCredentialAwsWithCtx(ctx context.Context, params *ListC
213187
214188// Streams CredentialAws records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.
215189func (c * ApiService ) StreamCredentialAws (params * ListCredentialAwsParams ) (chan AccountsV1CredentialAws , chan error ) {
216- return c .StreamCredentialAwsWithCtx (context .TODO (), params )
217- }
218-
219- // Streams CredentialAws records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.
220- func (c * ApiService ) StreamCredentialAwsWithCtx (ctx context.Context , params * ListCredentialAwsParams ) (chan AccountsV1CredentialAws , chan error ) {
221190 if params == nil {
222191 params = & ListCredentialAwsParams {}
223192 }
@@ -226,19 +195,19 @@ func (c *ApiService) StreamCredentialAwsWithCtx(ctx context.Context, params *Lis
226195 recordChannel := make (chan AccountsV1CredentialAws , 1 )
227196 errorChannel := make (chan error , 1 )
228197
229- response , err := c .PageCredentialAwsWithCtx ( ctx , params , "" , "" )
198+ response , err := c .PageCredentialAws ( params , "" , "" )
230199 if err != nil {
231200 errorChannel <- err
232201 close (recordChannel )
233202 close (errorChannel )
234203 } else {
235- go c .streamCredentialAws (ctx , response , params , recordChannel , errorChannel )
204+ go c .streamCredentialAws (response , params , recordChannel , errorChannel )
236205 }
237206
238207 return recordChannel , errorChannel
239208}
240209
241- func (c * ApiService ) streamCredentialAws (ctx context. Context , response * ListCredentialAwsResponse , params * ListCredentialAwsParams , recordChannel chan AccountsV1CredentialAws , errorChannel chan error ) {
210+ func (c * ApiService ) streamCredentialAws (response * ListCredentialAwsResponse , params * ListCredentialAwsParams , recordChannel chan AccountsV1CredentialAws , errorChannel chan error ) {
242211 curRecord := 1
243212
244213 for response != nil {
@@ -253,7 +222,7 @@ func (c *ApiService) streamCredentialAws(ctx context.Context, response *ListCred
253222 }
254223 }
255224
256- record , err := client .GetNextWithCtx ( ctx , c .baseURL , response , c .getNextListCredentialAwsResponse )
225+ record , err := client .GetNext ( c .baseURL , response , c .getNextListCredentialAwsResponse )
257226 if err != nil {
258227 errorChannel <- err
259228 break
@@ -268,11 +237,11 @@ func (c *ApiService) streamCredentialAws(ctx context.Context, response *ListCred
268237 close (errorChannel )
269238}
270239
271- func (c * ApiService ) getNextListCredentialAwsResponse (ctx context. Context , nextPageUrl string ) (interface {}, error ) {
240+ func (c * ApiService ) getNextListCredentialAwsResponse (nextPageUrl string ) (interface {}, error ) {
272241 if nextPageUrl == "" {
273242 return nil , nil
274243 }
275- resp , err := c .requestHandler .Get (ctx , nextPageUrl , nil , nil )
244+ resp , err := c .requestHandler .Get (nextPageUrl , nil , nil )
276245 if err != nil {
277246 return nil , err
278247 }
@@ -299,11 +268,6 @@ func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) *U
299268
300269// Modify the properties of a given Account
301270func (c * ApiService ) UpdateCredentialAws (Sid string , params * UpdateCredentialAwsParams ) (* AccountsV1CredentialAws , error ) {
302- return c .UpdateCredentialAwsWithCtx (context .TODO (), Sid , params )
303- }
304-
305- // Modify the properties of a given Account
306- func (c * ApiService ) UpdateCredentialAwsWithCtx (ctx context.Context , Sid string , params * UpdateCredentialAwsParams ) (* AccountsV1CredentialAws , error ) {
307271 path := "/v1/Credentials/AWS/{Sid}"
308272 path = strings .Replace (path , "{" + "Sid" + "}" , Sid , - 1 )
309273
@@ -314,7 +278,7 @@ func (c *ApiService) UpdateCredentialAwsWithCtx(ctx context.Context, Sid string,
314278 data .Set ("FriendlyName" , * params .FriendlyName )
315279 }
316280
317- resp , err := c .requestHandler .Post (ctx , c .baseURL + path , data , headers )
281+ resp , err := c .requestHandler .Post (c .baseURL + path , data , headers )
318282 if err != nil {
319283 return nil , err
320284 }
0 commit comments