Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove functions with wrong endpoints #88

Merged
merged 2 commits into from
Apr 28, 2022
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions application.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,64 +192,3 @@ func (c *Client) DeleteApplication(id string) (*SimpleResponse, error) {

return c.DecodeSimpleResponse(resp)
}

// ListAppDomains lists all domains for an application
func (c *Client) ListAppDomains(id string) ([]string, error) {
resp, err := c.SendGetRequest(fmt.Sprintf("/v2/applications/%s/domains", id))
if err != nil {
return nil, decodeError(err)
}

appDomain := make([]string, 0)
if err := json.NewDecoder(bytes.NewReader(resp)).Decode(&appDomain); err != nil {
return nil, err
}

return appDomain, nil
}

//FindAppDomain finds an app domain inside an application by the domain name
func (c *Client) FindAppDomain(search, id string) (string, error) {
appDomains, err := c.ListAppDomains(id)
if err != nil {
return "", decodeError(err)
}

for _, domain := range appDomains {
if domain == search {
return domain, nil
}
}
return "", ErrAppDomainNotFound
}

//DeleteAppDomain deletes an app domain from an application
func (c *Client) DeleteAppDomain(domains []string, appID, domain string) (*SimpleResponse, error) {
if len(domains) == 0 {
err := fmt.Errorf("there is no domain to delete")
return nil, err
}

url := fmt.Sprintf("/v2/applications/%s/domains/%s", appID, domain)
resp, err := c.SendDeleteRequest(url)
if err != nil {
return nil, decodeError(err)
}

return c.DecodeSimpleResponse(resp)
}

// GetAppConfig returns the config for an application
func (c *Client) GetAppConfig(id string) (*EnvVar, error) {
resp, err := c.SendGetRequest(fmt.Sprintf("/v2/applications/%s/config", id))
if err != nil {
return nil, decodeError(err)
}

appConfig := &EnvVar{}
if err := json.NewDecoder(bytes.NewReader(resp)).Decode(&appConfig); err != nil {
return nil, err
}

return appConfig, nil
}
70 changes: 0 additions & 70 deletions application_size.go

This file was deleted.