datadog_api_client 2.38.0 → 2.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.generated-info +4 -0
  3. data/.generator/schemas/v1/openapi.yaml +493 -13
  4. data/.generator/schemas/v2/openapi.yaml +1021 -36
  5. data/.github/workflows/approved_status.yml +1 -0
  6. data/.github/workflows/test.yml +1 -1
  7. data/CHANGELOG.md +16 -0
  8. data/examples/v1/dashboards/CreateDashboard_1751391372.rb +41 -0
  9. data/examples/v1/dashboards/CreatePublicDashboard_1668947073.rb +28 -0
  10. data/examples/v1/dashboards/UpdatePublicDashboard_1708268778.rb +27 -0
  11. data/examples/v1/logs-pipelines/CreateLogsPipeline_1248402480.rb +25 -0
  12. data/examples/v1/logs-pipelines/CreateLogsPipeline_1267211320.rb +27 -0
  13. data/examples/v1/logs-pipelines/CreateLogsPipeline_1271012410.rb +25 -0
  14. data/examples/v1/logs-pipelines/CreateLogsPipeline_3314493032.rb +26 -0
  15. data/examples/v1/logs-pipelines/CreateLogsPipeline_3934594739.rb +26 -0
  16. data/examples/v1/synthetics/SearchTests.rb +5 -0
  17. data/examples/v1/synthetics/SearchTests_195957771.rb +13 -0
  18. data/examples/v2/aws-integration/GetAWSIntegrationIAMPermissions.rb +5 -0
  19. data/examples/v2/cloud-cost-management/CreateCostGCPUsageCostConfig.rb +19 -0
  20. data/examples/v2/cloud-cost-management/DeleteCostGCPUsageCostConfig.rb +5 -0
  21. data/examples/v2/cloud-cost-management/ListCostGCPUsageCostConfigs.rb +5 -0
  22. data/examples/v2/cloud-cost-management/UpdateCostGCPUsageCostConfig.rb +14 -0
  23. data/examples/v2/datasets/CreateDataset.rb +27 -0
  24. data/examples/v2/datasets/DeleteDataset.rb +5 -0
  25. data/examples/v2/datasets/GetAllDatasets.rb +5 -0
  26. data/examples/v2/datasets/GetDataset.rb +5 -0
  27. data/examples/v2/monitors/CreateMonitorNotificationRule.rb +0 -3
  28. data/examples/v2/monitors/DeleteMonitorNotificationRule.rb +0 -3
  29. data/examples/v2/monitors/GetMonitorNotificationRule.rb +0 -3
  30. data/examples/v2/monitors/GetMonitorNotificationRules.rb +0 -3
  31. data/examples/v2/monitors/UpdateMonitorNotificationRule.rb +0 -3
  32. data/examples/v2/on-call/UpdateOnCallSchedule.rb +1 -1
  33. data/examples/v2/security-monitoring/ListAssetsSBOMs.rb +12 -0
  34. data/lib/datadog_api_client/configuration.rb +1 -5
  35. data/lib/datadog_api_client/inflector.rb +41 -0
  36. data/lib/datadog_api_client/v1/api/hosts_api.rb +1 -0
  37. data/lib/datadog_api_client/v1/api/synthetics_api.rb +72 -0
  38. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +6 -6
  39. data/lib/datadog_api_client/v1/models/dashboard_template_variable.rb +14 -3
  40. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_body.rb +1 -0
  41. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +9 -1
  42. data/lib/datadog_api_client/v1/models/logs_array_processor.rb +168 -0
  43. data/lib/datadog_api_client/v1/models/logs_array_processor_operation.rb +64 -0
  44. data/lib/datadog_api_client/v1/models/logs_array_processor_operation_append.rb +175 -0
  45. data/lib/datadog_api_client/v1/models/logs_array_processor_operation_append_type.rb +26 -0
  46. data/lib/datadog_api_client/v1/models/logs_array_processor_operation_length.rb +165 -0
  47. data/lib/datadog_api_client/v1/models/logs_array_processor_operation_length_type.rb +26 -0
  48. data/lib/datadog_api_client/v1/models/logs_array_processor_operation_select.rb +207 -0
  49. data/lib/datadog_api_client/v1/models/logs_array_processor_operation_select_type.rb +26 -0
  50. data/lib/datadog_api_client/v1/models/logs_array_processor_type.rb +26 -0
  51. data/lib/datadog_api_client/v1/models/logs_processor.rb +2 -1
  52. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_body.rb +1 -0
  53. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +14 -0
  54. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +142 -1
  55. data/lib/datadog_api_client/v1/models/selectable_template_variable_items.rb +12 -1
  56. data/lib/datadog_api_client/v1/models/synthetics_step_type.rb +1 -0
  57. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +81 -1
  58. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +81 -1
  59. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +81 -1
  60. data/lib/datadog_api_client/v2/api/aws_integration_api.rb +60 -0
  61. data/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +264 -0
  62. data/lib/datadog_api_client/v2/api/datasets_api.rb +283 -0
  63. data/lib/datadog_api_client/v2/api/events_api.rb +2 -0
  64. data/lib/datadog_api_client/v2/api/monitors_api.rb +0 -30
  65. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +7 -3
  66. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +111 -0
  67. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  68. data/lib/datadog_api_client/v2/models/asset_attributes.rb +13 -1
  69. data/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response.rb +123 -0
  70. data/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_attributes.rb +125 -0
  71. data/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data.rb +125 -0
  72. data/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data_type.rb +26 -0
  73. data/lib/datadog_api_client/v2/models/dataset.rb +154 -0
  74. data/lib/datadog_api_client/v2/models/dataset_attributes.rb +197 -0
  75. data/lib/datadog_api_client/v2/models/dataset_create_request.rb +123 -0
  76. data/lib/datadog_api_client/v2/models/dataset_response_multi.rb +125 -0
  77. data/lib/datadog_api_client/v2/models/dataset_response_single.rb +123 -0
  78. data/lib/datadog_api_client/v2/models/filters_per_product.rb +150 -0
  79. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config.rb +154 -0
  80. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_attributes.rb +369 -0
  81. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_patch_data.rb +144 -0
  82. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_patch_request.rb +123 -0
  83. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_patch_request_attributes.rb +123 -0
  84. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_patch_request_type.rb +26 -0
  85. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_post_data.rb +144 -0
  86. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_post_request.rb +123 -0
  87. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_post_request_attributes.rb +217 -0
  88. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_post_request_type.rb +26 -0
  89. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_response.rb +105 -0
  90. data/lib/datadog_api_client/v2/models/gcp_usage_cost_config_type.rb +26 -0
  91. data/lib/datadog_api_client/v2/models/gcp_usage_cost_configs_response.rb +107 -0
  92. data/lib/datadog_api_client/v2/models/layer_attributes.rb +1 -1
  93. data/lib/datadog_api_client/v2/models/layer_attributes_interval.rb +1 -1
  94. data/lib/datadog_api_client/v2/models/list_assets_sbo_ms_response.rb +145 -0
  95. data/lib/datadog_api_client/v2/models/sbom_attributes.rb +24 -1
  96. data/lib/datadog_api_client/v2/models/sbom_component.rb +46 -1
  97. data/lib/datadog_api_client/v2/models/sbom_component_dependency.rb +117 -0
  98. data/lib/datadog_api_client/v2/models/sbom_component_license.rb +123 -0
  99. data/lib/datadog_api_client/v2/models/sbom_component_license_license.rb +123 -0
  100. data/lib/datadog_api_client/v2/models/sbom_component_license_type.rb +33 -0
  101. data/lib/datadog_api_client/v2/models/sbom_component_property.rb +144 -0
  102. data/lib/datadog_api_client/v2/models/sbom_component_supplier.rb +123 -0
  103. data/lib/datadog_api_client/v2/models/sbom_metadata.rb +25 -3
  104. data/lib/datadog_api_client/v2/models/sbom_metadata_author.rb +105 -0
  105. data/lib/datadog_api_client/v2/models/schedule_create_request_data_attributes_layers_items.rb +1 -1
  106. data/lib/datadog_api_client/v2/models/schedule_update_request_data_attributes_layers_items.rb +1 -1
  107. data/lib/datadog_api_client/v2/models/vulnerability_attributes.rb +24 -1
  108. data/lib/datadog_api_client/version.rb +1 -1
  109. metadata +63 -2
  110. data/.apigentools-info +0 -16
