Skip to content

Commit

Permalink
Regenerate client from commit 4f349dda of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 31, 2022
1 parent b7e6bb0 commit 925bfcf
Show file tree
Hide file tree
Showing 13 changed files with 456 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2022-10-31 15:17:18.792675",
"spec_repo_commit": "41479b46"
"regenerated": "2022-10-31 17:50:19.089615",
"spec_repo_commit": "4f349dda"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-10-31 15:17:18.805121",
"spec_repo_commit": "41479b46"
"regenerated": "2022-10-31 17:50:19.102141",
"spec_repo_commit": "4f349dda"
}
}
}
43 changes: 35 additions & 8 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6042,20 +6042,12 @@ components:
- rum
- ci_pipelines
- ci_tests
- audit
- events
- logs
- spans
example: rum
type: string
x-enum-varnames:
- RUM
- CI_PIPELINES
- CI_TESTS
- AUDIT
- EVENTS
- LOGS
- SPANS
MonitorFormulaAndFunctionQueryDefinition:
description: A formula and function query.
oneOf:
Expand Down Expand Up @@ -6340,6 +6332,8 @@ components:
to `false` for sparse metrics,\notherwise some evaluations are skipped.
Default is false."
type: boolean
scheduling_options:
$ref: '#/components/schemas/MonitorOptionsSchedulingOptions'
silenced:
additionalProperties:
description: UTC epoch timestamp in seconds when the downtime for the
Expand Down Expand Up @@ -6391,6 +6385,39 @@ components:
type: string
readOnly: true
type: object
MonitorOptionsSchedulingOptions:
description: Configuration options for scheduling.
properties:
evaluation_window:
$ref: '#/components/schemas/MonitorOptionsSchedulingOptionsEvaluationWindow'
type: object
MonitorOptionsSchedulingOptionsEvaluationWindow:
description: Configuration options for the evaluation window. If `hour_starts`
is set, no other fields may be set. Otherwise, `day_starts` and `month_starts`
must be set together.
properties:
day_starts:
description: The time of the day at which a one day cumulative evaluation
window starts. Must be defined in UTC time in `HH:mm` format.
example: 04:00
type: string
hour_starts:
description: The minute of the hour at which a one hour cumulative evaluation
window starts.
example: 0
format: int32
maximum: 59
minimum: 0
type: integer
month_starts:
description: The day of the month at which a one month cumulative evaluation
window starts.
example: 1
format: int32
maximum: 1
minimum: 1
type: integer
type: object
MonitorOverallStates:
description: The different states your monitor can be in.
enum:
Expand Down
4 changes: 2 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14890,7 +14890,7 @@ paths:
Cloud Workload Security rules, and downloads them as a .policy file. This
file can then be deployed to

your Agents to update the policy running in your environment.'
your agents to update the policy running in your environment.'
operationId: DownloadCloudWorkloadPolicyFile
responses:
'200':
Expand Down Expand Up @@ -16639,7 +16639,7 @@ paths:
- Usage Metering
/api/v2/usage/hourly_usage:
get:
description: Get hourly usage by product family.
description: Get hourly usage by product family
operationId: GetHourlyUsage
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,12 @@ const (
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_RUM MonitorFormulaAndFunctionEventsDataSource = "rum"
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_CI_PIPELINES MonitorFormulaAndFunctionEventsDataSource = "ci_pipelines"
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_CI_TESTS MonitorFormulaAndFunctionEventsDataSource = "ci_tests"
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_AUDIT MonitorFormulaAndFunctionEventsDataSource = "audit"
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_EVENTS MonitorFormulaAndFunctionEventsDataSource = "events"
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_LOGS MonitorFormulaAndFunctionEventsDataSource = "logs"
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_SPANS MonitorFormulaAndFunctionEventsDataSource = "spans"
)

var allowedMonitorFormulaAndFunctionEventsDataSourceEnumValues = []MonitorFormulaAndFunctionEventsDataSource{
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_RUM,
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_CI_PIPELINES,
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_CI_TESTS,
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_AUDIT,
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_EVENTS,
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_LOGS,
MONITORFORMULAANDFUNCTIONEVENTSDATASOURCE_SPANS,
}

// GetAllowedValues reeturns the list of possible values.
Expand Down
42 changes: 42 additions & 0 deletions api/datadogV1/model_monitor_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ type MonitorOptions struct {
// We highly recommend you set this to `false` for sparse metrics,
// otherwise some evaluations are skipped. Default is false.
RequireFullWindow *bool `json:"require_full_window,omitempty"`
// Configuration options for scheduling.
SchedulingOptions *MonitorOptionsSchedulingOptions `json:"scheduling_options,omitempty"`
// Information about the downtime applied to the monitor.
// Deprecated
Silenced map[string]int64 `json:"silenced,omitempty"`
Expand Down Expand Up @@ -877,6 +879,34 @@ func (o *MonitorOptions) SetRequireFullWindow(v bool) {
o.RequireFullWindow = &v
}

// GetSchedulingOptions returns the SchedulingOptions field value if set, zero value otherwise.
func (o *MonitorOptions) GetSchedulingOptions() MonitorOptionsSchedulingOptions {
if o == nil || o.SchedulingOptions == nil {
var ret MonitorOptionsSchedulingOptions
return ret
}
return *o.SchedulingOptions
}

// GetSchedulingOptionsOk returns a tuple with the SchedulingOptions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MonitorOptions) GetSchedulingOptionsOk() (*MonitorOptionsSchedulingOptions, bool) {
if o == nil || o.SchedulingOptions == nil {
return nil, false
}
return o.SchedulingOptions, true
}

