Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-29 20:46:33.498190",
"spec_repo_commit": "c0b9551e"
"regenerated": "2024-10-30 18:58:10.241853",
"spec_repo_commit": "755120dd"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-29 20:46:33.516450",
"spec_repo_commit": "c0b9551e"
"regenerated": "2024-10-30 18:58:10.260831",
"spec_repo_commit": "755120dd"
}
}
}
138 changes: 138 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7115,6 +7115,81 @@ components:
description: The type of the resource. The value should always be device.
type: string
type: object
DomainAllowlist:
description: The email domain allowlist for an org.
properties:
attributes:
$ref: '#/components/schemas/DomainAllowlistAttributes'
id:
description: The unique identifier of the org.
nullable: true
type: string
type:
$ref: '#/components/schemas/DomainAllowlistType'
required:
- type
type: object
DomainAllowlistAttributes:
description: The details of the email domain allowlist.
properties:
domains:
description: The list of domains in the email domain allowlist.
items:
type: string
type: array
enabled:
description: Whether the email domain allowlist is enabled for the org.
type: boolean
type: object
DomainAllowlistRequest:
description: Request containing the desired email domain allowlist configuration.
properties:
data:
$ref: '#/components/schemas/DomainAllowlist'
required:
- data
type: object
DomainAllowlistResponse:
description: Response containing information about the email domain allowlist.
properties:
data:
$ref: '#/components/schemas/DomainAllowlistResponseData'
type: object
DomainAllowlistResponseData:
description: The email domain allowlist response for an org.
properties:
attributes:
$ref: '#/components/schemas/DomainAllowlistResponseDataAttributes'
id:
description: The unique identifier of the org.
nullable: true
type: string
type:
$ref: '#/components/schemas/DomainAllowlistType'
required:
- type
type: object
DomainAllowlistResponseDataAttributes:
description: The details of the email domain allowlist.
properties:
domains:
description: The list of domains in the email domain allowlist.
items:
type: string
type: array
enabled:
description: Whether the email domain allowlist is enabled for the org.
type: boolean
type: object
DomainAllowlistType:
default: domain_allowlist
description: Email domain allowlist allowlist type.
enum:
- domain_allowlist
example: domain_allowlist
type: string
x-enum-varnames:
- DOMAIN_ALLOWLIST
DowntimeCreateRequest:
description: Request for creating a downtime.
properties:
Expand Down Expand Up @@ -29433,6 +29508,61 @@ paths:
tags:
- Dashboard Lists
x-codegen-request-body-name: body
/api/v2/domain_allowlist:
get:
description: Get the domain allowlist for an organization.
operationId: GetDomainAllowlist
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistResponse'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Get Domain Allowlist
tags:
- Domain Allowlist
x-permission:
operator: OR
permissions:
- org_management
patch:
description: Update the domain allowlist for an organization.
operationId: PatchDomainAllowlist
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistResponse'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Sets Domain Allowlist
tags:
- Domain Allowlist
x-permission:
operator: OR
permissions:
- org_management
/api/v2/dora/deployment:
post:
description: 'Use this API endpoint to provide data about deployments for DORA
Expand Down Expand Up @@ -41786,6 +41916,14 @@ tags:

organization.'
name: Dashboard Lists
- description: 'Configure your Datadog Email Domain Allowlist directly through the
Datadog API.

The Email Domain Allowlist controls the domains that certain datadog emails can
be sent to.

