Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
Regenerated clients to pick up codegen changes
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Nov 7, 2017
1 parent b234f15 commit 4e8e6f6
Show file tree
Hide file tree
Showing 12 changed files with 229 additions and 100 deletions.
29 changes: 20 additions & 9 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
//
// The source code of this go package was auto-generated from the API definition at
// http://references.taskcluster.net/auth/v1/api.json together with the input and output schemas it references, downloaded on
// Wed, 1 Nov 2017 at 18:25:00 UTC. The code was generated
// Tue, 7 Nov 2017 at 17:24:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package auth

Expand All @@ -85,28 +85,39 @@ type Auth tcclient.Client
// wish to point at a different API endpoint url, set BaseURL to the preferred
// url. Authentication can be disabled (for example if you wish to use the
// taskcluster-proxy) by setting Authenticate to false (in which case creds is
// ignored).
// ignored). If credentials is nil, credentials will be loaded from environment
// variables:
// TASKCLUSTER_CLIENT_ID
// TASKCLUSTER_ACCESS_TOKEN
// TASKCLUSTER_CERTIFICATE
// To use empty credentials rather than loading from environment variables, set
// credentials to &tcclient.Credentials{} rather than nil.
//
// For example:
// creds := &tcclient.Credentials{
// ClientID: os.Getenv("TASKCLUSTER_CLIENT_ID"),
// AccessToken: os.Getenv("TASKCLUSTER_ACCESS_TOKEN"),
// Certificate: os.Getenv("TASKCLUSTER_CERTIFICATE"),
// myAuth, credsError := auth.New(nil) // credentials loaded from TASKCLUSTER_* environment variables
// if credsError != nil {
// // handle malformed credentials...
// }
// myAuth := auth.New(creds) // set credentials
// myAuth.Authenticate = false // disable authentication (creds above are now ignored)
// myAuth.BaseURL = "http://localhost:1234/api/Auth/v1" // alternative API endpoint (production by default)
// data, err := myAuth.ListClients(.....) // for example, call the ListClients(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
func New(credentials *tcclient.Credentials) *Auth {
func New(credentials *tcclient.Credentials) (*Auth, error) {
if credentials == nil {
credentials = tcclient.CredentialsFromEnvVars()
err := credentials.Validate()
if err != nil {
return nil, err
}
}
myAuth := Auth(tcclient.Client{
Credentials: credentials,
BaseURL: "https://auth.taskcluster.net/v1",
Authenticate: true,
})
return &myAuth
return &myAuth, nil
}

// Get a list of all clients. With `prefix`, only clients for which
Expand Down
29 changes: 20 additions & 9 deletions awsprovisioner/awsprovisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
//
// The source code of this go package was auto-generated from the API definition at
// http://references.taskcluster.net/aws-provisioner/v1/api.json together with the input and output schemas it references, downloaded on
// Wed, 1 Nov 2017 at 18:25:00 UTC. The code was generated
// Tue, 7 Nov 2017 at 17:24:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package awsprovisioner

Expand All @@ -73,28 +73,39 @@ type AwsProvisioner tcclient.Client
// wish to point at a different API endpoint url, set BaseURL to the preferred
// url. Authentication can be disabled (for example if you wish to use the
// taskcluster-proxy) by setting Authenticate to false (in which case creds is
// ignored).
// ignored). If credentials is nil, credentials will be loaded from environment
// variables:
// TASKCLUSTER_CLIENT_ID
// TASKCLUSTER_ACCESS_TOKEN
// TASKCLUSTER_CERTIFICATE
// To use empty credentials rather than loading from environment variables, set
// credentials to &tcclient.Credentials{} rather than nil.
//
// For example:
// creds := &tcclient.Credentials{
// ClientID: os.Getenv("TASKCLUSTER_CLIENT_ID"),
// AccessToken: os.Getenv("TASKCLUSTER_ACCESS_TOKEN"),
// Certificate: os.Getenv("TASKCLUSTER_CERTIFICATE"),
// awsProvisioner, credsError := awsprovisioner.New(nil) // credentials loaded from TASKCLUSTER_* environment variables
// if credsError != nil {
// // handle malformed credentials...
// }
// awsProvisioner := awsprovisioner.New(creds) // set credentials
// awsProvisioner.Authenticate = false // disable authentication (creds above are now ignored)
// awsProvisioner.BaseURL = "http://localhost:1234/api/AwsProvisioner/v1" // alternative API endpoint (production by default)
// data, err := awsProvisioner.ListWorkerTypeSummaries(.....) // for example, call the ListWorkerTypeSummaries(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
func New(credentials *tcclient.Credentials) *AwsProvisioner {
func New(credentials *tcclient.Credentials) (*AwsProvisioner, error) {
if credentials == nil {
credentials = tcclient.CredentialsFromEnvVars()
err := credentials.Validate()
if err != nil {
return nil, err
}
}
awsProvisioner := AwsProvisioner(tcclient.Client{
Credentials: credentials,
BaseURL: "https://staging-aws-provisioner.herokuapp.com/v1",
Authenticate: true,
})
return &awsProvisioner
return &awsProvisioner, nil
}

// Return a list of worker types, including some summary information about
Expand Down
10 changes: 9 additions & 1 deletion codegenerator/model-data.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generated: 1509560703
Generated: 1510075495
The following file is an auto-generated static dump of the API models at time of code generation.
It is provided here for reference purposes, but is not used by any code.

Expand Down Expand Up @@ -9018,6 +9018,10 @@ OneOf
Items
Properties
Property 'headers' =
Additional Properties = 'Type = 'string'
TypeName = ''
SourceURL = ''
'
Description = 'Headers of request'
Type = 'object'
TypeName = 'Headers'
Expand Down Expand Up @@ -9201,6 +9205,10 @@ Properties
Items
Properties
Property 'headers' =
Additional Properties = 'Type = 'string'
TypeName = ''
SourceURL = ''
'
Description = 'Headers of request'
Type = 'object'
TypeName = 'Headers'
Expand Down
29 changes: 20 additions & 9 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
//
// The source code of this go package was auto-generated from the API definition at
// http://references.taskcluster.net/github/v1/api.json together with the input and output schemas it references, downloaded on
// Wed, 1 Nov 2017 at 18:25:00 UTC. The code was generated
// Tue, 7 Nov 2017 at 17:24:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package github

Expand All @@ -54,28 +54,39 @@ type Github tcclient.Client
// wish to point at a different API endpoint url, set BaseURL to the preferred
// url. Authentication can be disabled (for example if you wish to use the
// taskcluster-proxy) by setting Authenticate to false (in which case creds is
// ignored).
// ignored). If credentials is nil, credentials will be loaded from environment
// variables:
// TASKCLUSTER_CLIENT_ID
// TASKCLUSTER_ACCESS_TOKEN
// TASKCLUSTER_CERTIFICATE
// To use empty credentials rather than loading from environment variables, set
// credentials to &tcclient.Credentials{} rather than nil.
//
// For example:
// creds := &tcclient.Credentials{
// ClientID: os.Getenv("TASKCLUSTER_CLIENT_ID"),
// AccessToken: os.Getenv("TASKCLUSTER_ACCESS_TOKEN"),
// Certificate: os.Getenv("TASKCLUSTER_CERTIFICATE"),
// myGithub, credsError := github.New(nil) // credentials loaded from TASKCLUSTER_* environment variables
// if credsError != nil {
// // handle malformed credentials...
// }
// myGithub := github.New(creds) // set credentials
// myGithub.Authenticate = false // disable authentication (creds above are now ignored)
// myGithub.BaseURL = "http://localhost:1234/api/Github/v1" // alternative API endpoint (production by default)
// err := myGithub.GithubWebHookConsumer(.....) // for example, call the GithubWebHookConsumer(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
func New(credentials *tcclient.Credentials) *Github {
func New(credentials *tcclient.Credentials) (*Github, error) {
if credentials == nil {
credentials = tcclient.CredentialsFromEnvVars()
err := credentials.Validate()
if err != nil {
return nil, err
}
}
myGithub := Github(tcclient.Client{
Credentials: credentials,
BaseURL: "https://github.taskcluster.net/v1",
Authenticate: true,
})
return &myGithub
return &myGithub, nil
}

// Stability: *** EXPERIMENTAL ***
Expand Down
29 changes: 20 additions & 9 deletions hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//
// The source code of this go package was auto-generated from the API definition at
// http://references.taskcluster.net/hooks/v1/api.json together with the input and output schemas it references, downloaded on
// Wed, 1 Nov 2017 at 18:25:00 UTC. The code was generated
// Tue, 7 Nov 2017 at 17:24:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package hooks

Expand All @@ -61,28 +61,39 @@ type Hooks tcclient.Client
// wish to point at a different API endpoint url, set BaseURL to the preferred
// url. Authentication can be disabled (for example if you wish to use the
// taskcluster-proxy) by setting Authenticate to false (in which case creds is
// ignored).
// ignored). If credentials is nil, credentials will be loaded from environment
// variables:
// TASKCLUSTER_CLIENT_ID
// TASKCLUSTER_ACCESS_TOKEN
// TASKCLUSTER_CERTIFICATE
// To use empty credentials rather than loading from environment variables, set
// credentials to &tcclient.Credentials{} rather than nil.
//
// For example:
// creds := &tcclient.Credentials{
// ClientID: os.Getenv("TASKCLUSTER_CLIENT_ID"),
// AccessToken: os.Getenv("TASKCLUSTER_ACCESS_TOKEN"),
// Certificate: os.Getenv("TASKCLUSTER_CERTIFICATE"),
// myHooks, credsError := hooks.New(nil) // credentials loaded from TASKCLUSTER_* environment variables
// if credsError != nil {
// // handle malformed credentials...
// }
// myHooks := hooks.New(creds) // set credentials
// myHooks.Authenticate = false // disable authentication (creds above are now ignored)
// myHooks.BaseURL = "http://localhost:1234/api/Hooks/v1" // alternative API endpoint (production by default)
// data, err := myHooks.ListHookGroups(.....) // for example, call the ListHookGroups(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
func New(credentials *tcclient.Credentials) *Hooks {
func New(credentials *tcclient.Credentials) (*Hooks, error) {
if credentials == nil {
credentials = tcclient.CredentialsFromEnvVars()
err := credentials.Validate()
if err != nil {
return nil, err
}
}
myHooks := Hooks(tcclient.Client{
Credentials: credentials,
BaseURL: "https://hooks.taskcluster.net/v1",
Authenticate: true,
})
return &myHooks
return &myHooks, nil
}

// Stability: *** EXPERIMENTAL ***
Expand Down
29 changes: 20 additions & 9 deletions index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
//
// The source code of this go package was auto-generated from the API definition at
// http://references.taskcluster.net/index/v1/api.json together with the input and output schemas it references, downloaded on
// Wed, 1 Nov 2017 at 18:25:00 UTC. The code was generated
// Tue, 7 Nov 2017 at 17:24:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package index

Expand All @@ -138,28 +138,39 @@ type Index tcclient.Client
// wish to point at a different API endpoint url, set BaseURL to the preferred
// url. Authentication can be disabled (for example if you wish to use the
// taskcluster-proxy) by setting Authenticate to false (in which case creds is
// ignored).
// ignored). If credentials is nil, credentials will be loaded from environment
// variables:
// TASKCLUSTER_CLIENT_ID
// TASKCLUSTER_ACCESS_TOKEN
// TASKCLUSTER_CERTIFICATE
// To use empty credentials rather than loading from environment variables, set
// credentials to &tcclient.Credentials{} rather than nil.
//
// For example:
// creds := &tcclient.Credentials{
// ClientID: os.Getenv("TASKCLUSTER_CLIENT_ID"),
// AccessToken: os.Getenv("TASKCLUSTER_ACCESS_TOKEN"),
// Certificate: os.Getenv("TASKCLUSTER_CERTIFICATE"),
// myIndex, credsError := index.New(nil) // credentials loaded from TASKCLUSTER_* environment variables
// if credsError != nil {
// // handle malformed credentials...
// }
// myIndex := index.New(creds) // set credentials
// myIndex.Authenticate = false // disable authentication (creds above are now ignored)
// myIndex.BaseURL = "http://localhost:1234/api/Index/v1" // alternative API endpoint (production by default)
// data, err := myIndex.FindTask(.....) // for example, call the FindTask(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
func New(credentials *tcclient.Credentials) *Index {
func New(credentials *tcclient.Credentials) (*Index, error) {
if credentials == nil {
credentials = tcclient.CredentialsFromEnvVars()
err := credentials.Validate()
if err != nil {
return nil, err
}
}
myIndex := Index(tcclient.Client{
Credentials: credentials,
BaseURL: "https://index.taskcluster.net/v1",
Authenticate: true,
})
return &myIndex
return &myIndex, nil
}

// Find a task by index path, returning the highest-rank task with that path. If no
Expand Down
29 changes: 20 additions & 9 deletions login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//
// The source code of this go package was auto-generated from the API definition at
// http://references.taskcluster.net/login/v1/api.json together with the input and output schemas it references, downloaded on
// Wed, 1 Nov 2017 at 18:25:00 UTC. The code was generated
// Tue, 7 Nov 2017 at 17:24:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package login

Expand All @@ -47,28 +47,39 @@ type Login tcclient.Client
// wish to point at a different API endpoint url, set BaseURL to the preferred
// url. Authentication can be disabled (for example if you wish to use the
// taskcluster-proxy) by setting Authenticate to false (in which case creds is
// ignored).
// ignored). If credentials is nil, credentials will be loaded from environment
// variables:
// TASKCLUSTER_CLIENT_ID
// TASKCLUSTER_ACCESS_TOKEN
// TASKCLUSTER_CERTIFICATE
// To use empty credentials rather than loading from environment variables, set
// credentials to &tcclient.Credentials{} rather than nil.
//
// For example:
// creds := &tcclient.Credentials{
// ClientID: os.Getenv("TASKCLUSTER_CLIENT_ID"),
// AccessToken: os.Getenv("TASKCLUSTER_ACCESS_TOKEN"),
// Certificate: os.Getenv("TASKCLUSTER_CERTIFICATE"),
// myLogin, credsError := login.New(nil) // credentials loaded from TASKCLUSTER_* environment variables
// if credsError != nil {
// // handle malformed credentials...
// }
// myLogin := login.New(creds) // set credentials
// myLogin.Authenticate = false // disable authentication (creds above are now ignored)
// myLogin.BaseURL = "http://localhost:1234/api/Login/v1" // alternative API endpoint (production by default)
// data, err := myLogin.OidcCredentials(.....) // for example, call the OidcCredentials(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
func New(credentials *tcclient.Credentials) *Login {
func New(credentials *tcclient.Credentials) (*Login, error) {
if credentials == nil {
credentials = tcclient.CredentialsFromEnvVars()
err := credentials.Validate()
if err != nil {
return nil, err
}
}
myLogin := Login(tcclient.Client{
Credentials: credentials,
BaseURL: "https://login.taskcluster.net/v1",
Authenticate: true,
})
return &myLogin
return &myLogin, nil
}

// Stability: *** EXPERIMENTAL ***
Expand Down

0 comments on commit 4e8e6f6

Please sign in to comment.