Skip to content

Commit

Permalink
Ssl -> SSL, version 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bgentry committed Mar 27, 2014
1 parent 5f33c5e commit afedbf6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion gen/gen.rb
Expand Up @@ -247,7 +247,8 @@ def variablecase(str)

def titlecase(str)
str.gsub('_','-').gsub(' ','-').split('-').map do |k|
if k.downcase == "url" # special case so Url becomes URL
# special case so Url becomes URL, Ssl becomes SSL
if %w{url ssl}.include?(k.downcase)
k.upcase
elsif k.downcase == "oauth" # special case so Oauth becomes OAuth
"OAuth"
Expand Down
2 changes: 1 addition & 1 deletion heroku.go
Expand Up @@ -22,7 +22,7 @@ import (
)

const (
Version = "0.5.2"
Version = "0.6.0"
DefaultAPIURL = "https://api.heroku.com"
DefaultUserAgent = "heroku-go/" + Version + " (" + runtime.GOOS + "; " + runtime.GOARCH + ")"
)
Expand Down
30 changes: 15 additions & 15 deletions ssl_endpoint.go
Expand Up @@ -11,7 +11,7 @@ import (
// SSL Endpoint is a public address serving custom SSL cert for HTTPS traffic to
// a Heroku app. Note that an app must have the ssl:endpoint addon installed
// before it can provision an SSL Endpoint using these APIs.
type SslEndpoint struct {
type SSLEndpoint struct {
// raw contents of the public certificate chain (eg: .crt or .pem file)
CertificateChain string `json:"certificate_chain"`

Expand All @@ -37,32 +37,32 @@ type SslEndpoint struct {
// certificateChain is the raw contents of the public certificate chain (eg:
// .crt or .pem file). privateKey is the contents of the private key (eg .key
// file).
func (c *Client) SslEndpointCreate(appIdentity string, certificateChain string, privateKey string) (*SslEndpoint, error) {
func (c *Client) SSLEndpointCreate(appIdentity string, certificateChain string, privateKey string) (*SSLEndpoint, error) {
params := struct {
CertificateChain string `json:"certificate_chain"`
PrivateKey string `json:"private_key"`
}{
CertificateChain: certificateChain,
PrivateKey: privateKey,
}
var sslEndpointRes SslEndpoint
var sslEndpointRes SSLEndpoint
return &sslEndpointRes, c.Post(&sslEndpointRes, "/apps/"+appIdentity+"/ssl-endpoints", params)
}

// Delete existing SSL endpoint.
//
// appIdentity is the unique identifier of the ssl-endpoint's app.
// sslEndpointIdentity is the unique identifier of the SslEndpoint.
func (c *Client) SslEndpointDelete(appIdentity string, sslEndpointIdentity string) error {
// sslEndpointIdentity is the unique identifier of the SSLEndpoint.
func (c *Client) SSLEndpointDelete(appIdentity string, sslEndpointIdentity string) error {
return c.Delete("/apps/" + appIdentity + "/ssl-endpoints/" + sslEndpointIdentity)
}

// Info for existing SSL endpoint.
//
// appIdentity is the unique identifier of the ssl-endpoint's app.
// sslEndpointIdentity is the unique identifier of the SslEndpoint.
func (c *Client) SslEndpointInfo(appIdentity string, sslEndpointIdentity string) (*SslEndpoint, error) {
var sslEndpoint SslEndpoint
// sslEndpointIdentity is the unique identifier of the SSLEndpoint.
func (c *Client) SSLEndpointInfo(appIdentity string, sslEndpointIdentity string) (*SSLEndpoint, error) {
var sslEndpoint SSLEndpoint
return &sslEndpoint, c.Get(&sslEndpoint, "/apps/"+appIdentity+"/ssl-endpoints/"+sslEndpointIdentity)
}

Expand All @@ -71,7 +71,7 @@ func (c *Client) SslEndpointInfo(appIdentity string, sslEndpointIdentity string)
// appIdentity is the unique identifier of the ssl-endpoint's app. lr is an
// optional ListRange that sets the Range options for the paginated list of
// results.
func (c *Client) SslEndpointList(appIdentity string, lr *ListRange) ([]SslEndpoint, error) {
func (c *Client) SSLEndpointList(appIdentity string, lr *ListRange) ([]SSLEndpoint, error) {
req, err := c.NewRequest("GET", "/apps/"+appIdentity+"/ssl-endpoints", nil)
if err != nil {
return nil, err
Expand All @@ -81,22 +81,22 @@ func (c *Client) SslEndpointList(appIdentity string, lr *ListRange) ([]SslEndpoi
lr.SetHeader(req)
}

var sslEndpointsRes []SslEndpoint
var sslEndpointsRes []SSLEndpoint
return sslEndpointsRes, c.DoReq(req, &sslEndpointsRes)
}

// Update an existing SSL endpoint.
//
// appIdentity is the unique identifier of the ssl-endpoint's app.
// sslEndpointIdentity is the unique identifier of the SslEndpoint. options is
// sslEndpointIdentity is the unique identifier of the SSLEndpoint. options is
// the struct of optional parameters for this action.
func (c *Client) SslEndpointUpdate(appIdentity string, sslEndpointIdentity string, options *SslEndpointUpdateOpts) (*SslEndpoint, error) {
var sslEndpointRes SslEndpoint
func (c *Client) SSLEndpointUpdate(appIdentity string, sslEndpointIdentity string, options *SSLEndpointUpdateOpts) (*SSLEndpoint, error) {
var sslEndpointRes SSLEndpoint
return &sslEndpointRes, c.Patch(&sslEndpointRes, "/apps/"+appIdentity+"/ssl-endpoints/"+sslEndpointIdentity, options)
}

// SslEndpointUpdateOpts holds the optional parameters for SslEndpointUpdate
type SslEndpointUpdateOpts struct {
// SSLEndpointUpdateOpts holds the optional parameters for SSLEndpointUpdate
type SSLEndpointUpdateOpts struct {
// raw contents of the public certificate chain (eg: .crt or .pem file)
CertificateChain *string `json:"certificate_chain,omitempty"`
// contents of the private key (eg .key file)
Expand Down

0 comments on commit afedbf6

Please sign in to comment.