For more information, see the [Domain Allowlist docs page](https://docs.datadoghq.com/account_management/org_settings/domain_allowlist)'
name: Domain Allowlist
- description: '**Note**: Downtime V2 is currently in private beta. To request access,
contact [Datadog support](https://docs.datadoghq.com/help/).

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-10-23T18:16:16.668Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-10-23T18:16:16.928Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions examples/v2/domain-allowlist/GetDomainAllowlist.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get Domain Allowlist returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DomainAllowlistAPI.new
p api_instance.get_domain_allowlist()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Quality Violation

Suggested change
p api_instance.get_domain_allowlist()
p api_instance.get_domain_allowlist
Do not use parentheses with methods that take no arguments (...read more)

The rule "Avoid parentheses when methods take no arguments" is part of the Ruby style guide. It suggests that when a method takes no arguments, you should not use parentheses. This is because the use of parentheses in such a case is redundant and unnecessary, and it can make your code more difficult to read and understand.

This rule is important because it promotes cleaner, more readable code. In Ruby, clean and readable code is highly valued. By following this rule, you can ensure your code is easier to understand and maintain, which is crucial for long-term project success.

To adhere to this rule, remove the parentheses when calling a method that does not require any arguments. For example, instead of writing 'test'.upcase(), you should write 'test'.upcase. Similarly, instead of Kernel.exit!(), write Kernel.exit!. However, note that there is an exception for super - super by itself is different from super(), so in this case, parentheses may be necessary.

View in Datadog  Leave us feedback  Documentation

17 changes: 17 additions & 0 deletions examples/v2/domain-allowlist/PatchDomainAllowlist.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Sets Domain Allowlist returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DomainAllowlistAPI.new

body = DatadogAPIClient::V2::DomainAllowlistRequest.new({
data: DatadogAPIClient::V2::DomainAllowlist.new({
attributes: DatadogAPIClient::V2::DomainAllowlistAttributes.new({
domains: [
"@static-test-domain.test",
],
enabled: false,
}),
type: DatadogAPIClient::V2::DomainAllowlistType::DOMAIN_ALLOWLIST,
}),
})
p api_instance.patch_domain_allowlist(body)
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,9 @@
"dashboard_list_id" => "Integer",
"body" => "DashboardListUpdateItemsRequest",
},
"v2.PatchDomainAllowlist" => {
"body" => "DomainAllowlistRequest",
},
Comment on lines +1188 to +1190

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Quality Violation

Consider using symbols instead of string hash keys (...read more)

In Ruby, it is a best practice to use symbols instead of strings as hash keys. This rule emphasizes that it's more efficient and idiomatic to use symbols for this purpose. Symbols are immutable and unique, which makes them ideal for identifying things, whereas strings are mutable and can create multiple objects for the same sequence of characters.

The importance of this rule lies in the performance and memory usage of your Ruby application. Using symbols as hash keys reduces memory usage because they are stored in memory only once during a Ruby process. This can make a significant difference in the efficiency of your application, especially when dealing with large data sets.

To ensure you're following good coding practices, always use symbols for hash keys unless there's a specific reason to use a string. A simple refactoring from values = { 'foo' => 42, 'bar' => 99, 'baz' => 123 } to values = { foo: 42, bar: 99, baz: 123 } will make your code compliant with this rule. This not only improves your code's performance but also makes it more readable and consistent with Ruby's conventions.

View in Datadog  Leave us feedback  Documentation

"v2.CreateDORADeployment" => {
"body" => "DORADeploymentRequest",
},
Expand Down
32 changes: 32 additions & 0 deletions features/v2/domain_allowlist.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@endpoint(domain-allowlist) @endpoint(domain-allowlist-v2)
Feature: Domain Allowlist
Configure your Datadog Email Domain Allowlist directly through the Datadog
API. The Email Domain Allowlist controls the domains that certain datadog
emails can be sent to. For more information, see the [Domain Allowlist
docs page](https://docs.datadoghq.com/account_management/org_settings/doma
in_allowlist)

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "DomainAllowlist" API

@team:Datadog/team-aaa-dogmail
Scenario: Get Domain Allowlist returns "OK" response
Given new "GetDomainAllowlist" request
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "domain_allowlist"
And the response "data.attributes.domains" array contains value "@static-test-domain.test"
And the response "data.attributes.enabled" is equal to false

@team:Datadog/team-aaa-dogmail
Scenario: Sets Domain Allowlist returns "OK" response
Given new "PatchDomainAllowlist" request
And body with value {"data": {"attributes": {"domains": ["@static-test-domain.test"], "enabled": false}, "type": "domain_allowlist"}}
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "domain_allowlist"
And the response "data.attributes.domains" has length 1
And the response "data.attributes.domains" array contains value "@static-test-domain.test"
And the response "data.attributes.enabled" is equal to false
12 changes: 12 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,18 @@
"type": "safe"
}
},
"GetDomainAllowlist": {
"tag": "Domain Allowlist",
"undo": {
"type": "safe"
}
},
"PatchDomainAllowlist": {
"tag": "Domain Allowlist",
"undo": {
"type": "idempotent"
}
},
"CreateDORADeployment": {
"tag": "DORA Metrics",
"undo": {
Expand Down
8 changes: 8 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,13 @@ def overrides
"v2.device_attributes" => "DeviceAttributes",
"v2.device_attributes_interface_statuses" => "DeviceAttributesInterfaceStatuses",
"v2.devices_list_data" => "DevicesListData",
"v2.domain_allowlist" => "DomainAllowlist",
"v2.domain_allowlist_attributes" => "DomainAllowlistAttributes",
"v2.domain_allowlist_request" => "DomainAllowlistRequest",
"v2.domain_allowlist_response" => "DomainAllowlistResponse",
"v2.domain_allowlist_response_data" => "DomainAllowlistResponseData",
"v2.domain_allowlist_response_data_attributes" => "DomainAllowlistResponseDataAttributes",
"v2.domain_allowlist_type" => "DomainAllowlistType",
"v2.dora_deployment_request" => "DORADeploymentRequest",
"v2.dora_deployment_request_attributes" => "DORADeploymentRequestAttributes",
"v2.dora_deployment_request_data" => "DORADeploymentRequestData",
Expand Down Expand Up @@ -2580,6 +2587,7 @@ def overrides
"v2.containers_api" => "ContainersAPI",
"v2.csm_threats_api" => "CSMThreatsAPI",
"v2.dashboard_lists_api" => "DashboardListsAPI",
"v2.domain_allowlist_api" => "DomainAllowlistAPI",
"v2.dora_metrics_api" => "DORAMetricsAPI",
"v2.downtimes_api" => "DowntimesAPI",
"v2.events_api" => "EventsAPI",
Expand Down
Loading
Loading