Documentation ¶
Index ¶
- Variables
- func AccountAndLambdaArnFromID(id string) (string, string, error)
- func AccountAndNamespaceFromID(id string) (string, string, error)
- func AccountAndRoleFromID(id string) (string, string, error)
- func AccountNameAndChannelNameFromID(id string) (string, string, error)
- func CheckForUnparsed(resp interface{}) error
- func ConvertResponseByteToMap(b []byte) (map[string]interface{}, error)
- func ConvertToSha256(content string) string
- func DeleteKeyInMap(mapObject map[string]interface{}, keyList []string)
- func GetMetadataFromJSON(jsonBytes []byte, unmarshalled interface{}) error
- func GetUserAgent(clientUserAgent string) string
- func Retry(interval time.Duration, count int, call func() error) error
- func SendRequest(ctx context.Context, client *datadogV1.APIClient, method, path string, ...) ([]byte, *http.Response, error)
- func TenantAndClientFromID(id string) (string, string, error)
- func TranslateClientError(err error, httpresp *http.Response, msg string) error
- func TranslateClientErrorDiag(err error, httpresp *http.Response, msg string) diag.Diagnostics
- type CustomRequestAPIError
- type FatalError
- type ResourceDataKey
- func (k *ResourceDataKey) Add(newParts interface{}) *ResourceDataKey
- func (k *ResourceDataKey) Get() interface{}
- func (k *ResourceDataKey) GetOk() (interface{}, bool)
- func (k *ResourceDataKey) GetOkWith(parts interface{}) (interface{}, bool)
- func (k *ResourceDataKey) GetWith(parts interface{}) interface{}
- func (k *ResourceDataKey) Pop(removeCount int) *ResourceDataKey
- func (k *ResourceDataKey) Remove(parts interface{}) *ResourceDataKey
- func (k *ResourceDataKey) S() string
- func (k *ResourceDataKey) With(parts interface{}) string
- type RetryableError
Constants ¶
This section is empty.
Variables ¶
var DatadogProvider *schema.Provider
DatadogProvider holds a reference to the provider
Functions ¶
func AccountAndLambdaArnFromID ¶
AccountAndLambdaArnFromID returns account and Lambda ARN from an ID
func AccountAndNamespaceFromID ¶
AccountAndNamespaceFromID returns account and namespace from an ID
func AccountAndRoleFromID ¶
AccountAndRoleFromID returns account and role from an ID
func AccountNameAndChannelNameFromID ¶
AccountNameAndChannelNameFromID returns slack account and channel from an ID
func CheckForUnparsed ¶
func CheckForUnparsed(resp interface{}) error
CheckForUnparsed takes in a API response object and returns an error if it contains an unparsed element
func ConvertResponseByteToMap ¶
ConvertResponseByteToMap converts JSON []byte to map[string]interface{}
func ConvertToSha256 ¶
ConvertToSha256 builds a SHA256 hash of the passed string
func DeleteKeyInMap ¶
DeleteKeyInMap deletes key (in dot notation) in map
func GetMetadataFromJSON ¶
GetMetadataFromJSON decodes passed JSON data
func GetUserAgent ¶
GetUserAgent augments the default user agent with provider details
func Retry ¶
Retry calls the call function for count times every interval while it returns a RetryableError Call function should return either: nil, RetryableError, or FatalError nil indicates a success condition was met RetryableError means we'll retry up to the count FatalError indicates we shouldn't try the request again
func SendRequest ¶
func SendRequest(ctx context.Context, client *datadogV1.APIClient, method, path string, body interface{}) ([]byte, *http.Response, error)
SendRequest send custom request
func TenantAndClientFromID ¶
TenantAndClientFromID returns azure account and client from an ID
func TranslateClientError ¶
TranslateClientError turns an error into a message
func TranslateClientErrorDiag ¶
TranslateClientErrorDiag returns client error as type diag.Diagnostics
Types ¶
type CustomRequestAPIError ¶
type CustomRequestAPIError struct {
// contains filtered or unexported fields
}
CustomRequestAPIError Provides access to the body, and error on returned errors.
func (CustomRequestAPIError) Body ¶
func (e CustomRequestAPIError) Body() []byte
Body returns the raw bytes of the response
func (CustomRequestAPIError) Error ¶
func (e CustomRequestAPIError) Error() string
Error returns non-empty string if there was an error.
type FatalError ¶
type FatalError struct {
Prob string
}
FatalError should be considered final and not trigger any retries
func (*FatalError) Error ¶
func (e *FatalError) Error() string
type ResourceDataKey ¶
type ResourceDataKey struct {
// contains filtered or unexported fields
}
ResourceDataKey structure holds Terraform's *schema.ResourceData structure and a slice of strings that hold a "key" to somewhere in the stored data. For example, []string{"foo", "0", "bar"} would point to "foo.0.bar". This allows for easy extraction of the data while adding/removing parts of the "key".
func NewResourceDataKey ¶
func NewResourceDataKey(d *schema.ResourceData, initial string) *ResourceDataKey
NewResourceDataKey creates a new ResourceDataKey with given initial key (can be given with dotted notation, e.g. "foo.0.bar").
func (*ResourceDataKey) Add ¶
func (k *ResourceDataKey) Add(newParts interface{}) *ResourceDataKey
Add adds new parts to the stored key. The argument can either be a string using dotted notation (e.g. "foo.0.bar") or an int (assumed to be a list index and converted to string).
func (*ResourceDataKey) Get ¶
func (k *ResourceDataKey) Get() interface{}
Get calls the "Get" method on the stored ResourceData structure with the current key (obtained by S).
func (*ResourceDataKey) GetOk ¶
func (k *ResourceDataKey) GetOk() (interface{}, bool)
GetOk calls the "GetOk" method on the stored ResourceData structure with the current key (obtained by S).
func (*ResourceDataKey) GetOkWith ¶
func (k *ResourceDataKey) GetOkWith(parts interface{}) (interface{}, bool)
GetOkWith calls the "GetOk" method on the stored ResourceData structure with the current key plus given parts (obtained by With, meaning that the parts are not added permanently).
func (*ResourceDataKey) GetWith ¶
func (k *ResourceDataKey) GetWith(parts interface{}) interface{}
GetWith calls the "Get" method on the stored ResourceData structure with the current key plus given parts (obtained by With, meaning that the parts are not added permanently).
func (*ResourceDataKey) Pop ¶
func (k *ResourceDataKey) Pop(removeCount int) *ResourceDataKey
Pop will remove given count of key parts from the end of the key. Panics if given count is bigger than number of key parts.
func (*ResourceDataKey) Remove ¶
func (k *ResourceDataKey) Remove(parts interface{}) *ResourceDataKey
Remove like Add, but removes given key parts from the end of the key. Panics if the key doesn't end with given parts.
func (*ResourceDataKey) S ¶
func (k *ResourceDataKey) S() string
S returns string representation of the key, e.g. "foo.0.bar".
func (*ResourceDataKey) With ¶
func (k *ResourceDataKey) With(parts interface{}) string
With returns string representation of the key (much like S) with given parts added, but doesn't add the parts permanently.
type RetryableError ¶
type RetryableError struct {
Prob string
}
RetryableError represents a transient error and means its safe to try the request again
func (*RetryableError) Error ¶
func (e *RetryableError) Error() string