datadog_api_client 2.23.0 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/schemas/v1/openapi.yaml +666 -156
- data/.generator/schemas/v2/openapi.yaml +774 -89
- data/.generator/src/generator/replacement.json +1 -1
- data/.github/CODEOWNERS +5 -5
- data/CHANGELOG.md +26 -0
- data/examples/v1/dashboards/CreateDashboard_1213075383.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_2336428357.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_2563642929.rb +66 -0
- data/examples/v1/dashboards/CreateDashboard_3669695268.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_915214113.rb +10 -4
- data/examples/v1/monitors/UpdateMonitor.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +9 -4
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +15 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.rb +134 -0
- data/examples/v2/api-management/ListAPIs.rb +8 -0
- data/examples/v2/csm-threats/CreateCSMThreatsAgentRule.rb +3 -0
- data/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.rb +1 -0
- data/examples/v2/organizations/GetOrgConfig.rb +5 -0
- data/examples/v2/organizations/ListOrgConfigs.rb +5 -0
- data/examples/v2/organizations/UpdateOrgConfig.rb +14 -0
- data/examples/v2/security-monitoring/TestExistingSecurityMonitoringRule.rb +21 -0
- data/examples/v2/security-monitoring/TestSecurityMonitoringRule.rb +58 -0
- data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +1 -1
- data/lib/datadog_api_client/configuration.rb +1 -0
- data/lib/datadog_api_client/inflector.rb +37 -1
- data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
- data/lib/datadog_api_client/v1/models/event.rb +1 -1
- data/lib/datadog_api_client/v1/models/formula_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +14 -4
- data/lib/datadog_api_client/v1/models/group_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/monitor.rb +1 -16
- data/lib/datadog_api_client/v1/models/monitor_update_request.rb +2 -23
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +37 -180
- data/lib/datadog_api_client/v1/models/synthetics_api_test_step.rb +206 -0
- data/lib/datadog_api_client/v1/models/{synthetics_api_step_subtype.rb → synthetics_api_test_step_subtype.rb} +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_api_wait_step.rb +148 -0
- data/lib/datadog_api_client/v1/models/synthetics_api_wait_step_subtype.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_operator.rb +28 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_target.rb +140 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_json_path_target_target.rb +11 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb +0 -4
- data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +22 -1
- data/lib/datadog_api_client/v1/models/table_widget_request.rb +14 -4
- data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +7 -7
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_response.rb +2 -2
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +168 -18
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +169 -19
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +171 -21
- data/lib/datadog_api_client/v1/models/widget_formula_sort.rb +144 -0
- data/lib/datadog_api_client/v1/models/widget_group_sort.rb +140 -0
- data/lib/datadog_api_client/v1/models/widget_sort_by.rb +110 -0
- data/lib/datadog_api_client/v1/models/widget_sort_order_by.rb +63 -0
- data/lib/datadog_api_client/v2/api/api_management_api.rb +80 -2
- data/lib/datadog_api_client/v2/api/organizations_api.rb +197 -0
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +140 -1
- data/lib/datadog_api_client/v2/models/cloud_configuration_rule_payload.rb +240 -0
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb +13 -1
- data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v2/models/events_group_by.rb +5 -4
- data/lib/datadog_api_client/v2/models/list_apis_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_data_attributes.rb +80 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_meta.rb +80 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_meta_pagination.rb +100 -0
- data/lib/datadog_api_client/v2/models/org_config_get_response.rb +98 -0
- data/lib/datadog_api_client/v2/models/org_config_list_response.rb +100 -0
- data/lib/datadog_api_client/v2/models/org_config_read.rb +140 -0
- data/lib/datadog_api_client/v2/models/org_config_read_attributes.rb +179 -0
- data/lib/datadog_api_client/v2/models/org_config_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/org_config_write.rb +119 -0
- data/lib/datadog_api_client/v2/models/org_config_write_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/org_config_write_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload.rb +118 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload_data.rb +120 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_payload.rb +62 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_request.rb +92 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_response.rb +84 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_test.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_validate_payload.rb +64 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_payload.rb +251 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_payload.rb +263 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_test_payload.rb +263 -0
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +47 -3
@@ -0,0 +1,144 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 Collection
|
3
|
+
|
4
|
+
#Collection of all Datadog Public endpoints.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@datadoghq.com
|
8
|
+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
|
9
|
+
|
10
|
+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
|
11
|
+
This product includes software developed at Datadog (https://www.datadoghq.com/).
|
12
|
+
Copyright 2020-Present Datadog, Inc.
|
13
|
+
|
14
|
+
=end
|
15
|
+
|
16
|
+
require 'date'
|
17
|
+
require 'time'
|
18
|
+
|
19
|
+
module DatadogAPIClient::V1
|
20
|
+
# The formula to sort the widget by.
|
21
|
+
class WidgetFormulaSort
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# The index of the formula to sort by.
|
25
|
+
attr_reader :index
|
26
|
+
|
27
|
+
# Widget sorting methods.
|
28
|
+
attr_reader :order
|
29
|
+
|
30
|
+
# Set the sort type to formula.
|
31
|
+
attr_reader :type
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
# @!visibility private
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'index' => :'index',
|
38
|
+
:'order' => :'order',
|
39
|
+
:'type' => :'type'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
# @!visibility private
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'index' => :'Integer',
|
48
|
+
:'order' => :'WidgetSort',
|
49
|
+
:'type' => :'FormulaType'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
55
|
+
# @!visibility private
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetFormulaSort` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetFormulaSort`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'index')
|
70
|
+
self.index = attributes[:'index']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'order')
|
74
|
+
self.order = attributes[:'order']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'type')
|
78
|
+
self.type = attributes[:'type']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
# @!visibility private
|
85
|
+
def valid?
|
86
|
+
return false if @index.nil?
|
87
|
+
return false if @index < 0
|
88
|
+
return false if @order.nil?
|
89
|
+
return false if @type.nil?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Custom attribute writer method with validation
|
94
|
+
# @param index [Object] Object to be assigned
|
95
|
+
# @!visibility private
|
96
|
+
def index=(index)
|
97
|
+
if index.nil?
|
98
|
+
fail ArgumentError, 'invalid value for "index", index cannot be nil.'
|
99
|
+
end
|
100
|
+
if index < 0
|
101
|
+
fail ArgumentError, 'invalid value for "index", must be greater than or equal to 0.'
|
102
|
+
end
|
103
|
+
@index = index
|
104
|
+
end
|
105
|
+
|
106
|
+
# Custom attribute writer method with validation
|
107
|
+
# @param order [Object] Object to be assigned
|
108
|
+
# @!visibility private
|
109
|
+
def order=(order)
|
110
|
+
if order.nil?
|
111
|
+
fail ArgumentError, 'invalid value for "order", order cannot be nil.'
|
112
|
+
end
|
113
|
+
@order = order
|
114
|
+
end
|
115
|
+
|
116
|
+
# Custom attribute writer method with validation
|
117
|
+
# @param type [Object] Object to be assigned
|
118
|
+
# @!visibility private
|
119
|
+
def type=(type)
|
120
|
+
if type.nil?
|
121
|
+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
|
122
|
+
end
|
123
|
+
@type = type
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param o [Object] Object to be compared
|
128
|
+
# @!visibility private
|
129
|
+
def ==(o)
|
130
|
+
return true if self.equal?(o)
|
131
|
+
self.class == o.class &&
|
132
|
+
index == o.index &&
|
133
|
+
order == o.order &&
|
134
|
+
type == o.type
|
135
|
+
end
|
136
|
+
|
137
|
+
# Calculates hash code according to all attributes.
|
138
|
+
# @return [Integer] Hash code
|
139
|
+
# @!visibility private
|
140
|
+
def hash
|
141
|
+
[index, order, type].hash
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 Collection
|
3
|
+
|
4
|
+
#Collection of all Datadog Public endpoints.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@datadoghq.com
|
8
|
+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
|
9
|
+
|
10
|
+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
|
11
|
+
This product includes software developed at Datadog (https://www.datadoghq.com/).
|
12
|
+
Copyright 2020-Present Datadog, Inc.
|
13
|
+
|
14
|
+
=end
|
15
|
+
|
16
|
+
require 'date'
|
17
|
+
require 'time'
|
18
|
+
|
19
|
+
module DatadogAPIClient::V1
|
20
|
+
# The group to sort the widget by.
|
21
|
+
class WidgetGroupSort
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# The name of the group.
|
25
|
+
attr_reader :name
|
26
|
+
|
27
|
+
# Widget sorting methods.
|
28
|
+
attr_reader :order
|
29
|
+
|
30
|
+
# Set the sort type to group.
|
31
|
+
attr_reader :type
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
# @!visibility private
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'name' => :'name',
|
38
|
+
:'order' => :'order',
|
39
|
+
:'type' => :'type'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
# @!visibility private
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'name' => :'String',
|
48
|
+
:'order' => :'WidgetSort',
|
49
|
+
:'type' => :'GroupType'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
55
|
+
# @!visibility private
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetGroupSort` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetGroupSort`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'name')
|
70
|
+
self.name = attributes[:'name']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'order')
|
74
|
+
self.order = attributes[:'order']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'type')
|
78
|
+
self.type = attributes[:'type']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
# @!visibility private
|
85
|
+
def valid?
|
86
|
+
return false if @name.nil?
|
87
|
+
return false if @order.nil?
|
88
|
+
return false if @type.nil?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Custom attribute writer method with validation
|
93
|
+
# @param name [Object] Object to be assigned
|
94
|
+
# @!visibility private
|
95
|
+
def name=(name)
|
96
|
+
if name.nil?
|
97
|
+
fail ArgumentError, 'invalid value for "name", name cannot be nil.'
|
98
|
+
end
|
99
|
+
@name = name
|
100
|
+
end
|
101
|
+
|
102
|
+
# Custom attribute writer method with validation
|
103
|
+
# @param order [Object] Object to be assigned
|
104
|
+
# @!visibility private
|
105
|
+
def order=(order)
|
106
|
+
if order.nil?
|
107
|
+
fail ArgumentError, 'invalid value for "order", order cannot be nil.'
|
108
|
+
end
|
109
|
+
@order = order
|
110
|
+
end
|
111
|
+
|
112
|
+
# Custom attribute writer method with validation
|
113
|
+
# @param type [Object] Object to be assigned
|
114
|
+
# @!visibility private
|
115
|
+
def type=(type)
|
116
|
+
if type.nil?
|
117
|
+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
|
118
|
+
end
|
119
|
+
@type = type
|
120
|
+
end
|
121
|
+
|
122
|
+
# Checks equality by comparing each attribute.
|
123
|
+
# @param o [Object] Object to be compared
|
124
|
+
# @!visibility private
|
125
|
+
def ==(o)
|
126
|
+
return true if self.equal?(o)
|
127
|
+
self.class == o.class &&
|
128
|
+
name == o.name &&
|
129
|
+
order == o.order &&
|
130
|
+
type == o.type
|
131
|
+
end
|
132
|
+
|
133
|
+
# Calculates hash code according to all attributes.
|
134
|
+
# @return [Integer] Hash code
|
135
|
+
# @!visibility private
|
136
|
+
def hash
|
137
|
+
[name, order, type].hash
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 Collection
|
3
|
+
|
4
|
+
#Collection of all Datadog Public endpoints.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@datadoghq.com
|
8
|
+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
|
9
|
+
|
10
|
+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
|
11
|
+
This product includes software developed at Datadog (https://www.datadoghq.com/).
|
12
|
+
Copyright 2020-Present Datadog, Inc.
|
13
|
+
|
14
|
+
=end
|
15
|
+
|
16
|
+
require 'date'
|
17
|
+
require 'time'
|
18
|
+
|
19
|
+
module DatadogAPIClient::V1
|
20
|
+
# The controls for sorting the widget.
|
21
|
+
class WidgetSortBy
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# The number of items to limit the widget to.
|
25
|
+
attr_reader :count
|
26
|
+
|
27
|
+
# The array of items to sort the widget by in order.
|
28
|
+
attr_accessor :order_by
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
# @!visibility private
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'count' => :'count',
|
35
|
+
:'order_by' => :'order_by'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
# @!visibility private
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'count' => :'Integer',
|
44
|
+
:'order_by' => :'Array<WidgetSortOrderBy>'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Initializes the object
|
49
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
50
|
+
# @!visibility private
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetSortBy` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetSortBy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'count')
|
65
|
+
self.count = attributes[:'count']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'order_by')
|
69
|
+
if (value = attributes[:'order_by']).is_a?(Array)
|
70
|
+
self.order_by = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Check to see if the all the properties in the model are valid
|
76
|
+
# @return true if the model is valid
|
77
|
+
# @!visibility private
|
78
|
+
def valid?
|
79
|
+
return false if !@count.nil? && @count < 0
|
80
|
+
true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Custom attribute writer method with validation
|
84
|
+
# @param count [Object] Object to be assigned
|
85
|
+
# @!visibility private
|
86
|
+
def count=(count)
|
87
|
+
if !count.nil? && count < 0
|
88
|
+
fail ArgumentError, 'invalid value for "count", must be greater than or equal to 0.'
|
89
|
+
end
|
90
|
+
@count = count
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param o [Object] Object to be compared
|
95
|
+
# @!visibility private
|
96
|
+
def ==(o)
|
97
|
+
return true if self.equal?(o)
|
98
|
+
self.class == o.class &&
|
99
|
+
count == o.count &&
|
100
|
+
order_by == o.order_by
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
# @!visibility private
|
106
|
+
def hash
|
107
|
+
[count, order_by].hash
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 Collection
|
3
|
+
|
4
|
+
#Collection of all Datadog Public endpoints.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@datadoghq.com
|
8
|
+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
|
9
|
+
|
10
|
+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
|
11
|
+
This product includes software developed at Datadog (https://www.datadoghq.com/).
|
12
|
+
Copyright 2020-Present Datadog, Inc.
|
13
|
+
|
14
|
+
=end
|
15
|
+
|
16
|
+
require 'date'
|
17
|
+
require 'time'
|
18
|
+
|
19
|
+
module DatadogAPIClient::V1
|
20
|
+
# The item to sort the widget by.
|
21
|
+
module WidgetSortOrderBy
|
22
|
+
class << self
|
23
|
+
include BaseOneOfModel
|
24
|
+
include BaseOneOfModelNoDiscriminator
|
25
|
+
|
26
|
+
# List of class defined in oneOf (OpenAPI v3)
|
27
|
+
def openapi_one_of
|
28
|
+
[
|
29
|
+
:'WidgetFormulaSort',
|
30
|
+
:'WidgetGroupSort'
|
31
|
+
]
|
32
|
+
end
|
33
|
+
# Builds the object
|
34
|
+
# @param data [Mixed] Data to be matched against the list of oneOf items
|
35
|
+
# @return [Object] Returns the model or the data itself
|
36
|
+
def build(data)
|
37
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
38
|
+
# Note:
|
39
|
+
# - We do not attempt to check whether exactly one item matches.
|
40
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
41
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
42
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
43
|
+
# - TODO: logging when debugging is set.
|
44
|
+
openapi_one_of.each do |klass|
|
45
|
+
begin
|
46
|
+
next if klass == :AnyType # "nullable: true"
|
47
|
+
typed_data = find_and_cast_into_type(klass, data)
|
48
|
+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
|
49
|
+
return typed_data if typed_data
|
50
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
if openapi_one_of.include?(:AnyType)
|
55
|
+
data
|
56
|
+
else
|
57
|
+
self._unparsed = true
|
58
|
+
DatadogAPIClient::UnparsedObject.new(data)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -34,8 +34,8 @@ module DatadogAPIClient::V2
|
|
34
34
|
# Create a new API.
|
35
35
|
#
|
36
36
|
# Create a new API from the [OpenAPI](https://spec.openapis.org/oas/latest.html) specification given.
|
37
|
-
#
|
38
|
-
#
|
37
|
+
# See the [API Catalog documentation](https://docs.datadoghq.com/api_catalog/add_metadata/) for additional
|
38
|
+
# information about the possible metadata.
|
39
39
|
# It returns the created API ID.
|
40
40
|
#
|
41
41
|
#
|
@@ -239,6 +239,84 @@ module DatadogAPIClient::V2
|
|
239
239
|
return data, status_code, headers
|
240
240
|
end
|
241
241
|
|
242
|
+
# List APIs.
|
243
|
+
#
|
244
|
+
# @see #list_apis_with_http_info
|
245
|
+
def list_apis(opts = {})
|
246
|
+
data, _status_code, _headers = list_apis_with_http_info(opts)
|
247
|
+
data
|
248
|
+
end
|
249
|
+
|
250
|
+
# List APIs.
|
251
|
+
#
|
252
|
+
# List APIs and their IDs.
|
253
|
+
#
|
254
|
+
# @param opts [Hash] the optional parameters
|
255
|
+
# @option opts [String] :query Filter APIs by name
|
256
|
+
# @option opts [Integer] :page_limit Number of items per page.
|
257
|
+
# @option opts [Integer] :page_offset Offset for pagination.
|
258
|
+
# @return [Array<(ListAPIsResponse, Integer, Hash)>] ListAPIsResponse data, response status code and response headers
|
259
|
+
def list_apis_with_http_info(opts = {})
|
260
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.list_apis".to_sym]
|
261
|
+
if unstable_enabled
|
262
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_apis")
|
263
|
+
else
|
264
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_apis"))
|
265
|
+
end
|
266
|
+
|
267
|
+
if @api_client.config.debugging
|
268
|
+
@api_client.config.logger.debug 'Calling API: APIManagementAPI.list_apis ...'
|
269
|
+
end
|
270
|
+
if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] < 1
|
271
|
+
fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling APIManagementAPI.list_apis, must be greater than or equal to 1.'
|
272
|
+
end
|
273
|
+
if @api_client.config.client_side_validation && !opts[:'page_offset'].nil? && opts[:'page_offset'] < 0
|
274
|
+
fail ArgumentError, 'invalid value for "opts[:"page_offset"]" when calling APIManagementAPI.list_apis, must be greater than or equal to 0.'
|
275
|
+
end
|
276
|
+
# resource path
|
277
|
+
local_var_path = '/api/v2/apicatalog/api'
|
278
|
+
|
279
|
+
# query parameters
|
280
|
+
query_params = opts[:query_params] || {}
|
281
|
+
query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
|
282
|
+
query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
|
283
|
+
query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil?
|
284
|
+
|
285
|
+
# header parameters
|
286
|
+
header_params = opts[:header_params] || {}
|
287
|
+
# HTTP header 'Accept' (if needed)
|
288
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
289
|
+
|
290
|
+
# form parameters
|
291
|
+
form_params = opts[:form_params] || {}
|
292
|
+
|
293
|
+
# http body (model)
|
294
|
+
post_body = opts[:debug_body]
|
295
|
+
|
296
|
+
# return_type
|
297
|
+
return_type = opts[:debug_return_type] || 'ListAPIsResponse'
|
298
|
+
|
299
|
+
# auth_names
|
300
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
|
301
|
+
|
302
|
+
new_options = opts.merge(
|
303
|
+
:operation => :list_apis,
|
304
|
+
:header_params => header_params,
|
305
|
+
:query_params => query_params,
|
306
|
+
:form_params => form_params,
|
307
|
+
:body => post_body,
|
308
|
+
:auth_names => auth_names,
|
309
|
+
:return_type => return_type,
|
310
|
+
:api_version => "V2"
|
311
|
+
)
|
312
|
+
|
313
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
314
|
+
if @api_client.config.debugging
|
315
|
+
@api_client.config.logger.debug "API called: APIManagementAPI#list_apis\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
316
|
+
end
|
317
|
+
return data, status_code, headers
|
318
|
+
end
|
319
|
+
|
242
320
|
# Update an API.
|
243
321
|
#
|
244
322
|
# @see #update_open_api_with_http_info
|