go-mod: update the `go-tfe` dependency

This commit is contained in:
Sander van Harmelen 2018-12-05 11:46:37 +01:00
parent 69c647c3dc
commit 03ac6ec774
4 changed files with 39 additions and 4 deletions

2
go.mod
View File

@ -68,7 +68,7 @@ require (
github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90 github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90
github.com/hashicorp/go-safetemp v0.0.0-20180326211150-b1a1dbde6fdc // indirect github.com/hashicorp/go-safetemp v0.0.0-20180326211150-b1a1dbde6fdc // indirect
github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86 // indirect github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86 // indirect
github.com/hashicorp/go-tfe v0.3.3 github.com/hashicorp/go-tfe v0.3.4
github.com/hashicorp/go-uuid v1.0.0 github.com/hashicorp/go-uuid v1.0.0
github.com/hashicorp/go-version v0.0.0-20180322230233-23480c066577 github.com/hashicorp/go-version v0.0.0-20180322230233-23480c066577
github.com/hashicorp/golang-lru v0.5.0 // indirect github.com/hashicorp/golang-lru v0.5.0 // indirect

4
go.sum
View File

@ -152,8 +152,8 @@ github.com/hashicorp/go-slug v0.2.0 h1:gekvezBc+9LwN3qC+lesrz0Qg36hhgge9z/an1FCH
github.com/hashicorp/go-slug v0.2.0/go.mod h1:+zDycQOzGqOqMW7Kn2fp9vz/NtqpMLQlgb9JUF+0km4= github.com/hashicorp/go-slug v0.2.0/go.mod h1:+zDycQOzGqOqMW7Kn2fp9vz/NtqpMLQlgb9JUF+0km4=
github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86 h1:7YOlAIO2YWnJZkQp7B5eFykaIY7C9JndqAFQyVV5BhM= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86 h1:7YOlAIO2YWnJZkQp7B5eFykaIY7C9JndqAFQyVV5BhM=
github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-tfe v0.3.3 h1:v17u0VdSy54n6Xn575cTzLrNJ0gn+Y7mq5J+A/p1fkw= github.com/hashicorp/go-tfe v0.3.4 h1:A9pKjZMDTSGozXf2wQlWhBI7QoxCoas14Xg/TSiEAV8=
github.com/hashicorp/go-tfe v0.3.3/go.mod h1:Vssg8/lwVz+PyJ/nAK97zYmXxxLe28MCIMhKo+rva1o= github.com/hashicorp/go-tfe v0.3.4/go.mod h1:Vssg8/lwVz+PyJ/nAK97zYmXxxLe28MCIMhKo+rva1o=
github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v0.0.0-20180322230233-23480c066577 h1:at4+18LrM8myamuV7/vT6x2s1JNXp2k4PsSbt4I02X4= github.com/hashicorp/go-version v0.0.0-20180322230233-23480c066577 h1:at4+18LrM8myamuV7/vT6x2s1JNXp2k4PsSbt4I02X4=

View File

@ -35,6 +35,9 @@ type Organizations interface {
// Capacity shows the current run capacity of an organization. // Capacity shows the current run capacity of an organization.
Capacity(ctx context.Context, organization string) (*Capacity, error) Capacity(ctx context.Context, organization string) (*Capacity, error)
// Entitlements shows the entitlements of an organization.
Entitlements(ctx context.Context, organization string) (*Entitlements, error)
// RunQueue shows the current run queue of an organization. // RunQueue shows the current run queue of an organization.
RunQueue(ctx context.Context, organization string, options RunQueueOptions) (*RunQueue, error) RunQueue(ctx context.Context, organization string, options RunQueueOptions) (*RunQueue, error)
} }
@ -93,6 +96,17 @@ type Capacity struct {
Running int `jsonapi:"attr,running"` Running int `jsonapi:"attr,running"`
} }
// Entitlements represents the entitlements of an organization.
type Entitlements struct {
ID string `jsonapi:"primary,entitlement-sets"`
StateStorage bool `jsonapi:"attr,state-storage"`
Operations bool `jsonapi:"attr,operations"`
VCSIntegrations bool `jsonapi:"attr,vcs-integrations"`
Sentinel bool `jsonapi:"attr,sentinel"`
PrivateModuleRegistry bool `jsonapi:"attr,private-module-registry"`
Teams bool `jsonapi:"attr,teams"`
}
// RunQueue represents the current run queue of an organization. // RunQueue represents the current run queue of an organization.
type RunQueue struct { type RunQueue struct {
*Pagination *Pagination
@ -283,6 +297,27 @@ func (s *organizations) Capacity(ctx context.Context, organization string) (*Cap
return c, nil return c, nil
} }
// Entitlements shows the entitlements of an organization.
func (s *organizations) Entitlements(ctx context.Context, organization string) (*Entitlements, error) {
if !validStringID(&organization) {
return nil, errors.New("invalid value for organization")
}
u := fmt.Sprintf("organizations/%s/entitlement-set", url.QueryEscape(organization))
req, err := s.client.newRequest("GET", u, nil)
if err != nil {
return nil, err
}
e := &Entitlements{}
err = s.client.do(ctx, req, e)
if err != nil {
return nil, err
}
return e, nil
}
// RunQueueOptions represents the options for showing the queue. // RunQueueOptions represents the options for showing the queue.
type RunQueueOptions struct { type RunQueueOptions struct {
ListOptions ListOptions

2
vendor/modules.txt vendored
View File

@ -326,7 +326,7 @@ github.com/hashicorp/go-rootcerts
github.com/hashicorp/go-safetemp github.com/hashicorp/go-safetemp
# github.com/hashicorp/go-slug v0.2.0 # github.com/hashicorp/go-slug v0.2.0
github.com/hashicorp/go-slug github.com/hashicorp/go-slug
# github.com/hashicorp/go-tfe v0.3.3 # github.com/hashicorp/go-tfe v0.3.4
github.com/hashicorp/go-tfe github.com/hashicorp/go-tfe
# github.com/hashicorp/go-uuid v1.0.0 # github.com/hashicorp/go-uuid v1.0.0
github.com/hashicorp/go-uuid github.com/hashicorp/go-uuid