@@ -0,0 +1,123 @@
1
+ =begin
2
+ #Datadog API V2 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::V2
20
+ # AWS Integration IAM Permissions response body.
21
+ class AWSIntegrationIamPermissionsResponse
22
+ include BaseGenericModel
23
+
24
+ # AWS Integration IAM Permissions response data.
25
+ attr_reader :data
26
+
27
+ attr_accessor :additional_properties
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ # @!visibility private
31
+ def self.attribute_map
32
+ {
33
+ :'data' => :'data'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ # @!visibility private
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'AWSIntegrationIamPermissionsResponseData'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param attributes [Hash] Model attributes in the form of hash
47
+ # @!visibility private
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSIntegrationIamPermissionsResponse` initialize method"
51
+ end
52
+
53
+ self.additional_properties = {}
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ self.additional_properties[k.to_sym] = v
58
+ else
59
+ h[k.to_sym] = v
60
+ end
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ self.data = attributes[:'data']
65
+ end
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ # @!visibility private
71
+ def valid?
72
+ return false if @data.nil?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param data [Object] Object to be assigned
78
+ # @!visibility private
79
+ def data=(data)
80
+ if data.nil?
81
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
82
+ end
83
+ @data = data
84
+ end
85
+
86
+ # Returns the object in the form of hash, with additionalProperties support.
87
+ # @return [Hash] Returns the object in the form of hash
88
+ # @!visibility private
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ if value.nil?
94
+ is_nullable = self.class.openapi_nullable.include?(attr)
95
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96
+ end
97
+
98
+ hash[param] = _to_hash(value)
99
+ end
100
+ self.additional_properties.each_pair do |attr, value|
101
+ hash[attr] = value
102
+ end
103
+ hash
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ data == o.data &&
113
+ additional_properties == o.additional_properties
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ # @!visibility private
119
+ def hash
120
+ [data, additional_properties].hash
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,125 @@
1
+ =begin
2
+ #Datadog API V2 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::V2
20
+ # AWS Integration IAM Permissions response attributes.
21
+ class AWSIntegrationIamPermissionsResponseAttributes
22
+ include BaseGenericModel
23
+
24
+ # List of AWS IAM permissions required for the integration.
25
+ attr_reader :permissions
26
+
27
+ attr_accessor :additional_properties
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ # @!visibility private
31
+ def self.attribute_map
32
+ {
33
+ :'permissions' => :'permissions'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ # @!visibility private
39
+ def self.openapi_types
40
+ {
41
+ :'permissions' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param attributes [Hash] Model attributes in the form of hash
47
+ # @!visibility private
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSIntegrationIamPermissionsResponseAttributes` initialize method"
51
+ end
52
+
53
+ self.additional_properties = {}
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ self.additional_properties[k.to_sym] = v
58
+ else
59
+ h[k.to_sym] = v
60
+ end
61
+ }
62
+
63
+ if attributes.key?(:'permissions')
64
+ if (value = attributes[:'permissions']).is_a?(Array)
65
+ self.permissions = value
66
+ end
67
+ end
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ # @!visibility private
73
+ def valid?
74
+ return false if @permissions.nil?
75
+ true
76
+ end
77
+
78
+ # Custom attribute writer method with validation
79
+ # @param permissions [Object] Object to be assigned
80
+ # @!visibility private
81
+ def permissions=(permissions)
82
+ if permissions.nil?
83
+ fail ArgumentError, 'invalid value for "permissions", permissions cannot be nil.'
84
+ end
85
+ @permissions = permissions
86
+ end
87
+
88
+ # Returns the object in the form of hash, with additionalProperties support.
89
+ # @return [Hash] Returns the object in the form of hash
90
+ # @!visibility private
91
+ def to_hash
92
+ hash = {}
93
+ self.class.attribute_map.each_pair do |attr, param|
94
+ value = self.send(attr)
95
+ if value.nil?
96
+ is_nullable = self.class.openapi_nullable.include?(attr)
97
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
98
+ end
99
+
100
+ hash[param] = _to_hash(value)
101
+ end
102
+ self.additional_properties.each_pair do |attr, value|
103
+ hash[attr] = value
104
+ end
105
+ hash
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param o [Object] Object to be compared
110
+ # @!visibility private
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ permissions == o.permissions &&
115
+ additional_properties == o.additional_properties
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ # @!visibility private
121
+ def hash
122
+ [permissions, additional_properties].hash
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,125 @@
1
+ =begin
2
+ #Datadog API V2 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::V2
20
+ # AWS Integration IAM Permissions response data.
21
+ class AWSIntegrationIamPermissionsResponseData
22
+ include BaseGenericModel
23
+
24
+ # AWS Integration IAM Permissions response attributes.
25
+ attr_accessor :attributes
26
+
27
+ # The `AWSIntegrationIamPermissionsResponseData` `id`.
28
+ attr_accessor :id
29
+
30
+ # The `AWSIntegrationIamPermissionsResponseData` `type`.
31
+ attr_accessor :type
32
+
33
+ attr_accessor :additional_properties
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ # @!visibility private
37
+ def self.attribute_map
38
+ {
39
+ :'attributes' => :'attributes',
40
+ :'id' => :'id',
41
+ :'type' => :'type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'attributes' => :'AWSIntegrationIamPermissionsResponseAttributes',
50
+ :'id' => :'String',
51
+ :'type' => :'AWSIntegrationIamPermissionsResponseDataType'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param attributes [Hash] Model attributes in the form of hash
57
+ # @!visibility private
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSIntegrationIamPermissionsResponseData` initialize method"
61
+ end
62
+
63
+ self.additional_properties = {}
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ self.additional_properties[k.to_sym] = v
68
+ else
69
+ h[k.to_sym] = v
70
+ end
71
+ }
72
+
73
+ if attributes.key?(:'attributes')
74
+ self.attributes = attributes[:'attributes']
75
+ end
76
+
77
+ if attributes.key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes.key?(:'type')
82
+ self.type = attributes[:'type']
83
+ end
84
+ end
85
+
86
+ # Returns the object in the form of hash, with additionalProperties support.
87
+ # @return [Hash] Returns the object in the form of hash
88
+ # @!visibility private
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ if value.nil?
94
+ is_nullable = self.class.openapi_nullable.include?(attr)
95
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96
+ end
97
+
98
+ hash[param] = _to_hash(value)
99
+ end
100
+ self.additional_properties.each_pair do |attr, value|
101
+ hash[attr] = value
102
+ end
103
+ hash
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ attributes == o.attributes &&
113
+ id == o.id &&
114
+ type == o.type &&
115
+ additional_properties == o.additional_properties
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ # @!visibility private
121
+ def hash
122
+ [attributes, id, type, additional_properties].hash
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ #Datadog API V2 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::V2
20
+ # The `AWSIntegrationIamPermissionsResponseData` `type`.
21
+ class AWSIntegrationIamPermissionsResponseDataType
22
+ include BaseEnumModel
23
+
24
+ PERMISSIONS = "permissions".freeze
25
+ end
26
+ end
@@ -0,0 +1,154 @@
1
+ =begin
2
+ #Datadog API V2 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::V2
20
+ # Dataset object.
21
+ class Dataset
22
+ include BaseGenericModel
23
+
24
+ # Dataset metadata and configuration(s).
25
+ attr_reader :attributes
26
+
27
+ # Unique identifier for the dataset.
28
+ attr_accessor :id
29
+
30
+ # Resource type, always "dataset".
31
+ attr_reader :type
32
+
33
+ attr_accessor :additional_properties
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ # @!visibility private
37
+ def self.attribute_map
38
+ {
39
+ :'attributes' => :'attributes',
40
+ :'id' => :'id',
41
+ :'type' => :'type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'attributes' => :'DatasetAttributes',
50
+ :'id' => :'String',
51
+ :'type' => :'String'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param attributes [Hash] Model attributes in the form of hash
57
+ # @!visibility private
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Dataset` initialize method"
61
+ end
62
+
63
+ self.additional_properties = {}
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ self.additional_properties[k.to_sym] = v
68
+ else
69
+ h[k.to_sym] = v
70
+ end
71
+ }
72
+
73
+ if attributes.key?(:'attributes')
74
+ self.attributes = attributes[:'attributes']
75
+ end
76
+
77
+ if attributes.key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes.key?(:'type')
82
+ self.type = attributes[:'type']
83
+ end
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ # @!visibility private
89
+ def valid?
90
+ return false if @attributes.nil?
91
+ return false if @type.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param attributes [Object] Object to be assigned
97
+ # @!visibility private
98
+ def attributes=(attributes)
99
+ if attributes.nil?
100
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
101
+ end
102
+ @attributes = attributes
103
+ end
104
+
105
+ # Custom attribute writer method with validation
106
+ # @param type [Object] Object to be assigned
107
+ # @!visibility private
108
+ def type=(type)
109
+ if type.nil?
110
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
111
+ end
112
+ @type = type
113
+ end
114
+
115
+ # Returns the object in the form of hash, with additionalProperties support.
116
+ # @return [Hash] Returns the object in the form of hash
117
+ # @!visibility private
118
+ def to_hash
119
+ hash = {}
120
+ self.class.attribute_map.each_pair do |attr, param|
121
+ value = self.send(attr)
122
+ if value.nil?
123
+ is_nullable = self.class.openapi_nullable.include?(attr)
124
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
125
+ end
126
+
127
+ hash[param] = _to_hash(value)
128
+ end
129
+ self.additional_properties.each_pair do |attr, value|
130
+ hash[attr] = value
131
+ end
132
+ hash
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param o [Object] Object to be compared
137
+ # @!visibility private
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ attributes == o.attributes &&
142
+ id == o.id &&
143
+ type == o.type &&
144
+ additional_properties == o.additional_properties
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ # @!visibility private
150
+ def hash
151
+ [attributes, id, type, additional_properties].hash
152
+ end
153
+ end
154
+ end