// HasSchedulingOptions returns a boolean if a field has been set.
func (o *MonitorOptions) HasSchedulingOptions() bool {
return o != nil && o.SchedulingOptions != nil
}

// SetSchedulingOptions gets a reference to the given MonitorOptionsSchedulingOptions and assigns it to the SchedulingOptions field.
func (o *MonitorOptions) SetSchedulingOptions(v MonitorOptionsSchedulingOptions) {
o.SchedulingOptions = &v
}

// GetSilenced returns the Silenced field value if set, zero value otherwise.
// Deprecated
func (o *MonitorOptions) GetSilenced() map[string]int64 {
Expand Down Expand Up @@ -1145,6 +1175,9 @@ func (o MonitorOptions) MarshalJSON() ([]byte, error) {
if o.RequireFullWindow != nil {
toSerialize["require_full_window"] = o.RequireFullWindow
}
if o.SchedulingOptions != nil {
toSerialize["scheduling_options"] = o.SchedulingOptions
}
if o.Silenced != nil {
toSerialize["silenced"] = o.Silenced
}
Expand Down Expand Up @@ -1196,6 +1229,7 @@ func (o *MonitorOptions) UnmarshalJSON(bytes []byte) (err error) {
RenotifyOccurrences datadog.NullableInt64 `json:"renotify_occurrences,omitempty"`
RenotifyStatuses []MonitorRenotifyStatusType `json:"renotify_statuses,omitempty"`
RequireFullWindow *bool `json:"require_full_window,omitempty"`
SchedulingOptions *MonitorOptionsSchedulingOptions `json:"scheduling_options,omitempty"`
Silenced map[string]int64 `json:"silenced,omitempty"`
SyntheticsCheckId datadog.NullableString `json:"synthetics_check_id,omitempty"`
ThresholdWindows *MonitorThresholdWindowOptions `json:"threshold_windows,omitempty"`
Expand Down Expand Up @@ -1249,6 +1283,14 @@ func (o *MonitorOptions) UnmarshalJSON(bytes []byte) (err error) {
o.RenotifyOccurrences = all.RenotifyOccurrences
o.RenotifyStatuses = all.RenotifyStatuses
o.RequireFullWindow = all.RequireFullWindow
if all.SchedulingOptions != nil && all.SchedulingOptions.UnparsedObject != nil && o.UnparsedObject == nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
}
o.SchedulingOptions = all.SchedulingOptions
o.Silenced = all.Silenced
o.SyntheticsCheckId = all.SyntheticsCheckId
if all.ThresholdWindows != nil && all.ThresholdWindows.UnparsedObject != nil && o.UnparsedObject == nil {
Expand Down
105 changes: 105 additions & 0 deletions api/datadogV1/model_monitor_options_scheduling_options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// 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 (
"encoding/json"
)

// MonitorOptionsSchedulingOptions Configuration options for scheduling.
type MonitorOptionsSchedulingOptions struct {
// Configuration options for the evaluation window. If `hour_starts` is set, no other fields may be set. Otherwise, `day_starts` and `month_starts` must be set together.
EvaluationWindow *MonitorOptionsSchedulingOptionsEvaluationWindow `json:"evaluation_window,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{}
}

// NewMonitorOptionsSchedulingOptions instantiates a new MonitorOptionsSchedulingOptions object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewMonitorOptionsSchedulingOptions() *MonitorOptionsSchedulingOptions {
this := MonitorOptionsSchedulingOptions{}
return &this
}

// NewMonitorOptionsSchedulingOptionsWithDefaults instantiates a new MonitorOptionsSchedulingOptions object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewMonitorOptionsSchedulingOptionsWithDefaults() *MonitorOptionsSchedulingOptions {
this := MonitorOptionsSchedulingOptions{}
return &this
}

// GetEvaluationWindow returns the EvaluationWindow field value if set, zero value otherwise.
func (o *MonitorOptionsSchedulingOptions) GetEvaluationWindow() MonitorOptionsSchedulingOptionsEvaluationWindow {
if o == nil || o.EvaluationWindow == nil {
var ret MonitorOptionsSchedulingOptionsEvaluationWindow
return ret
}
return *o.EvaluationWindow
}

// GetEvaluationWindowOk returns a tuple with the EvaluationWindow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MonitorOptionsSchedulingOptions) GetEvaluationWindowOk() (*MonitorOptionsSchedulingOptionsEvaluationWindow, bool) {
if o == nil || o.EvaluationWindow == nil {
return nil, false
}
return o.EvaluationWindow, true
}

// HasEvaluationWindow returns a boolean if a field has been set.
func (o *MonitorOptionsSchedulingOptions) HasEvaluationWindow() bool {
return o != nil && o.EvaluationWindow != nil
}

// SetEvaluationWindow gets a reference to the given MonitorOptionsSchedulingOptionsEvaluationWindow and assigns it to the EvaluationWindow field.
func (o *MonitorOptionsSchedulingOptions) SetEvaluationWindow(v MonitorOptionsSchedulingOptionsEvaluationWindow) {
o.EvaluationWindow = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o MonitorOptionsSchedulingOptions) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return json.Marshal(o.UnparsedObject)
}
if o.EvaluationWindow != nil {
toSerialize["evaluation_window"] = o.EvaluationWindow
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *MonitorOptionsSchedulingOptions) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
EvaluationWindow *MonitorOptionsSchedulingOptionsEvaluationWindow `json:"evaluation_window,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
if all.EvaluationWindow != nil && all.EvaluationWindow.UnparsedObject != nil && o.UnparsedObject == nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
}
o.EvaluationWindow = all.EvaluationWindow
return nil
}
Loading

0 comments on commit 925bfcf

Please sign in to comment.