Skip to content
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

Add id_str property to Event response #451

Merged
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.4.1.dev11",
"regenerated": "2021-08-06 07:49:06.987183",
"spec_repo_commit": "75fd781"
"regenerated": "2021-08-06 08:07:56.716987",
"spec_repo_commit": "6e156e1"
},
"v2": {
"apigentools_version": "1.4.1.dev11",
"regenerated": "2021-08-06 07:49:49.682007",
"spec_repo_commit": "75fd781"
"regenerated": "2021-08-06 08:08:42.416194",
"spec_repo_commit": "6e156e1"
}
}
}
8 changes: 8 additions & 0 deletions data/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,14 @@ components:
format: int64
readOnly: true
type: integer
id_str:
description: 'Handling IDs as large 64-bit numbers can cause loss of accuracy
issues with some programming languages.

Instead, use the string representation of the Event ID to avoid losing
accuracy.'
readOnly: true
type: string
payload:
description: Payload of the event.
example: '{}'
Expand Down
2 changes: 2 additions & 0 deletions docs/v1/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| **device_name** | **String** | A device name. | [optional] |
| **host** | **String** | Host name to associate with the event. Any tags associated with the host are also applied to this event. | [optional] |
| **id** | **Integer** | Integer ID of the event. | [optional][readonly] |
| **id_str** | **String** | Handling IDs as large 64-bit numbers can cause loss of accuracy issues with some programming languages. Instead, use the string representation of the Event ID to avoid losing accuracy. | [optional][readonly] |
| **payload** | **String** | Payload of the event. | [optional][readonly] |
| **priority** | [**EventPriority**](EventPriority.md) | | [optional] |
| **source_type_name** | **String** | The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). | [optional] |
Expand All @@ -28,6 +29,7 @@ instance = DatadogAPIClient::V1::Event.new(
device_name: null,
host: null,
id: null,
id_str: null,
payload: {},
priority: null,
source_type_name: null,
Expand Down
12 changes: 11 additions & 1 deletion lib/datadog_api_client/v1/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Event
# Integer ID of the event.
attr_accessor :id

# Handling IDs as large 64-bit numbers can cause loss of accuracy issues with some programming languages. Instead, use the string representation of the Event ID to avoid losing accuracy.
attr_accessor :id_str

# Payload of the event.
attr_accessor :payload

Expand Down Expand Up @@ -61,6 +64,7 @@ def self.attribute_map
:'device_name' => :'device_name',
:'host' => :'host',
:'id' => :'id',
:'id_str' => :'id_str',
:'payload' => :'payload',
:'priority' => :'priority',
:'source_type_name' => :'source_type_name',
Expand All @@ -84,6 +88,7 @@ def self.openapi_types
:'device_name' => :'String',
:'host' => :'String',
:'id' => :'Integer',
:'id_str' => :'String',
:'payload' => :'String',
:'priority' => :'EventPriority',
:'source_type_name' => :'String',
Expand Down Expand Up @@ -135,6 +140,10 @@ def initialize(attributes = {})
self.id = attributes[:'id']
end

if attributes.key?(:'id_str')
self.id_str = attributes[:'id_str']
end

if attributes.key?(:'payload')
self.payload = attributes[:'payload']
end
Expand Down Expand Up @@ -219,6 +228,7 @@ def ==(o)
device_name == o.device_name &&
host == o.host &&
id == o.id &&
id_str == o.id_str &&
payload == o.payload &&
priority == o.priority &&
source_type_name == o.source_type_name &&
Expand All @@ -237,7 +247,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[alert_type, date_happened, device_name, host, id, payload, priority, source_type_name, tags, text, title, url].hash
[alert_type, date_happened, device_name, host, id, id_str, payload, priority, source_type_name, tags, text, title, url].hash
end

# Builds the object from hash
Expand Down