Skip to content

Commit

Permalink
fix(vfields): fixed name and added missing properties to objs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rambatino committed Jan 28, 2025
1 parent b836a5f commit 545f2be
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
3 changes: 3 additions & 0 deletions axiom/monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
BelowOrEqual // BelowOrEqual
Above // Above
AboveOrEqual // AboveOrEqual
AboveOrBelow // AboveOrBelow
)

func operatorFromString(s string) (c Operator, err error) {
Expand All @@ -40,6 +41,8 @@ func operatorFromString(s string) (c Operator, err error) {
c = Above
case AboveOrEqual.String():
c = AboveOrEqual
case AboveOrBelow.String():
c = AboveOrBelow
default:
err = fmt.Errorf("unknown operator %q", s)
}
Expand Down
5 changes: 3 additions & 2 deletions axiom/monitors_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions axiom/notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ type OpsGenieConfig struct {
type PagerDutyConfig struct {
// RoutingKey is the routing key to use for authentication.
RoutingKey string `json:"routingKey,omitempty"`
// Token is the token required to access private resources in
// Pager Duty
Token string `json:"token,omitempty"`
}

type SlackConfig struct {
Expand Down
9 changes: 9 additions & 0 deletions axiom/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ type APIToken struct {
// OrganisationCapabilities is the organisation capabilities available to
// the token.
OrganisationCapabilities OrganisationCapabilities `json:"orgCapabilities"`
// SAMLAuthenticated is a flag that determines whether the token can access
// a SAML authenticated org
SAMLAuthenticated bool `json:"samlAuthenticated"`
}

// DatasetCapabilities represents the capabilities available to a token for a
Expand All @@ -107,6 +110,9 @@ type DatasetCapabilities struct {
// Data is the data capability and the actions that can be performed on
// them.
Data []Action `json:"data"`
// Share is the share capability and the actions that can be performed on
// them.
Share []Action `json:"share"`
}

// OrganisationCapabilities represents the capabilities available to a token for
Expand Down Expand Up @@ -154,6 +160,9 @@ type OrganisationCapabilities struct {
// Users is the Users capability and the actions that can be performed on
// them.
Users []Action `json:"users,omitempty"`
// Views is the view capability and the actions that can be performed on
// them.
Views []Action `json:"views,omitempty"`
}

// CreateTokenRequest is the request payload for creating a new token with the
Expand Down
6 changes: 3 additions & 3 deletions axiom/vfields_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *VirtualFieldsTestSuite) SetupTest() {
var err error
s.vfield, err = s.client.VirtualFields.Create(s.ctx, axiom.VirtualField{
Dataset: "test-dataset",
Name: "Test Field",
Name: "TestField",
Expression: "a + b",
Type: "number",
})
Expand All @@ -61,7 +61,7 @@ func (s *VirtualFieldsTestSuite) Test() {
// Update the virtual field.
vfield, err := s.client.VirtualFields.Update(s.ctx, s.vfield.ID, axiom.VirtualField{
Dataset: "test-dataset",
Name: "Updated Test Field",
Name: "UpdatedTestField",
Expression: "a - b",
Type: "number",
})
Expand Down Expand Up @@ -89,7 +89,7 @@ func (s *VirtualFieldsTestSuite) TestCreateAndDeleteVirtualField() {
// Create a new virtual field.
vfield, err := s.client.VirtualFields.Create(s.ctx, axiom.VirtualField{
Dataset: "test-dataset",
Name: "New Test Field",
Name: "NewTestField",
Expression: "x * y",
Type: "number",
})
Expand Down

0 comments on commit 545f2be

Please sign in to comment.