-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5a720de
commit d64078b
Showing
30 changed files
with
1,199 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2019-Present Datadog, Inc. | ||
|
||
package datadogV1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
) | ||
|
||
// FormulaType Set the sort type to formula. | ||
type FormulaType string | ||
|
||
// List of FormulaType. | ||
const ( | ||
FORMULATYPE_FORMULA FormulaType = "formula" | ||
) | ||
|
||
var allowedFormulaTypeEnumValues = []FormulaType{ | ||
FORMULATYPE_FORMULA, | ||
} | ||
|
||
// GetAllowedValues reeturns the list of possible values. | ||
func (v *FormulaType) GetAllowedValues() []FormulaType { | ||
return allowedFormulaTypeEnumValues | ||
} | ||
|
||
// UnmarshalJSON deserializes the given payload. | ||
func (v *FormulaType) UnmarshalJSON(src []byte) error { | ||
var value string | ||
err := datadog.Unmarshal(src, &value) | ||
if err != nil { | ||
return err | ||
} | ||
*v = FormulaType(value) | ||
return nil | ||
} | ||
|
||
// NewFormulaTypeFromValue returns a pointer to a valid FormulaType | ||
// for the value passed as argument, or an error if the value passed is not allowed by the enum. | ||
func NewFormulaTypeFromValue(v string) (*FormulaType, error) { | ||
ev := FormulaType(v) | ||
if ev.IsValid() { | ||
return &ev, nil | ||
} | ||
return nil, fmt.Errorf("invalid value '%v' for FormulaType: valid values are %v", v, allowedFormulaTypeEnumValues) | ||
} | ||
|
||
// IsValid return true if the value is valid for the enum, false otherwise. | ||
func (v FormulaType) IsValid() bool { | ||
for _, existing := range allowedFormulaTypeEnumValues { | ||
if existing == v { | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
// Ptr returns reference to FormulaType value. | ||
func (v FormulaType) Ptr() *FormulaType { | ||
return &v | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2019-Present Datadog, Inc. | ||
|
||
package datadogV1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
) | ||
|
||
// GroupType Set the sort type to group. | ||
type GroupType string | ||
|
||
// List of GroupType. | ||
const ( | ||
GROUPTYPE_GROUP GroupType = "group" | ||
) | ||
|
||
var allowedGroupTypeEnumValues = []GroupType{ | ||
GROUPTYPE_GROUP, | ||
} | ||
|
||
// GetAllowedValues reeturns the list of possible values. | ||
func (v *GroupType) GetAllowedValues() []GroupType { | ||
return allowedGroupTypeEnumValues | ||
} | ||
|
||
// UnmarshalJSON deserializes the given payload. | ||
func (v *GroupType) UnmarshalJSON(src []byte) error { | ||
var value string | ||
err := datadog.Unmarshal(src, &value) | ||
if err != nil { | ||
return err | ||
} | ||
*v = GroupType(value) | ||
return nil | ||
} | ||
|
||
// NewGroupTypeFromValue returns a pointer to a valid GroupType | ||
// for the value passed as argument, or an error if the value passed is not allowed by the enum. | ||
func NewGroupTypeFromValue(v string) (*GroupType, error) { | ||
ev := GroupType(v) | ||
if ev.IsValid() { | ||
return &ev, nil | ||
} | ||
return nil, fmt.Errorf("invalid value '%v' for GroupType: valid values are %v", v, allowedGroupTypeEnumValues) | ||
} | ||
|
||
// IsValid return true if the value is valid for the enum, false otherwise. | ||
func (v GroupType) IsValid() bool { | ||
for _, existing := range allowedGroupTypeEnumValues { | ||
if existing == v { | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
// Ptr returns reference to GroupType value. | ||
func (v GroupType) Ptr() *GroupType { | ||
return &v | ||
} |
Oops, something went wrong.