Skip to content

Commit

Permalink
preview of generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Nov 9, 2023
1 parent 6975a6b commit b3bcd52
Show file tree
Hide file tree
Showing 1,523 changed files with 76,804 additions and 72,035 deletions.
6 changes: 1 addition & 5 deletions rest/accounts/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is the public Twilio REST API.
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 1.51.1
- API version: 1.0.0
- Package version: 1.0.0
- Build package: com.twilio.oai.TwilioGoGenerator
For more information, please visit [https://support.twilio.com](https://support.twilio.com)
Expand Down Expand Up @@ -44,9 +44,6 @@ Class | Method | HTTP request | Description
*CredentialsPublicKeysApi* | [**FetchCredentialPublicKey**](docs/CredentialsPublicKeysApi.md#fetchcredentialpublickey) | **Get** /v1/Credentials/PublicKeys/{Sid} |
*CredentialsPublicKeysApi* | [**ListCredentialPublicKey**](docs/CredentialsPublicKeysApi.md#listcredentialpublickey) | **Get** /v1/Credentials/PublicKeys |
*CredentialsPublicKeysApi* | [**UpdateCredentialPublicKey**](docs/CredentialsPublicKeysApi.md#updatecredentialpublickey) | **Post** /v1/Credentials/PublicKeys/{Sid} |
*SafeListNumbersApi* | [**CreateSafelist**](docs/SafeListNumbersApi.md#createsafelist) | **Post** /v1/SafeList/Numbers |
*SafeListNumbersApi* | [**DeleteSafelist**](docs/SafeListNumbersApi.md#deletesafelist) | **Delete** /v1/SafeList/Numbers |
*SafeListNumbersApi* | [**FetchSafelist**](docs/SafeListNumbersApi.md#fetchsafelist) | **Get** /v1/SafeList/Numbers |


## Documentation For Models
Expand All @@ -57,7 +54,6 @@ Class | Method | HTTP request | Description
- [AccountsV1AuthTokenPromotion](docs/AccountsV1AuthTokenPromotion.md)
- [AccountsV1CredentialAws](docs/AccountsV1CredentialAws.md)
- [AccountsV1CredentialPublicKey](docs/AccountsV1CredentialPublicKey.md)
- [AccountsV1Safelist](docs/AccountsV1Safelist.md)
- [ListCredentialAwsResponseMeta](docs/ListCredentialAwsResponseMeta.md)


Expand Down
6 changes: 3 additions & 3 deletions rest/accounts/v1/api_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package openapi

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

type ApiService struct {
Expand All @@ -24,12 +24,12 @@ type ApiService struct {
}

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService {
return &ApiService{
return &ApiService {
requestHandler: requestHandler,
baseURL: "https://accounts.twilio.com",
}
}

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService {
return NewApiService(twilio.NewRequestHandler(client))
return NewApiService(twilio.NewRequestHandler(client))
}
32 changes: 19 additions & 13 deletions rest/accounts/v1/auth_tokens_promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,33 @@ package openapi

import (
"encoding/json"
"fmt"

Check failure on line 19 in rest/accounts/v1/auth_tokens_promote.go

View workflow job for this annotation

GitHub Actions / Build & Test (1.15)

imported and not used: "fmt"
"net/url"

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

Check failure on line 22 in rest/accounts/v1/auth_tokens_promote.go

View workflow job for this annotation

GitHub Actions / Build & Test (1.15)

imported and not used: "github.com/twilio/twilio-go/client"
)


// Promote the secondary Auth Token to primary. After promoting the new token, all requests to Twilio using your old primary Auth Token will result in an error.
func (c *ApiService) UpdateAuthTokenPromotion() (*AccountsV1AuthTokenPromotion, error) {
path := "/v1/AuthTokens/Promote"
path := "/v1/AuthTokens/Promote"

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


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

resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

defer resp.Body.Close()
defer resp.Body.Close()

ps := &AccountsV1AuthTokenPromotion{}
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
return nil, err
}
ps := &AccountsV1AuthTokenPromotion{}
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
return nil, err
}

return ps, err
return ps, err
}
54 changes: 31 additions & 23 deletions rest/accounts/v1/auth_tokens_secondary.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,52 @@ package openapi

import (
"encoding/json"
"fmt"

Check failure on line 19 in rest/accounts/v1/auth_tokens_secondary.go

View workflow job for this annotation

GitHub Actions / Build & Test (1.15)

imported and not used: "fmt"
"net/url"

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

Check failure on line 22 in rest/accounts/v1/auth_tokens_secondary.go

View workflow job for this annotation

GitHub Actions / Build & Test (1.15)

imported and not used: "github.com/twilio/twilio-go/client"
)


// Create a new secondary Auth Token
func (c *ApiService) CreateSecondaryAuthToken() (*AccountsV1SecondaryAuthToken, error) {
path := "/v1/AuthTokens/Secondary"
path := "/v1/AuthTokens/Secondary"

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

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

resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

defer resp.Body.Close()
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

ps := &AccountsV1SecondaryAuthToken{}
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
return nil, err
}
defer resp.Body.Close()

return ps, err
ps := &AccountsV1SecondaryAuthToken{}
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
return nil, err
}

return ps, err
}

// Delete the secondary Auth Token from your account
func (c *ApiService) DeleteSecondaryAuthToken() error {
path := "/v1/AuthTokens/Secondary"
func (c *ApiService) DeleteSecondaryAuthToken() (error) {
path := "/v1/AuthTokens/Secondary"

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


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

resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
if err != nil {
return err
}
resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
if err != nil {
return err
}

defer resp.Body.Close()
defer resp.Body.Close()

return nil
return nil
}
Loading

0 comments on commit b3bcd52

Please sign in to comment.