Chore: Upgrade k8s.io/api v0.34.1 and grafana-app-sdk v0.43.1 (#111009)
This commit is contained in:
@@ -12,8 +12,9 @@
|
||||
package dataquery
|
||||
|
||||
import (
|
||||
bytes "bytes"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
errors "errors"
|
||||
)
|
||||
|
||||
type AzureMonitorQuery struct {
|
||||
@@ -856,39 +857,55 @@ func (resource StringOrBoolOrFloat64OrSelectableValue) MarshalJSON() ([]byte, er
|
||||
return []byte("null"), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements a custom JSON unmarshalling logic to decode StringOrBoolOrFloat64OrSelectableValue from JSON.
|
||||
// UnmarshalJSON implements a custom JSON unmarshalling logic to decode `StringOrBoolOrFloat64OrSelectableValue` from JSON.
|
||||
func (resource *StringOrBoolOrFloat64OrSelectableValue) UnmarshalJSON(raw []byte) error {
|
||||
if raw == nil {
|
||||
return nil
|
||||
}
|
||||
fields := make(map[string]json.RawMessage)
|
||||
if err := json.Unmarshal(raw, &fields); err != nil {
|
||||
return err
|
||||
|
||||
var errList []error
|
||||
|
||||
// String
|
||||
var String string
|
||||
if err := json.Unmarshal(raw, &String); err != nil {
|
||||
errList = append(errList, err)
|
||||
resource.String = nil
|
||||
} else {
|
||||
resource.String = &String
|
||||
return nil
|
||||
}
|
||||
|
||||
if fields["String"] != nil {
|
||||
if err := json.Unmarshal(fields["String"], &resource.String); err != nil {
|
||||
return fmt.Errorf("error decoding field 'String': %w", err)
|
||||
}
|
||||
// Bool
|
||||
var Bool bool
|
||||
if err := json.Unmarshal(raw, &Bool); err != nil {
|
||||
errList = append(errList, err)
|
||||
resource.Bool = nil
|
||||
} else {
|
||||
resource.Bool = &Bool
|
||||
return nil
|
||||
}
|
||||
|
||||
if fields["Bool"] != nil {
|
||||
if err := json.Unmarshal(fields["Bool"], &resource.Bool); err != nil {
|
||||
return fmt.Errorf("error decoding field 'Bool': %w", err)
|
||||
}
|
||||
// Float64
|
||||
var Float64 float64
|
||||
if err := json.Unmarshal(raw, &Float64); err != nil {
|
||||
errList = append(errList, err)
|
||||
resource.Float64 = nil
|
||||
} else {
|
||||
resource.Float64 = &Float64
|
||||
return nil
|
||||
}
|
||||
|
||||
if fields["Float64"] != nil {
|
||||
if err := json.Unmarshal(fields["Float64"], &resource.Float64); err != nil {
|
||||
return fmt.Errorf("error decoding field 'Float64': %w", err)
|
||||
}
|
||||
// SelectableValue
|
||||
var SelectableValue SelectableValue
|
||||
selectableValuedec := json.NewDecoder(bytes.NewReader(raw))
|
||||
selectableValuedec.DisallowUnknownFields()
|
||||
if err := selectableValuedec.Decode(&SelectableValue); err != nil {
|
||||
errList = append(errList, err)
|
||||
resource.SelectableValue = nil
|
||||
} else {
|
||||
resource.SelectableValue = &SelectableValue
|
||||
return nil
|
||||
}
|
||||
|
||||
if fields["SelectableValue"] != nil {
|
||||
if err := json.Unmarshal(fields["SelectableValue"], &resource.SelectableValue); err != nil {
|
||||
return fmt.Errorf("error decoding field 'SelectableValue': %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
return errors.Join(errList...)
|
||||
}
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
package dataquery
|
||||
|
||||
import (
|
||||
bytes "bytes"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
errors "errors"
|
||||
)
|
||||
|
||||
type BucketAggregation = DateHistogramOrHistogramOrTermsOrFiltersOrGeoHashGridOrNested
|
||||
@@ -1562,29 +1563,37 @@ func (resource StringOrDataqueryInlineScript) MarshalJSON() ([]byte, error) {
|
||||
return []byte("null"), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements a custom JSON unmarshalling logic to decode StringOrDataqueryInlineScript from JSON.
|
||||
// UnmarshalJSON implements a custom JSON unmarshalling logic to decode `StringOrDataqueryInlineScript` from JSON.
|
||||
func (resource *StringOrDataqueryInlineScript) UnmarshalJSON(raw []byte) error {
|
||||
if raw == nil {
|
||||
return nil
|
||||
}
|
||||
fields := make(map[string]json.RawMessage)
|
||||
if err := json.Unmarshal(raw, &fields); err != nil {
|
||||
return err
|
||||
|
||||
var errList []error
|
||||
|
||||
// String
|
||||
var String string
|
||||
if err := json.Unmarshal(raw, &String); err != nil {
|
||||
errList = append(errList, err)
|
||||
resource.String = nil
|
||||
} else {
|
||||
resource.String = &String
|
||||
return nil
|
||||
}
|
||||
|
||||
if fields["String"] != nil {
|
||||
if err := json.Unmarshal(fields["String"], &resource.String); err != nil {
|
||||
return fmt.Errorf("error decoding field 'String': %w", err)
|
||||
}
|
||||
// DataqueryInlineScript
|
||||
var DataqueryInlineScript DataqueryInlineScript
|
||||
dataqueryInlineScriptdec := json.NewDecoder(bytes.NewReader(raw))
|
||||
dataqueryInlineScriptdec.DisallowUnknownFields()
|
||||
if err := dataqueryInlineScriptdec.Decode(&DataqueryInlineScript); err != nil {
|
||||
errList = append(errList, err)
|
||||
resource.DataqueryInlineScript = nil
|
||||
} else {
|
||||
resource.DataqueryInlineScript = &DataqueryInlineScript
|
||||
return nil
|
||||
}
|
||||
|
||||
if fields["DataqueryInlineScript"] != nil {
|
||||
if err := json.Unmarshal(fields["DataqueryInlineScript"], &resource.DataqueryInlineScript); err != nil {
|
||||
return fmt.Errorf("error decoding field 'DataqueryInlineScript': %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
return errors.Join(errList...)
|
||||
}
|
||||
|
||||
type BucketScriptOrCumulativeSumOrDerivativeOrSerialDiffOrRawDataOrRawDocumentOrUniqueCountOrPercentilesOrExtendedStatsOrMinOrMaxOrSumOrAverageOrMovingAverageOrMovingFunctionOrLogsOrRateOrTopMetrics struct {
|
||||
|
||||
Reference in New Issue
Block a user