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,150 @@
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
+ # Product-specific filters for the dataset.
21
+ class FiltersPerProduct
22
+ include BaseGenericModel
23
+
24
+ # Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
25
+ # These filters act as access control rules. Each filter must follow the tag query syntax used by
26
+ # Datadog (such as `@tag.key:value`), and only one tag or attribute may be used to define the access strategy
27
+ # per telemetry type.
28
+ attr_reader :filters
29
+
30
+ # Name of the product the dataset is for. Possible values are 'apm', 'rum', 'synthetics',
31
+ # 'metrics', 'logs', 'sd_repoinfo', 'error_tracking', 'cloud_cost', and 'ml_obs'.
32
+ attr_reader :product
33
+
34
+ attr_accessor :additional_properties
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ # @!visibility private
38
+ def self.attribute_map
39
+ {
40
+ :'filters' => :'filters',
41
+ :'product' => :'product'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'filters' => :'Array<String>',
50
+ :'product' => :'String'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param attributes [Hash] Model attributes in the form of hash
56
+ # @!visibility private
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FiltersPerProduct` initialize method"
60
+ end
61
+
62
+ self.additional_properties = {}
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ self.additional_properties[k.to_sym] = v
67
+ else
68
+ h[k.to_sym] = v
69
+ end
70
+ }
71
+
72
+ if attributes.key?(:'filters')
73
+ if (value = attributes[:'filters']).is_a?(Array)
74
+ self.filters = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'product')
79
+ self.product = attributes[:'product']
80
+ end
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ # @!visibility private
86
+ def valid?
87
+ return false if @filters.nil?
88
+ return false if @product.nil?
89
+ true
90
+ end
91
+
92
+ # Custom attribute writer method with validation
93
+ # @param filters [Object] Object to be assigned
94
+ # @!visibility private
95
+ def filters=(filters)
96
+ if filters.nil?
97
+ fail ArgumentError, 'invalid value for "filters", filters cannot be nil.'
98
+ end
99
+ @filters = filters
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param product [Object] Object to be assigned
104
+ # @!visibility private
105
+ def product=(product)
106
+ if product.nil?
107
+ fail ArgumentError, 'invalid value for "product", product cannot be nil.'
108
+ end
109
+ @product = product
110
+ end
111
+
112
+ # Returns the object in the form of hash, with additionalProperties support.
113
+ # @return [Hash] Returns the object in the form of hash
114
+ # @!visibility private
115
+ def to_hash
116
+ hash = {}
117
+ self.class.attribute_map.each_pair do |attr, param|
118
+ value = self.send(attr)
119
+ if value.nil?
120
+ is_nullable = self.class.openapi_nullable.include?(attr)
121
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
122
+ end
123
+
124
+ hash[param] = _to_hash(value)
125
+ end
126
+ self.additional_properties.each_pair do |attr, value|
127
+ hash[attr] = value
128
+ end
129
+ hash
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param o [Object] Object to be compared
134
+ # @!visibility private
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ filters == o.filters &&
139
+ product == o.product &&
140
+ additional_properties == o.additional_properties
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ # @!visibility private
146
+ def hash
147
+ [filters, product, additional_properties].hash
148
+ end
149
+ end
150
+ 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
+ # GCP Usage Cost config.
21
+ class GCPUsageCostConfig
22
+ include BaseGenericModel
23
+
24
+ # Attributes for a GCP Usage Cost config.
25
+ attr_reader :attributes
26
+
27
+ # The ID of the GCP Usage Cost config.
28
+ attr_accessor :id
29
+
30
+ # Type of GCP Usage Cost config.
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' => :'GCPUsageCostConfigAttributes',
50
+ :'id' => :'String',
51
+ :'type' => :'GCPUsageCostConfigType'
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::GCPUsageCostConfig` 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
@@ -0,0 +1,369 @@
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
+ # Attributes for a GCP Usage Cost config.
21
+ class GCPUsageCostConfigAttributes
22
+ include BaseGenericModel
23
+
24
+ # The GCP account ID.
25
+ attr_reader :account_id
26
+
27
+ # The GCP bucket name used to store the Usage Cost export.
28
+ attr_reader :bucket_name
29
+
30
+ # The timestamp when the GCP Usage Cost config was created.
31
+ attr_reader :created_at
32
+
33
+ # The export dataset name used for the GCP Usage Cost Report.
34
+ attr_reader :dataset
35
+
36
+ # The error messages for the GCP Usage Cost config.
37
+ attr_accessor :error_messages
38
+
39
+ # The export prefix used for the GCP Usage Cost Report.
40
+ attr_reader :export_prefix
41
+
42
+ # The name of the GCP Usage Cost Report.
43
+ attr_reader :export_project_name
44
+
45
+ # The number of months the report has been backfilled.
46
+ attr_reader :months
47
+
48
+ # The `project_id` of the GCP Usage Cost report.
49
+ attr_accessor :project_id
50
+
51
+ # The unique GCP service account email.
52
+ attr_reader :service_account
53
+
54
+ # The status of the GCP Usage Cost config.
55
+ attr_reader :status
56
+
57
+ # The timestamp when the GCP Usage Cost config status was updated.
58
+ attr_reader :status_updated_at
59
+
60
+ # The timestamp when the GCP Usage Cost config status was updated.
61
+ attr_reader :updated_at
62
+
63
+ attr_accessor :additional_properties
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ # @!visibility private
67
+ def self.attribute_map
68
+ {
69
+ :'account_id' => :'account_id',
70
+ :'bucket_name' => :'bucket_name',
71
+ :'created_at' => :'created_at',
72
+ :'dataset' => :'dataset',
73
+ :'error_messages' => :'error_messages',
74
+ :'export_prefix' => :'export_prefix',
75
+ :'export_project_name' => :'export_project_name',
76
+ :'months' => :'months',
77
+ :'project_id' => :'project_id',
78
+ :'service_account' => :'service_account',
79
+ :'status' => :'status',
80
+ :'status_updated_at' => :'status_updated_at',
81
+ :'updated_at' => :'updated_at'
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ # @!visibility private
87
+ def self.openapi_types
88
+ {
89
+ :'account_id' => :'String',
90
+ :'bucket_name' => :'String',
91
+ :'created_at' => :'String',
92
+ :'dataset' => :'String',
93
+ :'error_messages' => :'Array<String>',
94
+ :'export_prefix' => :'String',
95
+ :'export_project_name' => :'String',
96
+ :'months' => :'Integer',
97
+ :'project_id' => :'String',
98
+ :'service_account' => :'String',
99
+ :'status' => :'String',
100
+ :'status_updated_at' => :'String',
101
+ :'updated_at' => :'String'
102
+ }
103
+ end
104
+
105
+ # List of attributes with nullable: true
106
+ # @!visibility private
107
+ def self.openapi_nullable
108
+ Set.new([
109
+ :'error_messages',
110
+ ])
111
+ end
112
+
113
+ # Initializes the object
114
+ # @param attributes [Hash] Model attributes in the form of hash
115
+ # @!visibility private
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GCPUsageCostConfigAttributes` initialize method"
119
+ end
120
+
121
+ self.additional_properties = {}
122
+ # check to see if the attribute exists and convert string to symbol for hash key
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!self.class.attribute_map.key?(k.to_sym))
125
+ self.additional_properties[k.to_sym] = v
126
+ else
127
+ h[k.to_sym] = v
128
+ end
129
+ }
130
+
131
+ if attributes.key?(:'account_id')
132
+ self.account_id = attributes[:'account_id']
133
+ end
134
+
135
+ if attributes.key?(:'bucket_name')
136
+ self.bucket_name = attributes[:'bucket_name']
137
+ end
138
+
139
+ if attributes.key?(:'created_at')
140
+ self.created_at = attributes[:'created_at']
141
+ end
142
+
143
+ if attributes.key?(:'dataset')
144
+ self.dataset = attributes[:'dataset']
145
+ end
146
+
147
+ if attributes.key?(:'error_messages')
148
+ if (value = attributes[:'error_messages']).is_a?(Array)
149
+ self.error_messages = value
150
+ end
151
+ end
152
+
153
+ if attributes.key?(:'export_prefix')
154
+ self.export_prefix = attributes[:'export_prefix']
155
+ end
156
+
157
+ if attributes.key?(:'export_project_name')
158
+ self.export_project_name = attributes[:'export_project_name']
159
+ end
160
+
161
+ if attributes.key?(:'months')
162
+ self.months = attributes[:'months']
163
+ end
164
+
165
+ if attributes.key?(:'project_id')
166
+ self.project_id = attributes[:'project_id']
167
+ end
168
+
169
+ if attributes.key?(:'service_account')
170
+ self.service_account = attributes[:'service_account']
171
+ end
172
+
173
+ if attributes.key?(:'status')
174
+ self.status = attributes[:'status']
175
+ end
176
+
177
+ if attributes.key?(:'status_updated_at')
178
+ self.status_updated_at = attributes[:'status_updated_at']
179
+ end
180
+
181
+ if attributes.key?(:'updated_at')
182
+ self.updated_at = attributes[:'updated_at']
183
+ end
184
+ end
185
+
186
+ # Check to see if the all the properties in the model are valid
187
+ # @return true if the model is valid
188
+ # @!visibility private
189
+ def valid?
190
+ return false if @account_id.nil?
191
+ return false if @bucket_name.nil?
192
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$/)
193
+ return false if !@created_at.nil? && @created_at !~ pattern
194
+ return false if @dataset.nil?
195
+ return false if @export_prefix.nil?
196
+ return false if @export_project_name.nil?
197
+ return false if !@months.nil? && @months > 36
198
+ return false if @service_account.nil?
199
+ return false if @status.nil?
200
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$/)
201
+ return false if !@status_updated_at.nil? && @status_updated_at !~ pattern
202
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$/)
203
+ return false if !@updated_at.nil? && @updated_at !~ pattern
204
+ true
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param account_id [Object] Object to be assigned
209
+ # @!visibility private
210
+ def account_id=(account_id)
211
+ if account_id.nil?
212
+ fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.'
213
+ end
214
+ @account_id = account_id
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param bucket_name [Object] Object to be assigned
219
+ # @!visibility private
220
+ def bucket_name=(bucket_name)
221
+ if bucket_name.nil?
222
+ fail ArgumentError, 'invalid value for "bucket_name", bucket_name cannot be nil.'
223
+ end
224
+ @bucket_name = bucket_name
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param created_at [Object] Object to be assigned
229
+ # @!visibility private
230
+ def created_at=(created_at)
231
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$/)
232
+ if !created_at.nil? && created_at !~ pattern
233
+ fail ArgumentError, "invalid value for \"created_at\", must conform to the pattern #{pattern}."
234
+ end
235
+ @created_at = created_at
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param dataset [Object] Object to be assigned
240
+ # @!visibility private
241
+ def dataset=(dataset)
242
+ if dataset.nil?
243
+ fail ArgumentError, 'invalid value for "dataset", dataset cannot be nil.'
244
+ end
245
+ @dataset = dataset
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param export_prefix [Object] Object to be assigned
250
+ # @!visibility private
251
+ def export_prefix=(export_prefix)
252
+ if export_prefix.nil?
253
+ fail ArgumentError, 'invalid value for "export_prefix", export_prefix cannot be nil.'
254
+ end
255
+ @export_prefix = export_prefix
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param export_project_name [Object] Object to be assigned
260
+ # @!visibility private
261
+ def export_project_name=(export_project_name)
262
+ if export_project_name.nil?
263
+ fail ArgumentError, 'invalid value for "export_project_name", export_project_name cannot be nil.'
264
+ end
265
+ @export_project_name = export_project_name
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param months [Object] Object to be assigned
270
+ # @!visibility private
271
+ def months=(months)
272
+ if !months.nil? && months > 36
273
+ fail ArgumentError, 'invalid value for "months", must be smaller than or equal to 36.'
274
+ end
275
+ @months = months
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param service_account [Object] Object to be assigned
280
+ # @!visibility private
281
+ def service_account=(service_account)
282
+ if service_account.nil?
283
+ fail ArgumentError, 'invalid value for "service_account", service_account cannot be nil.'
284
+ end
285
+ @service_account = service_account
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param status [Object] Object to be assigned
290
+ # @!visibility private
291
+ def status=(status)
292
+ if status.nil?
293
+ fail ArgumentError, 'invalid value for "status", status cannot be nil.'
294
+ end
295
+ @status = status
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param status_updated_at [Object] Object to be assigned
300
+ # @!visibility private
301
+ def status_updated_at=(status_updated_at)
302
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$/)
303
+ if !status_updated_at.nil? && status_updated_at !~ pattern
304
+ fail ArgumentError, "invalid value for \"status_updated_at\", must conform to the pattern #{pattern}."
305
+ end
306
+ @status_updated_at = status_updated_at
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param updated_at [Object] Object to be assigned
311
+ # @!visibility private
312
+ def updated_at=(updated_at)
313
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$/)
314
+ if !updated_at.nil? && updated_at !~ pattern
315
+ fail ArgumentError, "invalid value for \"updated_at\", must conform to the pattern #{pattern}."
316
+ end
317
+ @updated_at = updated_at
318
+ end
319
+
320
+ # Returns the object in the form of hash, with additionalProperties support.
321
+ # @return [Hash] Returns the object in the form of hash
322
+ # @!visibility private
323
+ def to_hash
324
+ hash = {}
325
+ self.class.attribute_map.each_pair do |attr, param|
326
+ value = self.send(attr)
327
+ if value.nil?
328
+ is_nullable = self.class.openapi_nullable.include?(attr)
329
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
330
+ end
331
+
332
+ hash[param] = _to_hash(value)
333
+ end
334
+ self.additional_properties.each_pair do |attr, value|
335
+ hash[attr] = value
336
+ end
337
+ hash
338
+ end
339
+
340
+ # Checks equality by comparing each attribute.
341
+ # @param o [Object] Object to be compared
342
+ # @!visibility private
343
+ def ==(o)
344
+ return true if self.equal?(o)
345
+ self.class == o.class &&
346
+ account_id == o.account_id &&
347
+ bucket_name == o.bucket_name &&
348
+ created_at == o.created_at &&
349
+ dataset == o.dataset &&
350
+ error_messages == o.error_messages &&
351
+ export_prefix == o.export_prefix &&
352
+ export_project_name == o.export_project_name &&
353
+ months == o.months &&
354
+ project_id == o.project_id &&
355
+ service_account == o.service_account &&
356
+ status == o.status &&
357
+ status_updated_at == o.status_updated_at &&
358
+ updated_at == o.updated_at &&
359
+ additional_properties == o.additional_properties
360
+ end
361
+
362
+ # Calculates hash code according to all attributes.
363
+ # @return [Integer] Hash code
364
+ # @!visibility private
365
+ def hash
366
+ [account_id, bucket_name, created_at, dataset, error_messages, export_prefix, export_project_name, months, project_id, service_account, status, status_updated_at, updated_at, additional_properties].hash
367
+ end
368
+ end
369
+ end