-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update app builder API #2168
base: master
Are you sure you want to change the base?
Update app builder API #2168
Conversation
# Deploy App. | ||
# | ||
# @see #deploy_app_with_http_info | ||
def deploy_app(app_id, opts = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Avoid using a hash as an optional parameter (...read more)
The rule "Avoid hash optional parameters" is a guideline that encourages developers to explicitly declare parameters instead of using a hash for optional parameters. This is because using a hash for optional parameters can make the code harder to understand and maintain. It can also lead to unexpected behavior if a developer accidentally includes a key in the hash that the method does not expect.
This rule is important because it promotes code readability and maintainability. It also helps prevent potential bugs that may occur due to unexpected keys in the optional hash. By explicitly declaring each parameter, developers can easily see what parameters a method expects, making the code easier to read and understand.
To adhere to this rule, instead of using a hash for optional parameters, explicitly declare each parameter in the method definition. For example, instead of using options = {}
in the method definition, declare each parameter like name, email, age
. This way, anyone reading the code can easily understand what parameters the method expects and in what order.
# header parameters | ||
header_params = opts[:header_params] || {} | ||
# HTTP header 'Accept' (if needed) | ||
header_params['Accept'] = @api_client.select_header_accept(['application/json']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
header_params['Accept'] = @api_client.select_header_accept(['application/json']) | |
header_params['Accept'] = @api_client.select_header_accept(%w[application/json]) |
Consider using the %w syntax instead (...read more)
The rule "Prefer %w
to the literal array syntax" is a Ruby style guideline that encourages the use of %w
notation instead of the traditional array syntax when defining arrays of strings. This rule is part of the Ruby community's efforts to promote readability and simplicity in Ruby code.
This rule is important because it helps to keep the code concise and easy to read. The %w
notation allows you to define an array of strings without having to use quotes and commas. This can make the code cleaner and easier to understand, especially when dealing with large arrays.
To follow this rule, replace the traditional array syntax with the %w
notation. For example, instead of writing ['foo', 'bar', 'baz']
, you should write %w[foo bar baz]
. This will create the same array, but in a more readable and concise way. By following this rule, you can help to make your Ruby code cleaner and easier to understand.
# Disable App. | ||
# | ||
# @see #disable_app_with_http_info | ||
def disable_app(app_id, opts = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Avoid using a hash as an optional parameter (...read more)
The rule "Avoid hash optional parameters" is a guideline that encourages developers to explicitly declare parameters instead of using a hash for optional parameters. This is because using a hash for optional parameters can make the code harder to understand and maintain. It can also lead to unexpected behavior if a developer accidentally includes a key in the hash that the method does not expect.
This rule is important because it promotes code readability and maintainability. It also helps prevent potential bugs that may occur due to unexpected keys in the optional hash. By explicitly declaring each parameter, developers can easily see what parameters a method expects, making the code easier to read and understand.
To adhere to this rule, instead of using a hash for optional parameters, explicitly declare each parameter in the method definition. For example, instead of using options = {}
in the method definition, declare each parameter like name, email, age
. This way, anyone reading the code can easily understand what parameters the method expects and in what order.
# @param app_id [String] | ||
# @param opts [Hash] the optional parameters | ||
# @return [Array<(DisableAppResponse, Integer, Hash)>] DisableAppResponse data, response status code and response headers | ||
def disable_app_with_http_info(app_id, opts = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Avoid using a hash as an optional parameter (...read more)
The rule "Avoid hash optional parameters" is a guideline that encourages developers to explicitly declare parameters instead of using a hash for optional parameters. This is because using a hash for optional parameters can make the code harder to understand and maintain. It can also lead to unexpected behavior if a developer accidentally includes a key in the hash that the method does not expect.
This rule is important because it promotes code readability and maintainability. It also helps prevent potential bugs that may occur due to unexpected keys in the optional hash. By explicitly declaring each parameter, developers can easily see what parameters a method expects, making the code easier to read and understand.
To adhere to this rule, instead of using a hash for optional parameters, explicitly declare each parameter in the method definition. For example, instead of using options = {}
in the method definition, declare each parameter like name, email, age
. This way, anyone reading the code can easily understand what parameters the method expects and in what order.
# @param app_id [String] | ||
# @param opts [Hash] the optional parameters | ||
# @return [Array<(DeployAppResponse, Integer, Hash)>] DeployAppResponse data, response status code and response headers | ||
def deploy_app_with_http_info(app_id, opts = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Avoid using a hash as an optional parameter (...read more)
The rule "Avoid hash optional parameters" is a guideline that encourages developers to explicitly declare parameters instead of using a hash for optional parameters. This is because using a hash for optional parameters can make the code harder to understand and maintain. It can also lead to unexpected behavior if a developer accidentally includes a key in the hash that the method does not expect.
This rule is important because it promotes code readability and maintainability. It also helps prevent potential bugs that may occur due to unexpected keys in the optional hash. By explicitly declaring each parameter, developers can easily see what parameters a method expects, making the code easier to read and understand.
To adhere to this rule, instead of using a hash for optional parameters, explicitly declare each parameter in the method definition. For example, instead of using options = {}
in the method definition, declare each parameter like name, email, age
. This way, anyone reading the code can easily understand what parameters the method expects and in what order.
224eb44
to
e47251a
Compare
return_type = opts[:debug_return_type] || 'DisableAppResponse' | ||
|
||
# auth_names | ||
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] | |
auth_names = opts[:debug_auth_names] || %i[apiKeyAuth appKeyAuth] |
Consider using the %i syntax instead (...read more)
The rule "Prefer %i
to the literal array syntax" is a guideline that encourages the use of the %i
syntax for arrays of symbols. This is a part of the Ruby style guide that aims to promote conciseness and readability.
Symbols are immutable, reusable objects often used in Ruby instead of strings when the value does not need to be changed. When declaring an array of symbols, using the %i
syntax can make your code cleaner and easier to read.
To adhere to this rule, instead of declaring an array of symbols using the literal array syntax like [:foo, :bar, :baz]
, use the %i
syntax like %i[foo bar baz]
. It's a good practice to consistently use %i
for arrays of symbols as it enhances code readability and maintainability.
661a358
to
b1ca3ba
Compare
b1ca3ba
to
3f6a8fe
Compare
See DataDog/datadog-api-spec#3438
Test branch datadog-api-spec/test/oliver/update-app-builder-api