mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
13
vendor/github.com/digitalocean/godo/godo.go
generated
vendored
13
vendor/github.com/digitalocean/godo/godo.go
generated
vendored
@@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
libraryVersion = "1.17.0"
|
||||
libraryVersion = "1.30.0"
|
||||
defaultBaseURL = "https://api.digitalocean.com/"
|
||||
userAgent = "godo/" + libraryVersion
|
||||
mediaType = "application/json"
|
||||
@@ -45,6 +45,7 @@ type Client struct {
|
||||
// Services used for communicating with the API
|
||||
Account AccountService
|
||||
Actions ActionsService
|
||||
Balance BalanceService
|
||||
CDNs CDNService
|
||||
Domains DomainsService
|
||||
Droplets DropletsService
|
||||
@@ -65,6 +66,7 @@ type Client struct {
|
||||
Firewalls FirewallsService
|
||||
Projects ProjectsService
|
||||
Kubernetes KubernetesService
|
||||
Registry RegistryService
|
||||
Databases DatabasesService
|
||||
VPCs VPCsService
|
||||
|
||||
@@ -93,6 +95,9 @@ type Response struct {
|
||||
// request body and not the header.
|
||||
Links *Links
|
||||
|
||||
// Meta describes generic information about the response.
|
||||
Meta *Meta
|
||||
|
||||
// Monitoring URI
|
||||
Monitor string
|
||||
|
||||
@@ -161,6 +166,7 @@ func NewClient(httpClient *http.Client) *Client {
|
||||
c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: userAgent}
|
||||
c.Account = &AccountServiceOp{client: c}
|
||||
c.Actions = &ActionsServiceOp{client: c}
|
||||
c.Balance = &BalanceServiceOp{client: c}
|
||||
c.CDNs = &CDNServiceOp{client: c}
|
||||
c.Certificates = &CertificatesServiceOp{client: c}
|
||||
c.Domains = &DomainsServiceOp{client: c}
|
||||
@@ -181,6 +187,7 @@ func NewClient(httpClient *http.Client) *Client {
|
||||
c.StorageActions = &StorageActionsServiceOp{client: c}
|
||||
c.Tags = &TagsServiceOp{client: c}
|
||||
c.Kubernetes = &KubernetesServiceOp{client: c}
|
||||
c.Registry = &RegistryServiceOp{client: c}
|
||||
c.Databases = &DatabasesServiceOp{client: c}
|
||||
c.VPCs = &VPCsServiceOp{client: c}
|
||||
|
||||
@@ -227,13 +234,11 @@ func SetUserAgent(ua string) ClientOpt {
|
||||
// BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the
|
||||
// value pointed to by body is JSON encoded and included in as the request body.
|
||||
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error) {
|
||||
rel, err := url.Parse(urlStr)
|
||||
u, err := c.BaseURL.Parse(urlStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
u := c.BaseURL.ResolveReference(rel)
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
if body != nil {
|
||||
err = json.NewEncoder(buf).Encode(body)
|
||||
|
||||
Reference in New Issue
Block a user