Update documentation with account filtering info for aws_cur_config endpoints#2251
Conversation
| } | ||
|
|
||
| if attributes.key?(:'excluded_accounts') | ||
| if (value = attributes[:'excluded_accounts']).is_a?(Array) |
There was a problem hiding this comment.
⚪ Code Quality Violation
Consider using Array() to ensure the type is that of an array (...read more)
The rule "Use Array() to ensure your variable is an array" is important for ensuring your code behaves as expected, regardless of the type of data it receives. It is common in Ruby to need to iterate through an array of items. However, if the variable is not an array, this can lead to unexpected behavior or errors.
The Array() method in Ruby is a Kernel method that converts its argument to an Array. If the argument is already an Array, it returns the argument. If the argument is nil, it returns an empty Array. This can be used to ensure that a variable is an array before trying to iterate over it, preventing potential errors or unexpected behavior.
By using Array(foos), you can ensure that foos is an array before you try to iterate over it with each. This prevents the need to check if foos is an array with foos.is_a?(Array) and makes your code cleaner and easier to understand.
| end | ||
|
|
||
| if attributes.key?(:'included_accounts') | ||
| if (value = attributes[:'included_accounts']).is_a?(Array) |
There was a problem hiding this comment.
⚪ Code Quality Violation
Consider using Array() to ensure the type is that of an array (...read more)
The rule "Use Array() to ensure your variable is an array" is important for ensuring your code behaves as expected, regardless of the type of data it receives. It is common in Ruby to need to iterate through an array of items. However, if the variable is not an array, this can lead to unexpected behavior or errors.
The Array() method in Ruby is a Kernel method that converts its argument to an Array. If the argument is already an Array, it returns the argument. If the argument is nil, it returns an empty Array. This can be used to ensure that a variable is an array before trying to iterate over it, preventing potential errors or unexpected behavior.
By using Array(foos), you can ensure that foos is an array before you try to iterate over it with each. This prevents the need to check if foos is an array with foos.is_a?(Array) and makes your code cleaner and easier to understand.
Datadog ReportBranch report: ✅ 0 Failed, 1189 Passed, 1790 Skipped, 2m 3.5s Total Time |
5752064 to
eb86d3b
Compare
eb86d3b to
81e79e4
Compare
See DataDog/datadog-api-spec#3359
Test branch datadog-api-spec/test/jahanzeb.hassan/update-aws-cur-config-documentation-with-account-filtering-info