Skip to content

Commit

Permalink
changed activations exports to match account format
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Oct 19, 2018
1 parent 9e34f00 commit e08b5f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 10 additions & 0 deletions exports.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ type Exports struct {
Streams ExportedStreams `json:"streams,omitempty"`
Services ExportedServices `json:"services,omitempty"`
}

func (e *Exports) Valid() error {
if err := e.Services.Valid(); err != nil {
return err
}
if err := e.Streams.Valid(); err != nil {
return err
}
return nil
}
9 changes: 2 additions & 7 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,13 @@ func (u *Permissions) Valid() error {
}

type Activation struct {
Exports []Export `json:"exports,omitempty"`
Exports Exports `json:"exports,omitempty"`
Limits
OperatorLimits
}

func (a *Activation) Valid() error {
for i, t := range a.Exports {
if err := t.Valid(); err != nil {
return fmt.Errorf("error validating activation (index %d):%v", i, err)
}
}
return nil
return a.Exports.Valid()
}

type Identity struct {
Expand Down

0 comments on commit e08b5f9

Please sign in to comment.